WO2014013674A1 - Communication keeping system, terminal device, communication keeping method, and connection keeping program - Google Patents
Communication keeping system, terminal device, communication keeping method, and connection keeping program Download PDFInfo
- Publication number
- WO2014013674A1 WO2014013674A1 PCT/JP2013/003763 JP2013003763W WO2014013674A1 WO 2014013674 A1 WO2014013674 A1 WO 2014013674A1 JP 2013003763 W JP2013003763 W JP 2013003763W WO 2014013674 A1 WO2014013674 A1 WO 2014013674A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- interval
- persistent connection
- connection
- server device
- terminal device
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/143—Termination or inactivation of sessions, e.g. event-controlled end of session
- H04L67/145—Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session
Definitions
- the present invention relates to a communication maintenance system that maintains communication between devices, a terminal device, a communication maintenance method, a connection maintenance method with a server device, and a connection maintenance program.
- TCP / IP Transmission Control Protocol / Internet Protocol
- transmission / reception is performed using this connection protocol.
- TCP / IP Transmission Control Protocol / Internet Protocol
- one device that wishes to connect transmits a packet indicating a connection start request to the other device, and the device that receives the connection start request packet sends a connection acceptance response to the transmission source terminal. Return the meaning packet.
- the connection associated with the connection start request is set in each device. Thereafter, communication is executed by transmitting and receiving packets using this connection.
- a middle box for relaying or blocking communication
- a middle box for relaying or blocking communication
- a network connecting a server and a mobile terminal Examples of the middle box include a NAT (Network Address Translation), a firewall, and a proxy server.
- NAT Network Address Translation
- the middle box is mainly used to send and receive packets between a terminal having a private IP address assigned by a network operator or user and a server device having a global IP address that can also be used in a global network such as the Internet. Convert IP addresses to each other. Such conversion enables a mobile terminal connected to a private network to communicate with a server device connected to a global network such as the Internet.
- a normal middle box discards the packet unless special conditions are set in advance. Do not allow connection between devices.
- the middle box when the middle box receives a connection start request packet for a server device on the global network from a terminal on the private network, the middle box relays the connection start request packet to the server device. Further, when the middle box receives the connection acceptance reply packet from the server device, the middle box relays the reply packet to the terminal on the private network. In this way, the setting of the connection associated with the connection start request is permitted between the terminal on the private network and the server device on the global network.
- the middle box continuously relays the packet transmitted from the server device or the terminal using the permitted connection.
- the middle box usually monitors the transmission and reception of packets on the connection. If transmission / reception of a packet is not executed between devices for a certain period of time (hereinafter also referred to as a connection invalidation deadline), the middle box invalidates the connection permission setting, and thereafter transmits packets transmitted / received using that connection. Discard.
- Patent Document 1 describes a communication system in which such a middle box is interposed.
- a packet is transmitted from a server device on the global network to a terminal on the private network at an arbitrary timing, a connection is established from the terminal on the private network to the server on the global network. Is set. Thereafter, the packet is transmitted and received between the devices every predetermined period (hereinafter referred to as keep alive interval) so that the persistent connection is not invalidated by the middle box. Connection is maintained.
- the increment of the keep-alive interval to be increased next is d
- the connection invalidation deadline is T
- the response period is calculated by (Kn + d) ⁇ T.
- Kn does not reach T easily, and packets are continuously transmitted and received at a short interval, which places a wasteful load on the network.
- the present invention provides a communication maintenance system, a terminal device, and a communication that can suppress a communication load for maintaining a connection while maintaining the connection between devices even in a communication network in which the connection between the devices becomes invalid for a predetermined period. It is an object to provide a maintenance method, a connection maintenance method with a server device, and a connection maintenance program.
- a communication maintenance system includes a server device and a terminal device that communicates with the server device using a persistent connection set between the server device, and the server device and the terminal device use the persistent connection.
- the terminals When communication is not performed during a predetermined period of keep-alive interval, the terminals are connected to each other via at least one middle box device that invalidates the persistent connection, and the persistent connection is valid.
- the high-reliability interval which is the maximum period of the keep-alive interval when it can be confirmed, and the extended interval with a longer period than the high-reliability interval used to check whether the persistent connection is valid or not are extended.
- a connection management unit is provided for setting a persistent connection with the server device by specifying an interval.
- the high-reliability interval elapses, a new persistent connection that specifies an extended interval determined according to the keep-alive packet reception status is set with the server device, and the keep based on the new persistent connection is set.
- the alive packet is received from the server device, the extended interval designated by the setting of the persistent connection is set as a high-reliability interval.
- the terminal device is a terminal device that communicates with the server device using a persistent connection set up with the server device, and communication with the server device using the persistent connection is predetermined. If the keep alive interval is not performed, it is connected via at least one middlebox device that invalidates the persistent connection, and the keep alive interval when it is confirmed that the persistent connection is valid. The maximum reliable period and the extended interval longer than the reliable interval used to check whether the persistent connection is valid are retained, and the extended interval is specified to establish a persistent connection with the server device.
- a connection management unit is provided, and when the high reliability interval elapses after the connection management unit sets a persistent connection, A new extension interval that is determined according to the reception status of the keep-alive packet sent from the server device when the extension interval specified in the setting of the persistent connection elapses after a persistent connection is set between When a persistent connection is set with the server device and a keep-alive packet based on the new persistent connection is received from the server device, the extended interval specified by the setting of the persistent connection is set as a reliable interval. It is characterized by that.
- the communication maintenance method communicates with a server device using a persistent connection established between the server device and the server device for a predetermined period of communication using the persistent connection.
- the keep alive interval when the terminal device connected via at least one middle box device that invalidates the persistent connection can confirm that the persistent connection is valid.
- the high-reliability interval that is the maximum period, and the extended interval that is longer than the high-reliability interval that is used to check whether the persistent connection is valid or not are retained.
- the persistent connection is established after the server device establishes a persistent connection with the terminal device. When the extended interval specified in the setting elapses, a keep-alive packet is transmitted to the terminal device.
- the high-reliability interval elapses after the terminal device establishes a persistent connection, it depends on the reception status of the keep-alive packet.
- the terminal device receives a keep-alive packet based on the new persistent connection from the server device, a new persistent connection that specifies the extended interval determined in this way is set with the server device.
- the extended interval specified by the step is set to a highly reliable interval.
- the method for maintaining a connection with a server device communicates with the server device using a persistent connection set up with the server device, and communication using the persistent connection is predetermined with the server device. If the terminal device connected via at least one middlebox device that invalidates the persistent connection can be confirmed that the persistent connection is valid when the keep alive interval is not performed.
- the high-reliability interval which is the maximum period of the keep-alive interval, and the extended interval longer than the high-reliability interval used to check whether the persistent connection is valid are retained, and the terminal device specifies the extended interval. To establish a persistent connection with the server device, and when the high reliability interval has elapsed since the terminal device established the persistent connection.
- the extension interval that is determined according to the reception status of the keep-alive packet sent from the server device when the extension interval specified in the setting of the persistent connection has elapsed since the persistent connection was set up with the server device.
- the terminal device receives a keep-alive packet based on the new persistent connection from the server device, the extended interval specified by the setting of the persistent connection is increased.
- the confidence interval is set.
- connection maintenance program communicates with a server device using a persistent connection set up with the server device, and the server device has a predetermined period of communication using the persistent connection.
- the high-reliability interval which is the maximum period of the keep-alive interval when it can be confirmed, and the extended interval with a longer period than the high-reliability interval used to check whether the persistent connection is valid or not are extended.
- Connection management is executed by specifying the interval and executing connection management processing to set up a persistent connection with the server device.
- a new persistent connection specifying an extension interval determined according to the reception state of the keep-alive packet to be transmitted is set between the server apparatus and the keep-alive packet based on the new persistent connection is received from the server apparatus.
- the extended interval designated by the setting of the persistent connection is set to a highly reliable interval.
- the present invention it is possible to suppress a communication load for maintaining a connection while maintaining a connection between devices even in a communication network in which a connection between devices is invalidated during a predetermined period.
- FIG. 1 is a block diagram showing an embodiment of a communication maintenance system according to the present invention.
- the communication maintenance system of this embodiment includes a terminal device 1 and a server device 2.
- the terminal device 1 is operated by a user, for example.
- the server device 2 is connected to the other server device 3 and mediates a message transmitted from the other server device 3 to the terminal device 1.
- the other server device 3 provides a service to a user who operates the terminal device 1 by transmitting a message to the terminal device 1.
- the middle box device 4 is connected between the terminal device 1 and the server device 2 via a communication network.
- the middle box device 4 monitors and relays communication between the terminal device 1 and the server device 2 by a firewall function or a NAT function.
- 1 illustrates a case where one middle box is connected between the terminal device 1 and the server device 2.
- the number of middle box devices 4 is not limited to one. It may be more than one.
- the middle box device 4 monitors whether a packet is transmitted / received over a TCP / IP connection between the terminal device 1 and the server device 2. If no packet transmission / reception is executed during the connection invalidation period, the middle box device 4 invalidates the connection permission setting, and thereafter discards the packet transmitted / received using the connection. That is, the middle box device 4 invalidates the connection when communication using the connection set between the terminal device 1 and the server device 2 is not performed for a predetermined period.
- the terminal device 1 includes a persistent connection management unit 11, a duration calculation unit 12, a timeout processing unit 13, a terminal identifier management unit 14, a connection management unit 15, a message reception unit 16, and a timer 17.
- the persistent connection management unit 11 is configured such that when the terminal device 1 is activated, when a network device (not shown) included in the terminal device 1 is activated, or when a user operates the terminal device 1, the server device 2. Setting up a persistent connection with 2.
- the persistent connection management unit 11 holds the maximum period among the periods in which it is confirmed that the connection (sustained connection) maintained with the server device 2 is valid as a highly reliable interval. Further, the persistent connection management unit 11 holds an interval for confirming whether or not the persistent connection set next time with the server device 2 is valid as an extended interval.
- the high-reliability interval is the maximum period of the keep-alive interval when it can be confirmed that the persistent connection is valid. it can.
- the expansion interval can be said to be a period obtained by adding a difference in keep alive interval to be increased and a highly reliable interval. In other words, the expansion interval means a period increased by a predetermined period to the high reliability interval.
- This extension interval is a value set to determine whether or not the determined high-reliability interval can be further extended. For example, when a high-reliability interval is determined for a certain persistent connection, an extended interval obtained by extending the high-reliability interval is determined, and a continuous connection with the specified extended interval is newly set between devices. A packet is transmitted as keep-alive from one device to the other device at the timing when this expansion interval elapses. When this packet arrives, the highly reliable keep-alive interval can be expanded.
- the high-reliability interval and the extension interval may be held by the persistent connection management unit 11 or may be held by the duration calculation unit 12 described later.
- the persistent connection management unit 11 sets a new persistent connection with the server device 2 after the high reliability interval has elapsed when the maximum value of the high reliability interval has not been determined.
- the persistent connection management unit 11 receives a packet from the server device 2 that confirms whether the persistent connection is valid (hereinafter referred to as a keep alive packet).
- a new persistent connection is set up with the device 2. Note that whether or not the maximum value of the high confidence interval has been determined is determined based on a change mode held by the duration calculation unit 12 described later. In this way, the persistent connection management unit 11 continues to maintain a persistent connection with the server device 2.
- the duration calculation unit 12 determines the extension interval.
- the duration calculation unit 12 holds one of the three states (enlargement mode, reduction mode, and steady mode) as the change mode.
- the expansion mode is a mode that maintains the high reliability interval and the expansion interval and gradually increases the expansion interval of the newly set persistent connection.
- the reduction mode is a mode indicating that the extension interval of a newly established persistent connection is gradually reduced.
- the steady mode is a mode in which the expansion interval is not changed.
- the state in which the duration calculation unit 12 holds the steady mode as the change mode indicates a case where the maximum value of the high reliability interval is determined.
- the duration calculation unit 12 determines the expansion interval based on these modes and the high reliability interval. A method for determining the expansion interval will be described later.
- the timeout processing unit 13 sets a setting for generating two types of events in the timer 17 attached to the terminal device 1.
- the first event is a high-reliability interval elapsed event that occurs after a high-reliability interval elapses from the current time when setting a persistent connection with the server device 2.
- the second event is an extended interval elapsed event that occurs after the extended interval has elapsed since the present time.
- the terminal identifier management unit 14 acquires a terminal identifier for uniquely identifying the terminal device 1.
- the connection management unit 15 sets a TCP / IP connection with the server device 2 as a persistent connection. Further, the connection management unit 15 notifies the expansion interval to the server device 2 when the persistent connection is set.
- the message receiving unit 16 receives a message transmitted from the server device 2 through a persistent connection with the server device 2, and executes a predetermined process.
- the persistent connection manager 11, the duration calculator 12, the timeout processor 13, the terminal identifier manager 14, the connection manager 15, and the message receiver 16 are computers that operate according to a program (communication maintenance program). This is realized by the CPU.
- the program is stored in a storage unit (not shown) of the terminal device 1, and the CPU reads the program, and according to the program, the persistent connection management unit 11, the duration calculation unit 12, the timeout processing unit 13, the terminal identifier
- the management unit 14, the connection management unit 15, and the message reception unit 16 may be operated.
- the persistent connection management unit 11, the duration calculation unit 12, the timeout processing unit 13, the terminal identifier management unit 14, the connection management unit 15, and the message reception unit 16 are each realized by dedicated hardware. May be.
- the server device 2 includes a persistent connection receiving unit 21, a keep alive processing unit 22, a message transmitting unit 23, an active connection managing unit 24, and a timer 25.
- the persistent connection receiving unit 21 manages a persistent connection with the terminal device 1. Specifically, the persistent connection receiving unit 21 transmits, to the terminal device 1, a keep alive packet for trying to determine whether the persistent connection is conductive or transmits a message.
- the keep alive processing unit 22 tries based on the extension interval transmitted from the terminal device 1 whether the persistent connection is conductive after the extension interval has elapsed since the present time. Specifically, when a persistent connection is set, the keep alive processing unit 22 performs a connection between the terminal device 1 and the server device 2 after the extended interval notified when the persistent connection is set from that point. An event (hereinafter referred to as a keep alive event) for confirming the continuity of is generated. At this time, the keep alive processing unit 22 transmits a packet (keep alive packet) used for confirmation of continuity between the terminal device 1 and the server device 2 to the terminal device 1.
- a packet keep alive packet
- the message transmission unit 23 receives a message transmission request from the other server device 3 to the terminal device 1 and instructs the persistent connection reception unit 21 to transmit a message to the terminal device 1.
- the active connection manager 24 instructs the persistent connection receiver 21 to transmit a message using the last established connection from the terminal device 1.
- the other server device 3 includes a message transmission application 31 (hereinafter referred to as a message transmission application 31) that instructs the terminal device 1 to execute some processing.
- a message transmission application 31 (hereinafter referred to as a message transmission application 31) that instructs the terminal device 1 to execute some processing.
- FIG. 2 is a flowchart illustrating an operation example in which the terminal device 1 sets a persistent connection.
- FIG. 3 is a flowchart illustrating an operation example in which the server apparatus 2 sets a persistent connection.
- the duration calculation unit 12 holds the high reliability interval and the expansion interval.
- the persistent connection management unit 11 of the terminal device 1 starts setting a persistent connection with the server device 2 (step S101 in FIG. 2).
- the persistent connection management unit 11 is a server device at the time when the terminal device 1 is activated, when the network device (not shown) included in the terminal device 1 is activated, or when the user operates the terminal device 1. 2. Setting up a persistent connection with 2.
- the persistent connection management unit 11 inquires of the duration calculation unit 12 about the high reliability interval and the extension interval of the persistent connection.
- the duration calculation unit 12 acquires the retained high reliability interval. Then, the duration calculation unit 12 determines whether the change mode used for the current period calculation is the enlargement mode, the reduction mode, or the steady mode (step S102). Thereafter, the expansion interval is determined based on the determined mode and the high reliability interval.
- the duration calculation unit 12 When the change mode is the steady mode (“steady mode” in step S102), the duration calculation unit 12 notifies the persistent connection management unit 11 of a result indicating that the extension interval and the high-reliability interval are the same (step S102). S103). In the expansion mode or the reduction mode, the duration calculation unit 12 calculates the expansion interval by calculation. When the change mode is the expansion mode (“enlargement mode” in step S102), the duration calculation unit 12 calculates a value larger than the expansion interval calculated last time as the current expansion interval (step S104). On the other hand, when the change mode is the reduction mode (“reduction mode” in step S102), the duration calculation unit 12 calculates a value smaller than the previously calculated extension interval as the current extension interval (step S105).
- the duration calculation unit 12 may hold, for example, the previously determined expansion interval, and in the expansion mode, the extended interval may be a period obtained by adding a highly reliable interval to the previous expansion interval. On the other hand, in the reduction mode, the duration calculation unit 12 may calculate a value obtained by subtracting the high reliability interval from the previous expansion interval, and may set a period obtained by adding half of the value to the high reliability interval as the expansion interval.
- the method for calculating the expansion interval is not limited to the method described above.
- the duration calculation unit 12 may set a period twice as long as the high-reliability interval as the extension interval.
- the duration calculation unit 12 may use a value obtained by adding half the value of the high-reliability interval to the original high-reliability interval (that is, 1.5 times the high-reliability interval) as the extended interval. .
- the expansion interval is calculated to be longer than the high reliability interval, and the calculation method is arbitrary. Further, when no persistent connection is set once and there is no highly reliable interval, an initial value specified in advance by the terminal device may be set as the extended interval. However, the initial value is set shorter than the period during which the connection is invalidated by the middle box device 4.
- the duration calculation unit 12 operates in the expansion mode in the initial state. The duration calculation unit 12 notifies the persistent connection management unit 11 of the determined high-reliability interval and extension interval.
- the persistent connection manager 11 issues a unique connection identifier for managing the persistent connection (step S106).
- the persistent connection management unit 11 notifies the timeout processing unit 13 of the issued connection identifier, high reliability interval, and extended interval.
- the timeout processing unit 13 sets the timer 17 attached to the terminal device 1 so as to generate a high-reliability interval elapse event including information indicating the connection identifier and the high-reliability interval after elapse of the high-reliability interval from the current time. . Further, the timeout processing unit 13 sets the timer 17 so as to generate an extended interval elapsed event including a connection identifier after the extended interval has elapsed from the present time (step S107).
- the timeout processing unit 13 does not set a timer for generating a high-reliability interval elapse event.
- the timing for generating the extended interval elapsed event may not be the same as the extended interval.
- the timeout processing unit 13 may set the timer 17 so as to generate an extended interval elapsed event after a predetermined amount of time has elapsed from the extended interval.
- the persistent connection management unit 11 acquires a terminal identifier for identifying the terminal device 1 from the terminal identifier management unit 14 (step S108).
- the terminal identifier may be information that can identify the terminal, such as the IP address of the terminal device 1 or the user ID of the user who uses the terminal device 1.
- the persistent connection management unit 11 instructs the connection management unit 15 to set a persistent connection by passing the connection identifier, the terminal identifier, and the extension interval. That is, the persistent connection management unit 11 and the connection management unit 15 specify the extension interval and set the persistent connection with the server device 2.
- the connection management unit 15 checks whether there is a connection classified as unused at present among the persistent connections set with the server device 2 (step S109).
- connection management unit 15 If there is no connection classified as unused (“No” in step S109), the connection management unit 15 starts setting a new connection from the terminal device 1 to the server device 2 (step S110). When the connection management unit 15 sets a connection with the persistent connection receiving unit 21 of the server device 2, the connection management unit 15 manages the connection in association with the connection identifier.
- connection management unit 15 manages the connection in association with the connection identifier (step S111).
- connection management unit 15 writes a notification including the terminal identifier and the extension interval to the persistent connection receiving unit 21 of the server device 2 through the persistent connection associated with the connection identifier (hereinafter referred to as a new keepalive period update notification). ) Is transmitted (step S112).
- the persistent connection receiving unit 21 of the server device 2 When the persistent connection receiving unit 21 of the server device 2 receives the new keep-alive period update notification through the persistent connection (step S201 in FIG. 3), it issues a unique connection identifier for the persistent connection (step S202). Then, the persistent connection receiving unit 21 stores the connection identifier and the persistent connection in association with each other. Further, the persistent connection receiving unit 21 notifies the active connection managing unit 24 of the connection identifier and the terminal identifier included in the new keepalive period update notification.
- the active connection management unit 24 stores the terminal identifier and the connection identifier in association with each other. At this time, the active connection management unit 24 checks whether or not another connection identifier is already stored in association with a certain terminal identifier (step S203). When these identifiers are already associated (“Yes” in step S203), the active connection management unit 24 deletes the existing association (step S204). On the other hand, if these identifiers are not associated (“NO” in step S203), the process proceeds to step S205.
- the active connection management unit 24 stores the terminal identifier and the new connection identifier in association with each other (step S205).
- the persistent connection receiving unit 21 notifies the keep alive processing unit 22 of the connection identifier and the extension interval included in the new keep alive period update notification.
- the keep alive processing unit 22 is attached to the server apparatus 2 so as to generate a keep alive event including information indicating the connection identifier and the extension interval after elapse of the extension interval from the present time (that is, the persistent connection is set).
- the timer 25 is set (step S206).
- FIG. 4 is a flowchart illustrating an example of processing in which the server apparatus 2 transmits a message.
- FIG. 5 is a flowchart illustrating an example of processing in which the terminal device 1 receives a message.
- the operation when the server apparatus 2 transmits a message to the terminal apparatus 1 will be described with reference to FIGS. 4 and 5.
- the message transmission unit 23 of the server device 2 When the message transmission unit 23 of the server device 2 receives a message transmission request to the terminal device 1 from the other server device 3 or each application in the server device 2 (step S301), the message transmission unit 23 specifies a terminal that transmits the message (step S301). Step S302).
- the message transmission unit 23 may specify the terminal from the terminal identifier included in the transmission request, for example.
- the message transmission unit 23 for example, sends the terminal identifier to an external device (not shown in FIG. 1) that manages the identifier and the terminal identifier in association with each other.
- the terminal may be specified from the terminal identifier received from the external device.
- the message transmission unit 23 notifies the persistent connection reception unit 21 of the terminal identifier and the message to be transmitted.
- the persistent connection receiving unit 21 acquires the connection identifier associated with the terminal identifier from the active connection management unit 24.
- the active connection management unit 24 specifies a connection identifier from the association between the terminal identifier and the connection identifier held as active connection information in response to a request from the persistent connection receiving unit 21 (step S303).
- the active connection management unit 24 notifies the identified connection identifier to the persistent connection receiving unit 21, and cancels the generation of the keep alive event including the connection identifier (step S304).
- the persistent connection receiving unit 21 acquires a persistent connection associated with the connection identifier (step S305), and transmits a message to the connection management unit 15 of the terminal device 1 through the persistent connection (step S306).
- connection management unit 15 of the terminal device 1 When the connection management unit 15 of the terminal device 1 receives a message through a certain persistent connection (step S401 in FIG. 5), it notifies the message reception unit 16 of the message.
- the message receiving unit 16 executes processing according to the content of the message (step S402). Note that the processing performed by the message receiving unit 16 is uniquely determined by each terminal device 1, and thus detailed description thereof is omitted here.
- connection management unit 15 acquires a connection identifier stored in association with the persistent connection that has received the message (step S403).
- the connection management unit 15 notifies the persistent connection management unit 11 that the message has been received via the persistent connection indicated by the connection identifier, and classifies the persistent connection as unused (step S404).
- the persistent connection management unit 11 When the persistent connection management unit 11 is notified that the message has been received, it notifies the timeout processing unit 13 of the connection identifier. The timeout processing unit 13 cancels the occurrence of the high reliability interval elapsed event and the extended interval elapsed event including the notified connection identifier (S405). Further, the persistent connection management unit 11 executes the processing after step S101 immediately or after a predetermined time has elapsed. That is, the terminal device 1 sets up a persistent connection with the server device 2 again.
- FIG. 6 is a flowchart illustrating an operation example when a highly reliable interval elapse event occurs in the terminal device 1.
- step S501 When a highly reliable interval elapsed event occurs in the terminal device 1 (step S501), that is, when a message using the persistent connection indicated by the connection identifier included in the highly reliable interval elapsed event is not received during the highly reliable interval.
- the timeout processing unit 13 notifies the persistent connection management unit 11 of the elapse of the high reliability interval of the persistent connection indicated by the connection identifier.
- the persistent connection manager 11 checks the current operation mode held by the duration calculator 12 (step S502). When the mode held by the duration calculation unit 12 is the steady mode (“Yes” in Step S502), the persistent connection management unit 11 acquires the current high-reliability interval from the duration calculation unit 12 (Step S503). Then, the persistent connection management unit 11 causes the timeout processing unit 13 to cancel the occurrence of the extended interval elapse event of the persistent connection (step S504).
- step S505 If the high reliability interval included in the high reliability interval elapsed event is shorter than the current high reliability interval (“Yes” in step S505), the persistent connection management unit 11 ends the process. On the other hand, when the high-reliability interval included in the high-reliability interval elapsed event is equal to or greater than the current high-reliability interval (“No” in step S505), the processing from step S101 illustrated in FIG. 2 is executed. That is, a persistent connection is set up with the server device.
- Step S502 the processing from Step S101 illustrated in FIG. 2 is executed. That is, a persistent connection is added to the server device. At this time, since the high-reliability interval is equal to or smaller than the extended interval, a plurality of persistent connections are set between the terminal device and the server device when the high-reliability interval is not equal to the extended interval.
- FIG. 7 is a flowchart illustrating an example of processing when a keep-alive event occurs in the server device 2.
- FIG. 8 is a flowchart illustrating an example of processing when the terminal device 1 receives a keep-alive packet.
- the operation when the keep alive event occurs in the server device 2 will be described with reference to FIGS. 7 and 8.
- the keep alive processing unit 22 receives a keep alive event. Then, the keep alive processing unit 22 instructs the persistent connection receiving unit 21 to transmit a keep alive packet using the persistent connection indicated by the connection identifier.
- the keep alive packet includes information indicating an extension interval included in the keep alive event.
- the persistent connection receiving unit 21 acquires the persistent connection indicated by the connection identifier (step S602), and transmits a keep-alive packet (step S603). At this time, if the extension interval set for the persistent connection is the same as or shorter than the connection invalidation deadline set in the middle box device 4, the keep-alive packet reaches the terminal device 1. On the other hand, when the extended interval set for the persistent connection is longer than the connection invalidation deadline set by the middle box device 4, the persistent connection is invalidated, and the keep-alive packet does not reach the terminal device 1.
- connection management unit 15 When the keep-alive packet arrives at the terminal device 1 and is received by the connection management unit 15 (step S701 in FIG. 8), the connection management unit 15 obtains a persistent identifier associated with the persistent connection (step S702). . Then, the connection management unit 15 notifies the persistent connection management unit 11 that the keepalive is received, and classifies the persistent connection as unused (step S703).
- the persistent connection management unit 11 instructs the timeout processing unit 13 to cancel the occurrence of the high-reliability interval elapsed event and the extended interval elapsed event including the connection identifier (step S704).
- the persistent connection management unit 11 confirms the mode of the duration calculation unit 12 (step S705).
- the mode held by the duration calculation unit 12 is the steady mode (“steady mode” in step S705)
- the persistent connection management unit 11 executes the processing after step S101 illustrated in FIG. That is, a persistent connection is set up with the server device.
- the persistent connection management unit 11 changes the mode of the duration calculation unit 12 to the steady mode (step S706). The process is terminated.
- the persistent connection management unit 11 sets the extension interval included in the received keepalive packet as the high reliability interval.
- the calculation unit 12 is notified (step S707).
- the duration calculation unit 12 holds the received high reliability interval. This high-reliability interval is used when the expansion interval is determined next time in steps S103 to S105 illustrated in FIG.
- the persistent connection management unit 11 and the connection management unit 15 are determined according to the reception state (for example, the change mode) of the keep alive packet when the high reliability interval has elapsed after setting the persistent connection.
- a new persistent connection designating the extension interval is set between the server apparatus 2 and the server apparatus 2. If the connection with the server device 2 is performed at a highly reliable interval, the middle box device 4 does not invalidate the persistent connection. Therefore, the connection between the terminal device 1 and the server device 2 can be maintained.
- the persistent connection management unit 11 receives a keep-alive packet based on a new persistent connection from the server device 2, the extended interval specified by the setting of the persistent connection is set as a highly reliable interval.
- the processing interval for maintaining the connection can be lengthened. That is, since the processing for maintaining the connection between both devices can be reduced, the communication load can be suppressed.
- FIG. 9 is a flowchart illustrating a processing example when an extended interval elapsed event occurs in the terminal device 1.
- step S801 When the extended interval elapsed event occurs in the terminal device 1 (step S801), that is, the timeout processing unit 13 does not receive a message using the persistent connection indicated by the connection identifier included in the extended interval elapsed event, and When the keep alive packet from the server apparatus 2 is not received before the extension interval elapses, the timeout processing unit 13 notifies the persistent connection management unit 11 of the timeout of the persistent connection indicated by the connection identifier. The persistent connection management unit 11 notifies the connection management unit 15 of the destruction of the persistent connection having the connection identifier.
- the connection management unit 15 discards the persistent connection associated with the connection identifier (step S802).
- the persistent connection management unit 11 instructs the duration calculation unit 12 to operate as the reduction mode (step S803). That is, the persistent connection management unit 11 changes the mode held by the duration calculation unit 12 to the reduction mode.
- the terminal device 1 holds the high-reliability interval and the extension interval, and specifies the extension interval to set a persistent connection with the server device 2.
- the server device 2 transmits a keep-alive packet to the terminal device 1 when the extended interval specified by the setting of the persistent connection has elapsed after the persistent connection is set with the terminal device 1.
- the terminal device 1 sets a new persistent connection that specifies an extended interval that is determined according to the reception state (for example, change mode) of the keep-alive packet when the high-reliability interval elapses after the persistent connection is set. Is set with the server device 2.
- the terminal device 1 receives a keep-alive packet based on a new persistent connection from the server device 2, the terminal device 1 sets the extended interval specified by the setting of the persistent connection as a highly reliable interval.
- the communication load for maintaining the connection can be suppressed while maintaining the connection between the devices.
- communication is performed at a highly reliable interval using any one of persistent connections set between devices. Therefore, it is possible to guarantee the arrival of packets between devices. Specifically, even if the extension interval of a certain persistent connection is set long, no response period is generated.
- the connection interval of the middle box device 4 is invalidated earlier by setting the extended interval longer. You can approach the deadline. Therefore, useless load on the network can be reduced.
- FIG. 10 is an explanatory diagram illustrating an operation example of the communication maintaining system of the present embodiment.
- the horizontal axis indicates the elapsed time
- the vertical axis indicates the order in which the persistent connection is set in the terminal device 1.
- the connection invalidation deadline of the middle box device 4 is 9 minutes, and the initial expansion interval is 2 minutes.
- the extension interval a value obtained by adding the current high-reliability interval to the extension interval when the last persistent connection is set is used.
- the difference between the extension interval and the high-reliability interval specified when setting each persistent connection is indicated by a shaded rectangle.
- the terminal device 1 sets the persistent connection 1 having the extension interval of 2 minutes with the server device 2.
- “after the passage” indicates the passage of time after the persistent connection 1 is set.
- the server device 2 After 2 minutes, the server device 2 generates a keep alive event for the persistent connection 1. Then, the keep alive packet in which the keep alive period is set to 2 minutes reaches the terminal device 1. Therefore, in the terminal device 1, the high reliability interval is set to 2 minutes. At this timing, the terminal device 1 is connected to the server device 2 using the persistent connection 2 having a high reliability interval of 2 minutes and an expansion interval of 4 minutes.
- the terminal device 1 After the elapse of 4 minutes (that is, when 2 minutes of the high-reliability interval has elapsed since the elapse of 2 minutes), the terminal device 1 generates a high-reliability interval elapse event for the persistent connection 2. Then, the terminal device 1 sets a persistent connection 3 with a high reliability interval of 2 minutes and an expansion interval of 6 minutes with the server device 2.
- the server device 2 After 6 minutes, the server device 2 generates a keep alive event for the persistent connection 2. Then, the keep alive packet in which the keep alive period is set to 4 minutes arrives at the terminal device 1. Since the extension interval of the persistent connection 2 is 4 minutes, the high reliability interval is set to 4 minutes in the terminal device 1. At this timing, the terminal device 1 is connected to the server device 2 using the persistent connection 4 having a high reliability interval of 4 minutes and an expansion interval of 10 minutes.
- the server device 2 After 10 minutes, the server device 2 generates a keep alive event for the persistent connection 3. Then, the keep alive packet in which the keep alive period is set to 6 minutes reaches the terminal device 1. Since the expansion interval of the persistent connection 3 is 6 minutes, the high reliability interval is set to 6 minutes in the terminal device 1. At this timing, the terminal device 1 is connected to the server device 2 using the persistent connection 5 having a high reliability interval of 6 minutes and an expansion interval of 16 minutes.
- the server device 2 After 16 minutes, the server device 2 generates a keep alive event for the persistent connection 4. Then, the server device 2 transmits a keep alive packet in which the keep alive period is set to 10 minutes toward the terminal device 1. However, since the connection invalidation deadline of the middle box device 4 is 9 minutes, this keep-alive packet does not reach the terminal device 1. Therefore, at this timing, the terminal device 1 generates an extended interval elapsed event for the persistent connection 4, and the duration calculation unit 12 sets the mode to be held to the reduced mode.
- the terminal device 1 After 16 minutes have elapsed, the terminal device 1 generates a highly reliable interval elapsed event for the persistent connection 5. Then, the terminal device 1 sets the persistent connection 6 with the high reliability interval of 6 minutes and the expansion interval of 11 minutes with the server device 2.
- 11 minutes of the expansion interval is obtained by adding 6 minutes of the high reliability interval to half of the value (10 minutes) obtained by subtracting 6 minutes of the high reliability interval from the previous expansion interval of 16 minutes (that is, (Previous expansion interval 16 minutes-high reliability interval 6 minutes) ⁇ 2 + high reliability interval 6 minutes) is calculated.
- the terminal device 1 After 22 minutes, the terminal device 1 generates a highly reliable interval elapsed event for the persistent connection 6. Then, the terminal device 1 sets a persistent connection 7 having a high reliability interval of 6 minutes and an expansion interval of 9 minutes with the server device 2.
- 9 minutes of the expansion interval is obtained by adding 6 minutes of the high reliability interval to half of the value (5 minutes) obtained by subtracting 6 minutes of the high reliability interval from 11 minutes that is the previous expansion interval (that is, (Previous expansion interval 11 minutes ⁇ high reliability interval 6 minutes) ⁇ 2 + high reliability interval 6 minutes) is calculated. Note that 0.5 minutes is calculated by rounding up to 1 minute.
- the server device 2 After 26 minutes, the server device 2 generates a keep alive event for the persistent connection 5. Then, the server device 2 transmits a keep alive packet in which the keep alive period is set to 16 minutes toward the terminal device 1. However, since the connection invalidation deadline of the middle box device 4 is 9 minutes, this keep-alive packet does not reach the terminal device 1. Therefore, at this timing, the terminal device 1 generates an extended interval elapsed event for the persistent connection 4. However, since the mode held by the duration calculation unit 12 is already the reduction mode, nothing is particularly performed.
- the server device 2 After 27 minutes, the server device 2 generates a keep alive event for the persistent connection 6. Then, the server device 2 transmits a keep alive packet in which the keep alive period is set to 11 minutes toward the terminal device 1. However, since the connection invalidation deadline of the middle box device 4 is 9 minutes, this keep-alive packet does not reach the terminal device 1. Therefore, at this timing, the terminal device 1 generates an extended interval elapsed event for the persistent connection 4. However, since the mode held by the duration calculation unit 12 is already the reduction mode, nothing is particularly performed.
- the terminal device 1 After 28 minutes, the terminal device 1 generates a highly reliable interval elapsed event for the persistent connection 7. Then, the terminal device 1 sets a persistent connection 8 with a high reliability interval of 6 minutes and an expansion interval of 8 minutes with the server device 2.
- 8 minutes of the expansion interval is obtained by adding 6 minutes of the high reliability interval to half of the value (3 minutes) obtained by subtracting 6 minutes of the high reliability interval from 9 minutes that is the previous expansion interval (that is, (Previous expansion interval 9 minutes ⁇ high reliability interval 6 minutes) ⁇ 2 + high reliability interval 6 minutes) is calculated. Note that 0.5 minutes is calculated by rounding up to 1 minute.
- the server device 2 After 31 minutes, the server device 2 generates a keep alive event for the persistent connection 7. Then, the keep alive packet in which the keep alive period is set to 9 minutes reaches the terminal device 1. Since the connection invalidation deadline of the middle box device 4 is 9 minutes, this keep alive packet reaches the terminal device 1. Since the extension interval of the persistent connection 7 is 9 minutes, the high reliability interval is set to 9 minutes in the terminal device 1. At this time, the terminal device 1 generates an extended interval elapsed event for the persistent connection 4, and the duration calculation unit 12 sets the held mode to the steady mode. Thereafter, the terminal device 1 operates in a state where the high reliability interval is set to 9 minutes.
- the terminal device 1 After 34 minutes have elapsed, the terminal device 1 generates a highly reliable interval elapsed event for the persistent connection 8. At this time, the mode held by the duration calculation unit 12 is a steady mode, and since the high-reliability interval of the event is 6 minutes and the current high-reliability interval is 9 minutes, nothing is performed.
- the server device 2 After 36 minutes, the server device 2 generates a keep alive event for the persistent connection 8. Then, the server device 2 transmits a keep alive packet in which the keep alive period is set to 8 minutes toward the terminal device 1. In the terminal device 1, since the mode held by the duration calculation unit 12 is the steady mode, the terminal device 1 establishes a persistent connection 9 between the server device 2 and the high-reliability interval and the extension interval of 9 minutes. Set.
- the server device 2 transmits a keep alive packet to the terminal device 1 every nine minutes, and the terminal device 1 sets a persistent connection with the server device 2 every time the keep alive packet is received.
- FIG. 11 is a block diagram showing an outline of a communication maintenance system according to the present invention.
- the communication maintenance system according to the present invention includes a terminal device 90 (for example, a terminal device) that communicates with the server device 80 using a persistent connection set between the server device 80 (for example, the server device 2) and the server device 80. 1).
- the server device 80 and the terminal device 90 each have at least one middle box device (for example, invalidating the persistent connection) when communication using the persistent connection is not performed during a keep-alive interval that is a predetermined period. Are connected to each other via a middle box device 4).
- middle box device for example, invalidating the persistent connection
- the terminal device 90 is longer than the high-reliability interval, which is the maximum period of the keep-alive interval when it can be confirmed that the persistent connection is valid, and the high-reliability interval used for confirming whether the persistent connection is valid.
- a connection management unit 91 (for example, the persistent connection management unit 11 and the connection management unit 15) that holds the expansion interval of the period and sets the persistent connection with the server device 80 by specifying the expansion interval is included.
- the server device 80 transmits a keep alive packet to the terminal device 90 when the extended interval specified by the setting of the persistent connection has elapsed since the persistent connection was set up with the terminal device 90. (For example, the persistent connection receiver 21).
- the connection management unit 91 of the terminal device 90 creates a new persistent connection that specifies an extended interval determined according to the reception state of the keep-alive packet when the high-reliability interval elapses after setting the persistent connection.
- the extended interval specified by the setting of the persistent connection is set as the high reliability interval.
- the terminal device 90 has, as a change mode indicating a method for changing the extension interval, an extension mode in which the extension interval of the newly set persistent connection is gradually increased, and a reduction mode in which the extension interval is gradually reduced.
- it may include a duration calculation unit that holds any change mode of the steady mode that does not change the extension interval and determines the extension interval based on the change mode and the high-reliability interval.
- the connection management unit 91 determines the change mode according to the reception state of the keep alive packet, and assigns a new persistent connection that specifies the extension interval determined based on the change mode and the high reliability interval to the server device 80. You may set between.
- the duration calculation unit may hold the extended mode as the change mode in the initial state.
- the connection management unit 91 changes when the duration calculation unit holds the extended mode as the change mode and does not receive a keep-alive packet based on a new persistent connection from the server device 80.
- the mode may be changed from the extended mode to the reduced mode, and a new persistent connection specifying the extended interval determined based on the changed mode and the high-reliability interval may be set between the server device 80 and the server device 80.
- connection management unit 91 when the connection management unit 91 receives a keep-alive packet based on a new persistent connection from the server device 80 in a state where the duration calculation unit holds the reduced mode as the change mode, the connection management unit 91 changes the change mode from the reduced mode.
- the mode may be changed to the steady mode, and a new persistent connection may be set between the server apparatus and the high-reliability interval set based on the extended interval specified by the setting of the persistent connection.
- the duration calculation unit determines the high-reliability interval as the extension interval, and when the change mode to be held is the extension mode, the interval indicating a period longer than the previously determined extension interval If the extension mode is determined and the change mode to be held is the reduction mode, the extension interval may be determined as an interval indicating a period shorter than the previously determined extension interval.
- FIG. 12 is a block diagram showing an outline of the terminal device according to the present invention.
- the terminal device according to the present invention is the same as the terminal device 90 illustrated in FIG.
- the communication load for maintaining the connection can be suppressed while maintaining the connection between the devices even in the communication network in which the connection between the devices is invalidated for a predetermined period.
- the communication maintenance system provides a service to a terminal device operated by a user, a server device that mediates message transmission to the terminal device, and a user who operates the terminal device by transmitting a message to the terminal device.
- You may provide the middle server apparatus which monitors, relays, and cancels communication between a terminal device and a server apparatus by another server apparatus and a firewall function or a NAT function.
- the terminal device starts setting a persistent connection with the server device when the terminal is activated, when the network device on the terminal device is activated, or when the user operates the server device.
- the maximum period that can be confirmed that the persistent connection maintained between the server and the server is valid is the high reliability interval, and the interval for confirming whether the persistent connection set with the server is valid is the extended interval.
- a persistent connection is newly established with the server device after the high-reliability interval elapses, and the maximum value of the high-reliability interval is determined.
- a keep-alive packet is received that confirms whether or not the persistent connection is valid, a new persistent connection is set up with the server device.
- the extended mode that maintains the high reliability interval and the expansion interval and gradually increases the expansion interval of the persistent connection that is newly set
- the server unit and the duration calculation unit that retains the reduced mode that gradually decreases the expansion interval or the steady mode that does not change the expansion interval and determines the expansion interval based on that mode and the high-reliability interval
- a time-out processing unit that sets a timer associated with the terminal to generate a high-reliability interval elapse event after elapse of a high-reliability interval from the current time, and an extended interval elapse event after elapse of the extended interval from the current time
- a TCP / IP connection between the terminal identifier management unit that acquires a terminal identifier for uniquely identifying the device and the server device
- the message is sent from the server device through the persistent connection between the server and the connection management unit that notifies the server device of the expansion interval when it is set, and executes the default processing.
- the server device manages a persistent connection with the terminal device, and transmits a keep alive packet to try whether or not the persistent connection is conductive, or transmits a message to the terminal device.
- the terminal device Based on the extended connection received from the persistent connection receiving unit, the terminal device, a keep alive processing unit that tries to determine whether the persistent connection is conductive after the extended interval from the current time, and a message transmission from the other server device to the terminal device.
- a message transmission unit that accepts the request and instructs the persistent connection reception unit to transmit a message to the terminal device;
- An active connection management unit that instructs the persistent connection receiving unit to transmit a message using the last-established persistent connection from the terminal device may be included.
- the terminal device of the communication maintenance system when the terminal device is activated, when the network device on the terminal device is activated, or when the user operates, the persistent connection management unit establishes the persistent connection with the server.
- Start setting inquire the duration calculation unit about the high-reliability interval and extended interval of the persistent connection, the duration calculation unit acquires the high-reliability interval held, and the current period calculation is expanded Determine whether the mode, reduced mode or steady mode.
- the expansion interval is the same as the reliable interval and is passed to the persistent connection manager, and the expansion interval calculated in the expansion mode is larger than the previously calculated expansion interval.
- the extension interval calculated in the reduced mode is calculated as a value smaller than the previously calculated extension interval, and the persistent connection management unit A unique connection identifier for management is issued, the connection identifier, the high-reliability interval, and the extended interval are passed to the timeout processing unit, and the time-out processing unit connects the connection identifier and the high-reliability interval after the high-reliability interval elapses from the current time.
- a high-reliability interval elapse event that includes a connection identifier and an extended interval elapse event that includes a connection identifier after the elapse of an extension interval from the current time, a timer attached to the terminal is set, and the persistent connection management unit sends the terminal identifier management unit to the terminal
- a terminal identifier for identifying the terminal is acquired, the connection identifier, the terminal identifier, and the extension interval are passed to the connection management unit, and the setting of the persistent connection is instructed.
- the connection management unit is set with the server device.
- the terminal device Starts a new connection setting for the server device, sets a connection with the persistent connection receiver of the server device, manages the connection in association with the connection identifier, and if there is an unused connection,
- the connection may be managed in association with the connection identifier, and a new keep alive period update notification including the terminal identifier and the extension interval may be transmitted to the persistent connection receiver of the server device through the persistent connection associated with the connection identifier.
- the server device of the communication maintenance system issues a unique connection identifier to the persistent connection when the persistent connection receiver receives the new keep-alive period update notification through the persistent connection, and the connection identifier and the persistent connection And the connection identifier and the terminal identifier included in the new keep-alive period update notification are passed to the active connection management unit, and the active connection management unit Check whether another connection identifier is stored in association with it, and if so, delete the existing association, store the terminal identifier and the new connection identifier in association with each other, and the persistent connection reception unit performs the keep-alive process. Pass the connection identifier and the extended interval included in the new keep-alive period update notification. Live processing unit, connected from the current time after a lapse of diastolic interval identifier may be set to the accompanying timer device to generate a keep-alive events including the diastolic interval.
- connection management unit when the connection management unit receives a message through a certain persistent connection, the terminal device of the communication maintenance system passes the message to the message reception unit, and the message reception unit executes processing according to the content of the message, The management unit acquires a connection identifier stored in association with the persistent connection that has received the message, notifies the persistent connection management unit that the message has been received through the persistent connection indicated by the connection identifier, and When it is marked as used and the persistent connection manager is notified of the receipt of the message, the connection identifier is passed to the timeout processing unit, and the timeout processing unit includes a reliable interval elapsed event including the passed connection identifier and Cancel the occurrence of extended interval elapsed event, default It may be set persistent connection between the server again device after elapse.
- the terminal device of the communication maintenance system causes the time-out processing unit to indicate the elapse of the reliable interval of the persistent connection indicated by the connection identifier of the highly reliable interval elapse event to the persistent connection management unit.
- the persistent connection management unit confirms the current operation mode of the duration calculation unit, and if the operation mode of the duration calculation unit is in a steady state, obtains the current high-reliability interval from the duration calculation unit, Cancels the occurrence of the extended interval elapsed event of the persistent connection for the timeout processing unit, and terminates the process if the high-reliability interval included in the high-reliability interval elapse event is shorter than the current high-reliability interval, and the high-reliability interval elapses If the high-confidence interval included in the event is the same or longer than the current high-reliability interval, or the operation mode of the duration calculation unit is other than steady state If it may be added persistent connection with the server device.
- the keep alive processing unit when a keep alive event occurs, is included in the keep alive event with respect to the continuous connection indicated by the connection identifier of the keep alive event with respect to the continuous connection receiving unit. It may be instructed to transmit a keep alive packet having the extended interval as a content, and the persistent connection receiving unit may acquire the persistent connection indicated by the connection identifier and transmit the keep alive packet.
- the connection management unit acquires the persistent identifier associated with the persistent connection, and receives the keep alive from the persistent connection management unit. , Mark the persistent connection as unused, and the persistent connection manager cancels the occurrence of the reliable interval elapsed event and extended interval elapsed event including the connection identifier to the timeout processing unit, and calculates the duration.
- duration calculator may hold a reliable interval received.
- the terminal device of the communication maintenance system notifies the persistent connection manager of the timeout of the persistent connection indicated by the connection identifier to the persistent connection manager, and the persistent connection manager Notify the connection manager of the destruction of the persistent connection with the connection identifier, the connection manager discards the persistent connection associated with the connection identifier, and the persistent connection manager reduces the duration calculation unit It may be instructed to operate as a mode.
- the present invention is preferably applied to a communication maintenance system that maintains communication between devices.
Landscapes
- Health & Medical Sciences (AREA)
- Cardiology (AREA)
- General Health & Medical Sciences (AREA)
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
A connection management unit (91) sets a sustained connection with a server device (80) by designating an extension interval. A packet transmission unit (81) transmits a keep-alive packet to a terminal device (90) upon the elapse of the extension interval designated by the setting of the sustained connection. The connection management unit (91), upon the elapse of a high-reliability interval since the setting of the sustained connection, sets a new sustained connection with the server device (80) designating an extension interval determined in accordance with the reception state of the keep-alive packet, and, upon reception of the keep-alive packet based on the new sustained connection from the server device (80), sets the extension interval designated by the setting of the sustained connection as the high-reliability interval.
Description
本発明は、装置間の通信を維持する通信維持システム、端末装置、通信維持方法、サーバ装置との接続維持方法および接続維持プログラムに関する。
The present invention relates to a communication maintenance system that maintains communication between devices, a terminal device, a communication maintenance method, a connection maintenance method with a server device, and a connection maintenance program.
携帯端末の発展に伴い、サーバ装置とスマートフォンなどの携帯端末との連携システムが利用されるようになってきている。例えば、スマートフォンなど携帯端末上で動作する任意のアプリケーションと、ネットワーク上に配置されたサーバ装置との間で通信接続を実施する。その接続を利用して、サーバ装置から携帯端末に対して任意の処理を実行させる。
With the development of mobile terminals, cooperative systems between server devices and mobile terminals such as smartphones have come to be used. For example, communication connection is performed between an arbitrary application that operates on a mobile terminal such as a smartphone and a server device arranged on the network. Using the connection, the server device causes the mobile terminal to execute arbitrary processing.
このようなサーバ装置と携帯端末との間の通信には、一般的にTCP/IP(Transmission Control Protocol/Internet Protocol)と呼ばれるコネクション型の接続プロトコルが用いられ、この接続プロトコルを用いて送受信される場合が多い。
For such communication between the server device and the portable terminal, a connection type connection protocol called TCP / IP (Transmission Control Protocol / Internet Protocol) is generally used, and transmission / reception is performed using this connection protocol. There are many cases.
このTCP/IPでは、接続を希望する一方の装置が、他方の装置に向かって接続開始要求を意味するパケットを送信し、接続開始要求パケットを受け取った装置が送信元の端末に接続受け入れ回答を意味するパケットを返信する。この手順により、互いの装置で接続開始要求に関連付けられたコネクションが設定される。以後、このコネクションを用いてパケットを送受信しあうことで、通信が実行される。
In this TCP / IP, one device that wishes to connect transmits a packet indicating a connection start request to the other device, and the device that receives the connection start request packet sends a connection acceptance response to the transmission source terminal. Return the meaning packet. By this procedure, the connection associated with the connection start request is set in each device. Thereafter, communication is executed by transmitting and receiving packets using this connection.
また、主にセキュリティ上の問題により、サーバと携帯端末とを結ぶネットワーク上には、通信を中継、遮断するミドルボックスと総称される装置が設置されている場合が多い。ミドルボックスとして、例えば、NAT(Network Address Translation)やファイアーウォール、プロキシサーバなどが挙げられる。
Also, mainly due to security problems, there are many cases where a device collectively called a middle box for relaying or blocking communication is installed on a network connecting a server and a mobile terminal. Examples of the middle box include a NAT (Network Address Translation), a firewall, and a proxy server.
ミドルボックスは、主にネットワーク事業者、またはユーザが自ら付与したプライベートなIPアドレスを持つ端末と、インターネットなどグローバルなネットワークでも利用可能なグローバルIPアドレスを持つサーバ装置との間で送受信されるパケットのIPアドレスを相互に変換する。このような変換により、プライベートなネットワークに接続された携帯端末が、インターネットなどのグローバルネットワークに接続されたサーバ装置と通信できるようになる。
The middle box is mainly used to send and receive packets between a terminal having a private IP address assigned by a network operator or user and a server device having a global IP address that can also be used in a global network such as the Internet. Convert IP addresses to each other. Such conversion enables a mobile terminal connected to a private network to communicate with a server device connected to a global network such as the Internet.
通常のミドルボックスは、グローバルネットワーク上のサーバからプライベートネットワーク上の端末へのTCP/IPにおける接続開始要求パケットが送信された場合、特別な条件設定が事前にされていない限り、そのパケットを破棄し、装置間のコネクションの設定を許可しない。
When a connection start request packet in TCP / IP is sent from a server on the global network to a terminal on the private network, a normal middle box discards the packet unless special conditions are set in advance. Do not allow connection between devices.
一方、ミドルボックスは、プライベートネットワーク上の端末からグローバルネットワーク上のサーバ装置に対する接続開始要求パケットを受け取ると、その接続開始要求パケットをサーバ装置に対して中継する。また、ミドルボックスは、サーバ装置から接続受け入れ回答パケットを受け取ると、その回答パケットをプライベートネットワーク上の端末に中継する。このようにして、プライベートネットワーク上の端末と、グローバルネットワーク上のサーバ装置との間で、接続開始要求に関連付けられたコネクションの設定が許可される。
On the other hand, when the middle box receives a connection start request packet for a server device on the global network from a terminal on the private network, the middle box relays the connection start request packet to the server device. Further, when the middle box receives the connection acceptance reply packet from the server device, the middle box relays the reply packet to the terminal on the private network. In this way, the setting of the connection associated with the connection start request is permitted between the terminal on the private network and the server device on the global network.
以後、ミドルボックスは、許可されたコネクションを用いてサーバ装置、または、端末から送信されたパケットに対しては、そのパケットを継続して中継する。
Thereafter, the middle box continuously relays the packet transmitted from the server device or the terminal using the permitted connection.
また、ミドルボックスは、通常、コネクション上のパケットの送受信を監視する。装置間で一定期間(以下、コネクション無効化期限と記すこともある。)パケットの送受信が実行されないと、ミドルボックスは、コネクションの許可設定を無効にし、以後そのコネクションを用いて送受信されたパケットを破棄する。
Also, the middle box usually monitors the transmission and reception of packets on the connection. If transmission / reception of a packet is not executed between devices for a certain period of time (hereinafter also referred to as a connection invalidation deadline), the middle box invalidates the connection permission setting, and thereafter transmits packets transmitted / received using that connection. Discard.
特許文献1には、このようなミドルボックスが介在する通信システムが記載されている。特許文献1に記載された通信システムでは、グローバルネットワーク上のサーバ装置から任意のタイミングでプライベートネットワーク上の端末にパケットを送信するため、プライベートネットワーク上の端末からグローバルネットワーク上のサーバに対してコネクションが設定される。以後、その持続コネクションがミドルボックスによって無効にされないように、所定期間(以降、キープアライブ間隔と記すこともある。)ごとにパケットを装置間で送受信することで、サーバ装置と端末との間のコネクションが維持される。
Patent Document 1 describes a communication system in which such a middle box is interposed. In the communication system described in Patent Document 1, since a packet is transmitted from a server device on the global network to a terminal on the private network at an arbitrary timing, a connection is established from the terminal on the private network to the server on the global network. Is set. Thereafter, the packet is transmitted and received between the devices every predetermined period (hereinafter referred to as keep alive interval) so that the persistent connection is not invalidated by the middle box. Connection is maintained.
特許文献1に記載された通信システムでは、持続コネクションが設定された後、キープアライブ間隔経過後にパケットを送受信して持続コネクションが無効にされたか否かが判別される。持続コネクションが有効な場合、キープアライブ間隔を増加させ、持続コネクションが無効にされた場合、キープアライブ間隔を減少させた上で持続コネクションが再度設定される。
In the communication system described in Patent Document 1, it is determined whether or not the persistent connection has been invalidated by transmitting and receiving packets after the keep alive interval has elapsed after the persistent connection is set. When the persistent connection is valid, the keep alive interval is increased. When the persistent connection is invalidated, the persistent connection is set again after decreasing the keep alive interval.
しかし、特許文献1に記載された方法を用いた場合、キープアライブ間隔がコネクション無効化期限よりも長い場合、「キープアライブ間隔-コネクション無効化期限」により算出される期間(以下、無応答期間と記す。)は、持続コネクションが無効にされた状態になる。そのため、この間、サーバは、端末に対してパケットを送信できない。
However, when the method described in Patent Document 1 is used, if the keep alive interval is longer than the connection invalidation deadline, a period calculated by “keep alive interval−connection invalidation deadline” (hereinafter referred to as a no-response period). Will be in a state where the persistent connection is disabled. Therefore, during this time, the server cannot transmit a packet to the terminal.
また、持続コネクションが有効であった時のn回目(n≧1)のキープアライブ間隔をKnとし、次に増加させるキープアライブ間隔の増分をdとし、コネクション無効化期限をTとした場合、無応答期間は、(Kn+d)-Tで算出される。この場合、最大の無応答期間は、Kn=Tの場合の期間であり、すなわち、その期間はdになる。したがって、無応答期間を短くするためには、キープアライブ間隔の増分dを小さくすればよい。
Also, when the n-th (n ≧ 1) keep-alive interval when the persistent connection is valid is Kn, the increment of the keep-alive interval to be increased next is d, and the connection invalidation deadline is T, The response period is calculated by (Kn + d) −T. In this case, the maximum no-response period is a period when Kn = T, that is, the period is d. Therefore, in order to shorten the non-response period, the increment d of the keep alive interval may be reduced.
しかし、K1<Tを満たし、かつK1がTよりもかなり小さい値の場合、KnがTになかなか到達せず、短い間隔でパケットを送受信し続けるため、ネットワークに無駄な負荷をかけることになる。
However, when K1 <T is satisfied and K1 is a value much smaller than T, Kn does not reach T easily, and packets are continuously transmitted and received at a short interval, which places a wasteful load on the network.
そこで、本発明は、所定期間で装置間のコネクションが無効になる通信ネットワークにおいても、装置間のコネクションを維持しつつ、コネクションを維持するための通信負荷を抑制できる通信維持システム、端末装置、通信維持方法、サーバ装置との接続維持方法および接続維持プログラムを提供することを目的とする。
Therefore, the present invention provides a communication maintenance system, a terminal device, and a communication that can suppress a communication load for maintaining a connection while maintaining the connection between devices even in a communication network in which the connection between the devices becomes invalid for a predetermined period. It is an object to provide a maintenance method, a connection maintenance method with a server device, and a connection maintenance program.
本発明による通信維持システムは、サーバ装置と、サーバ装置との間に設定される持続コネクションを用いてサーバ装置と通信を行う端末装置とを備え、サーバ装置と端末装置が、持続コネクションを用いた通信が予め定められた期間であるキープアライブ間隔行われなかった場合に、その持続コネクションを無効にする少なくとも1つ以上のミドルボックス装置を介して相互に接続され、端末装置が、持続コネクションが有効であると確認できた場合のキープアライブ間隔のうち最大の期間である高信頼間隔と、持続コネクションが有効か否かの確認に用いられる高信頼間隔よりも長い期間の拡張間隔を保持し、拡張間隔を指定してサーバ装置との持続コネクションを設定する接続管理部を含み、サーバ装置が、端末装置との間に持続コネクションが設定されてからその持続コネクションの設定で指定された拡張間隔経過した時点で、端末装置にキープアライブパケットを送信するパケット送信部を含み、端末装置の接続管理部が、持続コネクションを設定してから高信頼間隔が経過した時点で、キープアライブパケットの受信状態に応じて決定される拡張間隔を指定した新たな持続コネクションをサーバ装置との間に設定し、その新たな持続コネクションに基づくキープアライブパケットをサーバ装置から受信したときに、その持続コネクションの設定により指定された拡張間隔を高信頼間隔に設定することを特徴とする。
A communication maintenance system according to the present invention includes a server device and a terminal device that communicates with the server device using a persistent connection set between the server device, and the server device and the terminal device use the persistent connection. When communication is not performed during a predetermined period of keep-alive interval, the terminals are connected to each other via at least one middle box device that invalidates the persistent connection, and the persistent connection is valid. The high-reliability interval, which is the maximum period of the keep-alive interval when it can be confirmed, and the extended interval with a longer period than the high-reliability interval used to check whether the persistent connection is valid or not are extended. A connection management unit is provided for setting a persistent connection with the server device by specifying an interval. Including a packet transmission unit that transmits keep-alive packets to the terminal device when the extended interval specified in the setting of the persistent connection has elapsed since the session was set, and the connection management unit of the terminal device sets the persistent connection. When the high-reliability interval elapses, a new persistent connection that specifies an extended interval determined according to the keep-alive packet reception status is set with the server device, and the keep based on the new persistent connection is set. When the alive packet is received from the server device, the extended interval designated by the setting of the persistent connection is set as a high-reliability interval.
本発明による端末装置は、サーバ装置との間に設定される持続コネクションを用いてそのサーバ装置と通信を行う端末装置であって、サーバ装置とは、持続コネクションを用いた通信が予め定められた期間であるキープアライブ間隔行われなかった場合に、その持続コネクションを無効にする少なくとも1つ以上のミドルボックス装置を介して接続され、持続コネクションが有効であると確認できた場合のキープアライブ間隔のうち最大の期間である高信頼間隔と、持続コネクションが有効か否かの確認に用いられる高信頼間隔よりも長い期間の拡張間隔を保持し、拡張間隔を指定してサーバ装置との持続コネクションを設定する接続管理部を備え、接続管理部が、持続コネクションを設定してから高信頼間隔が経過した時点で、サーバ装置との間に持続コネクションが設定されてからその持続コネクションの設定で指定された拡張間隔経過したときにサーバ装置から送信されるキープアライブパケットの受信状態に応じて決定される拡張間隔を指定した新たな持続コネクションをサーバ装置との間に設定し、その新たな持続コネクションに基づくキープアライブパケットをサーバ装置から受信したときに、その持続コネクションの設定により指定された拡張間隔を高信頼間隔に設定することを特徴とする。
The terminal device according to the present invention is a terminal device that communicates with the server device using a persistent connection set up with the server device, and communication with the server device using the persistent connection is predetermined. If the keep alive interval is not performed, it is connected via at least one middlebox device that invalidates the persistent connection, and the keep alive interval when it is confirmed that the persistent connection is valid. The maximum reliable period and the extended interval longer than the reliable interval used to check whether the persistent connection is valid are retained, and the extended interval is specified to establish a persistent connection with the server device. A connection management unit is provided, and when the high reliability interval elapses after the connection management unit sets a persistent connection, A new extension interval that is determined according to the reception status of the keep-alive packet sent from the server device when the extension interval specified in the setting of the persistent connection elapses after a persistent connection is set between When a persistent connection is set with the server device and a keep-alive packet based on the new persistent connection is received from the server device, the extended interval specified by the setting of the persistent connection is set as a reliable interval. It is characterized by that.
本発明による通信維持方法は、サーバ装置との間に設定される持続コネクションを用いてそのサーバ装置と通信を行い、そのサーバ装置とは、持続コネクションを用いた通信が予め定められた期間であるキープアライブ間隔行われなかった場合に、その持続コネクションを無効にする少なくとも1つ以上のミドルボックス装置を介して接続される端末装置が、持続コネクションが有効であると確認できた場合のキープアライブ間隔のうち最大の期間である高信頼間隔と、持続コネクションが有効か否かの確認に用いられる高信頼間隔よりも長い期間の拡張間隔を保持し、端末装置が、拡張間隔を指定してサーバ装置との持続コネクションを設定し、サーバ装置が、端末装置との間に持続コネクションが設定されてからその持続コネクションの設定で指定された拡張間隔経過した時点で、端末装置にキープアライブパケットを送信し、端末装置が、持続コネクションを設定してから高信頼間隔が経過した時点で、キープアライブパケットの受信状態に応じて決定される拡張間隔を指定した新たな持続コネクションをサーバ装置との間に設定し、端末装置が、新たな持続コネクションに基づくキープアライブパケットをサーバ装置から受信したときに、その持続コネクションの設定により指定された拡張間隔を高信頼間隔に設定することを特徴とする。
The communication maintenance method according to the present invention communicates with a server device using a persistent connection established between the server device and the server device for a predetermined period of communication using the persistent connection. When the keep alive interval is not performed, the keep alive interval when the terminal device connected via at least one middle box device that invalidates the persistent connection can confirm that the persistent connection is valid. Among these, the high-reliability interval that is the maximum period, and the extended interval that is longer than the high-reliability interval that is used to check whether the persistent connection is valid or not are retained. The persistent connection is established after the server device establishes a persistent connection with the terminal device. When the extended interval specified in the setting elapses, a keep-alive packet is transmitted to the terminal device. When the high-reliability interval elapses after the terminal device establishes a persistent connection, it depends on the reception status of the keep-alive packet. When the terminal device receives a keep-alive packet based on the new persistent connection from the server device, a new persistent connection that specifies the extended interval determined in this way is set with the server device. The extended interval specified by the step is set to a highly reliable interval.
本発明によるサーバ装置との接続維持方法は、サーバ装置との間に設定される持続コネクションを用いてそのサーバ装置と通信を行い、そのサーバ装置とは、持続コネクションを用いた通信が予め定められた期間であるキープアライブ間隔行われなかった場合に、その持続コネクションを無効にする少なくとも1つ以上のミドルボックス装置を介して接続される端末装置が、持続コネクションが有効であると確認できた場合のキープアライブ間隔のうち最大の期間である高信頼間隔と、持続コネクションが有効か否かの確認に用いられる高信頼間隔よりも長い期間の拡張間隔を保持し、端末装置が、拡張間隔を指定してサーバ装置との持続コネクションを設定し、端末装置が、持続コネクションを設定してから高信頼間隔が経過した時点で、サーバ装置との間に持続コネクションが設定されてからその持続コネクションの設定で指定された拡張間隔経過したときにサーバ装置から送信されるキープアライブパケットの受信状態に応じて決定される拡張間隔を指定した新たな持続コネクションをサーバ装置との間に設定し、端末装置が、新たな持続コネクションに基づくキープアライブパケットをサーバ装置から受信したときに、その持続コネクションの設定により指定された拡張間隔を高信頼間隔に設定することを特徴とする。
The method for maintaining a connection with a server device according to the present invention communicates with the server device using a persistent connection set up with the server device, and communication using the persistent connection is predetermined with the server device. If the terminal device connected via at least one middlebox device that invalidates the persistent connection can be confirmed that the persistent connection is valid when the keep alive interval is not performed. The high-reliability interval, which is the maximum period of the keep-alive interval, and the extended interval longer than the high-reliability interval used to check whether the persistent connection is valid are retained, and the terminal device specifies the extended interval. To establish a persistent connection with the server device, and when the high reliability interval has elapsed since the terminal device established the persistent connection. Specify the extension interval that is determined according to the reception status of the keep-alive packet sent from the server device when the extension interval specified in the setting of the persistent connection has elapsed since the persistent connection was set up with the server device. When the terminal device receives a keep-alive packet based on the new persistent connection from the server device, the extended interval specified by the setting of the persistent connection is increased. The confidence interval is set.
本発明による接続維持プログラムは、サーバ装置との間に設定される持続コネクションを用いてそのサーバ装置と通信を行い、そのサーバ装置とは、持続コネクションを用いた通信が予め定められた期間であるキープアライブ間隔行われなかった場合に、その持続コネクションを無効にする少なくとも1つ以上のミドルボックス装置を介して接続されるコンピュータに適用される接続維持プログラムであって、コンピュータに、持続コネクションが有効であると確認できた場合のキープアライブ間隔のうち最大の期間である高信頼間隔と、持続コネクションが有効か否かの確認に用いられる高信頼間隔よりも長い期間の拡張間隔を保持し、拡張間隔を指定してサーバ装置との持続コネクションを設定する接続管理処理を実行させ、接続管理処理で、持続コネクションを設定してから高信頼間隔が経過した時点で、サーバ装置との間に持続コネクションが設定されてからその持続コネクションの設定で指定された拡張間隔経過したときにサーバ装置から送信されるキープアライブパケットの受信状態に応じて決定される拡張間隔を指定した新たな持続コネクションをサーバ装置との間に設定させ、その新たな持続コネクションに基づくキープアライブパケットをサーバ装置から受信したときに、その持続コネクションの設定により指定された拡張間隔を高信頼間隔に設定させることを特徴とする。
The connection maintenance program according to the present invention communicates with a server device using a persistent connection set up with the server device, and the server device has a predetermined period of communication using the persistent connection. A connection maintenance program applied to a computer connected via at least one middlebox device that invalidates the persistent connection when the keep alive interval is not performed, and the persistent connection is valid for the computer. The high-reliability interval, which is the maximum period of the keep-alive interval when it can be confirmed, and the extended interval with a longer period than the high-reliability interval used to check whether the persistent connection is valid or not are extended. Connection management is executed by specifying the interval and executing connection management processing to set up a persistent connection with the server device. Therefore, when a high-reliability interval elapses after setting a persistent connection, when the extended interval specified in the setting of the persistent connection elapses after the persistent connection is set with the server device, A new persistent connection specifying an extension interval determined according to the reception state of the keep-alive packet to be transmitted is set between the server apparatus and the keep-alive packet based on the new persistent connection is received from the server apparatus. In some cases, the extended interval designated by the setting of the persistent connection is set to a highly reliable interval.
本発明によれば、所定期間で装置間のコネクションが無効になる通信ネットワークにおいても、装置間のコネクションを維持しつつ、コネクションを維持するための通信負荷を抑制できる。
According to the present invention, it is possible to suppress a communication load for maintaining a connection while maintaining a connection between devices even in a communication network in which a connection between devices is invalidated during a predetermined period.
以下、本発明の実施形態を図面を参照して説明する。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
図1は、本発明による通信維持システムの一実施形態を示すブロック図である。本実施形態の通信維持システムは、端末装置1と、サーバ装置2とを備えている。端末装置1は、例えば、ユーザによって操作される。また、サーバ装置2は、他サーバ装置3に接続され、他サーバ装置3が端末装置1に対して送信するメッセージを仲介する。他サーバ装置3は、端末装置1に対してメッセージを送信することにより、端末装置1を操作するユーザに対してサービスを提供する。
FIG. 1 is a block diagram showing an embodiment of a communication maintenance system according to the present invention. The communication maintenance system of this embodiment includes a terminal device 1 and a server device 2. The terminal device 1 is operated by a user, for example. The server device 2 is connected to the other server device 3 and mediates a message transmitted from the other server device 3 to the terminal device 1. The other server device 3 provides a service to a user who operates the terminal device 1 by transmitting a message to the terminal device 1.
端末装置1とサーバ装置2との間には、通信ネットワークを介して、ミドルボックス装置4が接続される。ミドルボックス装置4は、ファイアーウォール機能やNAT機能により、端末装置1とサーバ装置2との間の通信を監視したり中継したりする。なお、図1では、端末装置1とサーバ装置2との間にミドルボックスが1台接続されている場合を例示しているが、ミドルボックス装置4の台数は、1台に限定されず、2台以上であってもよい。
The middle box device 4 is connected between the terminal device 1 and the server device 2 via a communication network. The middle box device 4 monitors and relays communication between the terminal device 1 and the server device 2 by a firewall function or a NAT function. 1 illustrates a case where one middle box is connected between the terminal device 1 and the server device 2. However, the number of middle box devices 4 is not limited to one. It may be more than one.
また、ミドルボックス装置4は、端末装置1とサーバ装置2との間のTCP/IPコネクション上でパケットが送受信されているかを監視する。コネクション無効化期限の間パケットの送受信が実行されないと、ミドルボックス装置4は、コネクションの許可設定を無効にし、以後、そのコネクションを用いて送受信されたパケットを破棄する。すなわち、ミドルボックス装置4は、端末装置1とサーバ装置2との間に設定されるコネクションを用いた通信が所定期間行われなかった場合に、そのコネクションを無効化する。
Further, the middle box device 4 monitors whether a packet is transmitted / received over a TCP / IP connection between the terminal device 1 and the server device 2. If no packet transmission / reception is executed during the connection invalidation period, the middle box device 4 invalidates the connection permission setting, and thereafter discards the packet transmitted / received using the connection. That is, the middle box device 4 invalidates the connection when communication using the connection set between the terminal device 1 and the server device 2 is not performed for a predetermined period.
端末装置1は、持続接続管理部11と、持続期間計算部12と、タイムアウト処理部13と、端末識別子管理部14と、コネクション管理部15と、メッセージ受信部16と、タイマ17とを含む。
The terminal device 1 includes a persistent connection management unit 11, a duration calculation unit 12, a timeout processing unit 13, a terminal identifier management unit 14, a connection management unit 15, a message reception unit 16, and a timer 17.
持続接続管理部11は、例えば、端末装置1が起動した時点、端末装置1に含まれるネットワーク装置(図示せず)が起動した時点、または、ユーザが端末装置1を操作した時点で、サーバ装置2との持続コネクションの設定を開始する。持続接続管理部11は、サーバ装置2との間で維持されるコネクション(持続コネクション)が有効であると確認できた期間のうち最大の期間を高信頼間隔として保持する。また、持続接続管理部11は、サーバ装置2との間で次回設定する持続コネクションが有効かどうかを確認する間隔を拡張間隔として保持する。
For example, the persistent connection management unit 11 is configured such that when the terminal device 1 is activated, when a network device (not shown) included in the terminal device 1 is activated, or when a user operates the terminal device 1, the server device 2. Setting up a persistent connection with 2. The persistent connection management unit 11 holds the maximum period among the periods in which it is confirmed that the connection (sustained connection) maintained with the server device 2 is valid as a highly reliable interval. Further, the persistent connection management unit 11 holds an interval for confirming whether or not the persistent connection set next time with the server device 2 is valid as an extended interval.
ここで、ミドルボックス装置4によって無効にされない期間がキープアライブ間隔であることから、高信頼間隔とは、持続コネクションが有効であると確認できた場合のキープアライブ間隔のうち最大の期間ということができる。また、拡張間隔とは、増加させるキープアライブ間隔の差分と高信頼間隔とを足した期間ということができる。言い換えると、拡張間隔とは、高信頼間隔に所定の期間だけ増加させた期間を意味する。
Here, since the period that is not invalidated by the middle box device 4 is the keep-alive interval, the high-reliability interval is the maximum period of the keep-alive interval when it can be confirmed that the persistent connection is valid. it can. The expansion interval can be said to be a period obtained by adding a difference in keep alive interval to be increased and a highly reliable interval. In other words, the expansion interval means a period increased by a predetermined period to the high reliability interval.
この拡張間隔は、決定された高信頼間隔がさらに拡張できるか否か判断するために設定される値である。例えば、ある持続コネクションについて高信頼間隔が決定された時点で、この高信頼間隔を拡張した拡張間隔を決定し、この拡張間隔が指定された持続コネクションを新たに装置間で設定する。この拡張間隔が経過したタイミングで一方の装置からもう一方の装置に対してキープアライブとしてパケットを送信し、このパケットが到達すればキープアライブの高信頼間隔が拡張できることになる。
This extension interval is a value set to determine whether or not the determined high-reliability interval can be further extended. For example, when a high-reliability interval is determined for a certain persistent connection, an extended interval obtained by extending the high-reliability interval is determined, and a continuous connection with the specified extended interval is newly set between devices. A packet is transmitted as keep-alive from one device to the other device at the timing when this expansion interval elapses. When this packet arrives, the highly reliable keep-alive interval can be expanded.
なお、高信頼間隔および拡張間隔は、持続接続管理部11によって保持されていてもよく、後述する持続期間計算部12によって保持されていてもよい。
Note that the high-reliability interval and the extension interval may be held by the persistent connection management unit 11 or may be held by the duration calculation unit 12 described later.
また、持続接続管理部11は、高信頼間隔の最大値が定まっていない場合、高信頼間隔経過後に、サーバ装置2との間に新たに持続コネクションを設定する。一方、高信頼間隔の最大値が定まった場合、持続接続管理部11は、持続コネクションが有効かどうかを確認するパケット(以下、キープアライブパケットと記す。)をサーバ装置2から受信した際、サーバ装置2との間に新たに持続コネクションを設定する。なお、高信頼区間の最大値が定まったか否かは、後述する持続期間計算部12が保持する変更モードに基づいて判断される。このようにして、持続接続管理部11は、サーバ装置2との間で持続コネクションを維持し続ける。
In addition, the persistent connection management unit 11 sets a new persistent connection with the server device 2 after the high reliability interval has elapsed when the maximum value of the high reliability interval has not been determined. On the other hand, when the maximum value of the high-reliability interval is determined, the persistent connection management unit 11 receives a packet from the server device 2 that confirms whether the persistent connection is valid (hereinafter referred to as a keep alive packet). A new persistent connection is set up with the device 2. Note that whether or not the maximum value of the high confidence interval has been determined is determined based on a change mode held by the duration calculation unit 12 described later. In this way, the persistent connection management unit 11 continues to maintain a persistent connection with the server device 2.
持続期間計算部12は、拡張間隔を決定する。持続期間計算部12は、3つの状態(拡大モード、縮小モードおよび定常モード)のうち、いずれかの状態を変更モードとして保持する。拡大モードは、高信頼間隔及び拡張間隔を保持し、新しく設定する持続コネクションの拡張間隔を徐々に増加させていくことを示すモードである。縮小モードは、新しく設定する持続コネクションの拡張間隔を徐々に減少させていくことを示すモードである。定常モードは、拡張間隔を変化させないモードである。持続期間計算部12が変更モードとして定常モードを保持している状態が、高信頼間隔の最大値が定まった場合を示す。持続期間計算部12は、これらのモードと高信頼間隔とを基に拡張間隔を決定する。なお、拡張間隔の決定方法は後述する。
The duration calculation unit 12 determines the extension interval. The duration calculation unit 12 holds one of the three states (enlargement mode, reduction mode, and steady mode) as the change mode. The expansion mode is a mode that maintains the high reliability interval and the expansion interval and gradually increases the expansion interval of the newly set persistent connection. The reduction mode is a mode indicating that the extension interval of a newly established persistent connection is gradually reduced. The steady mode is a mode in which the expansion interval is not changed. The state in which the duration calculation unit 12 holds the steady mode as the change mode indicates a case where the maximum value of the high reliability interval is determined. The duration calculation unit 12 determines the expansion interval based on these modes and the high reliability interval. A method for determining the expansion interval will be described later.
タイムアウト処理部13は、2種類のイベントを発生させるための設定を端末装置1付属のタイマ17に設定する。第1のイベントは、サーバ装置2との間で持続コネクションを設定する際に、現時点から高信頼間隔経過後に発生させる高信頼間隔経過イベントである。第2のイベントは、現時点から拡張間隔経過後に発生させる拡張間隔経過イベントである。
The timeout processing unit 13 sets a setting for generating two types of events in the timer 17 attached to the terminal device 1. The first event is a high-reliability interval elapsed event that occurs after a high-reliability interval elapses from the current time when setting a persistent connection with the server device 2. The second event is an extended interval elapsed event that occurs after the extended interval has elapsed since the present time.
端末識別子管理部14は、端末装置1を一意に識別するための端末識別子を取得する。
The terminal identifier management unit 14 acquires a terminal identifier for uniquely identifying the terminal device 1.
コネクション管理部15は、サーバ装置2との間のTCP/IPコネクションを持続コネクションとして設定する。また、コネクション管理部15は、持続コネクションを設定した際、サーバ装置2に対して拡張間隔を通知する。
The connection management unit 15 sets a TCP / IP connection with the server device 2 as a persistent connection. Further, the connection management unit 15 notifies the expansion interval to the server device 2 when the persistent connection is set.
メッセージ受信部16は、サーバ装置2との間の持続コネクションを通して、サーバ装置2から送信されたメッセージを受信し、既定の処理を実行する。
The message receiving unit 16 receives a message transmitted from the server device 2 through a persistent connection with the server device 2, and executes a predetermined process.
持続接続管理部11と、持続期間計算部12と、タイムアウト処理部13と、端末識別子管理部14と、コネクション管理部15と、メッセージ受信部16とは、プログラム(通信維持プログラム)に従って動作するコンピュータのCPUによって実現される。例えば、プログラムは、端末装置1の記憶部(図示せず)に記憶され、CPUは、そのプログラムを読み込み、プログラムに従って、持続接続管理部11、持続期間計算部12、タイムアウト処理部13、端末識別子管理部14、コネクション管理部15およびメッセージ受信部16として動作してもよい。
The persistent connection manager 11, the duration calculator 12, the timeout processor 13, the terminal identifier manager 14, the connection manager 15, and the message receiver 16 are computers that operate according to a program (communication maintenance program). This is realized by the CPU. For example, the program is stored in a storage unit (not shown) of the terminal device 1, and the CPU reads the program, and according to the program, the persistent connection management unit 11, the duration calculation unit 12, the timeout processing unit 13, the terminal identifier The management unit 14, the connection management unit 15, and the message reception unit 16 may be operated.
また、持続接続管理部11と、持続期間計算部12と、タイムアウト処理部13と、端末識別子管理部14と、コネクション管理部15と、メッセージ受信部16とは、それぞれが専用のハードウェアで実現されていてもよい。
In addition, the persistent connection management unit 11, the duration calculation unit 12, the timeout processing unit 13, the terminal identifier management unit 14, the connection management unit 15, and the message reception unit 16 are each realized by dedicated hardware. May be.
サーバ装置2は、持続接続受信部21と、キープアライブ処理部22と、メッセージ送信部23と、活性接続管理部24と、タイマ25とを含む。
The server device 2 includes a persistent connection receiving unit 21, a keep alive processing unit 22, a message transmitting unit 23, an active connection managing unit 24, and a timer 25.
持続接続受信部21は、端末装置1との間で持続コネクションを管理する。具体的には、持続接続受信部21は、端末装置1に対して、持続コネクションが導通しているかどうかを試行するためのキープアライブパケットを送信したり、メッセージを送信したりする。
The persistent connection receiving unit 21 manages a persistent connection with the terminal device 1. Specifically, the persistent connection receiving unit 21 transmits, to the terminal device 1, a keep alive packet for trying to determine whether the persistent connection is conductive or transmits a message.
キープアライブ処理部22は、端末装置1から送信された拡張間隔に基づき、現時点から拡張間隔経過後に持続コネクションが導通しているかどうかを試行する。具体的には、キープアライブ処理部22は、持続コネクションが設定されると、その時点から持続コネクションが設定されたときに通知される拡張間隔の経過後に、端末装置1とサーバ装置2との間の導通を確認するイベント(以下、キープアライブイベントと記す。)を発生させる。このとき、キープアライブ処理部22は、端末装置1とサーバ装置2との間の導通の確認に用いられるパケット(キープアライブパケット)を端末装置1に送信する。
The keep alive processing unit 22 tries based on the extension interval transmitted from the terminal device 1 whether the persistent connection is conductive after the extension interval has elapsed since the present time. Specifically, when a persistent connection is set, the keep alive processing unit 22 performs a connection between the terminal device 1 and the server device 2 after the extended interval notified when the persistent connection is set from that point. An event (hereinafter referred to as a keep alive event) for confirming the continuity of is generated. At this time, the keep alive processing unit 22 transmits a packet (keep alive packet) used for confirmation of continuity between the terminal device 1 and the server device 2 to the terminal device 1.
メッセージ送信部23は、端末装置1に対する他サーバ装置3からのメッセージ送信要求を受信し、持続接続受信部21に端末装置1へのメッセージ送信を指示する。
The message transmission unit 23 receives a message transmission request from the other server device 3 to the terminal device 1 and instructs the persistent connection reception unit 21 to transmit a message to the terminal device 1.
活性接続管理部24は、持続接続受信部21に対して、端末装置1から最後に設定された持続コネクションを用いてメッセージを送信するよう指示する。
The active connection manager 24 instructs the persistent connection receiver 21 to transmit a message using the last established connection from the terminal device 1.
なお、他サーバ装置3は、端末装置1に対して何らかの処理の実行を命令するメッセージ送信アプリケーション31(以下、メッセージ送信アプリ31と記す。)を含んでいる。
The other server device 3 includes a message transmission application 31 (hereinafter referred to as a message transmission application 31) that instructs the terminal device 1 to execute some processing.
次に、本実施形態の通信維持システムの各動作を説明する。
Next, each operation of the communication maintenance system of this embodiment will be described.
(持続コネクション設定)
図2は、端末装置1が持続コネクションを設定する動作例を示すフローチャートである。また、図3は、サーバ装置2が持続コネクションを設定する動作例を示すフローチャートである。以下、図2および図3を用いて、端末装置とサーバ装置との間で持続コネクションを設定する動作を説明する。なお、ここでは、持続期間計算部12が高信頼間隔および拡張間隔を保持しているものとする。 (Persistent connection setting)
FIG. 2 is a flowchart illustrating an operation example in which theterminal device 1 sets a persistent connection. FIG. 3 is a flowchart illustrating an operation example in which the server apparatus 2 sets a persistent connection. Hereinafter, the operation of setting a persistent connection between the terminal device and the server device will be described with reference to FIGS. 2 and 3. Here, it is assumed that the duration calculation unit 12 holds the high reliability interval and the expansion interval.
図2は、端末装置1が持続コネクションを設定する動作例を示すフローチャートである。また、図3は、サーバ装置2が持続コネクションを設定する動作例を示すフローチャートである。以下、図2および図3を用いて、端末装置とサーバ装置との間で持続コネクションを設定する動作を説明する。なお、ここでは、持続期間計算部12が高信頼間隔および拡張間隔を保持しているものとする。 (Persistent connection setting)
FIG. 2 is a flowchart illustrating an operation example in which the
端末装置1の持続接続管理部11は、サーバ装置2との持続コネクションの設定を開始する(図2におけるステップS101)。持続接続管理部11は、例えば、端末装置1が起動した時点、端末装置1に含まれるネットワーク装置(図示せず)が起動した時点、また、ユーザが端末装置1を操作して時点でサーバ装置2との持続コネクションの設定を開始する。
The persistent connection management unit 11 of the terminal device 1 starts setting a persistent connection with the server device 2 (step S101 in FIG. 2). For example, the persistent connection management unit 11 is a server device at the time when the terminal device 1 is activated, when the network device (not shown) included in the terminal device 1 is activated, or when the user operates the terminal device 1. 2. Setting up a persistent connection with 2.
持続接続管理部11は、持続期間計算部12に対して持続コネクションの高信頼間隔と拡張間隔とを問い合わせる。持続期間計算部12は、保持している高信頼間隔を取得する。そして、持続期間計算部12は、現在の期間計算に用いられる変更モードが、拡大モードか縮小モードか定常モードかを判断する(ステップS102)。以降、判断されたモードと高信頼間隔とを基に拡張間隔が決定される。
The persistent connection management unit 11 inquires of the duration calculation unit 12 about the high reliability interval and the extension interval of the persistent connection. The duration calculation unit 12 acquires the retained high reliability interval. Then, the duration calculation unit 12 determines whether the change mode used for the current period calculation is the enlargement mode, the reduction mode, or the steady mode (step S102). Thereafter, the expansion interval is determined based on the determined mode and the high reliability interval.
変更モードが定常モードの場合(ステップS102における「定常モード」)、持続期間計算部12は、拡張間隔と高信頼間隔とが同一であることを示す結果を持続接続管理部11に通知する(ステップS103)。拡大モードまたは縮小モードの場合、持続期間計算部12は、拡張間隔を計算により算出する。変更モードが拡大モードの場合(ステップS102における「拡大モード」)、持続期間計算部12は、前回算出した拡張間隔よりも大きい値を今回の拡張間隔として算出する(ステップS104)。一方、変更モードが縮小モードの場合(ステップS102における「縮小モード」)、持続期間計算部12は、前回算出した拡張間隔よりも小さい値を今回の拡張間隔として算出する(ステップS105)。
When the change mode is the steady mode (“steady mode” in step S102), the duration calculation unit 12 notifies the persistent connection management unit 11 of a result indicating that the extension interval and the high-reliability interval are the same (step S102). S103). In the expansion mode or the reduction mode, the duration calculation unit 12 calculates the expansion interval by calculation. When the change mode is the expansion mode (“enlargement mode” in step S102), the duration calculation unit 12 calculates a value larger than the expansion interval calculated last time as the current expansion interval (step S104). On the other hand, when the change mode is the reduction mode (“reduction mode” in step S102), the duration calculation unit 12 calculates a value smaller than the previously calculated extension interval as the current extension interval (step S105).
持続期間計算部12は、例えば、前回決定した拡張間隔を保持しておき、拡大モードの場合には、前回の拡張間隔に高信頼間隔を加えた期間を拡張間隔としてもよい。一方、縮小モードの場合、持続期間計算部12は、前回の拡張間隔から高信頼間隔を引いた値を算出し、その値の半分を高信頼間隔に加えた期間を拡張間隔としてもよい。
The duration calculation unit 12 may hold, for example, the previously determined expansion interval, and in the expansion mode, the extended interval may be a period obtained by adding a highly reliable interval to the previous expansion interval. On the other hand, in the reduction mode, the duration calculation unit 12 may calculate a value obtained by subtracting the high reliability interval from the previous expansion interval, and may set a period obtained by adding half of the value to the high reliability interval as the expansion interval.
ただし、拡張間隔の算出方法は、上述する方法に限定されない。持続期間計算部12は、例えば、拡大モードの場合、高信頼間隔の2倍の期間を拡張間隔としてもよい。また、縮小モードの場合、持続期間計算部12は、高信頼間隔の半分の値をもとの高信頼間隔に足した値(すなわち、高信頼間隔の1.5倍)を拡張間隔としてもよい。
However, the method for calculating the expansion interval is not limited to the method described above. For example, in the expansion mode, the duration calculation unit 12 may set a period twice as long as the high-reliability interval as the extension interval. In the reduction mode, the duration calculation unit 12 may use a value obtained by adding half the value of the high-reliability interval to the original high-reliability interval (that is, 1.5 times the high-reliability interval) as the extended interval. .
なお、拡張間隔は、高信頼間隔よりも長い期間になるように算出され、その算出方法は任意である。また、持続コネクションが1回も設定されておらず、高信頼間隔が存在しない場合には、端末装置で予め指定された初期値を拡張間隔とすればよい。ただし、初期値は、ミドルボックス装置4によりコネクションが無効化される期間よりも短く設定される。また、持続期間計算部12は、初期状態では拡大モードで動作する。持続期間計算部12は、決定した高信頼間隔および拡張間隔を持続接続管理部11に通知する。
Note that the expansion interval is calculated to be longer than the high reliability interval, and the calculation method is arbitrary. Further, when no persistent connection is set once and there is no highly reliable interval, an initial value specified in advance by the terminal device may be set as the extended interval. However, the initial value is set shorter than the period during which the connection is invalidated by the middle box device 4. The duration calculation unit 12 operates in the expansion mode in the initial state. The duration calculation unit 12 notifies the persistent connection management unit 11 of the determined high-reliability interval and extension interval.
持続接続管理部11は、持続コネクションを管理するための一意な接続識別子を発行する(ステップS106)。持続接続管理部11は、発行した接続識別子、高信頼間隔および拡張間隔をタイムアウト処理部13に通知する。
The persistent connection manager 11 issues a unique connection identifier for managing the persistent connection (step S106). The persistent connection management unit 11 notifies the timeout processing unit 13 of the issued connection identifier, high reliability interval, and extended interval.
タイムアウト処理部13は、現時点から高信頼間隔分経過した後に、接続識別子と高信頼間隔とを示す情報を含んだ高信頼間隔経過イベントを発生させるよう、端末装置1に付随のタイマ17を設定する。また、タイムアウト処理部13は、現時点から拡張間隔分経過した後に、接続識別子を含んだ拡張間隔経過イベントを発生させるよう、タイマ17を設定する(ステップS107)。
The timeout processing unit 13 sets the timer 17 attached to the terminal device 1 so as to generate a high-reliability interval elapse event including information indicating the connection identifier and the high-reliability interval after elapse of the high-reliability interval from the current time. . Further, the timeout processing unit 13 sets the timer 17 so as to generate an extended interval elapsed event including a connection identifier after the extended interval has elapsed from the present time (step S107).
なお、高信頼間隔が0の場合、タイムアウト処理部13は、高信頼間隔経過イベントを発生させるためのタイマ設定を行わない。また、拡張間隔経過イベントを発生させるタイミングは、拡張間隔の経過と同時でなくてもよい。タイムアウト処理部13は、例えば、拡張間隔経過イベントを、拡張間隔より既定分だけ長く時間が経過した後に発生させるようにタイマ17を設定してもよい。
Note that when the high-reliability interval is 0, the timeout processing unit 13 does not set a timer for generating a high-reliability interval elapse event. Also, the timing for generating the extended interval elapsed event may not be the same as the extended interval. For example, the timeout processing unit 13 may set the timer 17 so as to generate an extended interval elapsed event after a predetermined amount of time has elapsed from the extended interval.
次に、持続接続管理部11は、端末識別子管理部14から端末装置1を識別するための端末識別子を取得する(ステップS108)。この端末識別子は、端末装置1のIPアドレスや、端末装置1を利用するユーザのユーザIDなど、端末を識別できる情報であればよい。
Next, the persistent connection management unit 11 acquires a terminal identifier for identifying the terminal device 1 from the terminal identifier management unit 14 (step S108). The terminal identifier may be information that can identify the terminal, such as the IP address of the terminal device 1 or the user ID of the user who uses the terminal device 1.
次に、持続接続管理部11は、コネクション管理部15に対して接続識別子、端末識別子、拡張間隔を渡して、持続コネクションの設定を指示する。すなわち、持続接続管理部11およびコネクション管理部15により、拡張間隔を指定してサーバ装置2との持続コネクションが設定される。コネクション管理部15は、サーバ装置2との間で設定されている持続コネクションのうち、現在未使用と分類されるコネクションが存在するか否か確認する(ステップS109)。
Next, the persistent connection management unit 11 instructs the connection management unit 15 to set a persistent connection by passing the connection identifier, the terminal identifier, and the extension interval. That is, the persistent connection management unit 11 and the connection management unit 15 specify the extension interval and set the persistent connection with the server device 2. The connection management unit 15 checks whether there is a connection classified as unused at present among the persistent connections set with the server device 2 (step S109).
未使用と分類されるコネクションが存在しない場合(ステップS109における「いいえ」)、コネクション管理部15は、端末装置1からサーバ装置2に対して新しいコネクションの設定を開始する(ステップS110)。コネクション管理部15は、サーバ装置2の持続接続受信部21との間にコネクションを設定すると、そのコネクションを接続識別子と関連付けて管理する。
If there is no connection classified as unused (“No” in step S109), the connection management unit 15 starts setting a new connection from the terminal device 1 to the server device 2 (step S110). When the connection management unit 15 sets a connection with the persistent connection receiving unit 21 of the server device 2, the connection management unit 15 manages the connection in association with the connection identifier.
一方、未使用と分類されるコネクションが存在する場合(ステップS109における「はい」)、コネクション管理部15は、そのコネクションを接続識別子と関連付けて管理する(ステップS111)。
On the other hand, if there is a connection classified as unused (“Yes” in step S109), the connection management unit 15 manages the connection in association with the connection identifier (step S111).
次に、コネクション管理部15は、接続識別子と関連付けた持続コネクションを通じて、サーバ装置2の持続接続受信部21に端末識別子と拡張間隔とを含んだ通知(以下、新規キープアライブ期間更新通知と記す。)を送信する(ステップS112)。
Next, the connection management unit 15 writes a notification including the terminal identifier and the extension interval to the persistent connection receiving unit 21 of the server device 2 through the persistent connection associated with the connection identifier (hereinafter referred to as a new keepalive period update notification). ) Is transmitted (step S112).
サーバ装置2の持続接続受信部21は、持続コネクションを通じて新規キープアライブ期間更新通知を受信すると(図3におけるステップS201)、その持続コネクションに対して一意な接続識別子を発行する(ステップS202)。そして、持続接続受信部21は、その接続識別子と持続コネクションとを関連付けて保存する。また、持続接続受信部21は、その接続識別子、および、新規キープアライブ期間更新通知に含まれる端末識別子を活性接続管理部24に通知する。
When the persistent connection receiving unit 21 of the server device 2 receives the new keep-alive period update notification through the persistent connection (step S201 in FIG. 3), it issues a unique connection identifier for the persistent connection (step S202). Then, the persistent connection receiving unit 21 stores the connection identifier and the persistent connection in association with each other. Further, the persistent connection receiving unit 21 notifies the active connection managing unit 24 of the connection identifier and the terminal identifier included in the new keepalive period update notification.
活性接続管理部24は、端末識別子と接続識別子を関連付けて記憶する。この時、活性接続管理部24は、ある端末識別子に対し、別の接続識別子がすでに関連付けて記憶されているか否か確認する(ステップS203)。これらの識別子がすでに関連付けられている場合(ステップS203における「はい」)、活性接続管理部24は、既存の関連付けを削除する(ステップS204)。一方、これらの識別子が関連付けられていない場合(ステップS203における「いいえ」)、ステップS205の処理に進む。
The active connection management unit 24 stores the terminal identifier and the connection identifier in association with each other. At this time, the active connection management unit 24 checks whether or not another connection identifier is already stored in association with a certain terminal identifier (step S203). When these identifiers are already associated (“Yes” in step S203), the active connection management unit 24 deletes the existing association (step S204). On the other hand, if these identifiers are not associated (“NO” in step S203), the process proceeds to step S205.
次に、活性接続管理部24は、端末識別子と新しい接続識別子とを関連付けて記憶する(ステップS205)。持続接続受信部21は、キープアライブ処理部22に対して、接続識別子と新規キープアライブ期間更新通知に含まれる拡張間隔とを通知する。
Next, the active connection management unit 24 stores the terminal identifier and the new connection identifier in association with each other (step S205). The persistent connection receiving unit 21 notifies the keep alive processing unit 22 of the connection identifier and the extension interval included in the new keep alive period update notification.
キープアライブ処理部22は、現時点(すなわち、持続コネクションが設定されて)から拡張間隔分経過した後に、接続識別子および拡張間隔を示す情報を含んだキープアライブイベントを発生するよう、サーバ装置2に付随のタイマ25を設定する(ステップS206)。
The keep alive processing unit 22 is attached to the server apparatus 2 so as to generate a keep alive event including information indicating the connection identifier and the extension interval after elapse of the extension interval from the present time (that is, the persistent connection is set). The timer 25 is set (step S206).
(メッセージ送信)
図4は、サーバ装置2がメッセージを送信する処理の例を示すフローチャートである。また、図5は、端末装置1がメッセージを受信する処理の例を示すフローチャートである。以下、図4および図5を用いて、サーバ装置2が端末装置1に対してメッセージを送信したときの動作を説明する。 (Send Messege)
FIG. 4 is a flowchart illustrating an example of processing in which theserver apparatus 2 transmits a message. FIG. 5 is a flowchart illustrating an example of processing in which the terminal device 1 receives a message. Hereinafter, the operation when the server apparatus 2 transmits a message to the terminal apparatus 1 will be described with reference to FIGS. 4 and 5.
図4は、サーバ装置2がメッセージを送信する処理の例を示すフローチャートである。また、図5は、端末装置1がメッセージを受信する処理の例を示すフローチャートである。以下、図4および図5を用いて、サーバ装置2が端末装置1に対してメッセージを送信したときの動作を説明する。 (Send Messege)
FIG. 4 is a flowchart illustrating an example of processing in which the
サーバ装置2のメッセージ送信部23は、他サーバ装置3、または、サーバ装置2内の各アプリケーションから端末装置1に対するメッセージの送信要求を受理すると(ステップS301)、メッセージを送信する端末を特定する(ステップS302)。
When the message transmission unit 23 of the server device 2 receives a message transmission request to the terminal device 1 from the other server device 3 or each application in the server device 2 (step S301), the message transmission unit 23 specifies a terminal that transmits the message (step S301). Step S302).
メッセージ送信部23は、例えば、送信要求に含まれる端末識別子から端末を特定してもよい。また、送信要求に端末識別子とは異なる別の識別子が含まれる場合、メッセージ送信部23は、例えば、その識別子と端末識別子とを関連づけて管理する外部装置(図1において図示せず)へ端末識別子を要求し、その外部装置から受け取った端末識別子から端末を特定してもよい。
The message transmission unit 23 may specify the terminal from the terminal identifier included in the transmission request, for example. When the transmission request includes another identifier different from the terminal identifier, the message transmission unit 23, for example, sends the terminal identifier to an external device (not shown in FIG. 1) that manages the identifier and the terminal identifier in association with each other. The terminal may be specified from the terminal identifier received from the external device.
メッセージ送信部23は、持続接続受信部21に端末識別子および送信するメッセージを通知する。持続接続受信部21は、端末識別子に関連付けられた接続識別子を活性接続管理部24から取得する。具体的には、活性接続管理部24は、持続接続受信部21の要求に応じ、活性接続情報として保持する端末識別子と接続識別子との関連付けより、接続識別子を特定する(ステップS303)。活性接続管理部24は、特定した接続識別子を持続接続受信部21に通知し、その接続識別子を含んだキープアライブイベントの発生をキャンセルする(ステップS304)。
The message transmission unit 23 notifies the persistent connection reception unit 21 of the terminal identifier and the message to be transmitted. The persistent connection receiving unit 21 acquires the connection identifier associated with the terminal identifier from the active connection management unit 24. Specifically, the active connection management unit 24 specifies a connection identifier from the association between the terminal identifier and the connection identifier held as active connection information in response to a request from the persistent connection receiving unit 21 (step S303). The active connection management unit 24 notifies the identified connection identifier to the persistent connection receiving unit 21, and cancels the generation of the keep alive event including the connection identifier (step S304).
次に、持続接続受信部21は、その接続識別子と関連付けられた持続コネクションを取得し(ステップS305)、その持続コネクションを通じて端末装置1のコネクション管理部15にメッセージを送信する(ステップS306)。
Next, the persistent connection receiving unit 21 acquires a persistent connection associated with the connection identifier (step S305), and transmits a message to the connection management unit 15 of the terminal device 1 through the persistent connection (step S306).
端末装置1のコネクション管理部15は、ある持続コネクションを通じてメッセージを受信する(図5におけるステップS401)と、そのメッセージをメッセージ受信部16に通知する。メッセージ受信部16は、メッセージの内容に応じた処理を実行する(ステップS402)。なお、メッセージ受信部16が行う処理は各端末装置1により、独自に定められるため、ここでは、詳細な説明を省略する。
When the connection management unit 15 of the terminal device 1 receives a message through a certain persistent connection (step S401 in FIG. 5), it notifies the message reception unit 16 of the message. The message receiving unit 16 executes processing according to the content of the message (step S402). Note that the processing performed by the message receiving unit 16 is uniquely determined by each terminal device 1, and thus detailed description thereof is omitted here.
次に、コネクション管理部15は、メッセージを受信した持続コネクションと関連付けて保存されている接続識別子を取得する(ステップS403)。コネクション管理部15は、接続識別子で示される持続コネクションを介してメッセージを受信したことを持続接続管理部11に通知し、その持続コネクションを未使用に分類する(ステップS404)。
Next, the connection management unit 15 acquires a connection identifier stored in association with the persistent connection that has received the message (step S403). The connection management unit 15 notifies the persistent connection management unit 11 that the message has been received via the persistent connection indicated by the connection identifier, and classifies the persistent connection as unused (step S404).
持続接続管理部11は、メッセージを受信したことを通知されると、接続識別子をタイムアウト処理部13に通知する。タイムアウト処理部13は、通知された接続識別子を含む高信頼間隔経過イベントおよび拡張間隔経過イベントの発生をキャンセルする(S405)。また、持続接続管理部11は、即座に、または、一定時間経過後に、ステップS101以降の処理を実行する。すなわち、端末装置1は、サーバ装置2との間に持続コネクションを再度設定する。
When the persistent connection management unit 11 is notified that the message has been received, it notifies the timeout processing unit 13 of the connection identifier. The timeout processing unit 13 cancels the occurrence of the high reliability interval elapsed event and the extended interval elapsed event including the notified connection identifier (S405). Further, the persistent connection management unit 11 executes the processing after step S101 immediately or after a predetermined time has elapsed. That is, the terminal device 1 sets up a persistent connection with the server device 2 again.
(高信頼間隔経過)
次に、端末装置1で高信頼間隔経過イベントが発生した場合について図6を用いて説明する。図6は、端末装置1で高信頼間隔経過イベントが発生した場合の動作例を示すフローチャートである。 (High reliability interval elapses)
Next, a case where a highly reliable interval elapsed event occurs in theterminal device 1 will be described with reference to FIG. FIG. 6 is a flowchart illustrating an operation example when a highly reliable interval elapse event occurs in the terminal device 1.
次に、端末装置1で高信頼間隔経過イベントが発生した場合について図6を用いて説明する。図6は、端末装置1で高信頼間隔経過イベントが発生した場合の動作例を示すフローチャートである。 (High reliability interval elapses)
Next, a case where a highly reliable interval elapsed event occurs in the
端末装置1で高信頼間隔経過イベントが発生した場合(ステップS501)、すなわち、高信頼間隔経過イベントに含まれる接続識別子で示される持続コネクションを利用したメッセージを高信頼間隔の間受信しなかった場合、タイムアウト処理部13は、その接続識別子で示される持続コネクションの高信頼間隔経過を持続接続管理部11に通知する。
When a highly reliable interval elapsed event occurs in the terminal device 1 (step S501), that is, when a message using the persistent connection indicated by the connection identifier included in the highly reliable interval elapsed event is not received during the highly reliable interval. The timeout processing unit 13 notifies the persistent connection management unit 11 of the elapse of the high reliability interval of the persistent connection indicated by the connection identifier.
持続接続管理部11は、持続期間計算部12が保持する現在の動作モードを確認する(ステップS502)。持続期間計算部12が保持するモードが定常モードだった場合(ステップS502における「はい」)、持続接続管理部11は、持続期間計算部12より現在の高信頼間隔を取得する(ステップS503)。そして、持続接続管理部11は、タイムアウト処理部13に対して、その持続コネクションの拡張間隔経過イベントの発生をキャンセルさせる(ステップS504)。
The persistent connection manager 11 checks the current operation mode held by the duration calculator 12 (step S502). When the mode held by the duration calculation unit 12 is the steady mode (“Yes” in Step S502), the persistent connection management unit 11 acquires the current high-reliability interval from the duration calculation unit 12 (Step S503). Then, the persistent connection management unit 11 causes the timeout processing unit 13 to cancel the occurrence of the extended interval elapse event of the persistent connection (step S504).
そして、高信頼間隔経過イベントに含まれる高信頼間隔が現在の高信頼間隔より短い場合(ステップS505における「はい」)、持続接続管理部11は、処理を終了する。一方、高信頼間隔経過イベントに含まれる高信頼間隔が現在の高信頼間隔以上の場合(ステップS505における「いいえ」)、図2に例示するステップS101以降の処理が実行される。すなわち、サーバ装置との間に持続コネクションが設定される。
If the high reliability interval included in the high reliability interval elapsed event is shorter than the current high reliability interval (“Yes” in step S505), the persistent connection management unit 11 ends the process. On the other hand, when the high-reliability interval included in the high-reliability interval elapsed event is equal to or greater than the current high-reliability interval (“No” in step S505), the processing from step S101 illustrated in FIG. 2 is executed. That is, a persistent connection is set up with the server device.
一方、ステップS502において、持続期間計算部12が保持するモードが定常モード以外の場合(ステップS502における「いいえ」)、図2に例示するステップS101以降の処理が実行される。すなわち、サーバ装置との間に持続コネクションが追加される。この時、高信頼間隔≦拡張間隔であるので、高信頼間隔=拡張間隔以外の場合には、端末装置とサーバ装置との間には複数本の持続コネクションが設定されることとなる。
On the other hand, if the mode held by the duration calculation unit 12 is other than the steady mode in Step S502 (“No” in Step S502), the processing from Step S101 illustrated in FIG. 2 is executed. That is, a persistent connection is added to the server device. At this time, since the high-reliability interval is equal to or smaller than the extended interval, a plurality of persistent connections are set between the terminal device and the server device when the high-reliability interval is not equal to the extended interval.
(キープアライブ期間経過)
図7は、サーバ装置2でキープアライブイベントが発生した場合の処理の例を示すフローチャートである。また、図8は、端末装置1でキープアライブパケットを受信した場合の処理の例を示すフローチャートである。以下、図7および図8を用いて、サーバ装置2でキープアライブイベントが発生した場合の動作を説明する。 (Keep-alive period elapses)
FIG. 7 is a flowchart illustrating an example of processing when a keep-alive event occurs in theserver device 2. FIG. 8 is a flowchart illustrating an example of processing when the terminal device 1 receives a keep-alive packet. Hereinafter, the operation when the keep alive event occurs in the server device 2 will be described with reference to FIGS. 7 and 8.
図7は、サーバ装置2でキープアライブイベントが発生した場合の処理の例を示すフローチャートである。また、図8は、端末装置1でキープアライブパケットを受信した場合の処理の例を示すフローチャートである。以下、図7および図8を用いて、サーバ装置2でキープアライブイベントが発生した場合の動作を説明する。 (Keep-alive period elapses)
FIG. 7 is a flowchart illustrating an example of processing when a keep-alive event occurs in the
サーバ装置2でタイマ25によるキープアライブイベントが発生した場合(図7におけるステップS601)、すなわち、キープアライブイベントに含まれる接続識別子で示される持続コネクションを利用したメッセージ送信が、拡張間隔の間なかった場合、キープアライブ処理部22は、キープアライブイベントを受けつける。そして、キープアライブ処理部22は、持続接続受信部21に対して、接続識別子で示される持続コネクションを用いたキープアライブパケットの送信を指示する。キープアライブパケットには、キープアライブイベントに含まれる拡張間隔を示す情報が含まれる。
When the keep alive event by the timer 25 occurs in the server device 2 (step S601 in FIG. 7), that is, the message transmission using the persistent connection indicated by the connection identifier included in the keep alive event has not occurred during the extended interval. In this case, the keep alive processing unit 22 receives a keep alive event. Then, the keep alive processing unit 22 instructs the persistent connection receiving unit 21 to transmit a keep alive packet using the persistent connection indicated by the connection identifier. The keep alive packet includes information indicating an extension interval included in the keep alive event.
持続接続受信部21は、接続識別子で示される持続コネクションを取得し(ステップS602)、キープアライブパケットを送出する(ステップS603)。この時、持続コネクションに設定された拡張間隔が、ミドルボックス装置4で設定されているコネクション無効化期限と同じか短い場合、キープアライブパケットは、端末装置1に到達する。一方、持続コネクションに設定された拡張間隔が、ミドルボックス装置4で設定されているコネクション無効化期限より長い場合、持続コネクションは、無効化され、キープアライブパケットは、端末装置1に到達しない。
The persistent connection receiving unit 21 acquires the persistent connection indicated by the connection identifier (step S602), and transmits a keep-alive packet (step S603). At this time, if the extension interval set for the persistent connection is the same as or shorter than the connection invalidation deadline set in the middle box device 4, the keep-alive packet reaches the terminal device 1. On the other hand, when the extended interval set for the persistent connection is longer than the connection invalidation deadline set by the middle box device 4, the persistent connection is invalidated, and the keep-alive packet does not reach the terminal device 1.
キープアライブパケットが端末装置1に到達し、コネクション管理部15で受信されると(図8におけるステップS701)、コネクション管理部15は、その持続コネクションに関連付けられた持続識別子を取得する(ステップS702)。そして、コネクション管理部15は、持続接続管理部11に対してキープアライブの受信を通知し、その持続コネクションを未使用に分類する(ステップS703)。
When the keep-alive packet arrives at the terminal device 1 and is received by the connection management unit 15 (step S701 in FIG. 8), the connection management unit 15 obtains a persistent identifier associated with the persistent connection (step S702). . Then, the connection management unit 15 notifies the persistent connection management unit 11 that the keepalive is received, and classifies the persistent connection as unused (step S703).
持続接続管理部11は、その接続識別子を含む高信頼間隔経過イベント、拡張間隔経過イベントの発生をキャンセルするようタイムアウト処理部13に指示する(ステップS704)。
The persistent connection management unit 11 instructs the timeout processing unit 13 to cancel the occurrence of the high-reliability interval elapsed event and the extended interval elapsed event including the connection identifier (step S704).
次に、持続接続管理部11は、持続期間計算部12のモードを確認する(ステップS705)。持続期間計算部12が保持するモードが定常モードの場合(ステップS705における「定常モード」)、持続接続管理部11は、図2に例示するステップS101以降の処理を実行する。すなわち、サーバ装置との間に持続コネクションが設定される。
Next, the persistent connection management unit 11 confirms the mode of the duration calculation unit 12 (step S705). When the mode held by the duration calculation unit 12 is the steady mode (“steady mode” in step S705), the persistent connection management unit 11 executes the processing after step S101 illustrated in FIG. That is, a persistent connection is set up with the server device.
また、持続期間計算部12が保持するモードが縮小モードの場合(ステップS705における「縮小モード」)、持続接続管理部11は、持続期間計算部12のモードを定常モードに変更し(ステップS706)、処理を終了する。
Further, when the mode held by the duration calculation unit 12 is the reduction mode (“reduction mode” in step S705), the persistent connection management unit 11 changes the mode of the duration calculation unit 12 to the steady mode (step S706). The process is terminated.
また、持続期間計算部12が保持するモードが拡大モードの場合(ステップS705における「拡大モード」)、持続接続管理部11は、受信したキープアライブパケットに含まれる拡張間隔を高信頼間隔として持続期間計算部12に通知する(ステップS707)。持続期間計算部12は、受け取った高信頼間隔を保持する。この高信頼間隔は、図2に例示するステップS103~S105において、拡張間隔を次回決定する際に利用される。
In addition, when the mode held by the duration calculation unit 12 is the expansion mode (“expansion mode” in step S705), the persistent connection management unit 11 sets the extension interval included in the received keepalive packet as the high reliability interval. The calculation unit 12 is notified (step S707). The duration calculation unit 12 holds the received high reliability interval. This high-reliability interval is used when the expansion interval is determined next time in steps S103 to S105 illustrated in FIG.
このように、持続接続管理部11およびコネクション管理部15が、持続コネクションを設定してから高信頼間隔が経過した時点で、キープアライブパケットの受信状態(例えば、変更モード)に応じて決定される拡張間隔を指定した新たな持続コネクションをサーバ装置2との間に設定する。高信頼間隔でサーバ装置2との接続を行っていれば、ミドルボックス装置4によって持続コネクションを無効にされることはない。そのため、端末装置1とサーバ装置2の間のコネクションを維持できる。
In this way, the persistent connection management unit 11 and the connection management unit 15 are determined according to the reception state (for example, the change mode) of the keep alive packet when the high reliability interval has elapsed after setting the persistent connection. A new persistent connection designating the extension interval is set between the server apparatus 2 and the server apparatus 2. If the connection with the server device 2 is performed at a highly reliable interval, the middle box device 4 does not invalidate the persistent connection. Therefore, the connection between the terminal device 1 and the server device 2 can be maintained.
さらに、持続接続管理部11が、新たな持続コネクションに基づくキープアライブパケットをサーバ装置2から受信したときに、その持続コネクションの設定により指定された拡張間隔を高信頼間隔に設定する。拡張間隔を高信頼間隔に設定することで、接続を維持するための処理間隔を長くできる。すなわち、両装置間でコネクションを維持するための処理を低減できるため、通信負荷を抑制できる。
Furthermore, when the persistent connection management unit 11 receives a keep-alive packet based on a new persistent connection from the server device 2, the extended interval specified by the setting of the persistent connection is set as a highly reliable interval. By setting the extended interval to a highly reliable interval, the processing interval for maintaining the connection can be lengthened. That is, since the processing for maintaining the connection between both devices can be reduced, the communication load can be suppressed.
(拡張間隔経過)
次に、端末装置1で拡張間隔経過イベントが発生した場合の動作を図9を用いて説明する。図9は、端末装置1で拡張間隔経過イベントが発生した場合の処理例を示すフローチャートである。 (Expansion interval elapses)
Next, an operation when an extended interval elapsed event occurs in theterminal device 1 will be described with reference to FIG. FIG. 9 is a flowchart illustrating a processing example when an extended interval elapsed event occurs in the terminal device 1.
次に、端末装置1で拡張間隔経過イベントが発生した場合の動作を図9を用いて説明する。図9は、端末装置1で拡張間隔経過イベントが発生した場合の処理例を示すフローチャートである。 (Expansion interval elapses)
Next, an operation when an extended interval elapsed event occurs in the
端末装置1で拡張間隔経過イベントが発生した場合(ステップS801)、すなわち、タイムアウト処理部13が、拡張間隔経過イベントに含まれる接続識別子で示される持続コネクションを利用したメッセージを受信せず、かつ、サーバ装置2からのキープアライブパケットも拡張間隔経過前に受信しなかった場合、タイムアウト処理部13は、その接続識別子で示される持続コネクションのタイムアウトを持続接続管理部11に通知する。持続接続管理部11は、その接続識別子を持つ持続コネクションの破棄をコネクション管理部15に通知する。
When the extended interval elapsed event occurs in the terminal device 1 (step S801), that is, the timeout processing unit 13 does not receive a message using the persistent connection indicated by the connection identifier included in the extended interval elapsed event, and When the keep alive packet from the server apparatus 2 is not received before the extension interval elapses, the timeout processing unit 13 notifies the persistent connection management unit 11 of the timeout of the persistent connection indicated by the connection identifier. The persistent connection management unit 11 notifies the connection management unit 15 of the destruction of the persistent connection having the connection identifier.
コネクション管理部15は、接続識別子に関連付けられた持続コネクションを破棄する(ステップS802)。次に、持続接続管理部11は、縮小モード(ステップS803)として動作するよう持続期間計算部12に指示する。すなわち、持続接続管理部11は、持続期間計算部12が保持するモードを縮小モードに変更させる。
The connection management unit 15 discards the persistent connection associated with the connection identifier (step S802). Next, the persistent connection management unit 11 instructs the duration calculation unit 12 to operate as the reduction mode (step S803). That is, the persistent connection management unit 11 changes the mode held by the duration calculation unit 12 to the reduction mode.
以上のように、本実施形態によれば、端末装置1は、高信頼間隔と拡張間隔を保持し、拡張間隔を指定してサーバ装置2との持続コネクションを設定する。サーバ装置2は、端末装置1との間に持続コネクションが設定されてから、その持続コネクションの設定で指定された拡張間隔が経過した時点で、端末装置1にキープアライブパケットを送信する。
As described above, according to the present embodiment, the terminal device 1 holds the high-reliability interval and the extension interval, and specifies the extension interval to set a persistent connection with the server device 2. The server device 2 transmits a keep-alive packet to the terminal device 1 when the extended interval specified by the setting of the persistent connection has elapsed after the persistent connection is set with the terminal device 1.
また、端末装置1は、持続コネクションを設定してから高信頼間隔が経過した時点で、キープアライブパケットの受信状態(例えば、変更モード)に応じて決定される拡張間隔を指定した新たな持続コネクションをサーバ装置2との間に設定する。そして、端末装置1は、新たな持続コネクションに基づくキープアライブパケットをサーバ装置2から受信したときに、その持続コネクションの設定により指定された拡張間隔を高信頼間隔に設定する。
In addition, the terminal device 1 sets a new persistent connection that specifies an extended interval that is determined according to the reception state (for example, change mode) of the keep-alive packet when the high-reliability interval elapses after the persistent connection is set. Is set with the server device 2. When the terminal device 1 receives a keep-alive packet based on a new persistent connection from the server device 2, the terminal device 1 sets the extended interval specified by the setting of the persistent connection as a highly reliable interval.
よって、所定期間で装置間のコネクションが無効になる(例えば、ミドルボックス装置4を含む)通信ネットワークにおいても、装置間のコネクションを維持しつつ、コネクションを維持するための通信負荷を抑制できる。
Therefore, even in a communication network in which the connection between devices becomes invalid in a predetermined period (for example, including the middle box device 4), the communication load for maintaining the connection can be suppressed while maintaining the connection between the devices.
すなわち、本実施形態では、装置間で設定されるいずれかの持続コネクションを用いて高信頼間隔で通信が行われる。そのため、装置間でのパケットの到達を保証することが可能になる。具体的には、ある持続コネクションの拡張間隔を長く設定しても、無応答期間が発生することがなくなる。
That is, in the present embodiment, communication is performed at a highly reliable interval using any one of persistent connections set between devices. Therefore, it is possible to guarantee the arrival of packets between devices. Specifically, even if the extension interval of a certain persistent connection is set long, no response period is generated.
また、ある時点におけるサーバ装置2のキープアライブ間隔がミドルボックス装置4のコネクション無効化期限より小さくても、拡張間隔を長く設定することで、キープアライブ間隔をより早くミドルボックス装置4のコネクション無効化期限に近づけることができる。よって、ネットワークにかける無駄な負荷を軽減できる。
Further, even if the keep alive interval of the server device 2 at a certain time is smaller than the connection invalidation time limit of the middle box device 4, the connection interval of the middle box device 4 is invalidated earlier by setting the extended interval longer. You can approach the deadline. Therefore, useless load on the network can be reduced.
以下、具体的な実施例により本発明を説明するが、本発明の範囲は以下に説明する内容に限定されない。図10は、本実施形態の通信維持システムの動作例を示す説明図である。図10では、横軸が経過時間を示し、縦軸が端末装置1で持続コネクションを設定した順番を示している。
Hereinafter, the present invention will be described with reference to specific examples, but the scope of the present invention is not limited to the contents described below. FIG. 10 is an explanatory diagram illustrating an operation example of the communication maintaining system of the present embodiment. In FIG. 10, the horizontal axis indicates the elapsed time, and the vertical axis indicates the order in which the persistent connection is set in the terminal device 1.
また、本実施例では、ミドルボックス装置4のコネクション無効化期限を9分とし、初期の拡張間隔を2分とする。また、拡張間隔には、前回持続コネクションを設定した際の拡張間隔に、現在の高信頼間隔を加算した値が用いられる。なお、図10において、各持続コネクションを設定する際の高信頼間隔を「高=」および白矩形で示し、各持続コネクションを設定する際に指定される拡張間隔を「拡=」で示す。また、図10において、各持続コネクションを設定する際に指定される拡張間隔と高信頼間隔との差分を網掛矩形で示す。
In this embodiment, the connection invalidation deadline of the middle box device 4 is 9 minutes, and the initial expansion interval is 2 minutes. In addition, as the extension interval, a value obtained by adding the current high-reliability interval to the extension interval when the last persistent connection is set is used. In FIG. 10, the high-reliability interval when setting each persistent connection is indicated by “high =” and a white rectangle, and the extension interval designated when setting each persistent connection is indicated by “expansion =”. Further, in FIG. 10, the difference between the extension interval and the high-reliability interval specified when setting each persistent connection is indicated by a shaded rectangle.
初期状態では、高信頼間隔が設定されていないため、まず、端末装置1は、拡張間隔が2分である持続コネクション1をサーバ装置2との間で設定する。なお、以下の説明で「経過後」とは、持続コネクション1が設定されてからの時間の経過を示す。
In the initial state, since the high-reliability interval is not set, first, the terminal device 1 sets the persistent connection 1 having the extension interval of 2 minutes with the server device 2. In the following description, “after the passage” indicates the passage of time after the persistent connection 1 is set.
2分経過後、サーバ装置2は、持続コネクション1についてのキープアライブイベントを発生させる。すると、キープアライブ期間が2分に設定されたキープアライブパケットが端末装置1に到達する。そのため、端末装置1では、高信頼間隔が2分に設定される。また、このタイミングで、端末装置1は、高信頼間隔が2分および拡張間隔が4分である持続コネクション2を用いてサーバ装置2に接続される。
After 2 minutes, the server device 2 generates a keep alive event for the persistent connection 1. Then, the keep alive packet in which the keep alive period is set to 2 minutes reaches the terminal device 1. Therefore, in the terminal device 1, the high reliability interval is set to 2 minutes. At this timing, the terminal device 1 is connected to the server device 2 using the persistent connection 2 having a high reliability interval of 2 minutes and an expansion interval of 4 minutes.
4分経過後(すなわち、2分経過後から高信頼間隔の2分が経過したとき)、端末装置1は、持続コネクション2についての高信頼間隔経過イベントを発生させる。すると、端末装置1は、高信頼間隔が2分および拡張間隔が6分である持続コネクション3をサーバ装置2との間で設定する。
After the elapse of 4 minutes (that is, when 2 minutes of the high-reliability interval has elapsed since the elapse of 2 minutes), the terminal device 1 generates a high-reliability interval elapse event for the persistent connection 2. Then, the terminal device 1 sets a persistent connection 3 with a high reliability interval of 2 minutes and an expansion interval of 6 minutes with the server device 2.
6分経過後、サーバ装置2は、持続コネクション2についてのキープアライブイベントを発生させる。すると、キープアライブ期間が4分に設定されたキープアライブパケットが端末装置1に到達する。持続コネクション2の拡張間隔は4分であるため、端末装置1では、高信頼間隔が4分に設定される。また、このタイミングで、端末装置1は、高信頼間隔が4分および拡張間隔が10分である持続コネクション4を用いてサーバ装置2に接続される。
After 6 minutes, the server device 2 generates a keep alive event for the persistent connection 2. Then, the keep alive packet in which the keep alive period is set to 4 minutes arrives at the terminal device 1. Since the extension interval of the persistent connection 2 is 4 minutes, the high reliability interval is set to 4 minutes in the terminal device 1. At this timing, the terminal device 1 is connected to the server device 2 using the persistent connection 4 having a high reliability interval of 4 minutes and an expansion interval of 10 minutes.
10分経過後、サーバ装置2は、持続コネクション3についてのキープアライブイベントを発生させる。すると、キープアライブ期間が6分に設定されたキープアライブパケットが端末装置1に到達する。持続コネクション3の拡張間隔は6分であるため、端末装置1では、高信頼間隔が6分に設定される。また、このタイミングで、端末装置1は、高信頼間隔が6分および拡張間隔が16分である持続コネクション5を用いてサーバ装置2に接続される。
After 10 minutes, the server device 2 generates a keep alive event for the persistent connection 3. Then, the keep alive packet in which the keep alive period is set to 6 minutes reaches the terminal device 1. Since the expansion interval of the persistent connection 3 is 6 minutes, the high reliability interval is set to 6 minutes in the terminal device 1. At this timing, the terminal device 1 is connected to the server device 2 using the persistent connection 5 having a high reliability interval of 6 minutes and an expansion interval of 16 minutes.
16分経過後、サーバ装置2は、持続コネクション4についてのキープアライブイベントを発生させる。すると、サーバ装置2は、キープアライブ期間が10分に設定されたキープアライブパケットを端末装置1に向けて送信する。しかし、ミドルボックス装置4のコネクション無効化期限が9分であるため、このキープアライブパケットは端末装置1に到達しない。よって、このタイミングで、端末装置1は、持続コネクション4についての拡張間隔経過イベントを発生させ、持続期間計算部12は、保持するモードを縮小モードにする。
After 16 minutes, the server device 2 generates a keep alive event for the persistent connection 4. Then, the server device 2 transmits a keep alive packet in which the keep alive period is set to 10 minutes toward the terminal device 1. However, since the connection invalidation deadline of the middle box device 4 is 9 minutes, this keep-alive packet does not reach the terminal device 1. Therefore, at this timing, the terminal device 1 generates an extended interval elapsed event for the persistent connection 4, and the duration calculation unit 12 sets the mode to be held to the reduced mode.
また、16分経過後には、端末装置1は、持続コネクション5についての高信頼間隔経過イベントを発生させる。すると、端末装置1は、高信頼間隔が6分および拡張間隔が11分である持続コネクション6をサーバ装置2との間で設定する。ここで、拡張間隔の11分は、前回の拡張間隔である16分から、高信頼間隔の6分を引いた値(10分)の半分に、高信頼間隔の6分を加算して(すなわち、(前回の拡張間隔16分-高信頼間隔6分)÷2+高信頼間隔6分)算出される。
In addition, after 16 minutes have elapsed, the terminal device 1 generates a highly reliable interval elapsed event for the persistent connection 5. Then, the terminal device 1 sets the persistent connection 6 with the high reliability interval of 6 minutes and the expansion interval of 11 minutes with the server device 2. Here, 11 minutes of the expansion interval is obtained by adding 6 minutes of the high reliability interval to half of the value (10 minutes) obtained by subtracting 6 minutes of the high reliability interval from the previous expansion interval of 16 minutes (that is, (Previous expansion interval 16 minutes-high reliability interval 6 minutes) ÷ 2 + high reliability interval 6 minutes) is calculated.
22分経過後、端末装置1は、持続コネクション6についての高信頼間隔経過イベントを発生させる。すると、端末装置1は、高信頼間隔が6分および拡張間隔が9分である持続コネクション7をサーバ装置2との間で設定する。ここで、拡張間隔の9分は、前回の拡張間隔である11分から、高信頼間隔の6分を引いた値(5分)の半分に、高信頼間隔の6分を加算して(すなわち、(前回の拡張間隔11分-高信頼間隔6分)÷2+高信頼間隔6分)算出される。なお、0.5分は、1分に切り上げて算出されるとする。
After 22 minutes, the terminal device 1 generates a highly reliable interval elapsed event for the persistent connection 6. Then, the terminal device 1 sets a persistent connection 7 having a high reliability interval of 6 minutes and an expansion interval of 9 minutes with the server device 2. Here, 9 minutes of the expansion interval is obtained by adding 6 minutes of the high reliability interval to half of the value (5 minutes) obtained by subtracting 6 minutes of the high reliability interval from 11 minutes that is the previous expansion interval (that is, (Previous expansion interval 11 minutes−high reliability interval 6 minutes) ÷ 2 + high reliability interval 6 minutes) is calculated. Note that 0.5 minutes is calculated by rounding up to 1 minute.
26分経過後、サーバ装置2は、持続コネクション5についてのキープアライブイベントを発生させる。すると、サーバ装置2は、キープアライブ期間が16分に設定されたキープアライブパケットを端末装置1に向けて送信する。しかし、ミドルボックス装置4のコネクション無効化期限が9分であるため、このキープアライブパケットは端末装置1に到達しない。よって、このタイミングで、端末装置1は、持続コネクション4についての拡張間隔経過イベントを発生させる。ただし、持続期間計算部12が保持するモードは、すでに縮小モードであるため、特に何も行われない。
After 26 minutes, the server device 2 generates a keep alive event for the persistent connection 5. Then, the server device 2 transmits a keep alive packet in which the keep alive period is set to 16 minutes toward the terminal device 1. However, since the connection invalidation deadline of the middle box device 4 is 9 minutes, this keep-alive packet does not reach the terminal device 1. Therefore, at this timing, the terminal device 1 generates an extended interval elapsed event for the persistent connection 4. However, since the mode held by the duration calculation unit 12 is already the reduction mode, nothing is particularly performed.
27分経過後、サーバ装置2は、持続コネクション6についてのキープアライブイベントを発生させる。すると、サーバ装置2は、キープアライブ期間が11分に設定されたキープアライブパケットを端末装置1に向けて送信する。しかし、ミドルボックス装置4のコネクション無効化期限が9分であるため、このキープアライブパケットは端末装置1に到達しない。よって、このタイミングで、端末装置1は、持続コネクション4についての拡張間隔経過イベントを発生させる。ただし、持続期間計算部12が保持するモードは、すでに縮小モードであるため、特に何も行われない。
After 27 minutes, the server device 2 generates a keep alive event for the persistent connection 6. Then, the server device 2 transmits a keep alive packet in which the keep alive period is set to 11 minutes toward the terminal device 1. However, since the connection invalidation deadline of the middle box device 4 is 9 minutes, this keep-alive packet does not reach the terminal device 1. Therefore, at this timing, the terminal device 1 generates an extended interval elapsed event for the persistent connection 4. However, since the mode held by the duration calculation unit 12 is already the reduction mode, nothing is particularly performed.
28分経過後、端末装置1は、持続コネクション7についての高信頼間隔経過イベントを発生させる。すると、端末装置1は、高信頼間隔が6分および拡張間隔が8分である持続コネクション8をサーバ装置2との間で設定する。ここで、拡張間隔の8分は、前回の拡張間隔である9分から、高信頼間隔の6分を引いた値(3分)の半分に、高信頼間隔の6分を加算して(すなわち、(前回の拡張間隔9分-高信頼間隔6分)÷2+高信頼間隔6分)算出される。なお、0.5分は、1分に切り上げて算出されるとする。
After 28 minutes, the terminal device 1 generates a highly reliable interval elapsed event for the persistent connection 7. Then, the terminal device 1 sets a persistent connection 8 with a high reliability interval of 6 minutes and an expansion interval of 8 minutes with the server device 2. Here, 8 minutes of the expansion interval is obtained by adding 6 minutes of the high reliability interval to half of the value (3 minutes) obtained by subtracting 6 minutes of the high reliability interval from 9 minutes that is the previous expansion interval (that is, (Previous expansion interval 9 minutes−high reliability interval 6 minutes) ÷ 2 + high reliability interval 6 minutes) is calculated. Note that 0.5 minutes is calculated by rounding up to 1 minute.
31分経過後、サーバ装置2は、持続コネクション7についてのキープアライブイベントを発生させる。すると、キープアライブ期間が9分に設定されたキープアライブパケットが端末装置1に到達する。ミドルボックス装置4のコネクション無効化期限が9分であるため、このキープアライブパケットは端末装置1に到達する。そして、持続コネクション7の拡張間隔は9分であるため、端末装置1では、高信頼間隔が9分に設定される。このとき、端末装置1は、持続コネクション4についての拡張間隔経過イベントを発生させ、持続期間計算部12は、保持するモードを定常モードにする。以降、端末装置1は、高信頼間隔が9分に設定された状態で動作する。
After 31 minutes, the server device 2 generates a keep alive event for the persistent connection 7. Then, the keep alive packet in which the keep alive period is set to 9 minutes reaches the terminal device 1. Since the connection invalidation deadline of the middle box device 4 is 9 minutes, this keep alive packet reaches the terminal device 1. Since the extension interval of the persistent connection 7 is 9 minutes, the high reliability interval is set to 9 minutes in the terminal device 1. At this time, the terminal device 1 generates an extended interval elapsed event for the persistent connection 4, and the duration calculation unit 12 sets the held mode to the steady mode. Thereafter, the terminal device 1 operates in a state where the high reliability interval is set to 9 minutes.
34分経過後、端末装置1は、持続コネクション8についての高信頼間隔経過イベントを発生させる。このとき、持続期間計算部12が保持するモードは定常モードであり、また、イベントの高信頼間隔が6分で現在の高信頼間隔が9分であるため、何も行われない。
After 34 minutes have elapsed, the terminal device 1 generates a highly reliable interval elapsed event for the persistent connection 8. At this time, the mode held by the duration calculation unit 12 is a steady mode, and since the high-reliability interval of the event is 6 minutes and the current high-reliability interval is 9 minutes, nothing is performed.
36分経過後、サーバ装置2は、持続コネクション8についてのキープアライブイベントを発生させる。すると、サーバ装置2は、キープアライブ期間が8分に設定されたキープアライブパケットを端末装置1に向けて送信する。端末装置1では、持続期間計算部12が保持するモードが定常モードであるため、端末装置1は、高信頼間隔および拡張間隔がいずれも9分である持続コネクション9をサーバ装置2との間で設定する。
After 36 minutes, the server device 2 generates a keep alive event for the persistent connection 8. Then, the server device 2 transmits a keep alive packet in which the keep alive period is set to 8 minutes toward the terminal device 1. In the terminal device 1, since the mode held by the duration calculation unit 12 is the steady mode, the terminal device 1 establishes a persistent connection 9 between the server device 2 and the high-reliability interval and the extension interval of 9 minutes. Set.
以後、サーバ装置2は、9分ごとにキープアライブパケットを端末装置1に送信し、端末装置1は、キープアライブパケットを受信するたびに、持続コネクションをサーバ装置2との間に設定する。
Thereafter, the server device 2 transmits a keep alive packet to the terminal device 1 every nine minutes, and the terminal device 1 sets a persistent connection with the server device 2 every time the keep alive packet is received.
次に、本発明の概要を説明する。図11は、本発明による通信維持システムの概要を示すブロック図である。本発明による通信維持システムは、サーバ装置80(例えば、サーバ装置2)と、サーバ装置80との間に設定される持続コネクションを用いてサーバ装置80と通信を行う端末装置90(例えば、端末装置1)とを備えている。
Next, the outline of the present invention will be described. FIG. 11 is a block diagram showing an outline of a communication maintenance system according to the present invention. The communication maintenance system according to the present invention includes a terminal device 90 (for example, a terminal device) that communicates with the server device 80 using a persistent connection set between the server device 80 (for example, the server device 2) and the server device 80. 1).
サーバ装置80と端末装置90は、持続コネクションを用いた通信が予め定められた期間であるキープアライブ間隔行われなかった場合に、その持続コネクションを無効にする少なくとも1つ以上のミドルボックス装置(例えば、ミドルボックス装置4)を介して相互に接続される。
The server device 80 and the terminal device 90 each have at least one middle box device (for example, invalidating the persistent connection) when communication using the persistent connection is not performed during a keep-alive interval that is a predetermined period. Are connected to each other via a middle box device 4).
端末装置90は、持続コネクションが有効であると確認できた場合のキープアライブ間隔のうち最大の期間である高信頼間隔と、持続コネクションが有効か否かの確認に用いられる高信頼間隔よりも長い期間の拡張間隔を保持し、拡張間隔を指定してサーバ装置80との持続コネクションを設定する接続管理部91(例えば、持続接続管理部11、コネクション管理部15)を含む。
The terminal device 90 is longer than the high-reliability interval, which is the maximum period of the keep-alive interval when it can be confirmed that the persistent connection is valid, and the high-reliability interval used for confirming whether the persistent connection is valid. A connection management unit 91 (for example, the persistent connection management unit 11 and the connection management unit 15) that holds the expansion interval of the period and sets the persistent connection with the server device 80 by specifying the expansion interval is included.
サーバ装置80は、端末装置90との間に持続コネクションが設定されてから、その持続コネクションの設定で指定された拡張間隔経過した時点で、端末装置90にキープアライブパケットを送信するパケット送信部81(例えば、持続接続受信部21)を含む。
The server device 80 transmits a keep alive packet to the terminal device 90 when the extended interval specified by the setting of the persistent connection has elapsed since the persistent connection was set up with the terminal device 90. (For example, the persistent connection receiver 21).
端末装置90の接続管理部91は、持続コネクションを設定してから高信頼間隔が経過した時点で、キープアライブパケットの受信状態に応じて決定される拡張間隔を指定した新たな持続コネクションをサーバ装置80との間に設定し、その新たな持続コネクションに基づくキープアライブパケットをサーバ装置80から受信したときに、その持続コネクションの設定により指定された拡張間隔を高信頼間隔に設定する。
The connection management unit 91 of the terminal device 90 creates a new persistent connection that specifies an extended interval determined according to the reception state of the keep-alive packet when the high-reliability interval elapses after setting the persistent connection. When the keep alive packet based on the new persistent connection is received from the server apparatus 80, the extended interval specified by the setting of the persistent connection is set as the high reliability interval.
そのような構成により、所定期間で装置間のコネクションが無効になる通信ネットワークにおいても、装置間のコネクションを維持しつつ、コネクションを維持するための通信負荷を抑制できる。
With such a configuration, even in a communication network in which a connection between devices becomes invalid during a predetermined period, it is possible to suppress a communication load for maintaining the connection while maintaining the connection between the devices.
具体的には、端末装置90は、拡張間隔の変更方法を示す変更モードとして、新しく設定する持続コネクションの拡張間隔を徐々に増加させていく拡大モード、拡張間隔を徐々に減少させていく縮小モード、または、拡張間隔を変化させない定常モードのいずれかの変更モードを保持し、その変更モードおよび高信頼間隔をもとに、拡張間隔を決定する持続期間計算部を含んでいてもよい。そして、接続管理部91は、キープアライブパケットの受信状態に応じて変更モードを決定し、その変更モードおよび高信頼間隔をもとに決定される拡張間隔を指定した新たな持続コネクションをサーバ装置80との間に設定してもよい。
Specifically, the terminal device 90 has, as a change mode indicating a method for changing the extension interval, an extension mode in which the extension interval of the newly set persistent connection is gradually increased, and a reduction mode in which the extension interval is gradually reduced. Alternatively, it may include a duration calculation unit that holds any change mode of the steady mode that does not change the extension interval and determines the extension interval based on the change mode and the high-reliability interval. Then, the connection management unit 91 determines the change mode according to the reception state of the keep alive packet, and assigns a new persistent connection that specifies the extension interval determined based on the change mode and the high reliability interval to the server device 80. You may set between.
また、持続期間計算部は、初期状態で変更モードとして拡張モードを保持していてもよい。具体的には、接続管理部91は、持続期間計算部が変更モードとして拡張モードを保持している状態で、新たな持続コネクションに基づくキープアライブパケットをサーバ装置80から受信しなかったとき、変更モードを拡張モードから縮小モードに変更し、その変更モードおよび高信頼間隔をもとに決定される拡張間隔を指定した新たな持続コネクションをサーバ装置80との間に設定してもよい。
In addition, the duration calculation unit may hold the extended mode as the change mode in the initial state. Specifically, the connection management unit 91 changes when the duration calculation unit holds the extended mode as the change mode and does not receive a keep-alive packet based on a new persistent connection from the server device 80. The mode may be changed from the extended mode to the reduced mode, and a new persistent connection specifying the extended interval determined based on the changed mode and the high-reliability interval may be set between the server device 80 and the server device 80.
さらに、接続管理部91は、持続期間計算部が変更モードとして縮小モードを保持している状態で、新たな持続コネクションに基づくキープアライブパケットをサーバ装置80から受信したとき、変更モードを縮小モードから定常モードに変更し、その持続コネクションの設定により指定された拡張間隔をもとに設定される高信頼間隔を指定した新たな持続コネクションをサーバ装置との間に設定してもよい。
Furthermore, when the connection management unit 91 receives a keep-alive packet based on a new persistent connection from the server device 80 in a state where the duration calculation unit holds the reduced mode as the change mode, the connection management unit 91 changes the change mode from the reduced mode. The mode may be changed to the steady mode, and a new persistent connection may be set between the server apparatus and the high-reliability interval set based on the extended interval specified by the setting of the persistent connection.
また、持続期間計算部は、保持する変更モードが定常モードの場合、高信頼間隔を拡張間隔と決定し、保持する変更モードが拡大モードの場合、前回決定した拡張間隔よりも長い期間を示す間隔に拡張間隔を決定し、保持する変更モードが縮小モードの場合、前回決定した拡張間隔よりも短い期間を示す間隔に拡張間隔を決定してもよい。
In addition, when the change mode to be held is the steady mode, the duration calculation unit determines the high-reliability interval as the extension interval, and when the change mode to be held is the extension mode, the interval indicating a period longer than the previously determined extension interval If the extension mode is determined and the change mode to be held is the reduction mode, the extension interval may be determined as an interval indicating a period shorter than the previously determined extension interval.
また、図12は、本発明による端末装置の概要を示すブロック図である。本発明による端末装置は、図11に例示する端末装置90と同様であるため、説明を省略する。図12に例示する端末装置を用いることで、所定期間で装置間のコネクションが無効になる通信ネットワークにおいても、装置間のコネクションを維持しつつ、コネクションを維持するための通信負荷を抑制できる。
FIG. 12 is a block diagram showing an outline of the terminal device according to the present invention. The terminal device according to the present invention is the same as the terminal device 90 illustrated in FIG. By using the terminal device illustrated in FIG. 12, the communication load for maintaining the connection can be suppressed while maintaining the connection between the devices even in the communication network in which the connection between the devices is invalidated for a predetermined period.
上記の実施形態の一部又は全部は、以下のようにも記載され得るが、以下の記載に限定されない。
Some or all of the above embodiments may be described as follows, but are not limited to the following descriptions.
通信維持システムは、ユーザが操作する端末装置と、端末装置に対してメッセージ送信を仲介するサーバ装置と、端末装置に対してメッセージを送信して端末装置を操作するユーザに対してサービスを提供する他サーバ装置と、ファイアーウォール機能やNAT機能により端末装置とサーバ装置との間の通信を監視、中継、破棄するミドルボックス装置を備えていてもよい。このとき、端末装置は、端末が起動した時点、もしくは、端末装置上のネットワーク装置が起動した時点、もしくは、ユーザが操作して時点で、サーバ装置との持続コネクションの設定を開始し、サーバ装置との間で維持する持続コネクションが有効であると確認できた期間のうち最大のものを高信頼間隔とし、サーバ装置との間で設定する持続コネクションが有効かどうかを確認する間隔を拡張間隔として保持し、高信頼間隔の最大値が定まっていない状態では高信頼間隔経過後に、サーバ装置との間に新たに持続コネクションを設定し、高信頼間隔の最大値が定まった場合には、サーバ装置からの持続コネクションが有効かどうかを確認するキープアライブパケットを受信した際にサーバ装置との間に新たに持続コネクションを設定することで、サーバ装置との間で持続コネクションを維持し続ける持続接続管理部と、高信頼間隔及び拡張間隔を保持し、新しく設定する持続コネクションの拡張間隔を徐々に増加させていく拡大モードか、拡張間隔を徐々に減少させていく縮小モードか、拡張間隔を変化させない定常モードかを保持し、そのモードと高信頼間隔を基に拡張間隔を決定する持続期間計算部と、サーバ装置との間で持続コネクションを設定する際に、現時点から高信頼間隔経過後に高信頼間隔経過イベント、現時点から拡張間隔経過後に拡張間隔経過イベントを発生するよう端末に付随のタイマに設定するタイムアウト処理部と、端末装置を一意に識別するための端末識別子を取得する端末識別子管理部と、サーバ装置との間のTCP/IPコネクションを持続コネクションとして設定し、設定した際にサーバ装置に対して拡張間隔を通知するコネクション管理部と、サーバ装置との間の持続コネクションを通して、サーバ装置から送信されたメッセージを受信し、既定の処理を実行するメッセージ受信部とを含んでいてもよい。また、サーバ装置は、端末装置との間で持続コネクションを管理し、持続コネクションが導通しているかどうかを試行するためのキープアライブパケットを送信したり、端末装置に対してメッセージを送信したりする持続接続受信部と、端末装置から送信された拡張間隔に基づき、現時点から拡張間隔経過後に持続コネクションが導通しているかどうかを試行するキープアライブ処理部と、他サーバ装置からの端末装置に対するメッセージ送信要求を受理し、持続接続受信部に当該端末装置へのメッセージの送信を指示するメッセージ送信部と、
持続接続受信部に対して、当該端末装置から一番最後に設定された持続コネクションを用いてメッセージを送信するよう指示する活性接続管理部とを含んでいてもよい。 The communication maintenance system provides a service to a terminal device operated by a user, a server device that mediates message transmission to the terminal device, and a user who operates the terminal device by transmitting a message to the terminal device. You may provide the middle server apparatus which monitors, relays, and cancels communication between a terminal device and a server apparatus by another server apparatus and a firewall function or a NAT function. At this time, the terminal device starts setting a persistent connection with the server device when the terminal is activated, when the network device on the terminal device is activated, or when the user operates the server device. The maximum period that can be confirmed that the persistent connection maintained between the server and the server is valid is the high reliability interval, and the interval for confirming whether the persistent connection set with the server is valid is the extended interval. If the maximum value of the high-reliability interval is determined, a persistent connection is newly established with the server device after the high-reliability interval elapses, and the maximum value of the high-reliability interval is determined. When a keep-alive packet is received that confirms whether or not the persistent connection is valid, a new persistent connection is set up with the server device. With the persistent connection management unit that maintains the persistent connection with the server device, the extended mode that maintains the high reliability interval and the expansion interval and gradually increases the expansion interval of the persistent connection that is newly set, Between the server unit and the duration calculation unit that retains the reduced mode that gradually decreases the expansion interval or the steady mode that does not change the expansion interval and determines the expansion interval based on that mode and the high-reliability interval A time-out processing unit that sets a timer associated with the terminal to generate a high-reliability interval elapse event after elapse of a high-reliability interval from the current time, and an extended interval elapse event after elapse of the extended interval from the current time, A TCP / IP connection between the terminal identifier management unit that acquires a terminal identifier for uniquely identifying the device and the server device The message is sent from the server device through the persistent connection between the server and the connection management unit that notifies the server device of the expansion interval when it is set, and executes the default processing. And a message receiving unit. In addition, the server device manages a persistent connection with the terminal device, and transmits a keep alive packet to try whether or not the persistent connection is conductive, or transmits a message to the terminal device. Based on the extended connection received from the persistent connection receiving unit, the terminal device, a keep alive processing unit that tries to determine whether the persistent connection is conductive after the extended interval from the current time, and a message transmission from the other server device to the terminal device A message transmission unit that accepts the request and instructs the persistent connection reception unit to transmit a message to the terminal device;
An active connection management unit that instructs the persistent connection receiving unit to transmit a message using the last-established persistent connection from the terminal device may be included.
持続接続受信部に対して、当該端末装置から一番最後に設定された持続コネクションを用いてメッセージを送信するよう指示する活性接続管理部とを含んでいてもよい。 The communication maintenance system provides a service to a terminal device operated by a user, a server device that mediates message transmission to the terminal device, and a user who operates the terminal device by transmitting a message to the terminal device. You may provide the middle server apparatus which monitors, relays, and cancels communication between a terminal device and a server apparatus by another server apparatus and a firewall function or a NAT function. At this time, the terminal device starts setting a persistent connection with the server device when the terminal is activated, when the network device on the terminal device is activated, or when the user operates the server device. The maximum period that can be confirmed that the persistent connection maintained between the server and the server is valid is the high reliability interval, and the interval for confirming whether the persistent connection set with the server is valid is the extended interval. If the maximum value of the high-reliability interval is determined, a persistent connection is newly established with the server device after the high-reliability interval elapses, and the maximum value of the high-reliability interval is determined. When a keep-alive packet is received that confirms whether or not the persistent connection is valid, a new persistent connection is set up with the server device. With the persistent connection management unit that maintains the persistent connection with the server device, the extended mode that maintains the high reliability interval and the expansion interval and gradually increases the expansion interval of the persistent connection that is newly set, Between the server unit and the duration calculation unit that retains the reduced mode that gradually decreases the expansion interval or the steady mode that does not change the expansion interval and determines the expansion interval based on that mode and the high-reliability interval A time-out processing unit that sets a timer associated with the terminal to generate a high-reliability interval elapse event after elapse of a high-reliability interval from the current time, and an extended interval elapse event after elapse of the extended interval from the current time, A TCP / IP connection between the terminal identifier management unit that acquires a terminal identifier for uniquely identifying the device and the server device The message is sent from the server device through the persistent connection between the server and the connection management unit that notifies the server device of the expansion interval when it is set, and executes the default processing. And a message receiving unit. In addition, the server device manages a persistent connection with the terminal device, and transmits a keep alive packet to try whether or not the persistent connection is conductive, or transmits a message to the terminal device. Based on the extended connection received from the persistent connection receiving unit, the terminal device, a keep alive processing unit that tries to determine whether the persistent connection is conductive after the extended interval from the current time, and a message transmission from the other server device to the terminal device A message transmission unit that accepts the request and instructs the persistent connection reception unit to transmit a message to the terminal device;
An active connection management unit that instructs the persistent connection receiving unit to transmit a message using the last-established persistent connection from the terminal device may be included.
また、通信維持システムの端末装置は、端末装置が起動した時点、もしくは、端末装置上のネットワーク装置が起動した時点、もしくは、ユーザが操作した時点で、持続接続管理部はサーバとの持続コネクションの設定を開始し、持続期間計算部に対して持続コネクションの高信頼間隔と拡張間隔とを問い合わせ、持続期間計算部が、保持している高信頼間隔を取得して、現在の期間計算が、拡大モードか縮小モードか定常モードかを判断し、定常モードの場合、拡張間隔は高信頼間隔と同一として持続接続管理部に渡し、拡大モード時に算出する拡張間隔を前回算出した拡張間隔よりも大きい値として算出し、縮小モード時に算出する拡張間隔を前回算出した拡張間隔よりも小さい値として算出し、持続接続管理部が、持続コネクションを管理するための一意な接続識別子を発行し、接続識別子と高信頼間隔、拡張間隔とをタイムアウト処理部に対して渡し、タイムアウト処理部が、現時点から高信頼間隔経過後に接続識別子と当該高信頼間隔とを含んだ高信頼間隔経過イベント、現時点から拡張間隔経過後に接続識別子を含んだ拡張間隔経過イベントを発生するよう端末に付随のタイマを設定し、持続接続管理部が、端末識別子管理部から端末を識別するための端末識別子を取得し、コネクション管理部に対して接続識別子、端末識別子、拡張間隔を渡して、持続コネクションの設定を指示し、コネクション管理部が、サーバ装置との間で設定されている持続コネクションで、現在未使用と分類されたコネクションがあるか確認し、未使用のコネクションがなければ、端末装置からサーバ装置に対して新しいコネクションの設定を開始し、サーバ装置の持続接続受信部との間にコネクションを設定して、当該コネクションを接続識別子と関連付けて管理し、未使用のコネクションがあれば、当該コネクションを接続識別子と関連付けて管理し、接続識別子と関連付けた持続コネクションを通じて、サーバ装置の持続接続受信部に端末識別子と拡張間隔とを含んだ新規キープアライブ期間更新通知を送信してもよい。
In addition, the terminal device of the communication maintenance system, when the terminal device is activated, when the network device on the terminal device is activated, or when the user operates, the persistent connection management unit establishes the persistent connection with the server. Start setting, inquire the duration calculation unit about the high-reliability interval and extended interval of the persistent connection, the duration calculation unit acquires the high-reliability interval held, and the current period calculation is expanded Determine whether the mode, reduced mode or steady mode. In the steady mode, the expansion interval is the same as the reliable interval and is passed to the persistent connection manager, and the expansion interval calculated in the expansion mode is larger than the previously calculated expansion interval. The extension interval calculated in the reduced mode is calculated as a value smaller than the previously calculated extension interval, and the persistent connection management unit A unique connection identifier for management is issued, the connection identifier, the high-reliability interval, and the extended interval are passed to the timeout processing unit, and the time-out processing unit connects the connection identifier and the high-reliability interval after the high-reliability interval elapses from the current time. A high-reliability interval elapse event that includes a connection identifier and an extended interval elapse event that includes a connection identifier after the elapse of an extension interval from the current time, a timer attached to the terminal is set, and the persistent connection management unit sends the terminal identifier management unit to the terminal A terminal identifier for identifying the terminal is acquired, the connection identifier, the terminal identifier, and the extension interval are passed to the connection management unit, and the setting of the persistent connection is instructed. The connection management unit is set with the server device. If there is a connection that is classified as currently unused, and if there is no unused connection, the terminal device Starts a new connection setting for the server device, sets a connection with the persistent connection receiver of the server device, manages the connection in association with the connection identifier, and if there is an unused connection, The connection may be managed in association with the connection identifier, and a new keep alive period update notification including the terminal identifier and the extension interval may be transmitted to the persistent connection receiver of the server device through the persistent connection associated with the connection identifier.
また、通信維持システムのサーバ装置は、持続接続受信部が、持続コネクションを通じて新規キープアライブ期間更新通知を受信すると、当該持続コネクションに対して一意な接続識別子を発行し、当該接続識別子と当該持続コネクションとを関連付けて保存し、活性接続管理部に対して当該接続識別子、新規キープアライブ期間更新通知に含まれる端末識別子を活性接続管理部に対して渡し、活性接続管理部が、既に当該端末識別子と別の接続識別子とが関連付けて保管しているか確認し、関連付けられている場合は既存の関連付けを削除し、端末識別子と新しい接続識別子とを関連付けて保管し、持続接続受信部が、キープアライブ処理部に対して、接続識別子と新規キープアライブ期間更新通知に含まれる拡張間隔とを渡し、キープアライブ処理部が、現時点から拡張間隔経過後に接続識別子、拡張間隔を含んだキープアライブイベントを発生するよう装置に付随のタイマを設定するようにしてもよい。
The server device of the communication maintenance system issues a unique connection identifier to the persistent connection when the persistent connection receiver receives the new keep-alive period update notification through the persistent connection, and the connection identifier and the persistent connection And the connection identifier and the terminal identifier included in the new keep-alive period update notification are passed to the active connection management unit, and the active connection management unit Check whether another connection identifier is stored in association with it, and if so, delete the existing association, store the terminal identifier and the new connection identifier in association with each other, and the persistent connection reception unit performs the keep-alive process. Pass the connection identifier and the extended interval included in the new keep-alive period update notification. Live processing unit, connected from the current time after a lapse of diastolic interval identifier may be set to the accompanying timer device to generate a keep-alive events including the diastolic interval.
また、通信維持システムの端末装置は、コネクション管理部が、ある持続コネクションを通じてメッセージを受信すると、当該メッセージをメッセージ受信部に渡し、メッセージ受信部が、メッセージの内容に応じた処理を実行し、コネクション管理部が、メッセージを受信した持続コネクションと関連付けて保存した接続識別子を取得し、持続接続管理部に対して接続識別子で示される持続コネクションでメッセージを受信したことを通知し、当該持続コネクションを未使用としてマークし、持続接続管理部が、メッセージの受信を通知されると、当該接続識別子をタイムアウト処理部に対して渡し、タイムアウト処理部が、渡された接続識別子を含む高信頼間隔経過イベントおよび拡張間隔経過イベントの発生をキャンセルし、既定時間経過後に再度サーバ装置との間に持続コネクションを設定してもよい。
In addition, when the connection management unit receives a message through a certain persistent connection, the terminal device of the communication maintenance system passes the message to the message reception unit, and the message reception unit executes processing according to the content of the message, The management unit acquires a connection identifier stored in association with the persistent connection that has received the message, notifies the persistent connection management unit that the message has been received through the persistent connection indicated by the connection identifier, and When it is marked as used and the persistent connection manager is notified of the receipt of the message, the connection identifier is passed to the timeout processing unit, and the timeout processing unit includes a reliable interval elapsed event including the passed connection identifier and Cancel the occurrence of extended interval elapsed event, default It may be set persistent connection between the server again device after elapse.
また、通信維持システムの端末装置は、高信頼間隔経過イベントが発生すると、タイムアウト処理部が、持続接続管理部に対して高信頼間隔経過イベントの接続識別子で示される持続コネクションの高信頼間隔経過を通知し、持続接続管理部が、持続期間計算部の現在の動作モードを確認し、持続期間計算部の動作モードが定常状態だった場合、持続期間計算部より現在の高信頼間隔を取得し、タイムアウト処理部に対して当該持続コネクションの拡張間隔経過イベントの発生をキャンセルし、高信頼間隔経過イベントに含まれる高信頼間隔が現在の高信頼間隔より短い場合は処理を終了し、高信頼間隔経過イベントに含まれる高信頼間隔が、現在の高信頼間隔と同じか長い場合、もしくは、持続期間計算部の動作モードが定常状態以外だった場合、サーバ装置との間に持続コネクションを追加してもよい。
In addition, when a highly reliable interval elapse event occurs, the terminal device of the communication maintenance system causes the time-out processing unit to indicate the elapse of the reliable interval of the persistent connection indicated by the connection identifier of the highly reliable interval elapse event to the persistent connection management unit. The persistent connection management unit confirms the current operation mode of the duration calculation unit, and if the operation mode of the duration calculation unit is in a steady state, obtains the current high-reliability interval from the duration calculation unit, Cancels the occurrence of the extended interval elapsed event of the persistent connection for the timeout processing unit, and terminates the process if the high-reliability interval included in the high-reliability interval elapse event is shorter than the current high-reliability interval, and the high-reliability interval elapses If the high-confidence interval included in the event is the same or longer than the current high-reliability interval, or the operation mode of the duration calculation unit is other than steady state If it may be added persistent connection with the server device.
また、通信維持システムのサーバ装置は、キープアライブイベントが発生すると、キープアライブ処理部が、持続接続受信部に対して、キープアライブイベントの接続識別子で示される持続コネクションに対してキープアライブイベントに含まれる拡張間隔を内容として持つキープアライブパケットの送信を指示し、持続接続受信部が、接続識別子で示される持続コネクションを取得し、キープアライブパケットを送出してもよい。
In addition, in the server device of the communication maintenance system, when a keep alive event occurs, the keep alive processing unit is included in the keep alive event with respect to the continuous connection indicated by the connection identifier of the keep alive event with respect to the continuous connection receiving unit. It may be instructed to transmit a keep alive packet having the extended interval as a content, and the persistent connection receiving unit may acquire the persistent connection indicated by the connection identifier and transmit the keep alive packet.
また、通信維持システムの端末装置は、キープアライブパケットをコネクション管理部で受信すると、コネクション管理部が、当該持続コネクションに関連付けられた持続識別子を取得し、持続接続管理部に対してキープアライブの受信を通知し、当該持続コネクションを未使用としてマークし、持続接続管理部が、タイムアウト処理部に対して当該接続識別子を含む高信頼間隔経過イベント、拡張間隔経過イベントの発生をキャンセルさせ、持続期間計算部の動作モードを確認し、持続期間計算部のモードが定常モードの場合、サーバ装置との間に再度持続コネクションを設定し、持続期間計算部のモードが縮小モードだった場合、持続接続管理部は持続期間計算部のモードを定常モードにし、持続期間計算部のモードが拡大モードだった場合、受信したキープアライブパケットに含まれる拡張間隔を高信頼間隔として持続期間計算部に対して通知し、持続期間計算部が、受け取った高信頼間隔を保持してもよい。
In addition, when the terminal device of the communication maintenance system receives the keep alive packet at the connection management unit, the connection management unit acquires the persistent identifier associated with the persistent connection, and receives the keep alive from the persistent connection management unit. , Mark the persistent connection as unused, and the persistent connection manager cancels the occurrence of the reliable interval elapsed event and extended interval elapsed event including the connection identifier to the timeout processing unit, and calculates the duration. If the mode of the duration calculation unit is the steady mode, a persistent connection is set again with the server device, and if the mode of the duration calculation unit is the reduced mode, the persistent connection management unit Sets the mode of the duration calculation unit to the steady mode, and the mode of the duration calculation unit is the expansion mode If, notified to the duration calculator extended intervals included in keepalive packet received as reliable interval, duration calculator may hold a reliable interval received.
また、通信維持システムの端末装置は、拡張間隔経過イベントが発生すると、タイムアウト処理部が、持続接続管理部に対して当該接続識別子で示される持続コネクションのタイムアウトを通知し、持続接続管理部が、コネクション管理部に対して当該接続識別子を持つ持続コネクションの破棄を通知し、コネクション管理部が、接続識別子に関連付けられた持続コネクションを破棄し、持続接続管理部が、持続期間計算部に対して縮小モードとして動作するよう指示してもよい。
In addition, when an extended interval elapsed event occurs, the terminal device of the communication maintenance system notifies the persistent connection manager of the timeout of the persistent connection indicated by the connection identifier to the persistent connection manager, and the persistent connection manager Notify the connection manager of the destruction of the persistent connection with the connection identifier, the connection manager discards the persistent connection associated with the connection identifier, and the persistent connection manager reduces the duration calculation unit It may be instructed to operate as a mode.
以上、実施形態及び実施例を参照して本願発明を説明したが、本願発明は上記実施形態および実施例に限定されるものではない。本願発明の構成や詳細には、本願発明のスコープ内で当業者が理解し得る様々な変更をすることができる。
As mentioned above, although this invention was demonstrated with reference to embodiment and an Example, this invention is not limited to the said embodiment and Example. Various changes that can be understood by those skilled in the art can be made to the configuration and details of the present invention within the scope of the present invention.
この出願は、2012年7月17日に出願された日本特許出願2012-158674を基礎とする優先権を主張し、その開示の全てをここに取り込む。
This application claims priority based on Japanese Patent Application 2012-158664 filed on July 17, 2012, the entire disclosure of which is incorporated herein.
本発明は、装置間の通信を維持する通信維持システムに好適に適用される。
The present invention is preferably applied to a communication maintenance system that maintains communication between devices.
1 端末装置
2 サーバ装置
3 他サーバ装置
4 ミドルボックス装置
11 持続接続管理部
12 持続期間計算部
13 タイムアウト処理部
14 端末識別子管理部
15 コネクション管理部
16 メッセージ受信部
21 持続接続受信部
22 キープアライブ処理部
23 メッセージ送信部
24 活性接続管理部
31 メッセージ送信アプリ DESCRIPTION OFSYMBOLS 1 Terminal apparatus 2 Server apparatus 3 Other server apparatus 4 Middle box apparatus 11 Persistent connection management part 12 Persistence period calculation part 13 Timeout processing part 14 Terminal identifier management part 15 Connection management part 16 Message receiving part 21 Persistent connection receiving part 22 Keep alive process Unit 23 Message transmission unit 24 Active connection management unit 31 Message transmission application
2 サーバ装置
3 他サーバ装置
4 ミドルボックス装置
11 持続接続管理部
12 持続期間計算部
13 タイムアウト処理部
14 端末識別子管理部
15 コネクション管理部
16 メッセージ受信部
21 持続接続受信部
22 キープアライブ処理部
23 メッセージ送信部
24 活性接続管理部
31 メッセージ送信アプリ DESCRIPTION OF
Claims (10)
- サーバ装置と、
前記サーバ装置との間に設定される持続コネクションを用いて当該サーバ装置と通信を行う端末装置とを備え、
前記サーバ装置と前記端末装置は、前記持続コネクションを用いた通信が予め定められた期間であるキープアライブ間隔行われなかった場合に、当該持続コネクションを無効にする少なくとも1つ以上のミドルボックス装置を介して相互に接続され、
前記端末装置は、
前記持続コネクションが有効であると確認できた場合のキープアライブ間隔のうち最大の期間である高信頼間隔と、前記持続コネクションが有効か否かの確認に用いられる前記高信頼間隔よりも長い期間の拡張間隔を保持し、前記拡張間隔を指定して前記サーバ装置との持続コネクションを設定する接続管理部を含み、
前記サーバ装置は、
前記端末装置との間に持続コネクションが設定されてから当該持続コネクションの設定で指定された拡張間隔経過した時点で、前記端末装置にキープアライブパケットを送信するパケット送信部を含み、
前記端末装置の接続管理部は、前記持続コネクションを設定してから前記高信頼間隔が経過した時点で、前記キープアライブパケットの受信状態に応じて決定される拡張間隔を指定した新たな持続コネクションを前記サーバ装置との間に設定し、当該新たな持続コネクションに基づくキープアライブパケットを前記サーバ装置から受信したときに、当該持続コネクションの設定により指定された拡張間隔を高信頼間隔に設定する
ことを特徴とする通信維持システム。 A server device;
A terminal device that communicates with the server device using a persistent connection set up with the server device;
The server device and the terminal device may include at least one middle box device that invalidates the persistent connection when communication using the persistent connection is not performed during a keep-alive interval that is a predetermined period. Connected to each other through
The terminal device
A high-reliability interval that is the maximum period of keep-alive intervals when it is confirmed that the persistent connection is valid, and a period that is longer than the reliable interval that is used to confirm whether the persistent connection is valid A connection management unit for holding an extension interval, and setting a persistent connection with the server device by specifying the extension interval;
The server device
A packet transmission unit that transmits a keep-alive packet to the terminal device when an extended interval specified in the setting of the persistent connection has elapsed since a persistent connection was set up with the terminal device;
The connection management unit of the terminal device creates a new persistent connection that specifies an extension interval determined according to a reception state of the keep-alive packet when the high-reliability interval elapses after the persistent connection is set. Set with the server device, and when the keep-alive packet based on the new persistent connection is received from the server device, the extended interval specified by the setting of the persistent connection is set to a highly reliable interval. A communication maintenance system. - 端末装置は、拡張間隔の変更方法を示す変更モードとして、新しく設定する持続コネクションの拡張間隔を徐々に増加させていく拡大モード、拡張間隔を徐々に減少させていく縮小モード、または、拡張間隔を変化させない定常モードのいずれかの変更モードを保持し、当該変更モードおよび高信頼間隔をもとに、拡張間隔を決定する持続期間計算部を含み、
接続管理部は、キープアライブパケットの受信状態に応じて変更モードを決定し、当該変更モードおよび高信頼間隔をもとに決定される拡張間隔を指定した新たな持続コネクションをサーバ装置との間に設定する
請求項1記載の通信維持システム。 As a change mode that indicates a method for changing the extension interval, the terminal device uses an expansion mode that gradually increases the extension interval of the newly set persistent connection, a reduction mode that gradually decreases the extension interval, or an extension interval. A duration calculation unit that holds any change mode of the steady mode that does not change and determines an expansion interval based on the change mode and the high-reliability interval,
The connection management unit determines the change mode according to the reception state of the keep-alive packet, and establishes a new persistent connection between the server device and the extended interval determined based on the change mode and the high-reliability interval. The communication maintenance system according to claim 1 to be set. - 持続期間計算部は、初期状態で変更モードとして拡張モードを保持し、
接続管理部は、持続期間計算部が変更モードとして拡張モードを保持している状態で、新たな持続コネクションに基づくキープアライブパケットをサーバ装置から受信しなかったとき、変更モードを拡張モードから縮小モードに変更し、当該変更モードおよび高信頼間隔をもとに決定される拡張間隔を指定した新たな持続コネクションをサーバ装置との間に設定する
請求項2記載の通信維持システム。 The duration calculation unit maintains the extended mode as the change mode in the initial state,
The connection management unit changes the change mode from the extended mode to the reduced mode when a keepalive packet based on a new persistent connection is not received from the server device while the duration calculation unit holds the extended mode as the change mode. The communication maintenance system according to claim 2, wherein a new persistent connection that specifies an extension interval determined based on the change mode and the high-reliability interval is set with the server device. - 接続管理部は、持続期間計算部が変更モードとして縮小モードを保持している状態で、新たな持続コネクションに基づくキープアライブパケットをサーバ装置から受信したとき、変更モードを縮小モードから定常モードに変更し、当該持続コネクションの設定により指定された拡張間隔をもとに設定される高信頼間隔を指定した新たな持続コネクションをサーバ装置との間に設定する
請求項3記載の通信維持システム。 The connection management unit changes the change mode from the reduced mode to the steady mode when a keep alive packet based on a new persistent connection is received from the server device while the duration calculation unit holds the reduced mode as the change mode. The communication maintenance system according to claim 3, wherein a new persistent connection that specifies a high-reliability interval that is set based on an extension interval that is specified by the setting of the persistent connection is set between the server apparatus and the server apparatus. - 持続期間計算部は、保持する変更モードが定常モードの場合、高信頼間隔を拡張間隔と決定し、保持する変更モードが拡大モードの場合、前回決定した拡張間隔よりも長い期間を示す間隔に拡張間隔を決定し、保持する変更モードが縮小モードの場合、前回決定した拡張間隔よりも短い期間を示す間隔に拡張間隔を決定する
請求項2から請求項4のうちのいずれか1項に記載の通信維持システム。 When the change mode to be held is the steady mode, the duration calculation unit determines the high-reliability interval as the extension interval, and when the change mode to be held is the extension mode, the duration calculation unit extends to an interval that indicates a period longer than the previously determined extension interval. The interval is determined, and when the change mode to be held is the reduction mode, the expansion interval is determined to be an interval that indicates a period shorter than the previously determined expansion interval. Communication maintenance system. - サーバ装置との間に設定される持続コネクションを用いて当該サーバ装置と通信を行う端末装置であって、
前記サーバ装置とは、前記持続コネクションを用いた通信が予め定められた期間であるキープアライブ間隔行われなかった場合に、当該持続コネクションを無効にする少なくとも1つ以上のミドルボックス装置を介して接続され、
前記持続コネクションが有効であると確認できた場合のキープアライブ間隔のうち最大の期間である高信頼間隔と、前記持続コネクションが有効か否かの確認に用いられる前記高信頼間隔よりも長い期間の拡張間隔を保持し、前記拡張間隔を指定して前記サーバ装置との持続コネクションを設定する接続管理部を備え、
前記接続管理部は、前記持続コネクションを設定してから前記高信頼間隔が経過した時点で、前記サーバ装置との間に持続コネクションが設定されてから当該持続コネクションの設定で指定された拡張間隔経過したときに前記サーバ装置から送信されるキープアライブパケットの受信状態に応じて決定される拡張間隔を指定した新たな持続コネクションを前記サーバ装置との間に設定し、当該新たな持続コネクションに基づくキープアライブパケットを前記サーバ装置から受信したときに、当該持続コネクションの設定により指定された拡張間隔を高信頼間隔に設定する
ことを特徴とする端末装置。 A terminal device that communicates with the server device using a persistent connection set with the server device,
The server device is connected via at least one middle box device that invalidates the persistent connection when communication using the persistent connection is not performed during a predetermined period of a keep-alive interval. And
A high-reliability interval that is the maximum period of keep-alive intervals when it is confirmed that the persistent connection is valid, and a period that is longer than the reliable interval that is used to confirm whether the persistent connection is valid A connection management unit for holding an extension interval, and setting a persistent connection with the server device by specifying the extension interval;
The connection management unit, when the high-reliability interval elapses after setting the persistent connection, the extended interval specified by the setting of the persistent connection since the persistent connection is established with the server device A new persistent connection that specifies an extension interval determined according to a reception state of a keep-alive packet transmitted from the server device is set between the server device and the keep based on the new persistent connection. When the alive packet is received from the server device, the extended interval designated by the setting of the persistent connection is set as a highly reliable interval. - サーバ装置との間に設定される持続コネクションを用いて当該サーバ装置と通信を行い、当該サーバ装置とは、前記持続コネクションを用いた通信が予め定められた期間であるキープアライブ間隔行われなかった場合に、当該持続コネクションを無効にする少なくとも1つ以上のミドルボックス装置を介して接続される端末装置は、前記持続コネクションが有効であると確認できた場合のキープアライブ間隔のうち最大の期間である高信頼間隔と、前記持続コネクションが有効か否かの確認に用いられる前記高信頼間隔よりも長い期間の拡張間隔を保持し、
前記端末装置は、前記拡張間隔を指定して前記サーバ装置との持続コネクションを設定し、
前記サーバ装置は、前記端末装置との間に持続コネクションが設定されてから当該持続コネクションの設定で指定された拡張間隔経過した時点で、前記端末装置にキープアライブパケットを送信し、
前記端末装置は、前記持続コネクションを設定してから前記高信頼間隔が経過した時点で、前記キープアライブパケットの受信状態に応じて決定される拡張間隔を指定した新たな持続コネクションを前記サーバ装置との間に設定し、
前記端末装置は、前記新たな持続コネクションに基づくキープアライブパケットを前記サーバ装置から受信したときに、当該持続コネクションの設定により指定された拡張間隔を高信頼間隔に設定する
ことを特徴とする通信維持方法。 Communication with the server apparatus is performed using a persistent connection set with the server apparatus, and communication using the persistent connection is not performed with the server apparatus during a predetermined period. A terminal device connected via at least one middle box device that invalidates the persistent connection is a maximum period of a keep-alive interval when it is confirmed that the persistent connection is valid. Holding a certain reliable interval and an extended interval of a longer period than the reliable interval used for checking whether the persistent connection is valid;
The terminal device sets a persistent connection with the server device by specifying the extension interval,
The server device transmits a keep-alive packet to the terminal device when an extended interval specified in the setting of the persistent connection has elapsed since a persistent connection was set up with the terminal device,
The terminal device establishes a new persistent connection specifying an extension interval determined according to a reception state of the keepalive packet with the server device when the high-reliability interval elapses after setting the persistent connection. Set between
When the terminal device receives a keep-alive packet based on the new persistent connection from the server device, the terminal device sets the extended interval specified by the setting of the persistent connection as a highly reliable interval. Method. - 端末装置は、拡張間隔の変更方法を示す変更モードとして、新しく設定する持続コネクションの拡張間隔を徐々に増加させていく拡大モード、拡張間隔を徐々に減少させていく縮小モード、または、拡張間隔を変化させない定常モードのいずれかの変更モードを保持し、
端末装置は、前記変更モードおよび高信頼間隔をもとに、拡張間隔を決定し、
端末装置は、キープアライブパケットの受信状態に応じて変更モードを決定し、
端末装置は、前記変更モードおよび高信頼間隔をもとに決定される拡張間隔を指定した新たな持続コネクションをサーバ装置との間に設定する
請求項7記載の通信維持方法。 As a change mode that indicates a method for changing the extension interval, the terminal device uses an expansion mode that gradually increases the extension interval of the newly set persistent connection, a reduction mode that gradually decreases the extension interval, or an extension interval. Hold one of the change modes of the steady mode that does not change,
The terminal device determines an expansion interval based on the change mode and the high reliability interval,
The terminal device determines the change mode according to the reception state of the keep alive packet,
The communication maintenance method according to claim 7, wherein the terminal device sets a new persistent connection that specifies an extension interval determined based on the change mode and the high-reliability interval with the server device. - サーバ装置との間に設定される持続コネクションを用いて当該サーバ装置と通信を行い、当該サーバ装置とは、前記持続コネクションを用いた通信が予め定められた期間であるキープアライブ間隔行われなかった場合に、当該持続コネクションを無効にする少なくとも1つ以上のミドルボックス装置を介して接続される端末装置は、前記持続コネクションが有効であると確認できた場合のキープアライブ間隔のうち最大の期間である高信頼間隔と、前記持続コネクションが有効か否かの確認に用いられる前記高信頼間隔よりも長い期間の拡張間隔を保持し、
前記端末装置は、前記拡張間隔を指定して前記サーバ装置との持続コネクションを設定し、
前記端末装置は、前記持続コネクションを設定してから前記高信頼間隔が経過した時点で、前記サーバ装置との間に持続コネクションが設定されてから当該持続コネクションの設定で指定された拡張間隔経過したときに前記サーバ装置から送信されるキープアライブパケットの受信状態に応じて決定される拡張間隔を指定した新たな持続コネクションを前記サーバ装置との間に設定し、
前記端末装置は、前記新たな持続コネクションに基づくキープアライブパケットを前記サーバ装置から受信したときに、当該持続コネクションの設定により指定された拡張間隔を高信頼間隔に設定する
ことを特徴とするサーバ装置との接続維持方法。 Communication with the server apparatus is performed using a persistent connection set with the server apparatus, and communication using the persistent connection is not performed with the server apparatus during a predetermined period. A terminal device connected via at least one middle box device that invalidates the persistent connection is a maximum period of a keep-alive interval when it is confirmed that the persistent connection is valid. Holding a certain reliable interval and an extended interval of a longer period than the reliable interval used for checking whether the persistent connection is valid;
The terminal device sets a persistent connection with the server device by specifying the extension interval,
When the high-reliability interval has elapsed since the terminal device set the persistent connection, the extended interval specified in the persistent connection setting has elapsed since the persistent connection was established with the server device. A new persistent connection that specifies an extension interval determined according to the reception state of a keep-alive packet transmitted from the server device is sometimes set between the server device and
When the terminal device receives a keep-alive packet based on the new persistent connection from the server device, the terminal device sets the extended interval specified by the setting of the persistent connection as a highly reliable interval. How to maintain connection with. - サーバ装置との間に設定される持続コネクションを用いて当該サーバ装置と通信を行い、当該サーバ装置とは、前記持続コネクションを用いた通信が予め定められた期間であるキープアライブ間隔行われなかった場合に、当該持続コネクションを無効にする少なくとも1つ以上のミドルボックス装置を介して接続されるコンピュータに適用される接続維持プログラムであって、
前記コンピュータに、
前記持続コネクションが有効であると確認できた場合のキープアライブ間隔のうち最大の期間である高信頼間隔と、前記持続コネクションが有効か否かの確認に用いられる前記高信頼間隔よりも長い期間の拡張間隔を保持し、前記拡張間隔を指定して前記サーバ装置との持続コネクションを設定する接続管理処理を実行させ、
前記接続管理処理で、前記持続コネクションを設定してから前記高信頼間隔が経過した時点で、前記サーバ装置との間に持続コネクションが設定されてから当該持続コネクションの設定で指定された拡張間隔経過したときに前記サーバ装置から送信されるキープアライブパケットの受信状態に応じて決定される拡張間隔を指定した新たな持続コネクションを前記サーバ装置との間に設定させ、当該新たな持続コネクションに基づくキープアライブパケットを前記サーバ装置から受信したときに、当該持続コネクションの設定により指定された拡張間隔を高信頼間隔に設定させる
ことを特徴とする接続維持プログラム。 Communication with the server apparatus is performed using a persistent connection set with the server apparatus, and communication using the persistent connection is not performed with the server apparatus during a predetermined period. A connection maintenance program applied to a computer connected via at least one or more middlebox devices to invalidate the persistent connection,
In the computer,
A high-reliability interval that is the maximum period of keep-alive intervals when it is confirmed that the persistent connection is valid, and a period that is longer than the reliable interval that is used to confirm whether the persistent connection is valid Holding an extension interval, specifying the extension interval and executing a connection management process for setting a persistent connection with the server device;
In the connection management process, when the high-reliability interval elapses after setting the persistent connection, the extended interval specified in the setting of the persistent connection has elapsed since the persistent connection was established with the server device. A new persistent connection that specifies an extension interval determined according to a reception state of a keep-alive packet transmitted from the server device is set between the server device and the keep based on the new persistent connection. A connection maintenance program that, when receiving an alive packet from the server device, causes the extended interval specified by the setting of the persistent connection to be set to a highly reliable interval.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014525698A JP6176247B2 (en) | 2012-07-17 | 2013-06-17 | Communication maintenance system, terminal device, communication maintenance method, and connection maintenance program |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012-158674 | 2012-07-17 | ||
JP2012158674 | 2012-07-17 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2014013674A1 true WO2014013674A1 (en) | 2014-01-23 |
Family
ID=49948518
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/JP2013/003763 WO2014013674A1 (en) | 2012-07-17 | 2013-06-17 | Communication keeping system, terminal device, communication keeping method, and connection keeping program |
Country Status (2)
Country | Link |
---|---|
JP (1) | JP6176247B2 (en) |
WO (1) | WO2014013674A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2016063425A (en) * | 2014-09-18 | 2016-04-25 | 株式会社東芝 | Communication device, communication system, and communication method |
JP2018195288A (en) * | 2017-05-16 | 2018-12-06 | 富士通株式会社 | Fuzzing test apparatus, fuzzing test method, and fuzzing test program |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
AT522844B1 (en) * | 2019-07-24 | 2021-05-15 | Frequentis Ag | Method for the transmission of data between a vehicle and a traffic safety system |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003018235A (en) * | 2001-06-29 | 2003-01-17 | Canon Inc | Communication system, communication method and control program |
US20080165796A1 (en) * | 2007-01-05 | 2008-07-10 | International Business Machines Corporation | Method for a heartbeat algorithm for a dynamically changing network environment |
US20080205288A1 (en) * | 2007-02-28 | 2008-08-28 | Microsoft Corporation | Concurrent connection testing for computation of NAT timeout period |
-
2013
- 2013-06-17 WO PCT/JP2013/003763 patent/WO2014013674A1/en active Application Filing
- 2013-06-17 JP JP2014525698A patent/JP6176247B2/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003018235A (en) * | 2001-06-29 | 2003-01-17 | Canon Inc | Communication system, communication method and control program |
US20080165796A1 (en) * | 2007-01-05 | 2008-07-10 | International Business Machines Corporation | Method for a heartbeat algorithm for a dynamically changing network environment |
US20080205288A1 (en) * | 2007-02-28 | 2008-08-28 | Microsoft Corporation | Concurrent connection testing for computation of NAT timeout period |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2016063425A (en) * | 2014-09-18 | 2016-04-25 | 株式会社東芝 | Communication device, communication system, and communication method |
US10003543B2 (en) | 2014-09-18 | 2018-06-19 | Kabushiki Kaisha Toshiba | Communication device, communication system, and communication method |
JP2018195288A (en) * | 2017-05-16 | 2018-12-06 | 富士通株式会社 | Fuzzing test apparatus, fuzzing test method, and fuzzing test program |
JP7027903B2 (en) | 2017-05-16 | 2022-03-02 | 富士通株式会社 | Fuzzing test device, fuzzing test method and fuzzing test program |
Also Published As
Publication number | Publication date |
---|---|
JP6176247B2 (en) | 2017-08-09 |
JPWO2014013674A1 (en) | 2016-06-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3490224A1 (en) | Data synchronization method and system | |
US10191760B2 (en) | Proxy response program, proxy response device and proxy response method | |
US11251981B2 (en) | Communication method and apparatus | |
US9621412B2 (en) | Method for guaranteeing service continuity in a telecommunication network and system thereof | |
CN107733808B (en) | Flow transmission method and device | |
CN109040295B (en) | Method and device for determining abnormal disconnection, terminal and storage medium | |
KR102128356B1 (en) | Resource acquisition method and device | |
CN110932876B (en) | A communication system, method and device | |
CN110771097B (en) | Connectivity monitoring for data tunneling between network device and application server | |
JP6176247B2 (en) | Communication maintenance system, terminal device, communication maintenance method, and connection maintenance program | |
US10680930B2 (en) | Method and apparatus for communication in virtual network | |
KR102412225B1 (en) | Message server and message processing apparatus including the same | |
KR102412226B1 (en) | Message server and message processing apparatus including the same | |
US20230146880A1 (en) | Management system and management method | |
JP5370493B2 (en) | COMMUNICATION SYSTEM, COMMUNICATION DEVICE, COMMUNICATION CONTROL METHOD, AND COMMUNICATION CONTROL PROGRAM | |
JP2014146876A (en) | Message distribution system and message distribution method | |
JP6248822B2 (en) | Communication address management system, building management system, and communication address management program | |
JP6014068B2 (en) | Relay device, relay method, and computer program | |
WO2014199692A1 (en) | Network communication confirmation device, network communication confirmation method, and network communication confirmation program | |
KR20220055259A (en) | Interworking support device for nf service and control method thereof | |
JP2017041714A (en) | Communication system, communication method, communication node device, and program | |
EP3771175B1 (en) | Forwarding method and forwarder for authentication information in internet of things | |
CN106612235B (en) | Route issuing method and device | |
CN116366598A (en) | Network address allocation method and device, electronic equipment and storage medium | |
CN117544665A (en) | Edge node management method and device, electronic equipment and readable storage medium |
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: 13820167 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 2014525698 Country of ref document: JP Kind code of ref document: A |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 13820167 Country of ref document: EP Kind code of ref document: A1 |