Summary of the invention
In order to solve the problem, what the present invention proposes a kind of instant messaging application of standard reconnects scheme, alternately stable to guarantee that instant messaging is applied.
Particularly, according to first scheme of the present invention, provide a kind of method reconnected for the network of instant messaging application.The method comprises the following steps: the event that the network detecting the application of triggering instant messaging reconnects; Determine current network connection status; And according to determined current network connection status perform instant messaging application network reconnect.The event that reconnects of network triggering instant messaging application comprises following any one: current network connection status is connection status, but instant messaging application disconnects with the connection of server; Current network connection status is not connection status, and instant messaging application enters foreground from backstage; Network connection state changes; And user's manual triggers reconnects.
In certain embodiments, the step that the network carrying out instant messaging application according to determined current network connection status reconnects comprises: have network to connect if current, and the server of instant messaging application has response, then carry out network and reconnect; If reconnect failure, then determine whether that reaching predetermined reconnects number of times; If do not reach predetermined to reconnect number of times, then repeat the step determining current network connection status and the step reconnected according to the network that determined current network connection status carries out instant messaging application.
In certain embodiments, the step that the network carrying out instant messaging application according to determined current network connection status reconnects also comprises: have network to connect if current, but the server of instant messaging application does not respond, then after the scheduled time, determine whether that reaching predetermined reconnects number of times; And if do not reach predetermined and reconnect number of times, then repeat the step determining current network connection status and the step reconnected according to the network that determined current network connection status carries out instant messaging application.
In certain embodiments, the step that the network carrying out instant messaging application according to determined current network connection status reconnects also comprises: if current network does not connect, then determine to reconnect failure, and terminate to reconnect.
In certain embodiments, make a reservation for reconnect number of times if reached, then the step that the network carrying out instant messaging application according to determined current network connection status reconnects also comprises: determine to reconnect failure, and terminates to reconnect.
According to alternative plan of the present invention, provide a kind of equipment reconnected for the network of instant messaging application.This equipment comprises: detecting unit, the event that the network for detecting the application of triggering instant messaging reconnects; Determining unit, for determining current network connection status; And reconnect performance element.The event that reconnects of network triggering instant messaging application comprises following any one: current network connection status is connection status, but instant messaging application disconnects with the connection of server; Current network connection status is not connection status, and instant messaging application enters foreground from backstage; Network connection state changes; And user's manual triggers reconnects.
In certain embodiments, this reconnect performance element for: have network to connect if current, and instant messaging application server have response, then carry out network and reconnect; If reconnect failure, then determine whether that reaching predetermined reconnects number of times; If do not reach predetermined to reconnect number of times, then repeat this determining unit determination current network connection status and this reconnects the network that performance element carries out instant messaging application according to determined current network connection status and reconnects.
In certain embodiments, this reconnect performance element also for: have network to connect if current, but the server of instant messaging application does not respond, then after the scheduled time, determines whether to reach predetermined reconnect number of times; And if do not reach predetermined and reconnect number of times, then repeat this determining unit determination current network connection status and this reconnects the network that performance element carries out instant messaging application according to determined current network connection status and reconnects.
In certain embodiments, this reconnect performance element also for: if current network does not connect, then determine to reconnect failure, and terminate reconnect.
In certain embodiments, predetermined reconnect number of times if reached, this reconnect performance element also for: determine to reconnect failure, and terminate to reconnect.
Utilize and reconnect scheme as above, the present invention can guarantee the stabilized communication that instant messaging is applied.
Embodiment
With reference to the accompanying drawings to a preferred embodiment of the present invention will be described in detail, eliminating in the course of the description is unnecessary details and function for the present invention, causes obscure to prevent the understanding of the present invention.The present invention can be applied to mobile communication system, fixed communications, wired communication system, or is applied to any mixed structure of mobile radio system, fixed communications, wired communication system etc.With regard to mobile communication system, the present invention is not limited to the concrete communication protocol of each involved mobile communication terminal, 2G, 3G, 4G, 5G network can be included, but is not limited to, WCDMA, CDMA2000, TD-SCDMA system etc., different mobile terminals can adopt identical communication protocol, also can adopt different communication protocol.The present invention is not limited to the specific operating system of mobile terminal, can include, but is not limited to iOS, Windows Mobile, Symbian, Android (Android) etc.The present invention be not limited to yet concrete use hardware, software (comprising operating system), firmware or their combination etc.
Fig. 1 shows the schematic diagram of the application scenarios according to communication system 100 of the present invention.As shown in Figure 1, communication system 100 can comprise mobile terminal 110 and server 120.For the sake of clarity, illustrate only a mobile terminal 110 in figure, but the present invention is not limited thereto, one or more fixed terminal, plural mobile terminal or the mobile terminal of arbitrary number and the combination of fixed terminal etc. can also be comprised.Mobile terminal 110 can belong to user A, or can be operated by user A.
Mobile terminal 110 comprises the instant communication client that is arranged on wherein/instant messaging application (not shown), such as QQ, MSN, micro-letter etc.User A can utilize this instant communication client to come to carry out immediately effectively linking up with contact person.Instant communication client can be arranged in mobile terminal 110 in the form of software voluntarily by user, or can be arranged in mobile terminal 110 with the form of hardware or firmware by terminal production firm.In certain embodiments, instant communication client can be the application software being specifically designed to list display such as downloaded from such as Android application shop, apple application shop after user have purchased mobile terminal 110.In further embodiments, instant communication client can be the application program be such as pre-installed in firmware or example, in hardware by terminal production firm in mobile terminal 110.
Server 120 is for this instant communication client provides the server of service, for the operation of management and supervision instant communication client.Mobile terminal 110 can be connected with server 120 by communication network 130 and communicate with it.Communication network 130 can be wired or wireless.Particularly, the example of communication network 130 can include, but is not limited to: wire cable or optical-fiber type network or mobile or cellular network or WLAN (" WLAN (wireless local area network) " may be 802.11 (or WiFi) or WiMAX type) or may be also the wireless short-range communication network of bluetooth-type.
The present invention relates to the network triggering instant communication client by detecting following several trigger event to reconnect:
-current network connection status is connection status (such as, mobile terminal 110 is connected with network 130), but the connection of instant communication client and server disconnects (such as, server 120 is unstable);
-current network connection status is not that connection status has been (such as, mobile terminal 110 disconnects with the connection of network 130), and instant communication client enters foreground from backstage, such as user A reenters the interface of instant communication client on mobile terminal 110 from the interface of other application;
-network connection state changes, such as mobile terminal 110 never networking state change to networking state; And
-user A manual triggers reconnects.
For Fig. 2, total inventive concept of the present invention is described main below.
Fig. 2 shows flow process Figure 200 of the exemplary operations process of the communication system 100 according to some embodiments of the present invention.
As shown in Figure 2, instant communication client detects above-mentioned several trigger event (step S201).When the arbitrary trigger event in above-mentioned several trigger event being detected, judge whether to carry out reconnecting action (step S202).If instant communication client is carrying out reconnecting action (judged result of step S202 is yes), then this operational processes is terminating.
If instant communication client is not carrying out reconnection operation (judged result of step S202 is no), then starting to reconnect required a series of initialization operations (step S203).Such as, current connection state is changed in reconnecting, number of times will be reconnected and be initialized as 0, and will reconnect status indicator in inside be true (true).
Then, instant communication client determination current network connection status (step S204).
Have network to connect if current, and server have response (such as, the address of server responds), then carry out network and reconnect (step S205).Such as, the API (application programming interfaces) that reconnects that can call the link block in mobile terminal reconnects.Then, successfully (step S206) whether Sampling network reconnect.Such as, whether the connection monitor function that can start the link block in mobile terminal carrys out Sampling network and reconnects successful.
If detect in step S206 and reconnect failure, then will reconnect number of times and add 1 (step S207), and then judge to reconnect number of times and whether reach predetermined and reconnect number of times (step 208).Such as, making a reservation for reconnect number of times can be 3 times, that is, judge whether reconnect number of times expires 3 times.If do not reach predetermined to reconnect number of times, then get back to step S204.If reconnect number of times to have reached predetermined and reconnect number of times, then terminate to reconnect (step S209).Now, can be pseudo-(false) by will reconnect status indicator in inside, to terminate to reconnect.
If detect that network reconnects successfully in step S206, then proceed to step S209, to terminate to reconnect.
If network is had to connect current, but server does not respond, then after the scheduled time (such as 10 seconds), then will reconnect number of times and add 1 (step S207), and proceed to step S208 and whether reach predetermined reconnect number of times (such as 3 times) to judge to reconnect number of times.Such as, if mobile terminal 110 is currently connected to network 130, but server 120 does not respond instant communication client, then after 10 seconds, will reconnect number of times and add 1, then judges whether reconnect number of times expires 3 times.If do not reach predetermined to reconnect number of times, then get back to step S204.
If current network does not connect, then determine to reconnect failure (step S210), and proceed to step S209, to terminate to reconnect.
Fig. 3 shows the flow chart of method 300 reconnected for the network of instant messaging application according to some embodiments of the present invention.As shown in Figure 3, the method 300 can comprise step S310, S320 and S330.In certain embodiments, method 300 can perform by equipment 400 as shown in Figure 4.In further embodiments, method 300 also can maybe can perform in conjunction with the instant communication client be arranged in mobile terminal 110 by mobile terminal 110 as shown in Figure 1.
Fig. 4 shows the block diagram of equipment 400 reconnected for the network of instant messaging application according to the embodiment of the present invention.Equipment 400 can mobile terminal 110 as shown in Figure 1 or the instant communication client that is arranged on mobile terminal 110 China realize.As shown in Figure 4, equipment 400 can comprise detecting unit 410, determining unit 420 and reconnect performance element 430.
The event that detecting unit 410 reconnects for the network detecting the application of triggering instant messaging.The event that reconnects of network triggering instant messaging application comprises following any one: current network connection status is connection status, but instant messaging application disconnects with the connection of server; Current network connection status is not connection status, and instant messaging application enters foreground from backstage; Network connection state changes; And user's manual triggers reconnects.In certain embodiments, detecting unit 410 can be the CPU (CPU), digital signal processor (DSP), microprocessor, microcontroller etc. of equipment 400, it can match with the memory device of equipment 400 (such as, hard disk, floppy disk, CD, tape etc.) etc., to detect the event that the network that triggers instant messaging application reconnects.
Determining unit 420 is for determining current network connection status.Such as, current network connection status can comprise: current have network to connect, and the server of instant messaging application has response; Current have network to connect, but the server of instant messaging application does not respond; Or current network does not connect.In certain embodiments, determining unit 420 can be the CPU (CPU), digital signal processor (DSP), microprocessor, microcontroller etc. of equipment 400, it can match with the memory device of equipment 400 (such as, hard disk, floppy disk, CD, tape etc.) etc., to determine current network connection status.
Reconnect performance element 430 to reconnect for the network performing instant messaging application according to the determined current network connection status of determining unit 420.
In one implementation, reconnect performance element 430 for: have network to connect if current, and instant messaging application server have response, then carry out network and reconnect; If reconnect failure, then determine whether that reaching predetermined reconnects number of times; If do not reach predetermined to reconnect number of times, then repeat determining unit 420 and determine current network connection status and reconnect the network that performance element 430 carries out instant messaging application according to determined current network connection status to reconnect.
In a further implementation, reconnect performance element 430 also for: have network to connect if current, but the server of instant messaging application does not respond, then after the scheduled time, determines whether to reach predetermined reconnect number of times; And if do not reach predetermined and reconnect number of times, then repeat determining unit 420 and determine current network connection status and reconnect the network that performance element 430 carries out instant messaging application according to determined current network connection status to reconnect.
In another realization, reconnect performance element 430 also for: if current network does not connect, then determine to reconnect failure, and terminate reconnect.
One realizing again, predetermined reconnecting number of times if reached, reconnect performance element 430 also for: determine to reconnect failure, and terminate to reconnect.
In certain embodiments, reconnect CPU (CPU), digital signal processor (DSP), microprocessor, microcontroller etc. that performance element 430 can be equipment 400, its can with the CPU of equipment 400 (CPU), digital signal processor (DSP), microprocessor, microcontroller etc., it can match with the memory device of equipment 400 (such as, hard disk, floppy disk, CD, tape etc.) etc., reconnects with the network performing instant messaging application according to the determined current network connection status of determining unit 420.
It should be noted that the two or more different units in equipment 400 can logically or physically be combined.Such as, detecting unit 410 and determining unit 420 can be combined into a unit.
Below with reference to Fig. 1 ~ 4, be described in detail according to the method 300 that reconnects of network for instant messaging application of the embodiment of the present invention and equipment 400.It should be noted that method 300 and the equipment 400 of the embodiment of the present invention can realize in the mobile terminal 110 shown in Fig. 1, but the present invention is not limited thereto.
In step S310, the detecting unit 410 of equipment 400 detects the event that the network that triggers instant messaging application reconnects.The event that reconnects of network triggering instant messaging application comprises following any one: current network connection status is connection status, but instant messaging application disconnects with the connection of server; Current network connection status is not connection status, and instant messaging application enters foreground from backstage; Network connection state changes; And user's manual triggers reconnects.
In step S320, the determining unit 420 of equipment 400 determines current network connection status.。Such as, current network connection status can comprise: current have network to connect, and the server of instant messaging application has response; Current have network to connect, but the server of instant messaging application does not respond; Or current network does not connect.
In step S330, equipment 400 reconnect performance element 430 according to determined current network connection status perform instant messaging application network reconnect.
In one implementation, step S330 comprises: have network to connect if current, and the server of instant messaging application has response, then carry out network and reconnect; If reconnect failure, then determine whether that reaching predetermined reconnects number of times; If do not reach predetermined to reconnect number of times, then repeat the step determining current network connection status and the step reconnected according to the network that determined current network connection status carries out instant messaging application.
In another realizes, step S330 also comprises: have network to connect if current, but the server of instant messaging application does not respond, then after the scheduled time, determine whether that reaching predetermined reconnects number of times; And if do not reach predetermined and reconnect number of times, then repeat the step determining current network connection status and the step reconnected according to the network that determined current network connection status carries out instant messaging application.
In another realizes, step S330 also comprises: if current network does not connect, then determine to reconnect failure, and terminates to reconnect.
One realizing, predetermined reconnect number of times if reached, then step 330 also comprises: determine to reconnect failure, and terminate to reconnect again.
Utilize the present invention, reconnecting of instant messaging application can be improved, thus guarantee that instant messaging can be stablized and carry out.
So far invention has been described in conjunction with the preferred embodiments.Should be appreciated that, those skilled in the art without departing from the spirit and scope of the present invention, can carry out various other change, replacement and interpolation.Therefore, scope of the present invention is not limited to above-mentioned specific embodiment, and should be limited by claims.