CN104104647B - Maintain connection method - Google Patents

Maintain connection method Download PDF

Info

Publication number
CN104104647B
CN104104647B CN 201310112126 CN201310112126A CN104104647B CN 104104647 B CN104104647 B CN 104104647B CN 201310112126 CN201310112126 CN 201310112126 CN 201310112126 A CN201310112126 A CN 201310112126A CN 104104647 B CN104104647 B CN 104104647B
Authority
CN
Grant status
Grant
Patent type
Application number
CN 201310112126
Other languages
Chinese (zh)
Other versions
CN104104647A (en )
Inventor
蔡伊峰
江书育
蔡孟达
Original Assignee
宏碁股份有限公司
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
Grant date

Links

Abstract

本发明提供一种维持连线方法,用于维持电子装置与服务器之间的连线状态。 The present invention provides a method for maintaining the connection, for maintaining the connection state between the electronic device and the server. 该方法包括以下步骤:(a)发出第N次测试封包至服务器,第N次测试封包要求服务器于等待N段间隔时间后再响应电子装置;(b)判断是否接收到服务器对第N次测试封包所发出的响应;(c)若是,则重复步骤(a);若否,则计算自发出第N‑1次测试封包至接收服务器响应所经过时间为周期时间;以及(d)当该电子装置切换为一待机/休眠模式后,依据周期时间发送维持封包至服务器,以维持与服务器之间的连线状态。 The method comprises the steps of: (a) issued the first test packet N to the server, the server requires N test packets waiting interval in response to the electronic device after N pieces; (b) the server determines whether a pair of test N response packet issued; (c) if so, repeating steps (a); if not, is calculated from the sent first N-1 test packet to the receiving server in response to the elapsed time of the cycle time; and (d) when the electronic after the device is switched to a standby / sleep mode, based on the cycle time to maintain the transmitted packet to the server to maintain the state of the connection between the servers. 通过本发明的设计,让电子装置能在减少资源耗费的情况下维持与服务器之间的连线状态。 By design of the present invention, so that the electronic device can maintain the connection status between the server and in the case of reducing the consumption of resources.

Description

维持连线方法 Maintain connection method

技术领域 FIELD

[0001] 本发明涉及一种维持连线方法,特别是涉及一种应用于电子装置与服务器之间的维持连线方法。 [0001] The present invention relates to a method of maintaining connections, particularly to a method of maintaining the connection between the electronic device and the server is applied.

背景技术 Background technique

[0002] —般用户要通过计算机与远程服务器之间进行彼此连线,必须通过网络及相关设备(例如路由器或分享器等)建立起连线路径。 [0002] - as for the user to connect to each other through between the computer and the remote server, the path through the network connection must be established and related equipment (such as routers or the like share). 以往计算机均采用固定IP,即使计算机与服务器之间连线中断,服务器可以通过各自独立的固定IP地址来找到对应连线的计算机;然而在现今计算机大多采用浮动(虚拟)IP的状态下,一旦计算机超过一定时间未发送封包至服务器,于连线路径中的路由器可能会关闭计算机所使用的通信端口,使得服务器无法寻得对应计算机所使用的IP地址,如此将造成计算机与服务器之间连线中断。 IP conventional computers are fixed, even if the connection is interrupted between the computer and the server, the server may be found by the computer corresponding to separate connections fixed IP address; however, in the computer today mostly used in the floating (virtual) state IP, once computer over a certain time has not sent a packet to the server, a router in the connection path may close the communication port used by the computer so that the server can not find a corresponding to the IP address used by the computer, thus causing the connection between the computer and the server interrupted. 此时必须由用户端计算机主动与服务器重新建立连线,才能恢复先前的连线状态。 We must now take the initiative to re-establish the connection to the server from the client computer to restore the previous state of the connection. 因此,在计算机处于某些特定模式下(例如休眠或待机模式),若想维持两者之间连线,计算机必须周期性发送封包至服务器。 Thus, the computer is in the certain mode (e.g. a sleep or standby mode), if you want to maintain the connection between the two, the computer must be periodically transmitted packet to the server.

[0003] 前述计算机若是发送封包过于频繁,会导致计算机资源的多余耗费;而若是发送封包间隔时间过久,又会导致与服务器之间连线中断。 [0003] If the aforementioned computer to send packets too often can lead to unnecessary consumption of computer resources; and if to send the packet interval is too long, will lead to interrupted connections between servers. 此外,计算机与服务器之间的连线路径往往需要经过多个路由器连线而构成,每个路由器关闭通信端口的设定时间并不相同, 因此如何决定出计算机发送封包的较佳间隔时间,实为一值得研究的课题。 Further, the connection path between the server computer and often require multiple routers is configured to connect, close the communication ports of each router set time is not the same, and therefore how to determine the preferred time interval computer that sent the packet, the real It is a worthy subject of study.

发明内容 SUMMARY

[0004] 有鉴于此,本发明的主要目的是提供一种应用于电子装置与服务器之间的维持连线方法,以解决现有技术存在的电子装置因闲置过久而容易造成与服务器之间连线中断的技术问题。 [0004] In view of this, the main object of the present invention is applied to maintain the connection between one kind of method between the electronic device and the server, in order to solve the electronic device in the prior art due to inactivity easily cause the server connection technical problems interrupted.

[0005] 为达到上述的目的,本发明的维持连线方法用于维持电子装置与服务器之间的连线状态。 [0005] To achieve the above objects, the method of the present invention maintains a connection state of the connection between the electronic device and for maintaining the server. 该方法包括以下步骤:(a)发出第N次测试封包至服务器,第N次测试封包要求服务器于等待N段间隔时间后再响应电子装置,其中N为正整数;(b)判断是否接收到服务器对第N次测试封包所发出的响应;(c)若是,则重复步骤(a);若否,则计算自发出第NI次测试封包至接收服务器响应所经过时间为周期时间;以及(d)当电子装置切换为待机/休眠模式后,依据周期时间发送维持封包至服务器,以维持与服务器之间的连线状态。 The method comprises the steps of: (a) issued the first test packet N to the server, the server requires N test packet to interval after waiting period in response to N electronic device, wherein N is a positive integer; (b) determines whether the received response from the server to the first N test packet issued; (c) if so, repeating steps (a); if not, is calculated from the issue of the NI test packet to the receiving server in response to the elapsed time of the cycle time; and (d ) when the electronic device is switched to the standby / sleep mode, based on the cycle time to maintain the transmitted packet to the server to maintain the state of the connection between the servers.

[0006] 在本发明的另一实施例中,本发明的维持连线方法包括以下步骤:(a)发出第N次测试封包至服务器,第N次测试封包要求服务器于等待N段间隔时间后再响应电子装置,其中N为正整数;(b)判断是否接收到服务器对第N次测试封包所发出的响应;(c)若接收到服务器对第N次测试封包所发出的响应,则重复步骤(a);若未接收到服务器对第N次测试封包所发出的响应,则反复发出第NI次测试封包并判断是否接收到服务器对所有第NI次测试封包所发出响应;(d)若接收到服务器对所有反复发出的第NI次测试封包的响应,则计算自发出第NI次测试封包至接收服务器响应所经过时间为周期时间;若未接收到服务器对所有反复发出的第NI次测试封包的响应,则计算自发出第N-2次测试封包至接收服务器响应所经过时间为周期时间;以及(e)当电子装置切换为待机/休眠模式 [0006] In another embodiment of the present invention, the present invention maintains a connection method comprising the steps of: (a) issued the first test packet N to the server, the server requires N test packet after waiting period interval N then in response to the electronic device, wherein N is a positive integer; (b) determining whether a response from the server to the N-th test packet issued; (c) when receiving the server response to the N-th test packet issued is repeated step (a); if not receiving a server response to the N-th test packet issued, repeatedly issued the first test NI received packet and determines whether the server sent in response to all of the NI test packet; (d) if the server receiving a response to all of the NI test packet is sent repeatedly, since the issue of the computing NI test packet to the receiving server in response to the elapsed time of the cycle time; if not all of the received server NI test is repeatedly issued response packet, sent from the calculation of the N-2 test packet to the receiving server response time is elapsed period of time; and (e) when the electronic device is switched to standby / hibernation mode 后,依据周期时间发送维持封包至服务器,以维持与服务器之间的连线状态。 After, according to the cycle time to maintain the transmitted packet to the server to maintain the state of the connection between the servers.

[0007] 通过本发明的设计,可以找出电子装置对服务器较为合适的封包发送周期,一方面能维持处于待机/休眠模式下的电子装置与服务器之间的连线状态,避免连线中断;另一方面则在被允许的状态下尽量拉长封包发送周期,以减少电子装置本身的资源耗费。 [0007] By design of the present invention, the electronic device can identify a more appropriate server for packet transmission cycle, is on the one hand to maintain the connection state between the electronic device and a server in a standby / sleep mode, to avoid interrupting the connection; in the other hand, a state is permitted to try to lengthen the packet transmission cycle, in order to reduce the resource consumption of the electronic device itself.

附图说明 BRIEF DESCRIPTION

[0008] 图1是本发明的各电子装置与服务器通过网络连线的示意图; [0008] FIG. 1 is a schematic view of the electronic apparatuses of the present invention and a server via a network connection;

[0009] 图2是本发明的电子装置的系统方框图; [0009] FIG. 2 is a system block diagram showing an electronic device according to the invention;

[0010] 图3是本发明的维持连线方法第一实施例的流程图; [0010] FIG. 3 is a flow diagram of the method of the present invention maintains a connection to a first embodiment;

[0011] 图4是本发明的维持连线方法第二实施例的流程图。 [0011] FIG. 4 is a flowchart of a method according to the present invention maintains a connection to a second embodiment.

[0012] 附图标记 [0012] reference numerals

[0013] IOa:第一电子装置IOb:第二电子装置 [0013] IOa: a first electronic device IOb: a second electronic device

[0014] 11:系统模块12:传输模块 [0014] 11: 12 system modules: a transmission module

[0015] 13 :测试模块20:服务器 [0015] 13: the test module 20: Server

[0016] 30:网络31:因特网 [0016] 30: network 31: Internet

[0017] 32:局域网络A、B、C、D、E、F:路由器 [0017] 32: LAN A, B, C, D, E, F: the router

[0018] P1、P2:连线路径 [0018] P1, P2: wiring path

具体实施方式 detailed description

[0019] 为能了解本发明的技术内容,特举出较佳实施例说明如下。 [0019] to understand the technical contents of the present invention, particularly preferred embodiments include embodiments described below.

[0020] 在本发明的一实施例中,电子装置可为计算机装置、可携式电子装置或其它具备网络连线功能的电子装置等,而服务器则为一般服务器主机或可提供服务器功能的类似装置,但本发明不以此为限。 [0020] In an embodiment of the present invention, the electronic device may be a computer device, a portable electronic device or other electronic device or the like includes a network connection function, and compared with the general server or a server providing server host functionality similar device, but the present invention is not limited thereto.

[0021] 请参考图1是本发明的各电子装置与服务器20通过网络30连线的示意图。 [0021] Please refer to FIG. 1 is a schematic view of each electronic device and the server 20 according to the present invention through the network connection 30. 如图1所示,第一电子装置IOa及第二电子装置IOb通过网络30与服务器20进行连线,而在网络30环境中包括多个路由器(router) A〜F,使得第一电子装置IOa及第二电子装置IOb依据其所在位置,分别通过不同的路由器形成与服务器20之间的连线路径。 As shown, a first electronic device and the second electronic device IOb IOa performed by a network connection 30 with the server 20, 30 in the network environment comprises a plurality of routers (router) A~F, such that a first electronic device IOa IOb and a second electronic device based on its location, are formed between the wiring path with the server 20 via different routers. 举例来说,第一电子装置IOa可经由因特网31中的路由器A、D、F连线至服务器20,其构成连线路径Pl;而第二电子装置IOb可经由局域网络32中的路由器B、C及因特网31中的路由器E、F连线至服务器20,其构成不同的连线路径P2。 For example, a first electronic device IOa Internet 31 via the router A, D, F connect to the server 20, which constitutes the wiring path Pl is; IOb and the second electronic device 32 may be router B via the local area network, C, and the Internet router 31 E, F 20 to connect to the server, which constitutes a different wiring path P2.

[0022] 请参考图2是本发明的第一电子装置IOa或第二电子装置IOb的系统方框图。 [0022] Please refer to FIG. 2 is a system block diagram of a first electronic device IOa invention or the second electronic device IOb. 如图2 所示,本发明的第一电子装置IOa或第二电子装置IOb可包括系统模块11、传输模块12及测试模块13。 As shown in FIG 2, the first electronic device IOa the present invention or the second electronic device may include a system IOb module 11, transmission module 12 and the test module 13. 系统模块11可为硬件、软件及固件的至少一者或其组合,例如系统模块11可为中央处理单元,或是中央处理单元与装置内操作系统的整合等,但本发明不以此为限。 The system module 11 may be at least one or a combination of hardware, software and firmware, such as system module 11 may be a central processing unit, or the central processing unit and integration within the device operating system, but the present invention is not limited thereto. . 系统模块11可依据用户的指令或设定,切换第一电子装置IOa或第二电子装置IOb进入一般操作模式或待机/休眠模式等,并执行各项操作指令;而在待机/休眠模式下,系统模块11会持续产生一维持封包并通过传输模块12发送至服务器,以维持与服务器之间的连线状态。 The system module 11 can be based on a user's instruction or setting, switching the first electronic device or the second electronic device IOb IOa enter general operation mode or standby / sleep mode, and executes the operation command; in the standby / sleep mode, the system module 11 will continue to maintain a packet is generated and sent to the server via the transmission module 12, and to maintain the connection state between servers. 传输模块12则用以发送封包至服务器或接收自服务器响应的封包,此处传输模块12可为单一网络处理芯片或其与传输端口的组合。 The transmission module 12 to send the packet to the packet received from the server or the server's response, or a combination of single-chip network processing and transmission port of the transmission module 12 may here.

[0023] 测试模块13用以产生不同的测试封包,以通过传输模块12发送至服务器;且测试模块13根据服务器对各测试封包的响应与否进行判断处理,以动态决定前述维持封包的较佳发送周期。 [0023] The test module 13 for generating different test packets for transmission to the server module 12 by; the test module 13 and the determination processing for each test response packet or not in accordance with the server, decide to dynamically maintain the preferred packet the transmission cycle. 在本发明的一实施例中,测试模块13可为一应用程序,但其也可以结合硬件或固件来执行相同功能,不以本实施例为限。 In an embodiment of the present invention, the test module 13 may be an application, but it can also be in connection with hardware or firmware to perform the same function, in the present embodiment is not limited thereto. 而前述测试封包可为一使用者数据流协议(user datagram protocol,UDP)圭寸包。 The foregoing may be a test packet stream protocol user data (user datagram protocol, UDP) packets Kyu inch.

[0024] 值得一提的是,对于需要通过网络存取器(Access Point,AP)连线至路由器的电子装置来说,电子装置除了要维持与该些路由器的连线状态外,电子装置另外需要维持与网络存取器之间的连线状态,以避免网络发生中断。 [0024] It is worth mentioning that the need to connect the electronic device to a network router for an access (Access Point, AP), in addition to the electronic device to maintain the connection state of the plurality of routers, the electronic device further It is necessary to maintain the connection state between the network access device in order to avoid a network outage. 网络存取器会不定期发送封包给与其连线的电子装置,而电子装置则依靠其本身的网络卡(例如前述的传输模块12)的驱动程序及固件来对应处理该些封包,响应给网络存取器,以维持电子装置与网络存取器之间的连线。 Network access is occasionally send packet to the electronic device connection therewith, and the electronic device relying on its own the network cards (such as the aforementioned transmission module 12) of the driver and the firmware corresponding to the plurality of packet processing in response to the network accessor to maintain the connection between the electronic device and a network access device. 在电子装置与网络存取器连线的前提下,电子装置才能发送前述测试封包,经该些路由器至服务器。 Under the premise of an electronic device and a network access connection, the electronic device can send a test packet through the router to the plurality of servers. 由于维持电子装置与网络存取器之间连线的技术属于现有技术,在此不多加赘述。 Since the electronic device is maintained between a network access connection with the prior art technology is, here not narrated herein.

[0025] 以下请参考图3是本发明的维持连线方法第一实施例的流程图。 [0025] Please refer to FIG. 3 is a flowchart of the method of the present invention maintains a connection to a first embodiment. 须注意的是,以下虽配合图1及图2所示的第一电子装置IOa及其与服务器20的连线路径Pl为例说明本发明的维持连线方法,但本发明并不以适用于此为限,应根据电子装置的组成架构或其与服务器20的连线路径不同而有所变化。 It should be noted that the first electronic device with the following IOa Although shown in FIG. 1 and FIG. 2 and the wiring path Pl server 20 maintains a connection to an example of the method of the present invention, but the present invention is not to be suitable for this is limited, the composition should vary according to the architecture of the electronic device or a wiring path different from the server 20. 如图3所示,本发明的维持连线方法包括步骤S301至步骤S304。 As shown in FIG. 3, to maintain the connection method of the present invention includes a step S301 to step S304. 以下将详细说明该方法的各个步骤。 The various steps of the method described in detail below.

[0026] 步骤S301:发出一第N次测试封包至服务器20,其中第N次测试封包要求服务器20 于等待N段间隔时间后再响应电子装置,且N为正整数。 [0026] Step S301: N-emitting a test packet to the server 20, wherein the N test packet server 20 requires a waiting period interval and then in response to N electronic device, and N is a positive integer.

[0027] 当第一电子装置IOa仍处于一般操作模式下,测试模块13可通过传输模块12发出一次到多次的测试封包至服务器20,其中第1次测试封包会要求服务器20于等待1段间隔时间后,再传送对第1次测试封包的响应给第一电子装置l〇a;此处间隔时间为测试模块13的默认值或由用户自行设定的时间值,其可为数秒至数十秒不等。 [0027] When the first electronic device IOa still under general operation mode, the test module 13 may be transmitted a plurality of times to test packet to the server 20 via the transmission module 12, wherein the first test packet will wait in claim 1 in the server section 20 time interval, and then transmits the first response to the test packet of a first electronic device l〇a; herein interval default value is 13, the test module or the time value set by the user, which may be several seconds to several ranging from ten seconds. 当第一电子装置IOa发送第2次测试封包时,第2次测试封包会要求服务器20于等待2段间隔时间(即间隔时间*2)后,再传送对第2次测试封包的响应给第一电子装置IOa;之后对所发出的第N次测试封包则以此类推,要求服务器20于等待N段间隔时间后再响应第一电子装置10a,此处N为正整数。 When the first electronic device transmits IOa the second test packet, and the second test packet to the server 20 will wait in claim 2 period interval (i.e., time interval 2 *), re-transmission of the second test in response to the first packet IOa of an electronic device; N after the first test packet is issued and so on, requires the server 20 in response to the first electronic device 10a after the waiting time interval period N, where N is a positive integer.

[0028] 举例来说,假设已设定的间隔时间为5秒,则第一电子装置IOa发出的第1次测试封包会要求服务器20在接到封包后,等待5秒间隔再发出对第1次测试封包的响应封包;若第一电子装置IOa发出的第2次测试封包,则要求服务器20在接到封包后,等待10秒(S卩2段的5 秒间隔)再发出对第2次测试封包的响应封包,以此类推。 [0028] For example, assume the set time interval is 5 seconds, the first electronic device emits IOa first test packet will ask the server 20 after receiving the packet, wait for 5 seconds and then send the first interval of 1 test packet response packet; if the second electronic device a first test packet sent IOa, requires the server 20 after receiving the packet, wait 10 seconds (S 2 segments Jie intervals of 5 seconds) and then send the first 2 test packet response packet, and so on.

[0029] 步骤S302:判断是否接收到服务器20对第N次测试封包所发出的响应。 [0029] Step S302: determining whether a response to the N-th received test packet 20 issued by the server.

[0030] 理论上在第一电子装置IOa与服务器20保持连线的状态下,服务器20会对第一电子装置IOa的封包做出响应;若是第一电子装置IOa与服务器20连线中断,服务器20所发出的响应封包将无法顺利传送至第一电子装置l〇a。 [0030] Theoretically a first electronic device in a state where IOa connection 20 with the server, the server a first electronic device 20 will respond IOa packet; IOa if a first electronic device and a server connection 20 is interrupted, the server 20 the response packet can not be successfully sent to the first electronic device transmits l〇a. 因此,当第一电子装置IOa的测试模块13 发出第N次测试封包至服务器20后,测试模块13会针对该次测试封包判断是否接收到服务器20对该次测试封包所发出的响应,来决定其继续执行步骤。 Thus, when the first electronic device IOa of N test modules sent to the server after the test packet 20, the response to the test module 13 will be issued for the test packet to the server 20 determines whether the received packet 13 tests to determine it continues to perform steps.

[0031] 在本发明的一实施例中,测试模块13通过判断等待服务器20响应的时间是否超过一封包来回时间加上该次测试封包所对应的N段间隔时间的总和,作为判断是否接收到服务器20对第N次测试封包所发出的响应的标准,但本发明不以此为限。 If [0031] In an embodiment of the present invention, the test module 13 waits for response from the server 20 by a packet round-trip time exceeds the judgment time plus the time interval of the test packet corresponding to N stages, determining whether a received server 20 in response to the standard test packets issued N times, but the present invention is not limited thereto. 此处所谓封包来回时间,为自第一电子装置IOa发送一封包至服务器20后,接收服务器20立即对封包做出响应的总时间;也即在未通知服务器20等待的状态下,第一电子装置IOa自发送封包至接获对该封包的响应的来回总时间。 Here, the term packet round-trip time, sending a packet to the server from the first electronic device 20 after IOa, the server 20 receives the total time made immediately responsive to the packet; i.e. the notification server 20 without waiting for a state, the first electronic means IOa received packet to the transmission from the total round-trip time of a response to the packet. 而此封包来回时间加上该次测试封包所对应的N段间隔时间的总和,即为该次测试封包理论上自发出后至接收到对该次测试封包的响应的总时间。 And this packet round-trip time plus the time interval of the test packet corresponding to N pieces of, namely the test packet received from the theoretical to the total time to issue a response to the test packet.

[0032] 若测试模块13接收到服务器20对该次测试封包所发出的响应,表示服务器20在等待该次测试封包所对应的N段间隔时间后,第一电子装置IOa与服务器20之间仍可维持连线路径不中断,因此可考虑再增加等待的间隔时间,以找出最佳的保持连线的封包发送周期。 Between [0032] When the server 13 receives the test module 20 tests the response packet issued, N represents the server 20 waits for the test period interval corresponding to the packet, a first electronic device and the server 20 remains IOa the wiring path can be maintained without interruption, and therefore could be considered further increase the interval to wait to find out the best stay connected packet sending period. 此时测试模块13将回到步骤S301,进行下一次的测试封包的发送。 In this case the test module 13 returns to step S301, the next test transmission packet.

[0033] 步骤S303:计算自发出第NI次测试封包至接收服务器20响应所经过时间为一周期时间。 [0033] Step S303: Calculation of issue of the received packet to the NI test server 20 in response to the elapsed time is a period of time.

[0034] 若测试模块13未能接收到服务器20对第N次测试封包所发出的响应,表示服务器20在等待该次测试封包所对应的N段间隔时间后,第一电子装置IOa与服务器20之间的连线可能已中断,因此考虑回朔至前一次测试封包(即第NI次测试封包),计算自第一电子装置IOa发出第NI次测试封包至接收服务器20响应所经过时间,并将其作为一周期时间。 [0034] When the test module 13 to the server fails to receive a response to the N-th test packet issued 20, N represents the server 20 waits for the test period interval corresponding to the packet, a first electronic device and a server 20 IOa may have interrupted the connection between, so consider a test packet before backtracking to (i.e. NI test packet) is calculated from the first electronic device IOa issued the first test NI packet to the receiving server 20 in response to the elapsed time, and a period of time as it. 其中当N=I的状态下,若未接收到服务器对该第1次测试封包所发出的响应,则以一般状态下的前述封包来回时间为周期时间。 Wherein when the N = I state, if no response is received to the server a first test packet is sent, places the packet in the general state of the cycle time for the round-trip time.

[0035] 步骤S304:当电子装置切换为待机/休眠模式后,依据周期时间发送维持封包至服务器20,以维持与服务器20之间的连线状态。 [0035] Step S304: When the electronic device is switched to standby / sleep mode, based on the cycle time to maintain the transmitted packet to the server 20, to maintain the connection status between the server 20.

[0036] 在决定周期时间后,测试模块13可通知系统模块11;而当第一电子装置IOa切换为待机/休眠模式后,系统模块11会以此周期时间持续且定期地发送维持封包至服务器20,来保持与服务器20之间的连线状态。 [0036] After determining the cycle time, the test module 13 may notify the system module 11; and when the first electronic switching device IOa standby / sleep mode, the system module 11 will continue this cycle time is maintained and periodically transmits the packet to the server 20, to maintain the state of the connection between the server 20.

[0037] 以下举出一实施方式说明如何应用本发明的维持连线方法的第一实施例。 [0037] The following embodiment illustrates how embodiments include a first embodiment is applied to maintain the connection method of the present invention. 表1表示于图1中各路由器A〜F关闭其通信端口的等待时间假设值;表2则表示第一电子装置IOa 应用本发明的维持连线方法第一实施例与服务器20进行连线状态测试的结果。 Table 1 is shown in FIG. 1 A~F off latency of each router is assumed that the value of its communication ports; Table 2 shows an example of the method of the server maintains a connection to a first electronic device IOa first embodiment of the present invention is applied for connection state 20 the results of the test.

[0038] 表1 [0038] TABLE 1

Figure CN104104647BD00061

[0040] 表2 (第一电子装置IOa) [0040] Table 2 (IOa of the first electronic device)

Figure CN104104647BD00071

[0042] 如表1所示,各个路由器A〜F会设定关闭其通信端口的等待时间。 [0042] As shown in Table 1, each router will set off its A~F communication port latency. 当路由器原本正在使用的通信端口,于超过所设定的等待时间后仍未有封包通过,路由器会自动关闭该通信端口以结束原本使用状态,使该通信端口得以供其他装置连线使用。 When the communication port is being used by the router originally, after the wait time has not exceeded the set by a packet, the router will automatically close the communication port originally used to end state, so that the communication port is used for connecting other devices. 由于各个路由器A〜 F的厂牌及规格设计有所差异,使得各路由器A〜F具有不同的等待时间;而在现实状态下并无法确切得知各路由器A〜F的等待时间,因此该些等待时间为假设值,不以表1所示为限。 Because each router A~ F of label design and specifications vary, so that each router A~F have different waiting times; and in the real state and can not wait to know the exact time of each router A~F, so that some the assumed value of the waiting time is not limited as shown in table 1.

[0043] 如表2所示,此实施方式中,第一电子装置IOa经由连线路径Pl与服务器20进行连线,假设每段间隔时间为5秒,而因为前述封包来回时间通常非常短暂,在本实施方式中为方便说明,而假设封包来回时间为〇秒,因此自第一电子装置IOa发出第N次测试封包至接收服务器20响应该封包所经过时间,大致等于第N次测试封包所对应的N段间隔时间,但本发明不以此为限。 [0043] As shown, in this embodiment, the first electronic device 2 through the connection path for IOa Pl connection with the server 20, each segment is assumed that the interval time was 5 seconds, and since the packet round-trip time is generally very short, in the present embodiment, for convenience of explanation, is assumed as the packet round-trip time billion seconds, test packets sent to the N-th received packet server 20 in response to the elapsed time from the first electronic device IOa of, roughly equal to the test packet of N corresponding to the N period intervals, but the present invention is not limited thereto.

[0044] 请一并参考图1、图2、表1及表2。 [0044] Please refer to FIG. 1, FIG. 2, Table 1 and Table 2. 当第一电子装置IOa应用本发明的维持连线方法第一实施例时,首先第一电子装置IOa会发送第1次测试封包至服务器20,此第1次测试封包要求服务器20等待5秒间隔时间后,再发送响应封包至第一电子装置IOa;由于其间隔时间小于连线路径Pl中各路由器A、D、F的等待时间,也即表示服务器20可顺利发送第1次测试封包的响应封包至第一电子装置l〇a,使得第一电子装置IOa得以继续发送下个测试封包。 While maintaining the connection method of the first electronic device IOa present invention is applied to the first embodiment, the first electronic device IOa first sends a test packet to first server 20, this first test packet server 20 waits claim intervals of 5 seconds after time, and then sends a response packet to IOa of a first electronic device; due to its connection path Pl is smaller than the interval of the routers a, D, F of the waiting time, but also means that the server 20 can be smoothly sent in response to the first test packet l〇a packet to the first electronic device, such that the first electronic device continues to send the next IOa test packets. 而后续发送的第2〜6次测试封包虽逐一累加5秒间隔时间,但直至第6次测试封包所对应的6 段间隔时间(即30秒间隔时间)也小于各路由器A、D、F的等待时间,表示服务器20可顺利发送第2〜6次测试封包的各响应封包至第一电子装置10a。 2 ~ 6, although the test of the subsequent packet transmitted by one accumulation time intervals of 5 seconds, but the time interval until the first segment 6 6 corresponding to the test packet (i.e., 30 seconds interval) is less than each of the routers A, D, F of waiting time, it represents the server 20 can be smoothly sent in response to each packet of 2 ~ 6 test packet to the first electronic device 10a.

[0045] 接着,当第一电子装置IOa发送第7次测试封包至服务器20时,第7次测试封包要求服务器20等待的35秒间隔时间已大于连线路径Pl中路由器D的30秒等待时间;使得服务器20发送第7次测试封包的响应封包至第一电子装置IOa的过程中,因为路由器D连线至路由器A通信端口已被关闭导致连线中断,而无法顺利传送至第一电子装置10a。 [0045] Next, when the first electronic device transmits IOa seventh test packet to the server 20, the seventh test packet server 20 waits claim 35 second interval is greater than the wiring path Pl router D in the waiting time for 30 seconds ; 7 such that the server 20 transmits test packets of the packet in response to the first electronic device IOa process, because the router D to router connecting the communication port a has interrupted the connection is closed, can not be successfully transferred to the first electronic device 10a. 第一电子装置IOa的测试模块13在判断未收到服务器20针对第7次测试封包所发送的响应封包后,得知此35秒间隔时间过长,因此测试模块13会回朔至前次第6次测试封包的状态,以自发出第6次测试封包至接收服务器20响应所经过时间(在本实施例中为30秒)为周期时间。 The first electronic device 13 IOa test modules 20 is determined in the response packet transmitted for the first 7 test server does not receive the packet, that this 35 seconds interval is too long, the test module 13 to the front retrospective sequential 6 state test packet, sent from the 6th to the test packet to the receiving server 20 in response to the elapsed time period (in the present embodiment, 30 seconds) is. 之后当第一电子装置IOa切换为待机/休眠模式后,系统模块11即以30秒为周期发送维持封包至服务器20,借以维持第一电子装置IOa与服务器20之间的连线状态。 When the electronic device after the first switching IOa standby / sleep mode, i.e., the system module 11 transmits 30-second period to maintain the packet to the server 20, so as to maintain the connection state between the first electronic device 20 and the server IOa.

[0046] 请参考图4是本发明的维持连线方法第二实施例的流程图。 [0046] Please refer to FIG. 4 is a flowchart of a method according to the present invention maintains a connection to a second embodiment. 须注意的是,以下虽配合图1及图2所示的电子装置IOb及其与服务器20的连线路径P2为例说明本发明的维持连线方法,但本发明并不以适用于此为限,应根据电子装置的组成架构或其与服务器20的连线路径不同而有所变化。 It should be noted that, although the electronic device shown in FIG. 1 and FIG fitting and the server 2 IOb wiring path P2 20 maintains a connection to an example of the method of the present invention, but the present invention is not applied thereto as in limit, the composition should vary according to the architecture of the electronic device or a wiring path different from the server 20. 如图4所示,本发明的维持连线方法第二实施例包括步骤S401至步骤S406,其中步骤S40US402与前述第一实施例的步骤S30US302相同,将不多做赘述。 As shown, the method of the present invention maintains a connection to the second embodiment includes a step S401 to step S406 4, wherein the same steps S40US402 foregoing first embodiment S30US302, would do little repeated. 以下将详细说明该方法新增的各个步骤。 The various steps of the new method will be described in detail.

[0047] 步骤S401:发出一第N次测试封包至服务器20,其中第N次测试封包要求服务器20 于等待N段间隔时间后再响应电子装置10b,且N为正整数。 [0047] Step S401: N-emitting a test packet to the server 20, wherein the first packet requires N test server 20 in response to the electronic device 10b interval after waiting period N, and N is a positive integer.

[0048] 步骤S402:判断是否接收到服务器20对第N次测试封包所发出的响应。 [0048] Step S402: determining whether a response to the N-th received test packet 20 issued by the server.

[0049] 若测试模块13接收到服务器20对该次测试封包所发出的响应,此时测试模块13将回到步骤S401,进行下一次的测试封包的发送。 [0049] If the test module 13 to the server 20 receives the response to the test packet sent, in which case the test module 13 returns to step S401, the next test transmission packet.

[0050] 步骤S403:反复发出第NI次测试封包至服务器20。 [0050] Step S403: NI repeatedly issued the first test packet to the server 20.

[0051] 若测试模块13未能接收到服务器20对第N次测试封包所发出的响应,表示服务器20在等待该次测试封包所对应的N段间隔时间后,第二电子装置IOb与服务器20之间的连线可能已中断,因此考虑回朔至前一次测试封包(即第NI次测试封包)。 [0051] When the test module 13 to the server fails to receive a response to the N-th test packet issued 20, N represents the server 20 waits for the test period interval corresponding to the packet, the second electronic device with the server 20 IOb the connection between may have been interrupted, so consider a test packet before backtracking to (ie NI test packet). 而为避免自发送第N-1次测试封包至服务器响应该封包的所经过时间可能相近于某路由器的等待时间,造成连线状态不稳定,此时仅凭单次测试可能无法反映现状;因此测试模块13会反复发出多次的第NI次测试封包至接收服务器20。 And in order to avoid self-send the first N-1 test packet to the server in response to the packet elapsed time may be similar to a particular router latency, resulting in an unstable connection state, this time only by a single test may not reflect the current situation; therefore test NI module 13 will issue a first test packet to the receiving server repeated 20 times. 在本实施例中,测试模块13会反复发出至少3次第NI次测试封包至服务器20,其次数随设计需要而加以调整。 In the present embodiment, the test module 13 will be repeated at least three sequential issue NI test packet to the server 20, the number of which depending on the design needs to be adjusted.

[0052] 步骤S404:判断是否接收到服务器20对所有第NI次测试封包所发出的响应。 [0052] Step S404: determining whether a response is received for all of the emitted packet server 20 NI test.

[0053] 测试模块13反复发出第NI次测试封包至接收服务器20后,会判断是否接收到服务器20对所有第NI次测试封包所发出的响应。 [0053] The first test module 13 is repeatedly sent NI test packet to the receiving server 20, it determines whether a response is received for all of the emitted packet server 20 NI test. 若测试模块13确认每次发出的第NI次测试封包均会收到响应,则进行步骤S405;若测试模块13确认并非每次发出的第NI次测试封包均会收到响应,则进行步骤S406。 If the test module 13 confirms the packet of the NI test will each receive a response issued, proceed to step S405; if the test module 13 confirms the packet of the NI test will not always receive a response issued, step S406 is performed .

[0054] 步骤S405:计算自发出第NI次测试封包至接收服务器20响应所经过时间为一周期时间。 [0054] Step S405: Calculation of issue of the received packet to the NI test server 20 in response to the elapsed time is a period of time.

[0055] 若测试模块13接收到服务器20对所有发出的多次第NI次测试封包的响应,表示服务器20自第二电子装置IOb发出第NI次测试封包至接收服务器20响应所经过时间应小于各路由器的等待时间,即此状态下连线稳定,因此计算自第一电子装置IOa发出第NI次测试封包至接收服务器20响应所经过时间,并将其作为周期时间。 [0055] If the test module 13 receives the response to the test server 20 times of all outgoing packets NI times, indicating that the server 20 sent from the second electronic device IOb NI test packet to first server 20 receives the response should be less than the elapsed time of each router latency, i.e., stable connection in this state, the calculation from the first electronic device IOa issued the first test NI packet to the receiving server 20 in response to the elapsed time, and as the period of the time.

[0056] 步骤S406:计算前次自发出该第N-2次测试封包至接收该服务器响应所经过时间为一周期时间。 [0056] Step S406: The second issue is calculated from the previous N-2 test packet to a server in response to receiving the elapsed time is a period of time.

[0057] 若测试模块13未能接收到服务器20对所有发出的第N-1次测试封包的响应,表示第NI次测试封包所对应的NI段间隔时间可能与某路由器的等待时间相近;在网络传输处理有所延迟的状态下,其所造成的时间误差加上NI段间隔时间会大于某路由器的等待时间,将使得第二电子装置IOb与服务器20之间的连线中断,连线状态也相对不稳定。 [0057] If the test module 13 fails to receive a response to all the 20 first N-1 test packet sent by a server, the first time interval represents a period NI NI test packet corresponding to a wait time may be similar to router; in a state of network transmission delay has been processed, plus the time error caused by its NI period interval will be larger than a certain latency routers, such that the second electronic device IOb of the connection between the server 20 interrupts the connection status It is relatively unstable. 因此测试模块13考虑再回朔至更前一次测试封包(即第N-2次测试封包),计算自第二电子装置IOb 发出第N-2次测试封包至接收服务器20响应所经过时间,并将其作为周期时间。 Thus the test module 13 consider a test packet to return moon more forward (i.e., N-2 of the test packet) is calculated from the second electronic device IOb issued the first N-2 test packet to the receiving server 20 in response to the elapsed time, and as their time period.

[0058] 于步骤S405或步骤S406后还包括步骤S407:当电子装置切换为待机/休眠模式后, 依据周期时间发送维持封包至服务器20,以维持与服务器20之间的连线状态。 [0058] After step S405 or in step S406, further comprising the step S407: when the electronic device is switched to standby / sleep mode, based on the cycle time to maintain the transmitted packet to the server 20, to maintain the connection status between the server 20.

[0059] 在决定周期时间后,测试模块13可通知系统模块11,当第二电子装置IOb切换为待机/休眠模式后,会以步骤S405或步骤S406所计算的周期时间持续且定期地发送维持封包至服务器20,来保持与服务器20之间的连线状态。 [0059] After determining the cycle time, the test module 13 may notify the system module 11, when the second electronic switching device IOb standby / sleep mode, step S405 or step S406 to the calculated cycle time and periodically transmitted continuously maintained packet to the server 20, to maintain the connection status between the server 20.

[0060] 以下举出另一实施方式说明如何应用本发明的维持连线方法的第二实施例。 [0060] Another embodiment includes the following embodiment explained how to apply the second embodiment to maintain the connection method of the present invention. 表3 表示第二电子装置IOb应用本发明的维持连线方法第二实施例与服务器20进行连线状态测试的结果。 Table 3 shows a second electronic device IOb application method of the invention maintains a connection to a second embodiment of the server 20 with the results of the test connection status.

[0061] 表3 (第二电子装置IOb) [0061] Table 3 (IOb of a second electronic device)

Figure CN104104647BD00091

[0064] 如表3所示,此实施方式中,第二电子装置IOb经由连线路径P2与服务器20进行连线,假设每段间隔时间为5秒,而因为前述封包来回时间通常非常短暂,在本实施方式中为方便说明,而假设封包来回时间为〇秒,因此自第二电子装置IOb发出第N次测试封包至接收服务器20响应该封包所经过时间,大致等于第N次测试封包所对应的N段间隔时间,但本发明不以此为限。 [0064] As shown in Table 3, in this embodiment, the second electronic device IOb via connection 20 with the server connection path P2, each segment is assumed that the interval time was 5 seconds, and since the packet round-trip time is generally very short, in the present embodiment, for convenience of explanation, is assumed as the packet round-trip time billion seconds, test packets sent to the N-th received packet server 20 in response to the elapsed time from the second electronic device IOb of, roughly equal to the test packet of N corresponding to the N period intervals, but the present invention is not limited thereto.

[0065] 请一并参考图1、图2、表1及表3。 [0065] Please refer to FIG. 1, FIG. 2, Table 1 and Table 3. 当第二电子装置IOb应用本发明的维持连线方法第一实施例时,首先第二电子装置IOb会发送第1次测试封包至服务器20,此第1次测试封包要求服务器20等待5秒间隔时间后,再发送响应封包至第二电子装置IOb;由于其间隔时间小于连线路径Pl中各路由器B、C、E、F的等待时间,也即表示服务器20可顺利发送第1次测试封包的响应封包至第二电子装置l〇b,使得第二电子装置IOb得以继续发送下个测试封包。 While maintaining the connection method of the second electronic device IOb present invention is applied to the first embodiment, the second electronic device IOb first sends a test packet to first server 20, this first test packet server 20 waits claim intervals of 5 seconds after time, and then sends a response packet to the second electronic device IOb of; due to its connection path Pl is smaller than the interval of the routers B, C, E, F of the waiting time, but also means that the server 20 can smoothly transmit the first test packet response packet to the second electronic device l〇b such IOb second electronic device to continue to send the next test packets. 而后续发送的第2〜7次测试封包虽逐一累加5秒间隔时间,但直至第7次测试封包所对应的7段间隔时间(即35秒间隔时间)也小于各路由器B、C、E、F的等待时间,表示服务器20可顺利发送第2〜7次测试封包的各响应封包至第二电子装置10b。 2~7 and the first test packet destined for a subsequent one by one accumulation time intervals of 5 seconds, the test packet until the 7th paragraph 7 corresponding interval (i.e., 35 seconds interval) is less than each of the routers B, C, E, F latency, expressed server 20 in response to smoothly transmit each packet of 2~7 test packet to a second electronic device 10b.

[0066] 接着,当第二电子装置IOb发送第8次测试封包至服务器20时,第8次测试封包要求服务器20等待的40秒间隔时间约等于连线路径P2中路由器E的40秒等待时间。 [0066] Next, when the second electronic device transmits IOb eighth test packet to the server 20, the eighth test packet to claim 40 second interval is approximately equal to the server 20 waits for 40 seconds connection path P2 latency routers E . 当服务器20 发送第8次测试封包的响应封包至第二电子装置IOb的过程中,若是网络状态稳定,则仍可能在路由器E的通信端口关闭前完成响应封包的传送,此时第二电子装置IOb可继续进行第9次测试封包的发送;若网络状态不稳定而造成传输延迟,路由器E的通信端口可能会先被关闭导致连线中断,而响应封包无法顺利传送至第二电子装置l〇b,此时即如同前述第一实施例的方式,回朔至前次第7次测试封包,而以自发出第7次测试封包至接收服务器20响应所经过时间为周期时间。 When the process in response to the packet server 20 transmits the eighth test packet to a second electronic device in IOb, if the network state is stable, it may still transmit the response packet is completed before closing the communication port router E, in which case the second electronic device IOb may continue sending a test packet 9th; if the network unstable state caused by transmission delay, a communications port router E may be closed first interrupted the connection and the response packet can not be transmitted successfully to the second electronic device l〇 B, i.e. as in case of the first embodiment described embodiment, back test packet sequence 7 prior to the new moon, and to emit from the seventh test packet to the receiving server 20 in response to the elapsed time of the cycle time. 在本实施例中,暂且认定网络状态相对稳定,使得第二电子装置IOb可继续进行第9次测试封包的发送。 In the present embodiment, the time being determined network status is relatively stable, so that the second electronic device may continue to transmit IOb ninth test packet.

[0067] 当第二电子装置IOb发送第9次测试封包至服务器20时,第9次测试封包要求服务器20等待的45秒间隔时间已大于连线路径P2中路由器E的40秒等待时间;使得服务器20发送第9次测试封包的响应封包至第二电子装置IOb的过程中,因为路由器E连线至路由器C的通信端口已被关闭导致连线中断,而无法顺利传送至第二电子装置l〇b。 [0067] When the second electronic device transmits IOb ninth test packet to the server 20, the ninth test packet to claim 45 second interval is greater than the server 20 waits for 40 seconds connection path P2 latency routers E; that server 20 transmits the ninth test response packet to the second packet process IOb electronic device, since the communication ports to connect to router E router C has interrupted the connection is closed, can not be successfully transferred to the second electronic device l 〇b. 第二电子装置IOb 的测试模块13在判断未收到服务器20针对第9次测试封包所发送的响应封包后,判断此45 秒间隔时间过长,因此测试模块13会回朔至前次第8次测试封包的状态。 IOb second electronic device 13 in the test module 20 determines the response packet for the transmitted test packets of the server 9 has not received, this determination 45 seconds interval is too long, the test module 13 to 8 times before backtracking sequence state test packet.

[0068] 但在本实施例中,为了确保第二电子装置IOb能正常接收到响应封包(即第二电子装置IOb与服务器20之间连线稳定不中断),因此测试模块13会反复发送至少3次的第8次测试封包。 [0068] In the present embodiment, in order to ensure that the second electronic device IOb normal response packet is received (i.e., the second electronic device and the server connection stability between IOb uninterrupted 20), so the test module 13 repeatedly transmitted at least the eighth test packets three times. 假设第二电子装置IOb能接收到所有发出的第8次测试封包的响应封包,即表示所对应的8段间隔时间(即40秒间隔时间)是适当的,因此第二电子装置IOb能以自发出第8次测试封包至接收服务器20响应所经过时间(在本实施例中为40秒)为周期时间。 IOb assumed that the second electronic device can receive all of the packets in response to the test packet sent 8 times, i.e., 8 represents a time interval corresponding to the period (i.e., 40 seconds interval) is appropriate, the second electronic device can be self-IOb issued eighth test packet to the receiving server 20 in response to the elapsed time period (in the present embodiment, 40 seconds) it is.

[0069] 若假设第二电子装置IOb未接收到所有发出的第8次测试封包的响应封包,即表示自发出第8次测试封包至接收服务器20响应所经过时间,可能仍会大于路由器等待时间而造成连线中断,因此第二电子装置IOb会再回朔至前次第7次测试封包,而以自发出第7次测试封包至接收服务器20响应所经过时间(在本实施例中为35秒)为周期时间。 [0069] Assuming that the second electronic device IOb not receive all of the eight test packet sent in response to the packet, that means from the eighth test packets sent to the receiver 20 in response to the elapsed time of the server, a router may still be greater than the waiting time interrupted the connection, the second electronic device will return moon IOb test packet sequence 7 to front, and to emit from the seventh test packet to the server 20 in response to receiving the elapsed time (in this embodiment 35 seconds ) cycle time.

[0070] 通过本发明的设计,使得电子装置在最大许可范围内,找出较适当的周期时间,于切换至待机/休眠模式后定期发送维持封包至连线服务器,以维持与服务器之间的连线状态;如此在有需要时,服务器即可通过网络随时自远程唤醒电子装置,以进行数据的存取等操作。 [0070] By design of the present invention, the electronic device within the maximum allowable range, to find a more appropriate time period, transmit packet to maintain the connection to the server periodically switch to standby / sleep mode, the server to maintain between connection state; thus, if necessary, at any time the server from a remote wakeup electronic device via a network, to access data, and other operations. 同时本发明的设计也可大幅减少封包传送次数,以节省电子装置的资源消耗。 While the design of the present invention may also significantly reduce the number of transmission packets, to save resource consumption of the electronic device.

[0071] 当然,本发明还可有其它多种实施例,在不背离本发明精神及其实质的情况下,熟悉本领域的技术人员当可根据本发明作出各种相应的改变和变形,但这些相应的改变和变形都应属于本发明所附的权利要求书的保护范围。 [0071] Of course, the present invention may have a variety of other embodiments, without departing from the spirit and essence of the present invention, those skilled in the art can make various corresponding modifications and variations according to the present invention, but the scope of protection according to corresponding changes and variations of the present invention should belong to the appended claims.

Claims (9)

  1. 1. 一种维持连线方法,用于维持一电子装置与一服务器之间的连线状态,其特征在于, 该方法包括以下步骤: (a)发出一第N次测试封包至该服务器,其中该第N次测试封包要求该服务器于等待N段间隔时间后再响应该电子装置,且N为正整数; ⑹判断是否接收到该服务器对该第N次测试封包所发出的响应; (c)若接收到该服务器对该第N次测试封包所发出的响应,则重复步骤(a);若未接收到该服务器对该第N次测试封包所发出的响应,则计算前次自发出该第NI次测试封包至接收该服务器响应所经过时间以直接设定为一周期时间;以及⑹当该电子装置切换为一待机/休眠模式后,依据该周期时间发送一维持封包至该服务器,以维持与该服务器之间的连线状态。 1. A method for maintaining the connection method for maintaining a connection state between the electronic device and a server, wherein, the method comprising the steps of: (a) emitting a first N test packet to the server, wherein the N-th test packet requests the server to wait before N period interval in response to the electronic device, and N is a positive integer; ⑹ determines whether the server receives a response to the N-th test packet issued; (c) when receiving the server response to the test packet to the N-emitted, repeating steps (a); if not the server receives a response to the N-th test packet issued is calculated from the previous issue of the NI test packet to a server in response to receiving the elapsed time is directly set as a period of time; and ⑹ when the electronic device is switched to a standby / sleep mode, according to the cycle time of a transmission packet to the server is maintained, in order to maintain and the connection status between the server.
  2. 2. 根据权利要求1所述的维持连线方法,其特征在于,于步骤(b)中判断等待该服务器响应的时间是否超过一封包来回时间加上N段间隔时间的总和,该封包来回时间为自该电子装置发送一封包至该服务器后,接收该服务器立即对该封包做出响应的一总时间。 The method of maintaining connection according to claim 1, wherein, in step (b) determines whether the wait time in response to the server over a packet round-trip time plus the interval time period N, the packet round-trip time after the electronic device from transmitting a packet to the server, the server receives the total time to make a response to the packet immediately.
  3. 3. 根据权利要求2所述的维持连线方法,其特征在于,当N= 1的状态下,若未接收到该服务器对该第1次测试封包所发出的响应,则以该封包来回时间为一周期时间。 3. The method of maintaining connection according to claim 2, wherein, when the state where N = 1, and if not the server receives a response to the first test packet is sent, the packet round-trip time places It is a period of time.
  4. 4. 根据权利要求1所述的维持连线方法,其特征在于,该间隔时间为5〜20秒。 The method of maintaining connection according to claim 1, characterized in that the interval of 5~20 seconds.
  5. 5. —种维持连线方法,用于维持一电子装置与一服务器之间的连线状态,其特征在于, 该方法包括以下步骤: (a)发出一第N次测试封包至该服务器,其中该第N次测试封包要求该服务器于等待N段间隔时间后再响应该电子装置,且N为正整数; ⑹判断是否接收到该服务器对该第N次测试封包所发出的响应; (c)若接收到该服务器对该第N次测试封包所发出的响应,则重复步骤(a);若未接收到该服务器对该第N次测试封包所发出的响应,则反复发出该第NI次测试封包并判断是否接收到该服务器对所有该第NI次测试封包所发出的响应; ⑹若接收到该服务器对所有反复发出的该第NI次测试封包的响应,则计算自发出该第NI次测试封包至接收该服务器响应所经过时间为一周期时间;若未接收到该服务器对所有反复发出的该第NI次测试封包的响应,则计算前次自发出该第N- 5. - Species maintains a connection method for maintaining a connection state between the electronic device and a server, wherein, the method comprising the steps of: (a) emitting a first N test packet to the server, wherein the N-th test packet requests the server to wait before N period interval in response to the electronic device, and N is a positive integer; ⑹ determines whether the server receives a response to the N-th test packet issued; (c) when receiving the server response to the test packet to the N-emitted, repeating steps (a); if not the server receives a response to the N-th test packet issued, the issuing of repeatedly NI test packet and determines whether a response to the server issued to all of the first NI test packet; ⑹ when receiving the server's response to all of the first NI test packet is repeatedly emitted, is calculated from the issue of the first NI test receiving a packet to the server in response to the elapsed time is a period of time; if not receiving the server's response to all of the NI test packet sent repeatedly, since the issue of the previous calculation of the N- 2次测试封包至接收该服务器响应所经过时间以直接设定为一周期时间;以及(e)当该电子装置切换为一待机/休眠模式后,依据该周期时间发送一维持封包至该服务器,以维持与该服务器之间的连线状态。 2 test packet to a server in response to receiving the elapsed time is directly set as a period of time; and (e) when the electronic device is switched to a standby / sleep mode, according to the cycle time to send a packet to the server is maintained, in the state of the connection is maintained between the server.
  6. 6. 根据权利要求5所述的维持连线方法,其特征在于,于步骤(c)中发出至少3次该第N-1次测试封包至该服务器。 6. The method of maintaining connection according to claim 5, wherein, in step (c) emitting at least three times the first N-1 test packet to the server.
  7. 7. 根据权利要求5所述的维持连线方法,其特征在于,于步骤(b)中判断等待该服务器响应的时间是否超过于未延迟情况下自该电子装置发送一封包至接收该服务器响应该封包的一来回时间,加上N段间隔时间的总和。 The method of maintaining connection according to claim 5, wherein, in step (b) it is determined whether the wait time exceeds the server response delay is not the case at the server in response to receiving from the electronic device sends a packet should a packet round-trip time plus the sum of N pieces interval.
  8. 8. 根据权利要求7所述的维持连线方法,其特征在于,当N = 1的状态下,若未接收到该服务器对该第1次测试封包所发出的响应,则以该来回时间为一周期时间。 8. The method maintains a connection response according to claim 7, wherein, when N = 1 state, if not the server receiving the first test packet is sent, the round-trip time places a period of time.
  9. 9. 根据权利要求5所述的维持连线方法,其特征在于,该间隔时间为5〜20秒。 9. A method of maintaining connection according to claim 5, characterized in that the interval of 5~20 seconds.
CN 201310112126 2013-04-02 2013-04-02 Maintain connection method CN104104647B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201310112126 CN104104647B (en) 2013-04-02 2013-04-02 Maintain connection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201310112126 CN104104647B (en) 2013-04-02 2013-04-02 Maintain connection method

Publications (2)

Publication Number Publication Date
CN104104647A true CN104104647A (en) 2014-10-15
CN104104647B true CN104104647B (en) 2018-02-06

Family

ID=51672450

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201310112126 CN104104647B (en) 2013-04-02 2013-04-02 Maintain connection method

Country Status (1)

Country Link
CN (1) CN104104647B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6212175B1 (en) * 1997-04-22 2001-04-03 Telxon Corporation Method to sustain TCP connection
CN101459871A (en) * 2007-12-14 2009-06-17 华为技术有限公司 Method, system and apparatus for paging periodic synchronization of access terminal and access network
CN102246469A (en) * 2008-12-15 2011-11-16 日本电气株式会社 Data transfer device
US8396950B1 (en) * 2000-03-02 2013-03-12 Rockstar Consortium Us Lp Method and apparatus for the fast detection of connectivity loss between devices in a network

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100433660C (en) * 2006-09-30 2008-11-12 杭州华三通信技术有限公司 Method and equipment for realizing fast detection
US7693084B2 (en) * 2007-02-28 2010-04-06 Microsoft Corporation Concurrent connection testing for computation of NAT timeout period
EP2223509A1 (en) * 2007-12-20 2010-09-01 Telefonaktiebolaget LM Ericsson (publ) Method and arrangement to maintain a tcp connection
US9516116B2 (en) * 2008-06-06 2016-12-06 Apple Inc. Managing notification service connections
US8375134B2 (en) * 2009-06-08 2013-02-12 Microsoft Corporation Determining an efficient keep-alive interval for a network connection
US8065419B2 (en) * 2009-06-23 2011-11-22 Core Wireless Licensing S.A.R.L. Method and apparatus for a keep alive probe service
US8566625B2 (en) * 2011-07-01 2013-10-22 Intel Corporation System and method for determining transmitting frequency to maintain remote application server connectivity
US8892710B2 (en) * 2011-09-09 2014-11-18 Microsoft Corporation Keep alive management

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6212175B1 (en) * 1997-04-22 2001-04-03 Telxon Corporation Method to sustain TCP connection
US8396950B1 (en) * 2000-03-02 2013-03-12 Rockstar Consortium Us Lp Method and apparatus for the fast detection of connectivity loss between devices in a network
CN101459871A (en) * 2007-12-14 2009-06-17 华为技术有限公司 Method, system and apparatus for paging periodic synchronization of access terminal and access network
CN102246469A (en) * 2008-12-15 2011-11-16 日本电气株式会社 Data transfer device

Also Published As

Publication number Publication date Type
CN104104647A (en) 2014-10-15 application

Similar Documents

Publication Publication Date Title
Gunaratne et al. Managing energy consumption costs in desktop PCs and LAN switches with proxying, split TCP connections, and scaling of link speed
US7492710B2 (en) Packet flow control
US20080162682A1 (en) Maintaining network connectivity while operating in low power mode
US20110035498A1 (en) Method and System for Managing Network Power Policy and Configuration of Data Center Bridging
US20080117909A1 (en) Switch scaling for virtualized network interface controllers
US20120188885A1 (en) Method and system for self-adapting dynamic power reduction mechanism for physical layer devices in packet data networks
US20110029659A1 (en) Method and System for Network Proxy Services for Energy Efficient Networking
US20090094365A1 (en) Thin client discovery
US20130205037A1 (en) Tcp-aware receive side coalescing
US20090219936A1 (en) Method and system for offloading network processing
US20100218011A1 (en) System and Method for Energy Savings Through Emulation of Wake on Lan in Energy Efficient Ethernet
US8977733B1 (en) Configuring host network parameters without powering on a host server
CN101951345A (en) Message transmitting method and equipment
CN103067277A (en) Method of building control channel, forwarding point (FP) and controller
US8156209B1 (en) Aggregation devices processing keep-alive messages of point-to-point sessions
US20140198649A1 (en) Extended link aggregation (lag) for use in multiple switches
JP2011018106A (en) Communication protocol processing device and method therefor
US20130194912A1 (en) Sea failover mechanism with minimized packet losses
US20150172112A1 (en) Simultaneous operation of remote management and link aggregation
CN101299689A (en) On-line detection method as well as mail server
US20100034178A1 (en) Methods and apparatus for priority-based adoption of an access device
US20070258463A1 (en) Load balancing for network server
CN1716869A (en) Network safety equipment synchronizing method under cluster mode
CN102065152A (en) Joined screen system and communication device thereof
EP2362578A1 (en) Method and system for managing network power policy and configuration of data center bridging

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
GR01