WO2015018338A1 - 一种连接建立的方法及装置 - Google Patents

一种连接建立的方法及装置 Download PDF

Info

Publication number
WO2015018338A1
WO2015018338A1 PCT/CN2014/083785 CN2014083785W WO2015018338A1 WO 2015018338 A1 WO2015018338 A1 WO 2015018338A1 CN 2014083785 W CN2014083785 W CN 2014083785W WO 2015018338 A1 WO2015018338 A1 WO 2015018338A1
Authority
WO
WIPO (PCT)
Prior art keywords
connection
instruction
service
policy
reconnection
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.)
Ceased
Application number
PCT/CN2014/083785
Other languages
English (en)
French (fr)
Inventor
严雪松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to HK15104049.6A priority Critical patent/HK1203711B/zh
Priority to EP14814669.9A priority patent/EP2858332B1/en
Priority to US14/585,887 priority patent/US9462053B2/en
Publication of WO2015018338A1 publication Critical patent/WO2015018338A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • H04L67/1076Resource dissemination mechanisms or network resource keeping policies for optimal resource availability in the overlay network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for establishing a connection. Background technique
  • PUSH Information push technology
  • PUSH technology is an information push technology between the server and the client.
  • PUSH technology usually establishes a connection channel between the client and the server, and the server pushes information to the client through this channel according to business needs.
  • PUSH technology is generally applied to application scenarios where servers and clients interact. Because the server needs to transmit a certain length of information to the client through the Transmission Control Protocol (TCP) connection according to the service requirements, PUSH technology usually establishes a long-term effective TCP connection between the client and the server. This long-term effective TCP connection is maintained through a heartbeat response.
  • TCP Transmission Control Protocol
  • a long-term effective TCP connection requires a heartbeat response to maintain, and a heartbeat response requires the client to frequently initiate a data call and bring high-frequency wireless data transmission, thereby making the client consume more power.
  • the embodiment of the present invention provides a method and an apparatus for establishing a connection, which is used to solve the problem in the prior art that a client needs to frequently initiate a data call to maintain a long-term TCP connection with a server, thereby causing a power consumption of the client. Big problem.
  • connection establishment method including:
  • the policy instruction for the service is generated according to the service information of the service carried in the registration request, where the policy instruction is used to indicate the adjustment server and the client.
  • connection request a connection for the service between the server and the client, and adjusting an on-off state of the connection based on the policy instruction.
  • the generating, by the service information of the service, a policy instruction for the service specifically:
  • connection mechanism and the connection instruction with the preset trigger condition are taken as policy instructions for the service.
  • connection mechanism includes an instant connection mechanism or a non-instant connection mechanism
  • connection instruction includes: any one of a connection holding instruction, a connection disconnection instruction, and a reconnection instruction or a combination thereof;
  • the preset triggering condition includes: a preset time limit arrives or / and a related service state changes.
  • the reconnecting instruction includes: an instant reconnect instruction, a timing reconnect instruction, and a step reconnect instruction Any of them.
  • connection mechanism in the policy instruction is an instant connection mechanism, keeping the connection in a connected state
  • connection Adjusting the connection to a long connection, a polled connection, or according to a connection instruction in the policy instruction Any of the short-term connections;
  • the connection is disconnected, and according to the reconnect instruction in the policy instruction, determining that the connection is reestablished is a timing reconnection or stepping Reconnection.
  • connection mechanism in the policy instruction is a non-instant connection mechanism
  • the connection is disconnected, and the reconnection is determined according to the reconnection instruction in the policy instruction as a timing reconnection or a step reconnection.
  • a seventh possible implementation manner of the first aspect after the connection is established between the server and the client, :
  • an embodiment of the present invention provides a connection establishment method, including:
  • connection mechanism of the service and the connection instruction with a preset trigger condition.
  • connection mechanism includes an instant connection mechanism or a non-instant connection mechanism
  • connection instruction includes: any one of a connection holding instruction, a connection disconnection instruction, and a reconnection instruction Species or combinations thereof;
  • the preset triggering condition includes: a preset time limit arrives or / and a related service state changes.
  • the reconnecting instruction includes: an instant reconnect instruction, a timing reconnect instruction, and a step reconnect instruction Any of them.
  • the adjusting the on/off state of the connection according to the policy instruction includes:
  • connection mechanism in the policy instruction is an instant connection mechanism, keeping the connection in a connected state
  • the connection is disconnected, and according to the reconnect instruction in the policy instruction, determining that the connection is reestablished is a timing reconnection or stepping Reconnection.
  • the adjusting the on/off state of the connection according to the policy instruction includes:
  • connection mechanism in the policy instruction is a non-instant connection mechanism, disconnect the connection, and determine, according to the reconnection instruction in the policy instruction, that the connection is re-established as a timing reconnection or a step reconnection.
  • the server, the server and the client are based on the connection request After establishing a connection for this service, it also includes:
  • an embodiment of the present invention provides a connection establishing apparatus, including: a receiving module, configured to receive a registration request and a connection request sent by the client based on a service, and a generating module, configured to: according to the service information of the service carried in the registration request, when the service is successfully registered according to the registration request Generating a policy instruction for the service, where the policy instruction is used to indicate an on-off state of adjusting a connection established between the device and the client for the service; and a feedback module, configured to feed back the policy instruction to the Determining, by the client, that the client adjusts an on-off state of a connection established between the device and the client for the service according to the policy instruction; and a connection module, configured to, according to the connection request, the device and the A connection for the service is established between the clients, and the connection is adjusted in an on-off state based on the policy instruction.
  • the generating module is specifically configured to:
  • conditional join instruction acts as a policy directive for the service.
  • connection mechanism includes an instant connection mechanism or a non-instant connection mechanism
  • connection instruction includes: any one of a connection holding instruction, a connection disconnection instruction, and a reconnection instruction or a combination thereof;
  • the preset triggering condition includes: a preset time limit arrives or / and a related service state changes.
  • the reconnecting instruction includes: an instant reconnect instruction, a timing reconnect instruction, and a step reconnect instruction Any of them.
  • the connecting module includes:
  • a first submodule configured to establish a connection for the service between the device and the client based on the connection request
  • a second submodule configured to maintain when the connection mechanism in the policy instruction is an instant connection mechanism
  • the connection is in a connected state; adjusting the connection to any one of a long connection, a polled connection, or a short-time connection according to a connection instruction in the policy instruction; disconnecting the connection in reaching the policy instruction
  • the preset trigger condition of the instruction is performed, the connection is disconnected, and according to the reconnect instruction in the policy instruction, it is determined that the re-establishment connection is a timing reconnection or a step reconnection.
  • the connecting module includes:
  • a first submodule configured to establish a connection for the service between the device and the client based on the connection request
  • a second submodule configured to: when the connection mechanism in the policy instruction is a non-instant connection mechanism, disconnect the connection, and determine, according to the reconnect instruction in the policy instruction, that the reestablishment connection is a timing reconnection Or step reconnect.
  • the feedback module is further used by the device and the client After the connection is established, the push message of the service is pushed to the client based on the established connection according to the message sending request sent by the client for the service.
  • an embodiment of the present invention provides a connection establishing apparatus, including:
  • a sending module configured to send a registration request and a connection request to the server based on a service
  • a receiving module configured to receive, when the server successfully registers the service according to the registration request, according to the service carried in the registration request Business information, generated and sent policy instructions for the service
  • an adjusting module configured to adjust, according to the policy instruction, an on/off state of the connection according to the policy instruction after the server establishes a connection for the service between the server and the device according to the connection request.
  • connection mechanism of the service and the connection instruction with a preset trigger condition.
  • connection mechanism includes an instant connection mechanism or a non-instant connection mechanism
  • connection instruction includes: any one of a connection holding instruction, a connection disconnection instruction, and a reconnection instruction or a combination thereof;
  • the preset triggering condition includes: a preset time limit arrives or / and a related service state changes.
  • the reconnecting instruction includes: an instant reconnect instruction, a timing reconnect instruction, and a step reconnect instruction Any of them.
  • the adjusting module is specifically configured to, based on the connection request, the server and the server After establishing a connection for the service between the devices, when the connection mechanism in the policy instruction is an instant connection mechanism, keeping the connection in a connected state; adjusting the connection according to a connection instruction in the policy instruction Is any one of a long connection, a polled connection, or a short-time connection; when the preset trigger condition of the connection disconnection instruction in the policy instruction is reached, the connection is disconnected, and according to the policy instruction Reconnect the command to determine whether the connection is re-established as a timing reconnection or a step reconnection.
  • the adjusting module is specifically configured to, based on the connection request, the server and the server After establishing a connection for the service between the devices, when the connection mechanism in the policy instruction is a non-instant connection mechanism, disconnecting the connection, and determining to re-establish the connection according to the reconnection instruction in the policy instruction.
  • the method is timing reconnection or step reconnection.
  • the receiving module is further configured to: After the connection between the server and the device is established, the server receives a push message of the service that is pushed by the server based on the established connection, where the push message is that the server is targeted according to the device. The message sent by the service is sent by the request.
  • the connection established and established between the clients determines the hold time of the connection according to actual needs. When there is no service demand, the connection is disconnected in time to avoid the long-term connection between the server and the client, and no need to frequently initiate data calls. Thereby avoiding the problem of excessive power consumption.
  • FIG. 1 is a flowchart of a connection establishment method designed according to an embodiment of the present invention
  • connection establishment method 3 is a flowchart of another connection establishment method designed according to an embodiment of the present invention.
  • connection establishing apparatus designed according to an embodiment of the present invention
  • FIG. 5 is a schematic diagram of another connection establishing apparatus according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of a connection establishment device designed according to an embodiment of the present invention:
  • FIG. 7 is a schematic structural diagram of another connection establishing device according to an embodiment of the present invention. detailed description
  • connection establishment method comprising the following steps.
  • Step 101 The server receives the registration request and the connection request sent by the client.
  • Step 102 The server generates a policy instruction for the service according to the service information of the service carried in the registration request, where the policy instruction is used to indicate the adjustment server and the client. The on/off state of the connection established for this service.
  • Step 103 The server feeds back the foregoing policy command to the client, and instructs the client to adjust an on-off state of the connection established between the server and the client for the service according to the policy command.
  • Step 104 Establish a connection for the service between the server and the client according to the connection request, and perform an adjustment of the connection state based on the policy command.
  • the above registration request or/and connection request may include the device identifier of the client, such as encrypted IMEI number, etc.
  • the registration response may include a registration token (ie, a TOKEN identifier).
  • the registration token may be a parameter corresponding to the foregoing service.
  • the server can generate policy instructions in the following manner:
  • connection mechanism and the connection instruction having the preset trigger condition are used as the policy instructions for the above service.
  • connection mechanism may include, but is not limited to, an instant connection mechanism or a non-instant connection mechanism.
  • connection instructions may include, but are not limited to, any one of a connection holding instruction, a connection disconnection instruction, and a reconnection instruction, or a combination thereof.
  • the preset trigger condition is not limited to include: The preset time limit arrives or / and the related business status changes.
  • the above reconnection instructions may include, but are not limited to, any one of an immediate reconnection instruction, a timing reconnection instruction, and a step reconnection instruction.
  • Instant reconnection can be: Reestablish the connection between the client and the server immediately after the connection between the client and the server is disconnected.
  • Timed reconnection means After the connection between the client and the server is disconnected, when the preset duration arrives, try to re-establish the connection between the client and the server.
  • Step reconnection means After the connection between the client and the server is disconnected, the interval is different, try to re-establish the connection between the client and the server. In general, in a step-and-repeat, the interval between the client and the two attempts to re-establish the connection is longer and longer.
  • connection state is adjusted based on the above-mentioned policy instruction:
  • Manner 1 When the connection mechanism in the foregoing policy instruction is an instant connection mechanism, the connection is kept in a connected state; Adjusting the connection to any one of a long connection, a polled connection, or a short-time connection according to a connection instruction in the above policy command;
  • the connection is disconnected, and according to the reconnect instruction in the policy command, it is determined that the reestablishment of the connection is a timing reconnection or a step reconnection.
  • the server can send a push (PUSH) message of the service to the client according to the message sent by the client for the service, and implement the PUSH process of the service.
  • PUSH push
  • connection between the server and the client may be a TCP connection, or may be another connection such as a Transport Layer Security (TLS) connection.
  • TLS Transport Layer Security
  • the server when the server successfully registers the service according to the foregoing registration request, the server may further generate, according to the service information of the service carried in the registration request and the application environment information stored in the server for the client, Policy directive.
  • the above application environment information may be information such as an application type, a policy instruction of other applications inside the client, and the like.
  • the embodiment of the present invention can synthesize the message pushing requirements of each service in the client according to different client application environments, and generate policy instructions for each service.
  • the server and the client can transfer messages based on binary or formatted strings.
  • the server and the client can also be based on JSON (JavaScript Object Notation), extensible Extensible description language (Extensible Markup Language, XML) and other extensibility description language to deliver messages, therefore, the above policy instructions can be based on binary or formatted strings, or can be a JSON or XML-based extensibility description language.
  • Embodiment 1 Application A and Application B are different applications of the same client, respectively, and both Application A and Application B require PUSH service.
  • Application A performs business A in the client, and application B performs business.
  • B The flow of the first embodiment of the present invention is shown in FIG. 2.
  • Figure 2 includes application clients (including application client A and application client B), PUSH client, PUSH server, and application server.
  • the application client can refer to a mobile phone, a computer, and the like.
  • the application client A and the application client B can be different application software on the same client.
  • the PUSH client can refer to PUSH-enabled software running independently in the client or PUSH-enabled software nested in an application.
  • the PUSH server can be a server for PUSH messages.
  • the application server can be a remote server of Application A and Application B.
  • the application client and the PUSH client can be different parts belonging to the same physical device (ie, the client).
  • the PUSH server and the application server can be different parts belonging to the same server (for example, different software modules, or different hardware parts), or two servers.
  • the PUSH client When no application client registers with the PUSH server, the PUSH client does not need to consume power and traffic, activates the connection with the PUSH server, and does not need to consume power and traffic to maintain the activity of the connection.
  • Step 201 The application server A registers the PUSH service with the PUSH server based on the service A and the service B, respectively.
  • Step 202 The application client A sends the registration information of the service A to the PUSH client.
  • Step 203 The PUSH client registers the PUSH service of the service A with the PUSH server.
  • the PUSH client sends a registration request and a connection request of the service A to the PUSH server, where the registration request includes the registration information of the service A.
  • the above connection request may be a TLS connection request or a TCP connection request or the like.
  • Step 204 The PUSH server determines that the service A is successfully registered, and feeds back the registration response and the policy instruction to the PUSH client.
  • step 204 means that the connection between the PUSH client and the PUSH server is established successfully.
  • the PUSH server determines that the connection mechanism of the PUSH service registered by the application server based on the service A is a non-instant connection mechanism according to the registration information of the service A, and determines that the service A needs to restart the PUSH service after being separated by 30 minutes.
  • the PUSH server can generate the policy of service A.
  • the connection mechanism included in the policy instruction is a non-instant connection mechanism
  • the reconnection mechanism included in the policy instruction is a timing reconnection instruction
  • the reconnection interval of the reconnection instruction is 30 minutes.
  • Step 205 The PUSH client sends a registration response to the application client.
  • Step 206 The PUSH client establishes a connection between the disconnected PUSH client and the PUSH server according to the foregoing policy instruction.
  • the PUSH client can re-establish a connection with the PUSH server after disconnecting for 30 minutes, and check whether the PUSH server has a message to push.
  • step 206 is a step in the information interaction process of the service A
  • step 207 is a step in the information interaction process of the service B. Therefore, in an actual application, the interval between step 206 and step 207 may be separated by a period of time. During the time, the interaction between the client and the server can also be through other information.
  • Step 207 The application client B sends the registration information of the service B to the PUSH client.
  • Step 208 The PUSH client registers the PUSH service of the service B with the PUSH server.
  • the PUSH client sends a registration request and a connection request of the service B to the PUSH server, where the registration request includes the registration information of the service B.
  • the above connection request may be a TLS connection request or a TCP connection request or the like.
  • Step 209 The PUSH server determines that the service B is successfully registered, and feeds back the registration response and the policy instruction to the PUSH client.
  • the PUSH server determines, according to the registration information of the service B, that the connection mechanism of the PUSH service registered by the application server based on the service B is an instant connection mechanism, and the service B needs to maintain the connection for a long time to transmit the message.
  • the PUSH server can generate a policy instruction of the service B, and the connection mechanism included in the policy instruction is an instant connection mechanism, and the policy instruction indicates that the established connection is adjusted to a long connection.
  • the policy instruction may further indicate that the heartbeat fixed period of the long connection is 3 minutes.
  • Step 210 The PUSH client sends a registration response to the application client B.
  • Step 211 The PUSH client receives the registration response and the policy command delivered by the PUSH server, establishes an instant connection according to the policy command, and adjusts the instant connection to a long connection. After the instant connection is adjusted to a long connection, the PUSH client can send heartbeat information to the PUSH server to maintain a long connection when each heartbeat fixed period arrives.
  • Step 212 The application server sends a PUSH message of the service B to the PUSH server.
  • Step 213 The PUSH server sends the PUSH message of the service B to the PUSH client in real time through the long connection.
  • Step 210 The PUSH client sends the PUSH message of the service B to the application client B in real time, and displays the message through the application B.
  • the server can perform intelligent analysis on the services registered by the client, and select different connection policies for different scenarios, different time segments, different client services, or different services of the same client, and avoid all the The same connection strategy is used for services, time segments, and scenarios to intelligently save the traffic and power consumption of the client while ensuring the service experience.
  • connection establishment method as shown in FIG. 3, including:
  • Step 301 The client sends a registration request and a connection request to the server based on a service.
  • Step 302 The client receives the service information of the service carried in the registration request according to the registration request. Generate and send policy directives for the above services.
  • Step 303 After the server establishes a connection for the service between the server and the client based on the connection request, the client adjusts the on/off state of the connection according to the policy command.
  • the foregoing policy instructions may include, but are not limited to, a connection mechanism of the foregoing service and a connection instruction having a preset trigger condition.
  • connection mechanism may include, but is not limited to, the following:
  • the foregoing connection mechanism includes an instant connection mechanism or a non-instant connection mechanism.
  • connection instructions may include, but are not limited to, any one of a connection holding instruction, a connection disconnection instruction, and a reconnection instruction, or a combination thereof.
  • the preset trigger condition may be, but is not limited to, including: a preset time limit arrival or/and related business status A change has occurred.
  • the reconnect instruction may include, but is not limited to, any one of an instant reconnect instruction, a timing reconnect instruction, and a step reconnect instruction.
  • the on/off state of the connection is adjusted according to the above policy command, which may be, but is not limited to, implemented by:
  • the connection is disconnected, and according to the reconnect instruction in the policy command, it is determined that the reestablishment of the connection is a timing reconnection or a step reconnection.
  • the client may receive a push message of the service pushed by the server based on the established connection, where the service is The push message is that the server pushes according to the message sending request sent by the client for the service.
  • the client can adjust the connection and disconnection according to the application scenario based on the connection policy sent by the server for a certain service, thereby avoiding the problem of excessive power consumption caused by frequently initiating data calls.
  • connection establishing device as shown in FIG. 4, including:
  • the receiving module 401 is configured to: receive a registration request and a connection request sent by the client based on a service; and generate a module 402: configured to: when the service is successfully registered according to the foregoing registration request, according to the foregoing note
  • the service information of the service carried in the request is used to generate a policy command for the service, where the policy command is used to indicate an on-off state of adjusting a connection established between the device and the client for the service;
  • the feedback module 403 is configured to feed back the foregoing policy command to the client, and instruct the client to adjust an on-off state of a connection established between the device and the client for the service according to the policy command;
  • the connection request establishes a connection for the service between the device and the client, and adjusts the connection state based on the policy command.
  • the generating module 402 is specifically configured to:
  • connection mechanism may include, but is not limited to, an instant connection mechanism or a non-instant connection mechanism.
  • connection instruction may include, but is not limited to, including: any one or a combination of a connection holding instruction, a connection disconnection instruction, and a reconnection instruction;
  • the foregoing preset triggering conditions may include, but are not limited to, including: a preset time limit arrival or / and a change in an associated service state.
  • the above reconnection instructions may include, but are not limited to, any one of an immediate reconnection instruction, a timing reconnection instruction, and a step reconnection instruction.
  • connection module 404 can be divided into the following two cases.
  • connection module 404 specifically includes:
  • a first submodule configured to establish a connection for the service between the device and the client according to the foregoing connection request
  • a second submodule configured to: when the connection mechanism in the foregoing policy instruction is an instant connection mechanism, keep the connection in a connected state; adjust the connection to a long connection, a polling connection, or a short according to the connection instruction in the policy instruction Any one of the time connections; when the preset trigger condition of the connection disconnection command in the above policy instruction is reached, the connection is disconnected, and according to the reconnection instruction in the above policy instruction, Determine how the connection is re-established as a timed reconnect or a step reconnect.
  • Case 2 a first submodule, configured to establish, according to the foregoing connection request, a connection for the service between the device and the client;
  • a second submodule configured to: when the connection mechanism in the foregoing policy instruction is a non-instant connection mechanism, disconnect the connection, and determine, according to the reconnect instruction in the policy instruction, that the connection is reestablished as a timing reconnection or stepping Reconnection.
  • the second sub-module of the connection module can simultaneously have the functions of the above two cases.
  • the feedback module 403 in the connection establishing apparatus may be further configured to: after establishing a connection between the device and the client, according to a message sending request sent by the client for the service, The push message is pushed to the client based on the established connection.
  • connection establishing device as shown in FIG. 5, including:
  • the sending module 501 is configured to send a registration request and a connection request to the server based on a service
  • the receiving module 502 is configured to receive, according to the registration request, the service of the service carried by the server according to the registration request.
  • the adjusting module 503 is configured to adjust, according to the policy command, the on/off state of the connection according to the policy command after the server establishes a connection for the service between the server and the device based on the connection request.
  • the foregoing policy instructions may include, but are not limited to, a connection mechanism of the foregoing service and a connection instruction with a preset trigger condition.
  • connection mechanism may include, but is not limited to, an instant connection mechanism or a non-instant connection mechanism;
  • connection instructions may include, but are not limited to, any one or a combination of a connection hold instruction, a connection disconnection instruction, and a reconnection instruction;
  • the foregoing preset triggering conditions may include, but are not limited to, including: a preset time limit arrival or / and a change in an associated service state.
  • the above reconnection instructions may include, but are not limited to,: an instant reconnect instruction, a timing reconnection instruction, and a step weight Any of the instructions.
  • the adjusting module 503 is specifically configured to: after the server establishes a connection for the service between the server and the device, based on the connection request, when the connection mechanism in the policy command is an instant connection mechanism, Keeping the above connection in a connected state; adjusting the connection to any one of a long connection, a polling connection, or a short-time connection according to the connection instruction in the above policy command; When the trigger condition is set, the above connection is disconnected, and according to the reconnection instruction in the above policy instruction, it is determined that the reconnection is established by timing reconnection or step reconnection.
  • the adjusting module 503 is specifically configured to: after the server establishes a connection with the service between the server and the device, based on the connection request, when the connection mechanism in the policy command is a non-instant connection mechanism , disconnect the above connection, and according to the reconnect instruction in the above policy command, determine the way to re-establish the connection as a timing reconnection or a step reconnection.
  • the adjustment module can have both of the above specific functions.
  • the receiving module 502 is further configured to: after the server establishes a connection for the service between the server and the device, the server receives, according to the connection request, a push message of the service that is pushed by the server based on the established connection, where The push message is pushed by the server according to a message transmission request sent by the device for the service.
  • the embodiment of the present invention also provides a connection establishing device.
  • the method includes: at least one transceiver 601, at least one processor 602, at least one memory 603, and a bus 604.
  • the at least one processor 602 and the at least one memory 603 are connected by the bus 604 and complete communication with each other, where:
  • the transceiver 601 is mainly used for transmitting and receiving communication data between the connection establishing device and the client in this embodiment.
  • the transceiver 601 is configured to receive a registration request and a connection request sent by the client based on a service.
  • the processor 602 is configured to call the program code in the memory 603 to perform the following operations: Operation 1: When the registration is successful according to the foregoing registration request, the policy instruction for the service is generated according to the service information of the service carried in the registration request, where the policy instruction is used to indicate that the device and the client are adjusted. The on/off state of the connection established for the service;
  • Operation 2 feeding the foregoing policy command to the client, instructing the client to adjust an on-off state of a connection established between the device and the client for the service according to the foregoing policy instruction;
  • Operation 3 Based on the connection request, establishing a connection for the service between the device and the client, and adjusting the connection state based on the policy command.
  • the processor 602 invokes the operation 1 performed by the program code in the memory 603, and specifically includes:
  • connection mechanism may include, but is not limited to, an instant connection mechanism or a non-instant connection mechanism.
  • connection instruction may include, but is not limited to, including: any one or a combination of a connection holding instruction, a connection disconnection instruction, and a reconnection instruction;
  • the foregoing preset triggering conditions may include, but are not limited to, including: a preset time limit arrival or / and a change in an associated service state.
  • the above reconnection instructions may include, but are not limited to, any one of an immediate reconnection instruction, a timing reconnection instruction, and a step reconnection instruction.
  • the foregoing processor may select any one of the following two implementation manners or a combination thereof, and perform the foregoing operation three:
  • Execution mode 1 establishing a connection for the service between the device and the client according to the connection request; and maintaining the connection in a connected state when the connection mechanism in the policy instruction is an instant connection mechanism;
  • the connection instruction the connection is adjusted to any one of a long connection, a polled connection, or a short-time connection; when the preset trigger condition of the connection disconnection instruction in the above policy instruction is reached, the connection is disconnected, and
  • the reconnection instruction in the above policy instruction determine the re The way to establish a connection is a timing reconnection or a step reconnection.
  • Execution mode 2 establishing a connection for the service between the device and the client according to the foregoing connection request; when the connection mechanism in the policy command is a non-instant connection mechanism, disconnecting the connection, and according to the foregoing policy command
  • the reconnect instruction in the middle determines whether the connection is re-established as a timing reconnection or a step reconnection.
  • the transceiver 601 is further configured to: after the device establishes a connection with the client, based on the message sending request sent by the client for the service, based on the established push message of the service.
  • the connection is pushed to the above client.
  • the above connection establishment device may be a server.
  • the embodiment of the present invention further provides a connection establishing device.
  • the method includes: at least one transceiver 701, at least one processor 702, at least one memory 703, and a bus 704, the at least one transceiver. 701.
  • the at least one processor 702 and the at least one memory 703 are connected by the bus 704 and complete communication with each other, where:
  • the transceiver 701 is mainly used to implement the transmission and reception of communication data between the connection establishment device and the server in this embodiment.
  • the transceiver 701 is configured to send a registration request and a connection request to the server based on a service, and receive the service information of the service carried in the registration request according to the registration request when the server successfully registers the service according to the registration request. Generate and send policy directives for the above services.
  • the processor 702 is configured to invoke the program code in the memory 703, to perform the following operations: after the server establishes a connection for the service between the server and the device based on the connection request, adjust the foregoing according to the policy command The on/off state of the connection.
  • the foregoing policy instructions may include, but are not limited to, a connection mechanism of the foregoing service and a connection instruction with a preset trigger condition.
  • connection mechanism may include, but is not limited to, an instant connection mechanism or a non-instant connection mechanism
  • the foregoing connection instruction may include, but is not limited to, any one or a combination of a connection holding instruction, a connection disconnection instruction, and a reconnection instruction
  • the foregoing preset triggering conditions may include, but are not limited to, including: a preset time limit arrival or/and a change in an associated service state.
  • the above reconnection instructions may include, but are not limited to, any one of an immediate reconnection instruction, a timing reconnection instruction, and a step reconnection instruction.
  • the processor 702 calls the operations performed by the program code in the memory 703, and specifically includes but is not limited to any one of the following two operations or a combination thereof:
  • the connection instruction in the policy instruction adjusts the connection to any one of a long connection, a polled connection, or a short-time connection; when the preset trigger condition of the connection disconnection instruction in the above policy instruction is reached, the connection is disconnected And according to the reconnect instruction in the above policy instruction, it is determined that the way to re-establish the connection is a timing reconnection or a step reconnection.
  • Operation two after the server establishes a connection for the service between the server and the device based on the connection request, when the connection mechanism in the policy command is a non-instant connection mechanism, disconnect the connection, and according to the foregoing
  • the reconnect instruction in the policy instruction determines whether the connection is re-established as a timing reconnection or a step reconnection.
  • the transceiver 701 is further configured to: after the server establishes a connection for the service between the server and the device, the server receives, according to the connection request, a push message of the service that is pushed by the server based on the established connection, where The push message is pushed by the server according to a message transmission request sent by the device for the service.
  • the connection establishing device may be a client, or may be a mobile terminal that communicates with one or more core networks via a Radio Access Network (RAN).
  • the mobile terminal can be a mobile phone (or "cellular" phone) or a computer with a mobile terminal, for example, a portable, pocket, handheld, computer built-in or in-vehicle mobile device with a wireless access network Exchange language and/or data.
  • the mobile terminal may be a personal communication service (PCS), a cordless telephone, or a session initiation protocol (SIP, Session Initiation).
  • PCS personal communication service
  • SIP Session Initiation
  • WLL Wireless Local Loop
  • PDA Personal Digital Assistant
  • Subscriber Unit Subscriber Station, Mobile Station , mobile station, remote station, access point, remote terminal, access terminal, user terminal, user agent , User Device ( User Device )
  • bus 604 or/and bus 704 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an extended industry standard architecture ( Extended). Industry Standard Architecture, EISA) Bus, etc.
  • Bus 604 or / and bus 704 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one line is shown in Figures 6 and 7, but it does not mean that there is only one bus or one type of bus.
  • Memory 603 or / and memory 703 are used to store program code, which includes operational instructions.
  • the memory 603 or / and the memory 703 may include a random access memory (RAM), and may also include a non-volatile memory such as a disk memory, a micro SD card, or the like.
  • RAM random access memory
  • non-volatile memory such as a disk memory, a micro SD card, or the like.
  • the processor 602 or/and the processor 702 may be a central processing unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one configured to implement an embodiment of the present invention. Multiple integrated circuits.
  • CPU central processing unit
  • ASIC Application Specific Integrated Circuit
  • the server when the server confirms that the client is successfully registered for a service, the server feeds back the corresponding registration response and the policy instruction according to the service information of the service, and adjusts the connection established between the server and the client according to the policy instruction.
  • the hold time of the connection is determined according to the actual demand, and the connection is disconnected in time when there is no service demand, so as to avoid the connection between the server and the client for a long time, and the data call is not frequently initiated, thereby avoiding the problem of excessive power consumption.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Communication Control (AREA)

Abstract

本发明公开了一种连接建立方法及装置,该方法包括以下步骤:服务器接收客户端基于一个业务发送的注册请求和连接请求(101);服务器在根据所述注册请求对该业务注册成功时,根据所述注册请求中携带的该业务的业务信息生成针对该业务的策略指令,其中所述策略指令用以指示调整服务器与所述客户端之间针对该业务建立的连接的通断状态(102);服务器将所述策略指令反馈给所述客户端,指示所述客户端根据所述策略指令调整所述服务器与客户端之间针对该业务建立的连接的通断状态(103);基于所述连接请求,在所述服务器与所述客户端之间建立针对该业务的连接,并基于所述策略指令对所述连接进行通断状态的调整(104)。用以解决现有技术中客户端耗电较大的问题。

Description

一种连接建立的方法及装置 本申请要求于 2013 年 08 月 09 日提交中国专利局、 申请号为 201310347450.3、 发明名称为 "一种连接建立的方法及装置" 的中国专利申请的 优先权, 其全部内容通过引用结合在本申请中。 技术领域
本发明涉及通信技术领域, 特别涉及一种连接建立的方法及装置。 背景技术
推送(PUSH )技术是服务器与客户端之间的一种信息推送技术。 PUSH技 术通常在客户端和服务器之间建立一条连接通道, 服务器根据业务需求将信息 通过此通道推送到客户端。 目前 PUSH技术一般集中应用于服务器和客户端交 互的应用场景。 由于服务器需要根据业务需求, 将一定长度的信息通过传输控 制协议(Transmission Control Protocol, TCP )连接传递到客户端, 因此, PUSH 技术通常会在客户端和服务器之间建立一条长期有效的 TCP连接, 并通过心跳 反应来维持该长期有效的 TCP连接。
长期有效的 TCP连接需要心跳反应来维持, 而心跳反应需要客户端频繁发 起数据呼叫, 并且带来高频度的无线数据传送, 从而使得客户端的耗电量较大。 发明内容
本发明实施例提供一种连接建立的方法及装置, 用以解决现有技术中存在 的, 客户端需要频繁发起数据呼叫以实现长期保持与服务器之间的 TCP连接, 从而导致客户端耗电较大的问题。
本发明实施例提供的具体技术方案如下:
第一方面, 提供一种连接建立方法, 包括:
接收客户端基于一个业务发送的注册请求和连接请求; 在根据所述注册请求对该业务注册成功时, 根据所述注册请求中携带的该 业务的业务信息生成针对该业务的策略指令, 其中所述策略指令用以指示调整 服务器与所述客户端之间针对该业务建立的连接的通断状态;
将所述策略指令反馈给所述客户端, 指示所述客户端根据所述策略指令调 整所述服务器与客户端之间针对该业务建立的连接的通断状态;
基于所述连接请求, 在所述服务器与所述客户端之间建立针对该业务的连 接, 并基于所述策略指令对所述连接进行通断状态的调整。
结合第一方面, 在第一方面的第一种可能的实现方式中, 根据所述业务的 业务信息生成针对该业务的策略指令, 具体包括:
根据所述业务的业务信息, 确定所述业务的连接机制, 并生成具有预设触 发条件的连接指令;
将所述连接机制和具有预设触发条件的连接指令作为针对所述业务的策略 指令。
结合第一方面的第一种可能的实现方式, 在第一方面的第二种可能的实现 方式中, 所述连接机制包括即时连接机制或非即时连接机制;
所述连接指令包括: 连接保持指令、 连接断开指令和重连指令中的任意一 种或其组合;
所述预设触发条件包括:预设的时间限制到达或 /和相关业务状态发生变化。 结合第一方面的第二种可能的实现方式, 在第一方面的第三种可能的实现 方式中, 所述重连指令包括: 即时重连指令、 定时重连指令和步进重连指令中 的任意一种。
结合第一方面的第三种可能的实现方式, 在第一方面的第四种可能的实现 方式中, 基于所述策略指令对所述连接进行通断状态的调整, 具体包括:
在所述策略指令中的连接机制为即时连接机制时, 保持所述连接处于连通 状态;
根据所述策略指令中的连接指令, 将所述连接调整为长连接、 轮询连接或 短时连接中的任一种;
在达到所述策略指令中的连接断开指令的预设触发条件时, 断开所述连接, 并根据所述策略指令中的重连指令, 确定重新建立连接的方式为定时重连或步 进重连。
结合第一方面的第三种可能的实现方式, 在第一方面的第五种可能的实现 方式中, 基于所述策略指令对所述连接进行通断状态的调整, 具体包括:
在所述策略指令中的连接机制为非即时连接机制时, 断开所述连接, 并根 据所述策略指令中的重连指令确定重新建立连接的方式为定时重连或步进重 连。
结合第一方面, 或第一方面的上述任意一种可能的实现方式, 在第一方面 的第七种可能的实现方式中, 在所述服务器与所述客户端之间建立连接之后, 还包括:
根据所述客户端针对所述业务发送的消息发送请求, 将所述业务的推送消 息基于建立的该连接推送至所述客户端。
第二方面, 本发明实施例提供一种连接建立方法, 包括:
基于一个业务向服务器发送注册请求和连接请求; 接收所述服务器在根据所述注册请求对该业务注册成功时, 根据所述注册 请求中携带的该业务的业务信息, 生成并发送的针对所述业务的策略指令; 在所述服务器基于所述连接请求, 在所述服务器与客户端之间建立针对该 业务的连接后, 根据所述策略指令调整所述连接的通断状态。
结合第二方面, 在第二方面的第一种可能的实现方式中, 所述策略指令, 具体包括:
所述业务的连接机制和具有预设触发条件的连接指令。
结合第二方面的第一种可能的实现方式, 在第二方面的第二种可能的实现 方式中, 所述连接机制包括即时连接机制或非即时连接机制;
所述连接指令包括: 连接保持指令、 连接断开指令和重连指令中的任意一 种或其组合;
所述预设触发条件包括:预设的时间限制到达或 /和相关业务状态发生变化。 结合第二方面的第二种可能的实现方式, 在第二方面的第三种可能的实现 方式中, 所述重连指令包括: 即时重连指令、 定时重连指令和步进重连指令中 的任意一种。
结合第二方面的第三种可能的实现方式, 在第二方面的第四种可能的实现 方式中, 根据所述策略指令调整所述连接的通断状态, 具体包括:
在所述策略指令中的连接机制为即时连接机制时, 保持所述连接处于连通 状态;
根据所述策略指令中的连接指令, 将所述连接调整为长连接、 轮询连接或 短时连接中的任一种;
在达到所述策略指令中的连接断开指令的预设触发条件时, 断开所述连接, 并根据所述策略指令中的重连指令, 确定重新建立连接的方式为定时重连或步 进重连。
结合第二方面的第三种可能的实现方式, 在第二方面的第五种可能的实现 方式中, 根据所述策略指令调整所述连接的通断状态, 具体包括:
在所述策略指令中的连接机制为非即时连接机制时, 断开所述连接, 并 根据所述策略指令中的重连指令确定重新建立连接的方式为定时重连或步 进重连。
结合第二方面, 或第二方面的上述任意一种可能的实现方式, 在第二方面 的第六种可能的实现方式中, 在所述服务器基于所述连接请求, 在所述服务器 与客户端之间建立针对该业务的连接之后, 还包括:
接收所述服务器基于建立的该连接推送的所述业务的推送消息, 其中, 所 述业务的推送消息是所述服务器根据所述客户端针对所述业务发送的消息发送 请求推送的。
第三方面, 本发明实施例提供一种连接建立装置, 包括: 接收模块, 用于接收客户端基于一个业务发送的注册请求和连接请求; 生成模块, 用于在根据所述注册请求对该业务注册成功时, 根据所述注册 请求中携带的该业务的业务信息生成针对该业务的策略指令, 其中所述策略指 令用以指示调整本装置与所述客户端之间针对该业务建立的连接的通断状态; 反馈模块, 用于将所述策略指令反馈给所述客户端, 指示所述客户端根据 所述策略指令调整本装置与客户端之间针对该业务建立的连接的通断状态; 连接模块, 用于基于所述连接请求, 在本装置与所述客户端之间建立针对 该业务的连接, 并基于所述策略指令对所述连接进行通断状态的调整。
结合第三方面, 在第三方面的第一种可能的实现方式中, 所述生成模块, 具体用于:
在根据所述注册请求对该业务注册成功时, 根据所述业务的业务信息, 确 定所述业务的连接机制, 并生成具有预设触发条件的连接指令; 将所述连接机 制和具有预设触发条件的连接指令作为针对所述业务的策略指令。
结合第三方面的第一种可能的实现方式, 在第三方面的第二种可能的实现 方式中, 所述连接机制包括即时连接机制或非即时连接机制;
所述连接指令包括: 连接保持指令、 连接断开指令和重连指令中的任意一 种或其组合;
所述预设触发条件包括:预设的时间限制到达或 /和相关业务状态发生变化。 结合第三方面的第二种可能的实现方式, 在第三方面的第三种可能的实现 方式中, 所述重连指令包括: 即时重连指令、 定时重连指令和步进重连指令中 的任意一种。
结合第三方面的第三种可能的实现方式, 在第三方面的第四种可能的实现 方式中, 所述连接模块, 具体包括:
第一子模块, 用于基于所述连接请求, 在本装置与所述客户端之间建立针 对该业务的连接;
第二子模块, 用于在所述策略指令中的连接机制为即时连接机制时, 保持 所述连接处于连通状态; 根据所述策略指令中的连接指令, 将所述连接调整为 长连接、 轮询连接或短时连接中的任一种; 在达到所述策略指令中的连接断开 指令的预设触发条件时, 断开所述连接, 并根据所述策略指令中的重连指令, 确定重新建立连接的方式为定时重连或步进重连。
结合第三方面的第三种可能的实现方式, 在第三方面的第五种可能的实现 方式中, 所述连接模块, 具体包括:
第一子模块, 用于基于所述连接请求, 在本装置与所述客户端之间建立针 对该业务的连接;
第二子模块, 用于在所述策略指令中的连接机制为非即时连接机制时, 断 开所述连接, 并根据所述策略指令中的重连指令确定重新建立连接的方式为定 时重连或步进重连。
结合第三方面, 或第三方面的上述任意一种可能的实现方式, 在第三方面 的第六种可能的实现方式中, 所述反馈模块, 还用于在本装置与所述客户端之 间建立连接之后, 根据所述客户端针对所述业务发送的消息发送请求, 将所述 业务的推送消息基于建立的该连接推送至所述客户端。
第四方面, 本发明实施例提供一种连接建立装置, 包括:
发送模块, 用于基于一个业务向服务器发送注册请求和连接请求; 接收模块, 用于接收所述服务器在根据所述注册请求对该业务注册成功时, 根据所述注册请求中携带的该业务的业务信息, 生成并发送的针对所述业务的 策略指令;
调整模块, 用于在所述服务器基于所述连接请求, 在所述服务器与本装置 之间建立针对该业务的连接后, 根据所述策略指令调整所述连接的通断状态。
结合第四方面, 在第四方面的第一种可能的实现方式中, 所述策略指令, 具体包括:
所述业务的连接机制和具有预设触发条件的连接指令。
结合第四方面的第一种可能的实现方式, 在第四方面的第二种可能的实现 方式中, 所述连接机制包括即时连接机制或非即时连接机制;
所述连接指令包括: 连接保持指令、 连接断开指令和重连指令中的任意一 种或其组合;
所述预设触发条件包括:预设的时间限制到达或 /和相关业务状态发生变化。 结合第四方面的第二种可能的实现方式, 在第四方面的第三种可能的实现 方式中, 所述重连指令包括: 即时重连指令、 定时重连指令和步进重连指令中 的任意一种。
结合第四方面的第三种可能的实现方式, 在第四方面的第四种可能的实现 方式中, 所述调整模块, 具体用于在所述服务器基于所述连接请求, 在所述服 务器与本装置之间建立针对该业务的连接后, 在所述策略指令中的连接机制为 即时连接机制时, 保持所述连接处于连通状态; 根据所述策略指令中的连接指 令, 将所述连接调整为长连接、 轮询连接或短时连接中的任一种; 在达到所述 策略指令中的连接断开指令的预设触发条件时, 断开所述连接, 并根据所述策 略指令中的重连指令, 确定重新建立连接的方式为定时重连或步进重连。
结合第四方面的第三种可能的实现方式, 在第四方面的第五种可能的实现 方式中, 所述调整模块, 具体用于在所述服务器基于所述连接请求, 在所述服 务器与本装置之间建立针对该业务的连接后, 在所述策略指令中的连接机制为 非即时连接机制时, 断开所述连接, 并根据所述策略指令中的重连指令确定重 新建立连接的方式为定时重连或步进重连。
结合第四方面, 或第四方面的上述任意一种可能的实现方式, 在第四方面 的第六种可能的实现方式中, 所述接收模块还用于: 在所述服务器基于所述连 接请求, 在所述服务器与本装置之间建立针对该业务的连接之后, 接收所述服 务器基于建立的该连接推送的所述业务的推送消息, 其中, 所述推送消息是所 述服务器根据本装置针对所述业务发送的消息发送请求推送的。
本发明实施例中, 在确认客户端针对一个业务注册成功时, 根据该业务的 业务信息反馈相应的注册响应和策略指令, 并根据该策略指令, 调整服务器与 客户端之间建立的连接通断状态, 根据实际需求确定该连接的保持时间, 在没 有业务需求的时候及时断开连接, 避免长期保持服务器与客户端之间的连接, 无需频繁发起数据呼叫, 从而避免了耗电过量问题。 附图说明
图 1为本发明实施例设计的一种连接建立方法流程图;
图 2为本发明的实施例一的信息交互图;
图 3为本发明实施例设计的另一种连接建立方法流程图;
图 4为本发明实施例设计的一种连接建立装置的示意图;
图 5为本发明实施例设计的另一种连接建立装置的示意图;
图 6为本发明实施例设计的一种连接建立设备的结构示意图:
图 7为本发明实施例设计的另一种连接建立设备的结构示意图。 具体实施方式
下面结合附图说明本发明的优选实施例。
参阅图 1所示, 本发明设计了一种连接建立方法, 包括如下步骤。
步骤 101 : 服务器接收客户端发送的注册请求和连接请求。
步骤 102: 服务器在根据上述注册请求对该业务注册成功时,根据上述注册 请求中携带的该业务的业务信息生成针对该业务的策略指令, 其中上述策略指 令用以指示调整服务器与上述客户端之间针对该业务建立的连接的通断状态。
步骤 103: 服务器将上述策略指令反馈给上述客户端, 指示上述客户端根据 上述策略指令调整上述服务器与客户端之间针对该业务建立的连接的通断状 态。
步骤 104: 基于上述连接请求, 在上述服务器与上述客户端之间建立针对该 业务的连接, 并基于上述策略指令对上述连接进行通断状态的调整。
上述注册请求或 /和连接请求中可以包括客户端的设备标识, 例如加密后的 IMEI号等。
上述注册响应可以包括注册令牌(即 TOKEN标识), 具体地, 该注册令牌 可以是与上述业务对应的参数。
较佳地, 服务器可以通过下述方式生成策略指令:
根据上述业务的业务信息, 确定上述业务的连接机制, 并生成具有预设触 发条件的连接指令;
将上述连接机制和具有预设触发条件的连接指令作为针对上述业务的策略 指令。
可选地, 连接机制可以但不限于包括即时连接机制或非即时连接机制。 连接指令可以但不限于包括: 连接保持指令、 连接断开指令和重连指令中 的任意一种或其组合。
预设触发条件但不限于包括: 预设的时间限制到达或 /和相关业务状态发生 变化。
上述重连指令可以包括但不限于: 即时重连指令、 定时重连指令和步进重 连指令中的任意一种。
即时重连可以是: 在客户端与服务器之间的连接断开后, 立即在客户端与 服务器之间重新建立连接。
定时重连是指: 在客户端与服务器之间的连接断开后, 预设时长到达时, 尝试在客户端与服务器之间重新建立连接。
步进重连是指: 在客户端与服务器之间的连接断开后, 间隔不同的时长, 尝试在客户端与服务器之间重新建立连接。 一般来说, 步进重连中, 客户端在 相邻两次尝试重新建立连接之间间隔的时间是越来越长的。
具体地, 可以但不限于釆用下述方式实现, 基于上述策略指令对上述连接 进行通断状态的调整:
方式一: 在上述策略指令中的连接机制为即时连接机制时, 保持上述连接 处于连通状态; 根据上述策略指令中的连接指令, 将上述连接调整为长连接、 轮询连接或 短时连接中的任一种;
在达到上述策略指令中的连接断开指令的预设触发条件时, 断开上述连接, 并根据上述策略指令中的重连指令, 确定重新建立连接的方式为定时重连或步 进重连。
方式二: 在上述策略指令中的连接机制为非即时连接机制时, 断开上述连 接, 并根据上述策略指令中的重连指令确定重新建立连接的方式为定时重连或 步进重连。
在服务器与客户端建立连接之后, 服务器就可以根据该客户端针对上述业 务发送的消息发送请求, 将上述业务的推送(PUSH ) 消息推送到客户端, 实现 该业务的消息 PUSH过程。
上述服务器与客户端之间的连接可以是 TCP连接, 也可以是安全传输层协 议( Transport Layer Security, TLS )连接等其他连接。
在实际应用中, 服务器在根据上述注册请求对上述业务注册成功时, 还可 以根据上述注册请求中携带的该业务的业务信息和服务器内部针对该客户端存 储的应用环境信息, 生成针对该业务的策略指令。
上述应用环境信息可以是应用类型、 客户端内部的其它应用的策略指令等 信息。 这样, 本发明实施例就能够根据客户端应用环境的不同, 综合客户端中 各个业务的消息推送需求, 生成针对每一个业务的策略指令。
为了节省流量, 服务器与客户端之间可以基于二进制或格式化字符串的方 式传递消息; 而为了消息的可扩展性, 服务器与客户端之间也可以基于 JSON ( JavaScript Object Notation )、 可扩展标己语言 ( Extensible Markup Language , XML )等可扩展性描述语言来传递消息, 因此, 上述策略指令可以是基于二进 制或格式化的字符串, 也可以是基于 JSON或 XML的可扩展性描述语言。
实施例一: 应用 A和应用 B分别是同一个客户端的不同应用, 并且应用 A 和应用 B都需要 PUSH服务。 在客户端中应用 A执行业务 A, 应用 B执行业务 B。 本发明的实施例一的流程参阅图 2所示。 图 2包括了应用客户端(包括应用 客户端 A和应用客户端 B )、 PUSH客户端、 PUSH服务器和应用服务器。 应用 客户端可以是指移动手机、 电脑等终端, 应用客户端 A和应用客户端 B可以是 同一个客户端上的不同应用软件。 PUSH客户端可以是指客户端中独立运行的具 有 PUSH功能的软件或嵌套在某一个应用中的具有 PUSH功能的软件。 PUSH 服务器可以是 PUSH消息的服务器。 应用服务器可以是应用 A和应用 B的远端 服务器。 应用客户端和 PUSH客户端可以是属于同一个实体装置 (即客户端) 的不同部分。 PUSH服务器和应用服务器既可以是属于同一个服务器的不同部分 (例如不同的软件模块, 或, 不同的硬件部分), 也可以是两个服务器。
在没有任何应用客户端向 PUSH服务器注册时 , PUSH客户端不需要耗费电 量和流量, 激活与 PUSH服务器之间的连接, 也无需耗费电量和流量, 保持连 接的活性。
步骤 201 : 应用服务器 A基于业务 A和业务 B分别向 PUSH服务器注册 PUSH服务。
步骤 202: 应用客户端 A向 PUSH客户端发送业务 A的注册信息。
步骤 203: PUSH客户端向 PUSH服务器注册业务 A的 PUSH服务。
在步骤 203中, PUSH客户端将业务 A的注册请求和连接请求发送给 PUSH 服务器, 该注册请求中包含业务 A的注册信息。 上述连接请求可以是 TLS连接 请求或 TCP连接请求等。
步骤 204: PUSH服务器确定业务 A注册成功, 向 PUSH客户端反馈注册响 应和策略指令。
步骤 204的实行就意味着, PUSH客户端与 PUSH服务器之间的连接建立成 功。
假设 PUSH服务器根据业务 A的注册信息, 确定应用服务器基于业务 A注 册的 PUSH服务的连接机制为非即时连接机制,并且确定业务 A在间隔 30分钟 后, 需要重新开始 PUSH服务。 此时, PUSH服务器就可以生成业务 A的策略 指令, 该策略指令中包含的连接机制为非即时连接机制, 该策略指令中包含的 重连机制为定时重连指令, 并且该重连指令的重连间隔时长为 30分钟。
步骤 205: PUSH客户端向应用该客户端发送注册响应。
步骤 206: PUSH客户端根据上述策略指令建立断开 PUSH客户端与 PUSH 服务器之间的连接。
PUSH客户端可以根据该策略指令, 在断开连接 30分钟后重新与 PUSH服 务器建立连接, 并检查 PUSH服务器是否有消息可以推送。
由于步骤 206是业务 A的信息交互流程中的步骤, 步骤 207是业务 B的信 息交互流程中的步骤, 因此, 在实际应用中, 步骤 206和步骤 207之间可以间 隔一段时间, 并且在这段时间内, 客户端与服务器之间也可以由其他信息的交 互过程。
步骤 207: 应用客户端 B向 PUSH客户端发送业务 B的注册信息。
步骤 208: PUSH客户端向 PUSH服务器注册业务 B的 PUSH服务。
在步骤 208中, PUSH客户端将业务 B的注册请求和连接请求发送给 PUSH 服务器, 该注册请求中包含业务 B的注册信息。 上述连接请求可以是 TLS连接 请求或 TCP连接请求等。
步骤 209: PUSH服务器确定业务 B注册成功, 向 PUSH客户端反馈注册响 应和策略指令。
假设 PUSH服务器根据业务 B的注册信息, 确定应用服务器基于业务 B注 册的 PUSH服务的连接机制为即时连接机制, 业务 B需要长期保持这个连接, 以便传输消息。 此时, PUSH服务器就可以生成业务 B的策略指令, 该策略指 令中包含的连接机制为即时连接机制, 该策略指令指示将建立好的连接调整为 长连接。 具体地, 该策略指令还可以指示该长连接的心跳固定周期为 3分钟。
步骤 210: PUSH客户端向应用客户端 B发送注册响应。
步骤 211 : PUSH客户端接收 PUSH服务器下发的注册响应和策略指令, 根 据该策略指令建立即时连接, 并将该即时连接调整为长连接。 在将该即时连接调整为长连接之后 , PUSH客户端可以在每一个心跳固定周 期到达时, 向 PUSH服务器发送心跳信息, 用以保持长连接。
步骤 212: 应用服务器向 PUSH服务器发送业务 B的 PUSH消息。
步骤 213: PUSH服务器将业务 B的 PUSH消息, 通过上述长连接, 实时发 送给 PUSH客户端。
步骤 210: PUSH客户端实时将业务 B的 PUSH消息发送给应用客户端 B, 并通过应用 B显示该消息。
通过本发明实施例, 服务器可以对客户端注册的业务进行智能分析, 针对 不同的场景、 不同的时间段、 不同客户端的业务或同一客户端的不同业务, 釆 取不同的连接策略, 避免针对所有的业务、 时间段和场景都釆用同一种连接策 略, 从而在保证业务体验的同时, 智能化地节省客户端的流量和电量的消耗。
基于同一设计思路, 本发明实施例还设计了一种连接建立方法, 参阅图 3 所示, 包括:
步骤 301 : 客户端基于一个业务向服务器发送注册请求和连接请求; 步骤 302: 客户端接收上述服务器在根据上述注册请求对该业务注册成功 时, 根据上述注册请求中携带的该业务的业务信息, 生成并发送的针对上述业 务的策略指令。
步骤 303: 客户端在上述服务器基于上述连接请求, 在上述服务器与客户端 之间建立针对该业务的连接后, 根据上述策略指令调整上述连接的通断状态。
较佳地, 上述策略指令可以但不限于包括: 上述业务的连接机制和具有预 设触发条件的连接指令。
可选地, 连接机制可以但不限于包括: 上述连接机制包括即时连接机制或 非即时连接机制。
连接指令可以但不限于包括: 连接保持指令、 连接断开指令和重连指令中 的任意一种或其组合。
预设触发条件可以但不限于包括: 预设的时间限制到达或 /和相关业务状态 发生变化。
重连指令可以但不限于包括: 即时重连指令、 定时重连指令和步进重连指 令中的任意一种。
较佳地, 根据上述策略指令调整上述连接的通断状态, 可以但不限于通过 下述方式实现:
方式一: 在上述策略指令中的连接机制为即时连接机制时, 保持上述连接 处于连通状态;
根据上述策略指令中的连接指令, 将上述连接调整为长连接、 轮询连接或 短时连接中的任一种;
在达到上述策略指令中的连接断开指令的预设触发条件时, 断开上述连接, 并根据上述策略指令中的重连指令, 确定重新建立连接的方式为定时重连或步 进重连。
方式二: 在上述策略指令中的连接机制为非即时连接机制时, 断开上述连 接, 并根据上述策略指令中的重连指令确定重新建立连接的方式为定时重连或 步进重连。
在该服务器基于上述连接请求, 在该服务器与客户端之间建立针对该业务 的连接之后, 该客户端就可以接收该服务器基于建立的该连接推送的该业务的 推送消息, 其中, 上述业务的推送消息是上述服务器根据上述客户端针对上述 业务发送的消息发送请求推送的。
本发明实施例中, 客户端基于服务器针对某一业务发送的连接策略, 可以 根据应用场景调整连接通断, 避免了始终频繁发起数据呼叫造成的耗电过量的 问题。
基于同一设计思路, 本发明实施例还设计了一种连接建立装置, 参阅图 4 所示, 包括:
接收模块 401: 用于接收客户端基于一个业务发送的注册请求和连接请求; 生成模块 402: 用于在根据上述注册请求对该业务注册成功时,根据上述注 册请求中携带的该业务的业务信息生成针对该业务的策略指令, 其中上述策略 指令用以指示调整本装置与上述客户端之间针对该业务建立的连接的通断状 态;
反馈模块 403 , 用于将上述策略指令反馈给上述客户端, 指示上述客户端根 据上述策略指令调整本装置与客户端之间针对该业务建立的连接的通断状态; 连接模块 404 , 用于基于上述连接请求, 在本装置与上述客户端之间建立针 对该业务的连接, 并基于上述策略指令对上述连接进行通断状态的调整。
较佳地, 上述生成模块 402 , 具体用于:
在根据上述注册请求对该业务注册成功时, 根据上述业务的业务信息, 确 定上述业务的连接机制, 并生成具有预设触发条件的连接指令; 将上述连接机 制和具有预设触发条件的连接指令作为针对上述业务的策略指令。
可选地, 上述连接机制可以但不限于包括即时连接机制或非即时连接机制。 上述连接指令可以但不限于包括: 连接保持指令、 连接断开指令和重连指 令中的任意一种或其组合;
上述预设触发条件可以但不限于包括: 预设的时间限制到达或 /和相关业务 状态发生变化。
上述重连指令可以但不限于包括: 即时重连指令、 定时重连指令和步进重 连指令中的任意一种。
较佳地, 上述连接模块 404可以分为下述两种情况。
情况一: 该连接模块 404具体包括:
第一子模块, 用于基于上述连接请求, 在本装置与上述客户端之间建立针 对该业务的连接;
第二子模块, 用于在上述策略指令中的连接机制为即时连接机制时, 保持 上述连接处于连通状态; 根据上述策略指令中的连接指令, 将上述连接调整为 长连接、 轮询连接或短时连接中的任一种; 在达到上述策略指令中的连接断开 指令的预设触发条件时, 断开上述连接, 并根据上述策略指令中的重连指令, 确定重新建立连接的方式为定时重连或步进重连。
情况二: 第一子模块, 用于基于上述连接请求, 在本装置与上述客户端之 间建立针对该业务的连接;
第二子模块, 用于在上述策略指令中的连接机制为非即时连接机制时, 断 开上述连接, 并根据上述策略指令中的重连指令确定重新建立连接的方式为定 时重连或步进重连。
实际应用时, 连接模块的第二子模块可以同时具有上述两种情况的功能。 较佳地, 上述连接建立装置中的反馈模块 403 ,还可以用于在本装置与上述 客户端之间建立连接之后, 根据所述客户端针对所述业务发送的消息发送请求 , 将上述业务的推送消息基于建立的该连接推送至上述客户端。
基于同一设计思路, 本发明实施例还可设计了一种连接建立装置, 参阅图 5 所示, 包括:
发送模块 501 , 用于基于一个业务向服务器发送注册请求和连接请求; 接收模块 502 ,用于接收上述服务器在根据上述注册请求对该业务注册成功 时, 根据上述注册请求中携带的该业务的业务信息, 生成并发送的针对上述业 务的策略指令;
调整模块 503 , 用于在上述服务器基于上述连接请求, 在上述服务器与本装 置之间建立针对该业务的连接后, 根据上述策略指令调整上述连接的通断状态。
可选地, 上述策略指令可以但不限于包括: 上述业务的连接机制和具有预 设触发条件的连接指令。
上述连接机制可以但不限于包括即时连接机制或非即时连接机制; 上述连接指令可以但不限于包括: 连接保持指令、 连接断开指令和重连指 令中的任意一种或其组合;
上述预设触发条件可以但不限于包括: 预设的时间限制到达或 /和相关业务 状态发生变化。
上述重连指令可以但不限于包括: 即时重连指令、 定时重连指令和步进重 连指令中的任意一种。
较佳地, 上述调整模块 503 , 具体用于在上述服务器基于上述连接请求, 在 上述服务器与本装置之间建立针对该业务的连接后, 在上述策略指令中的连接 机制为即时连接机制时, 保持上述连接处于连通状态; 根据上述策略指令中的 连接指令, 将上述连接调整为长连接、 轮询连接或短时连接中的任一种; 在达 到上述策略指令中的连接断开指令的预设触发条件时, 断开上述连接, 并根据 上述策略指令中的重连指令, 确定重新建立连接的方式为定时重连或步进重连。
较佳地, 上述调整模块 503 , 具体用于在上述服务器基于上述连接请求, 在 上述服务器与本装置之间建立针对该业务的连接后, 在上述策略指令中的连接 机制为非即时连接机制时, 断开上述连接, 并根据上述策略指令中的重连指令 确定重新建立连接的方式为定时重连或步进重连。
实际应用中, 调整模块可以同时具有上述两种具体功能。
上述接收模块 502还用于: 在上述服务器基于上述连接请求, 在上述服务 器与本装置之间建立针对该业务的连接之后, 接收上述服务器基于建立的该连 接推送的上述业务的推送消息, 其中, 上述推送消息是上述服务器根据本装置 针对上述业务发送的消息发送请求推送的。
上述装置是与方法流程——对应的, 在此不再赘述。
基于同一设计思路, 本发明实施例还设计了一种连接建立设备, 参照图 6 所示包括: 至少一个收发器 601、 至少一个处理器 602、 至少一个存储器 603和 总线 604, 该至少一个收发器 601、 至少一个处理器 602和至少一个存储器 603 通过总线 604连接并完成相互间的通信, 其中:
收发器 601 ,主要用于实现本实施例中的连接建立设备与客户端之间通信数 据的收发。
具体的, 收发器 601 , 用于接收客户端基于一个业务发送的注册请求和连接 请求。
处理器 602, 用于调用存储器 603中的程序代码, 用以执行以下操作: 操作一: 在根据上述注册请求对该业务注册成功时, 根据上述注册请求中 携带的该业务的业务信息生成针对该业务的策略指令, 其中上述策略指令用以 指示调整本设备与上述客户端之间针对该业务建立的连接的通断状态;
操作二: 将上述策略指令反馈给上述客户端, 指示上述客户端根据上述策 略指令调整本设备与客户端之间针对该业务建立的连接的通断状态;
操作三: 基于上述连接请求, 在本设备与上述客户端之间建立针对该业务 的连接, 并基于上述策略指令对上述连接进行通断状态的调整。
较佳地, 处理器 602调用存储器 603 中的程序代码所执行的操作一, 具体 包括:
在根据上述注册请求对该业务注册成功时, 根据上述业务的业务信息, 确 定上述业务的连接机制, 并生成具有预设触发条件的连接指令; 将上述连接机 制和具有预设触发条件的连接指令作为针对上述业务的策略指令。
可选地, 上述连接机制可以但不限于包括即时连接机制或非即时连接机制。 上述连接指令可以但不限于包括: 连接保持指令、 连接断开指令和重连指 令中的任意一种或其组合;
上述预设触发条件可以但不限于包括: 预设的时间限制到达或 /和相关业务 状态发生变化。
上述重连指令可以但不限于包括: 即时重连指令、 定时重连指令和步进重 连指令中的任意一种。
较佳地, 上述处理器可以选择下述两种执行方式中的任意一种或其组合, 执行上述操作三:
执行方式一: 基于上述连接请求, 在本设备与上述客户端之间建立针对该 业务的连接; 在上述策略指令中的连接机制为即时连接机制时, 保持上述连接 处于连通状态; 根据上述策略指令中的连接指令, 将上述连接调整为长连接、 轮询连接或短时连接中的任一种; 在达到上述策略指令中的连接断开指令的预 设触发条件时, 断开上述连接, 并根据上述策略指令中的重连指令, 确定重新 建立连接的方式为定时重连或步进重连。
执行方式二: 基于上述连接请求, 在本设备与上述客户端之间建立针对该 业务的连接; 在上述策略指令中的连接机制为非即时连接机制时, 断开上述连 接, 并根据上述策略指令中的重连指令确定重新建立连接的方式为定时重连或 步进重连。
较佳地, 上述收发器 601 ,还可以用于在本设备与上述客户端之间建立连接 之后, 根据所述客户端针对所述业务发送的消息发送请求, 将上述业务的推送 消息基于建立的该连接推送至上述客户端。
上述连接建立设备可以是服务器。
基于同一设计思路, 本发明实施例还设计了一种连接建立设备, 参照图 7 所示包括: 至少一个收发器 701、 至少一个处理器 702、 至少一个存储器 703和 总线 704, 该至少一个收发器 701、 至少一个处理器 702和至少一个存储器 703 通过总线 704连接并完成相互间的通信, 其中:
收发器 701 ,主要用于实现本实施例中的连接建立设备与服务器之间通信数 据的收发。
具体的,收发器 701 ,用于基于一个业务向服务器发送注册请求和连接请求, 以及接收上述服务器在根据上述注册请求对该业务注册成功时, 根据上述注册 请求中携带的该业务的业务信息, 生成并发送的针对上述业务的策略指令。
处理器 702, 用于调用存储器 703中的程序代码, 用以执行以下操作: 在上述服务器基于上述连接请求, 在上述服务器与本装置之间建立针对该 业务的连接后, 根据上述策略指令调整上述连接的通断状态。
可选地, 上述策略指令可以但不限于包括: 上述业务的连接机制和具有预 设触发条件的连接指令。
上述连接机制可以但不限于包括即时连接机制或非即时连接机制; 上述连接指令可以但不限于包括: 连接保持指令、 连接断开指令和重连指 令中的任意一种或其组合; 上述预设触发条件可以但不限于包括: 预设的时间限制到达或 /和相关业务 状态发生变化。
上述重连指令可以但不限于包括: 即时重连指令、 定时重连指令和步进重 连指令中的任意一种。
较佳地, 处理器 702调用存储器 703 中的程序代码所执行的操作, 具体包 括但不限于如下两种操作中的任意一种或其组合:
操作一: 在上述服务器基于上述连接请求, 在上述服务器与本装置之间建 立针对该业务的连接后, 在上述策略指令中的连接机制为即时连接机制时, 保 持上述连接处于连通状态; 根据上述策略指令中的连接指令, 将上述连接调整 为长连接、 轮询连接或短时连接中的任一种; 在达到上述策略指令中的连接断 开指令的预设触发条件时, 断开上述连接, 并根据上述策略指令中的重连指令, 确定重新建立连接的方式为定时重连或步进重连。
操作二: 在上述服务器基于上述连接请求, 在上述服务器与本装置之间建 立针对该业务的连接后, 在上述策略指令中的连接机制为非即时连接机制时, 断开上述连接, 并根据上述策略指令中的重连指令确定重新建立连接的方式为 定时重连或步进重连。
上述收发器 701 还用于: 在上述服务器基于上述连接请求, 在上述服务器 与本装置之间建立针对该业务的连接之后, 接收上述服务器基于建立的该连接 推送的上述业务的推送消息, 其中, 上述推送消息是上述服务器根据本装置针 对上述业务发送的消息发送请求推送的。
连接建立设备可以是客户端,也可以是经无线接入网(RAN , Radio Access Network )与一个或多个核心网进行通信的移动终端。 移动终端可以是移动电话 (或称为 "蜂窝" 电话)或者是具有移动终端的计算机, 例如, 可以是便携式、 袖珍式、 手持式、 计算机内置的或者车载的移动装置, 它们与无线接入网交换 语言和 /或数据。 又例如, 移动终端可以是个人通信业务 ( PCS , Personal Communication Service )电话、 无绳电话、会话发起协议 ( SIP, Session Initiation Protocol )话机、 无线本地环路 ( WLL , Wireless Local Loop )站、 个人数字助 理(PDA, Personal Digital Assistant )等设备、 订户单元( Subscriber Unit )、 订 户站( Subscriber Station ), 移动站( Mobile Station )、 移动台 ( Mobile )、 远程站 ( Remote Station )、 接入点( Access Point )、 远程终端( Remote Terminal )、 接入 终端 ( Access Terminal )、 用户终端 ( User Terminal )、 用户代理(User Agent )、 用户设备 ( User Device )„
在上述两个实施例中, 总线 604 或 /和总线 704 可以是工业标准体系结构 ( Industry Standard Architecture , ISA ) 总线、 夕卜部设备互连 ( Peripheral Component, PCI ) 总线或扩展工业标准体系结构 ( Extended Industry Standard Architecture, EISA ) 总线等。 总线 604或 /和总线 704可以分为地址总线、 数据 总线、 控制总线等。 为便于表示, 图 6和图 7中仅用一条线表示, 但并不表示 仅有一根总线或一种类型的总线。
存储器 603或 /和存储器 703用于存储程序代码,该程序代码包括操作指令。 存储器 603或 /和存储器 703可能包括高速随机存储器( random access memory, RAM ), 也可能包括非易失性存储器 (non-volatile memory ), 例如磁盘存储器、 快闪存储器卡( Micro SD Card )等。
处理器 602或 /和处理器 702可能是一个中央处理器( Central Processing Unit, CPU ), 或者是特定集成电路(Application Specific Integrated Circuit, ASIC ), 或 者是被配置成实施本发明实施例的一个或多个集成电路。
本发明实施例中, 服务器在确认客户端针对一个业务注册成功时, 根据该 业务的业务信息反馈相应的注册响应和策略指令, 并根据该策略指令, 调整服 务器与客户端之间建立的连接通断状态, 根据实际需求确定该连接的保持时间, 在没有业务需求的时候及时断开连接, 避免长期保持服务器与客户端之间的连 接, 无需频繁发起数据呼叫, 从而避免了耗电过量问题。
本发明是参照根据本发明实施例的方法、 设备(系统)、 和计算机程序产品 的流程图和 /或方框图来描述的。 应理解可由计算机程序指令实现流程图和 / 或方框图中的每一流程和 /或方框、 以及流程图和 /或方框图中的流程和 /或 方框的结合。 可提供这些计算机程序指令到通用计算机、 专用计算机、 嵌入式 处理机或其他可编程数据处理设备的处理器以产生一个机器, 使得通过计算机 或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流 程或多个流程和 /或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备 以特定方式工作的计算机可读存储器中, 使得存储在该计算机可读存储器中的 指令产生包括指令装置的制造品, 该指令装置实现在流程图一个流程或多个流 程和 /或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上, 使 得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处 理, 从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个 流程或多个流程和 /或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本发明的优选实施例, 但本领域内的技术人员一旦得知了基 本创造性概念, 则可对这些实施例做出另外的变更和修改。 所以, 所附权利要 求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。 离本发明实施例的精神和范围。 这样, 倘若本发明实施例的这些修改和变型属 于本发明权利要求及其等同技术的范围之内, 则本发明也意图包含这些改动和 变型在内。

Claims

权 利 要 求 书
1、 一种连接建立方法, 其特征在于, 包括:
接收客户端基于一个业务发送的注册请求和连接请求;
在根据所述注册请求对该业务注册成功时, 根据所述注册请求中携带的该 业务的业务信息生成针对该业务的策略指令, 其中所述策略指令用以指示调整 服务器与所述客户端之间针对该业务建立的连接的通断状态;
将所述策略指令反馈给所述客户端, 指示所述客户端根据所述策略指令调 整所述服务器与客户端之间针对该业务建立的连接的通断状态;
基于所述连接请求, 在所述服务器与所述客户端之间建立针对该业务的连 接, 并基于所述策略指令对所述连接进行通断状态的调整。
2、 如权利要求 1所述的方法, 其特征在于, 根据所述业务的业务信息生成 针对该业务的策略指令, 具体包括:
根据所述业务的业务信息, 确定所述业务的连接机制, 并生成具有预设触 发条件的连接指令;
将所述连接机制和具有预设触发条件的连接指令作为针对所述业务的策略 指令。
3、 如权利要求 2所述的方法, 其特征在于, 所述连接机制包括即时连接机 制或非即时连接机制;
所述连接指令包括: 连接保持指令、 连接断开指令和重连指令中的任意一 种或其组合;
所述预设触发条件包括:预设的时间限制到达或 /和相关业务状态发生变化。
4、 如权利要求 3所述的方法, 其特征在于, 所述重连指令包括: 即时重连 指令、 定时重连指令和步进重连指令中的任意一种。
5、 如权利要求 4所述的方法, 其特征在于, 基于所述策略指令对所述连接 进行通断状态的调整, 具体包括:
在所述策略指令中的连接机制为即时连接机制时, 保持所述连接处于连通 状态;
根据所述策略指令中的连接指令, 将所述连接调整为长连接、 轮询连接或 短时连接中的任一种;
在达到所述策略指令中的连接断开指令的预设触发条件时, 断开所述连接, 并根据所述策略指令中的重连指令, 确定重新建立连接的方式为定时重连或步 进重连。
6、 如权利要求 4所述的方法, 其特征在于, 基于所述策略指令对所述连接 进行通断状态的调整, 具体包括:
在所述策略指令中的连接机制为非即时连接机制时, 断开所述连接, 并根 据所述策略指令中的重连指令确定重新建立连接的方式为定时重连或步进重 连。
7、 如权利要求 1-6中任一项所述的方法, 其特征在于, 在所述服务器与所 述客户端之间建立连接之后, 还包括:
根据所述客户端针对所述业务发送的消息发送请求, 将所述业务的推送消 息基于建立的该连接推送至所述客户端。
8、 一种连接建立方法, 其特征在于, 包括:
基于一个业务向服务器发送注册请求和连接请求; 接收所述服务器在根据所述注册请求对该业务注册成功时, 根据所述注册 请求中携带的该业务的业务信息, 生成并发送的针对所述业务的策略指令; 在所述服务器基于所述连接请求, 在所述服务器与客户端之间建立针对该 业务的连接后, 根据所述策略指令调整所述连接的通断状态。
9、 如权利要求 8所述的方法, 其特征在于, 所述策略指令, 具体包括: 所述业务的连接机制和具有预设触发条件的连接指令。
10、 如权利要求 9 所述的方法, 其特征在于, 所述连接机制包括即时连接 机制或非即时连接机制;
所述连接指令包括: 连接保持指令、 连接断开指令和重连指令中的任意一 种或其组合;
所述预设触发条件包括:预设的时间限制到达或 /和相关业务状态发生变化。
11、 如权利要求 10所述的方法, 其特征在于, 所述重连指令包括: 即时重 连指令、 定时重连指令和步进重连指令中的任意一种。
12、 如权利要求 11所述的方法, 其特征在于, 根据所述策略指令调整所述 连接的通断状态, 具体包括:
在所述策略指令中的连接机制为即时连接机制时, 保持所述连接处于连通 状态;
根据所述策略指令中的连接指令, 将所述连接调整为长连接、 轮询连接或 短时连接中的任一种;
在达到所述策略指令中的连接断开指令的预设触发条件时, 断开所述连接, 并根据所述策略指令中的重连指令, 确定重新建立连接的方式为定时重连或步 进重连。
13、 如权利要求 11所述的方法, 其特征在于, 根据所述策略指令调整所述 连接的通断状态, 具体包括:
在所述策略指令中的连接机制为非即时连接机制时, 断开所述连接, 并 根据所述策略指令中的重连指令确定重新建立连接的方式为定时重连或步 进重连。
14、 如权利要求 9-13中任一项所述的方法, 其特征在于, 在所述服务器基 于所述连接请求, 在所述服务器与客户端之间建立针对该业务的连接之后, 还 包括:
接收所述服务器基于建立的该连接推送的所述业务的推送消息, 其中, 所 述业务的推送消息是所述服务器根据所述客户端针对所述业务发送的消息发送 请求推送的。
15、 一种连接建立装置, 其特征在于, 包括:
接收模块, 用于接收客户端基于一个业务发送的注册请求和连接请求; 生成模块, 用于在根据所述注册请求对该业务注册成功时, 根据所述注册 请求中携带的该业务的业务信息生成针对该业务的策略指令, 其中所述策略指 令用以指示调整本装置与所述客户端之间针对该业务建立的连接的通断状态; 反馈模块, 用于将所述策略指令反馈给所述客户端, 指示所述客户端根据 所述策略指令调整本装置与客户端之间针对该业务建立的连接的通断状态; 连接模块, 用于基于所述连接请求, 在本装置与所述客户端之间建立针对 该业务的连接, 并基于所述策略指令对所述连接进行通断状态的调整。
16、 如权利要求 15所述的装置, 其特征在于, 所述生成模块, 具体用于: 在根据所述注册请求对该业务注册成功时, 根据所述业务的业务信息, 确 定所述业务的连接机制, 并生成具有预设触发条件的连接指令; 将所述连接机 制和具有预设触发条件的连接指令作为针对所述业务的策略指令。
17、 如权利要求 16所述的装置, 其特征在于, 所述连接机制包括即时连接 机制或非即时连接机制;
所述连接指令包括: 连接保持指令、 连接断开指令和重连指令中的任意一 种或其组合;
所述预设触发条件包括:预设的时间限制到达或 /和相关业务状态发生变化。
18、 如权利要求 17所述的装置, 其特征在于, 所述重连指令包括: 即时重 连指令、 定时重连指令和步进重连指令中的任意一种。
19、 如权利要求 18所述的装置, 其特征在于, 所述连接模块, 具体包括: 第一子模块, 用于基于所述连接请求, 在本装置与所述客户端之间建立针 对该业务的连接;
第二子模块, 用于在所述策略指令中的连接机制为即时连接机制时, 保持 所述连接处于连通状态; 根据所述策略指令中的连接指令, 将所述连接调整为 长连接、 轮询连接或短时连接中的任一种; 在达到所述策略指令中的连接断开 指令的预设触发条件时, 断开所述连接, 并根据所述策略指令中的重连指令, 确定重新建立连接的方式为定时重连或步进重连。
20、 如权利要求 18所述的装置, 其特征在于, 所述连接模块, 具体包括: 第一子模块, 用于基于所述连接请求, 在本装置与所述客户端之间建立针 对该业务的连接;
第二子模块, 用于在所述策略指令中的连接机制为非即时连接机制时, 断 开所述连接, 并根据所述策略指令中的重连指令确定重新建立连接的方式为定 时重连或步进重连。
21、 如权利要求 15-20中任一项所述的装置, 其特征在于, 所述反馈模块, 还用于在本装置与所述客户端之间建立连接之后, 根据所述客户端针对所述业 务发送的消息发送请求, 将所述业务的推送消息基于建立的该连接推送至所述 客户端。
22、 一种连接建立装置, 其特征在于, 包括:
发送模块, 用于基于一个业务向服务器发送注册请求和连接请求; 接收模块, 用于接收所述服务器在根据所述注册请求对该业务注册成功时, 根据所述注册请求中携带的该业务的业务信息, 生成并发送的针对所述业务的 策略指令;
调整模块, 用于在所述服务器基于所述连接请求, 在所述服务器与本装置 之间建立针对该业务的连接后, 根据所述策略指令调整所述连接的通断状态。
23、 如权利要求 22所述的装置, 其特征在于, 所述策略指令, 具体包括: 所述业务的连接机制和具有预设触发条件的连接指令。
24、 如权利要求 23所述的装置, 其特征在于, 所述连接机制包括即时连接 机制或非即时连接机制;
所述连接指令包括: 连接保持指令、 连接断开指令和重连指令中的任意一 种或其组合;
所述预设触发条件包括:预设的时间限制到达或 /和相关业务状态发生变化。
25、 如权利要求 24所述的装置, 其特征在于, 所述重连指令包括: 即时重 连指令、 定时重连指令和步进重连指令中的任意一种。
26、 如权利要求 25所述的装置, 其特征在于, 所述调整模块, 具体用于在 所述服务器基于所述连接请求, 在所述服务器与本装置之间建立针对该业务的 连接后, 在所述策略指令中的连接机制为即时连接机制时, 保持所述连接处于 连通状态; 根据所述策略指令中的连接指令, 将所述连接调整为长连接、 轮询 连接或短时连接中的任一种; 在达到所述策略指令中的连接断开指令的预设触 发条件时, 断开所述连接, 并根据所述策略指令中的重连指令, 确定重新建立 连接的方式为定时重连或步进重连。
27、 如权利要求 25所述的装置, 其特征在于, 所述调整模块, 具体用于在 所述服务器基于所述连接请求, 在所述服务器与本装置之间建立针对该业务的 连接后, 在所述策略指令中的连接机制为非即时连接机制时, 断开所述连接, 并根据所述策略指令中的重连指令确定重新建立连接的方式为定时重连或步进 重连。
28、 如权利要求 22-27中任一项所述的装置, 其特征在于, 所述接收模块还 用于: 在所述服务器基于所述连接请求, 在所述服务器与本装置之间建立针对 该业务的连接之后, 接收所述服务器基于建立的该连接推送的所述业务的推送 消息, 其中, 所述推送消息是所述服务器根据本装置针对所述业务发送的消息 发送请求推送的。
PCT/CN2014/083785 2013-08-09 2014-08-06 一种连接建立的方法及装置 Ceased WO2015018338A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
HK15104049.6A HK1203711B (zh) 2013-08-09 2014-08-06 一种连接建立的方法及装置
EP14814669.9A EP2858332B1 (en) 2013-08-09 2014-08-06 Method and device for establishing a connection
US14/585,887 US9462053B2 (en) 2013-08-09 2014-12-30 Method and apparatus for connection establishment

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310347450.3A CN103428287B (zh) 2013-08-09 2013-08-09 一种连接建立的方法及装置
CN201310347450.3 2013-08-09

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/585,887 Continuation US9462053B2 (en) 2013-08-09 2014-12-30 Method and apparatus for connection establishment

Publications (1)

Publication Number Publication Date
WO2015018338A1 true WO2015018338A1 (zh) 2015-02-12

Family

ID=49652451

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/083785 Ceased WO2015018338A1 (zh) 2013-08-09 2014-08-06 一种连接建立的方法及装置

Country Status (4)

Country Link
US (1) US9462053B2 (zh)
EP (1) EP2858332B1 (zh)
CN (1) CN103428287B (zh)
WO (1) WO2015018338A1 (zh)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103428287B (zh) 2013-08-09 2017-04-12 华为技术有限公司 一种连接建立的方法及装置
CN104468649B (zh) * 2013-09-16 2018-06-05 北大方正集团有限公司 服务器、终端、数据推送系统和数据推送方法
CN103618746A (zh) * 2013-12-10 2014-03-05 南京守护宝信息技术有限公司 一种基于推送指令的客户端服务器通信方法
CN104468547B (zh) * 2014-11-28 2019-03-15 北京奇安信科技有限公司 建立长连接的方法、装置及系统
CN105786611A (zh) * 2014-12-16 2016-07-20 中国移动通信集团公司 一种分布式集群的任务调度方法及装置
CN106161580A (zh) * 2015-04-28 2016-11-23 中兴通讯股份有限公司 一种连接状态控制方法、装置及系统
CN107402896B (zh) * 2016-05-20 2020-12-08 阿里巴巴集团控股有限公司 计算设备间桥接的方法、装置及系统
US10298744B2 (en) * 2017-10-24 2019-05-21 Comptel Oyj Method and arrangement for policy regulation of electronic communication devices
CN112448968B (zh) * 2019-08-28 2022-08-09 华为云计算技术有限公司 一种处理网络请求的方法、相关装置和存储系统
CN110719315B (zh) * 2019-09-02 2022-11-01 北京三快在线科技有限公司 与服务器交互方法、与客户端交互方法、客户端及服务器
CN111726413B (zh) * 2020-06-28 2022-05-17 北京百度网讯科技有限公司 设备连接方法和装置
CN112261647B (zh) * 2020-10-21 2022-04-22 广州助蜂网络科技有限公司 一种基于Netty的ETC双向加密通信系统及方法
US20220166751A1 (en) * 2020-11-20 2022-05-26 Charter Communications Operating, Llc Phone call endpoint security
CN113596116B (zh) * 2021-07-13 2024-02-06 成都安恒信息技术有限公司 一种运维审计系统ssh会话恢复的方法
CN115766823A (zh) * 2022-10-26 2023-03-07 浪潮软件股份有限公司 基于tcp实现终端app与服务器断线重连的方法及系统
CN119071334B (zh) * 2024-06-18 2025-11-21 国网山东省电力公司滨州市沾化区供电公司 基于边缘计算的变电站连接方法、系统、设备及介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102395123A (zh) * 2011-10-31 2012-03-28 中兴通讯股份有限公司 管理服务器,以及移动终端的应用程序管理方法
CN102404701A (zh) * 2010-09-17 2012-04-04 中国移动通信集团公司 电子邮件推送方法、服务器及系统
CN102480517A (zh) * 2010-11-30 2012-05-30 北京千橡网景科技发展有限公司 数据推送方法以及移动终端、服务器
CN103037483A (zh) * 2011-09-30 2013-04-10 联想(北京)有限公司 网络服务器以及维持其与应用服务器的连接的方法
CN103428287A (zh) * 2013-08-09 2013-12-04 华为技术有限公司 一种连接建立的方法及装置

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040177247A1 (en) * 2003-03-05 2004-09-09 Amir Peles Policy enforcement in dynamic networks
JP4303541B2 (ja) * 2003-09-02 2009-07-29 株式会社日立製作所 検索方法及び検索ブローカ
US20060041669A1 (en) * 2004-05-19 2006-02-23 Lucent Technologies, Inc. Securing web services
WO2006019275A1 (en) * 2004-08-18 2006-02-23 Sk Telecom Co., Ltd. Method for providing contents in a mobile communication system and apparatus thereof
CN100566251C (zh) * 2007-08-01 2009-12-02 西安西电捷通无线网络通信有限公司 一种增强安全性的可信网络连接方法
US20120265873A1 (en) * 2009-09-09 2012-10-18 Telefonaktiebolaget Lm Ericsson (Publ) Adaptation of Content Transmission in Mobile Networks
US20110085470A1 (en) * 2009-10-12 2011-04-14 Electronics And Telecommunications Research Institute Apparatus and method for integrated signal processing for ip-based convergence network
CN102571704B (zh) * 2010-12-24 2015-05-27 华为终端有限公司 管理会话的发起和通知方法、被管理终端及管理服务器
KR101918734B1 (ko) * 2011-07-13 2019-02-08 한국전자통신연구원 모바일 방송 서비스를 위한 시스템 및 방법, 컨트롤러 및 컨트롤러의 구동 방법, 프로그램을 기록한 컴퓨터로 읽을 수 있는 매체
CN102355496B (zh) * 2011-09-27 2014-08-20 中国铁道科学研究院电子计算技术研究所 列车车地间数据通信方法
US8732810B2 (en) * 2011-10-27 2014-05-20 Cellco Partnership IP push platform and connection protocol in a push notification framework
US9143548B2 (en) * 2012-01-06 2015-09-22 Telefonaktiebolaget L M Ericsson (Publ) Quality of service support for machine-to-machine applications

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102404701A (zh) * 2010-09-17 2012-04-04 中国移动通信集团公司 电子邮件推送方法、服务器及系统
CN102480517A (zh) * 2010-11-30 2012-05-30 北京千橡网景科技发展有限公司 数据推送方法以及移动终端、服务器
CN103037483A (zh) * 2011-09-30 2013-04-10 联想(北京)有限公司 网络服务器以及维持其与应用服务器的连接的方法
CN102395123A (zh) * 2011-10-31 2012-03-28 中兴通讯股份有限公司 管理服务器,以及移动终端的应用程序管理方法
CN103428287A (zh) * 2013-08-09 2013-12-04 华为技术有限公司 一种连接建立的方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2858332A4 *

Also Published As

Publication number Publication date
US9462053B2 (en) 2016-10-04
HK1203711A1 (zh) 2015-10-30
US20150113155A1 (en) 2015-04-23
CN103428287A (zh) 2013-12-04
CN103428287B (zh) 2017-04-12
EP2858332A4 (en) 2015-09-16
EP2858332B1 (en) 2019-11-13
EP2858332A1 (en) 2015-04-08

Similar Documents

Publication Publication Date Title
WO2015018338A1 (zh) 一种连接建立的方法及装置
TWI718517B (zh) 用於無線通訊中的會話釋放的方法、電子裝置及存儲器
CN112042233B (zh) 在5g网络中管理与局域数据网络(ladn)的连接的方法
US8762546B2 (en) Method and apparatus for adaptive network heartbeat message for TCP channel
EP2605556B1 (en) Fast resuming a suspended packet connection
JP2006236346A (ja) イベント通知方法、携帯端末機及びサーバ
JP6068648B2 (ja) トランキングサービスを迅速に確立するための方法、関連する装置及びシステム
JP2021182764A5 (zh)
US9197575B2 (en) Handling of snapshot messages as a result of delivery failure in a two-way push connection
CN112514528A (zh) 用于5g蜂窝物联网的用户平面优化
TWI358922B (en) Method and apparatus of default timer configuratio
JP2011050078A5 (zh)
CN117441329A (zh) 解决呼叫质量问题
US12489800B2 (en) Exchanging status messages during a call
JP5661579B2 (ja) 無線端末の消費電力を低減させる通信制御方法及びシステム
WO2023280014A1 (zh) 单播侧链路通信方法、装置及终端
JP2013131993A (ja) 無線アクセスポイント装置、無線アクセスポイント接続方法および無線アクセスポイント接続プログラム
WO2012006855A1 (zh) 一种码分多址单模双待终端调度短消息的方法及装置
CN115915089B (zh) 通信方法、装置、核心网设备及通信设备
HK1203711B (zh) 一种连接建立的方法及装置
EP2606673B1 (en) NODE AND METHOD FOR AoIP ADDRESS CHANGE
CN115714985B (zh) 地址转换控制方法、装置、终端及网元
KR101711082B1 (ko) 패킷 교환 서비스 시스템의 호 처리 장치 및 방법
KR100574661B1 (ko) 이동통신 단말기에서의 데이터 서비스를 위한 연속 호연결 방법
WO2025036131A1 (zh) 一种拥塞控制方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14814669

Country of ref document: EP

Kind code of ref document: A1

REG Reference to national code

Ref country code: BR

Ref legal event code: B01A

Ref document number: 112016001117

Country of ref document: BR

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 112016001117

Country of ref document: BR

Kind code of ref document: A2

Effective date: 20160118