US20170222919A1 - Communication device, communication system, and computer program product - Google Patents
Communication device, communication system, and computer program product Download PDFInfo
- Publication number
- US20170222919A1 US20170222919A1 US15/257,169 US201615257169A US2017222919A1 US 20170222919 A1 US20170222919 A1 US 20170222919A1 US 201615257169 A US201615257169 A US 201615257169A US 2017222919 A1 US2017222919 A1 US 2017222919A1
- Authority
- US
- United States
- Prior art keywords
- relay server
- connection
- managing unit
- message
- devices
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000004891 communication Methods 0.000 title claims abstract description 132
- 238000004590 computer program Methods 0.000 title claims description 8
- 230000005540 biological transmission Effects 0.000 claims abstract description 43
- 238000012545 processing Methods 0.000 description 84
- 238000012986 modification Methods 0.000 description 28
- 230000004048 modification Effects 0.000 description 28
- 238000010586 diagram Methods 0.000 description 22
- 230000004044 response Effects 0.000 description 18
- 230000002452 interceptive effect Effects 0.000 description 15
- 238000000034 method Methods 0.000 description 13
- 230000006870 function Effects 0.000 description 11
- 238000012546 transfer Methods 0.000 description 11
- 230000008569 process Effects 0.000 description 10
- 230000007246 mechanism Effects 0.000 description 8
- 239000002131 composite material Substances 0.000 description 7
- 230000000694 effects Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000001174 ascending effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 230000002542 deteriorative effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/44—Distributed routing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/19—Flow control; Congestion control at layers above the network layer
- H04L47/193—Flow control; Congestion control at layers above the network layer at the transport layer, e.g. TCP related
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/24—Traffic characterised by specific attributes, e.g. priority or QoS
- H04L47/2441—Traffic characterised by specific attributes, e.g. priority or QoS relying on flow classification, e.g. using integrated services [IntServ]
-
- 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/141—Setup of application sessions
-
- 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/142—Managing session states for stateless protocols; Signalling session states; State transitions; Keeping-state mechanisms
-
- 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
Definitions
- Embodiments described herein relate generally to a communication device, a communication system, and a computer program product.
- a first client device out of the client devices establishes a connection with the relay server and maintains the connected state.
- a second client device also establishes a connection with the relay server.
- the relay server transfers the message to the second client device.
- a plurality of relay servers may be provided.
- a certain number of relay servers out of the relay servers may possibly be shut down (referred to as scale-in).
- the interactive communication systems execute scale-in at times when fewer users use the systems, such as night-time, to reduce power consumption or carry out maintenance of the relay servers.
- a relay server when a relay server is shut down, client devices connected to the relay server fail to perform communications if they remain in that state.
- the client devices need to be switched to another available relay server.
- a client device serving as a transmitter of a message and a client device serving as a receiver thereof fail to transmit and receive the message until both of them can establish a connection.
- FIG. 1 is a block diagram schematically illustrating an exemplary configuration of a communication system applicable to a first embodiment
- FIG. 2 is a block diagram more specifically illustrating the exemplary configuration of the communication system applicable to the first embodiment
- FIG. 3 is a block diagram of an exemplary hardware configuration of a client device serving as an information processor
- FIG. 4 is a block diagram of an exemplary hardware configuration of a client device serving as a home device
- FIG. 5 is an exemplary functional block diagram for explaining functions of the client device according to the first embodiment
- FIG. 6 is an exemplary functional block diagram for explaining functions of a communication unit according to the first embodiment
- FIGS. 7A and 7B are diagrams for explaining connection establishment processing and message transmission processing performed by the client devices according to the first embodiment
- FIGS. 8A to 8C are diagrams of examples of a device list according to the first embodiment
- FIG. 9 is a diagram for explaining connection termination processing performed by the client devices according to the first embodiment.
- FIGS. 10A and 10B are diagrams schematically illustrating processing for shifting relay servers according to the first embodiment
- FIG. 11 is an exemplary sequence diagram of a process performed by the client device in the processing for shifting the relay servers according to the first embodiment
- FIG. 12 is a block diagram of an exemplary configuration of a communication system according to a first modification of the first embodiment
- FIG. 13 is a block diagram of an exemplary configuration of a communication system according to a second modification of the first embodiment
- FIG. 14 is a block diagram of an exemplary configuration of a communication system according to a third modification of the first embodiment
- FIGS. 15A and 15B are diagrams for explaining processing performed to establish a connection and terminate a connection in a case where the communication system according to the first embodiment is applied to a message broker system;
- FIG. 16 is a diagram schematically illustrating a configuration of a video compositing system according to the conventional technique
- FIGS. 17A and 17B are diagrams for explaining connection establishment processing and connection termination processing performed by a video compositing system according to another application example of the first embodiment
- FIG. 18 is a diagram for explaining communication processing according to a second embodiment.
- FIG. 19 is an exemplary flowchart of processing performed by an acquiring unit according to the second embodiment.
- a communication device performs communications with one or more devices via a relay server.
- the communication device To switch a connection destination from a first relay server serving as an origin to a second relay server serving as a destination, the communication device establishes a connection with the second relay server, switches a transmission destination of a message from the first relay server to the second relay server, and cuts a connection with the first relay server.
- FIG. 1 schematically illustrates an exemplary configuration of a communication system applicable to a first embodiment.
- the communication system illustrated in FIG. 1 is a remote control system that controls equipment from a remote information terminal via a communication channel.
- the communication system 1 includes a plurality of client devices 10 , a plurality of relay servers 20 , and an instructing unit 300 a .
- the client devices 10 , the relay servers 20 , and a mediation server 30 functioning as the instructing unit 300 a are connected in a communicable manner with one another via a network 40 , such as the Internet.
- the client device 10 is a communication device and may be a smartphone (multifunctional mobile phone) or a tablet computer serving as a portable information processor, for example.
- the client device 10 is not limited thereto and may be a desktop computer.
- the client device 10 may be a device including a central processing unit (CPU) and a communication interface (I/F) and connectable to the network 40 out of home devices installed in a user's house, for example. Examples of the device include, but are not limited to, a video recorder, an air conditioner, etc.
- the embodiments employ a protocol conforming to WebSocket as a protocol used by the client devices 10 and the relay servers 20 to perform interactive communications.
- WebSocket is developed by the Internet Engineering Task Force (IETF), and the specification of the protocol is disclosed as RFC6455 (refer to RFC 6455 The WebSocket Protocol, (searched on Dec. 8, 2015) (URL: http://tools.ietf.org/html/rfc6455)).
- the WebSocket Protocol operates on the Transmission Control Protocol (TCP).
- the client device 10 functions as a WebSocket client.
- the relay server 20 functions as a WebSocket server.
- a plurality of client devices 10 are connected to one of the relay servers 20 by WebSocket connections (represented by “WS” in FIG. 1 ).
- FIGS. 3 and 4 illustrate exemplary hardware configurations of the client device 10 .
- FIG. 3 illustrates an exemplary hardware configuration of a client device 10 a serving as an information processor.
- the client device 10 a includes a CPU 1000 , a read only memory (ROM) 1001 , a random access memory (RAM) 1002 , a graphics I/F 1003 , a display device 1004 , a storage 1005 , an input device 1006 , a data I/F 1007 , and a communication I/F 1008 . These units are connected in a communicable manner with one another via a bus 1010 .
- the storage 1005 is a non-volatile memory, such as a hard disk drive and a flash memory, and stores therein a computer program and various types of data for operating the CPU 1000 .
- the ROM 1001 stores therein in advance a computer program and data used to start the client device 10 , for example. Based on the computer programs stored in the storage 1005 and the ROM 1001 , the CPU 1000 controls the entire operation of the client device 10 a using the RAM 1002 as a work memory.
- the graphics I/F 1003 converts display information generated based on the computer program by the CPU 1000 into display signals and supplies them to the display device 1004 .
- the display device 1004 includes a liquid-crystal display (LCD) and a drive circuit that drives the LCD, for example, and displays a screen based on the display signals supplied from the graphics I/F 1003 .
- the input device 1006 outputs signals corresponding to a user operation.
- the input device 1006 may be a touch panel integrated with the display device 1004 .
- the data I/F 1007 inputs and outputs data from and to an external device and may be a universal serial bus (USB), for example.
- the communication I/F 1008 uses the Transmission Control Protocol/Internet Protocol (TCP/IP) as its communication protocol and controls communications via the network 40 .
- TCP/IP Transmission Control Protocol/Internet Protocol
- FIG. 4 illustrates an exemplary hardware configuration of a client device 10 b serving as a home device.
- the client device 10 b includes the CPU 1000 , the ROM 1001 , the RAM 1002 , the storage 1005 , the input device 1006 , the data I/F 1007 , and the communication I/F 1008 , a functional unit I/F 1020 , a functional unit 1021 .
- the client device 10 b has a substantially same configuration as that of the client device 10 a serving as an information processor illustrated in FIG. 3 .
- the client device 10 b is different from the client device 10 a in that it includes the functional unit I/F 1020 and the functional unit 1021 instead of the graphics I/F 1003 and the display device 1004 .
- the functional unit 1021 provides functions as a home device of the client device 10 b .
- the functional unit 1021 has a television signal receiving function or the like.
- the functional unit I/F 1020 is an interface of the CPU 1000 for the functional unit 1021 .
- FIG. 5 is an exemplary functional block diagram for explaining functions of the client device 10 according to the first embodiment.
- the configuration illustrated in FIG. 5 is applicable to both of the client device 10 a serving as an information processor and the client device 10 b serving as a home device.
- the client device 10 includes a message generating unit 101 , a distributing unit 102 , a message processing unit 103 , an acquiring unit 104 , a connection managing unit 105 , a device managing unit 106 , and a communication unit 107 .
- the message generating unit 101 , the distributing unit 102 , the message processing unit 103 , the acquiring unit 104 , the connection managing unit 105 , the device managing unit 106 , and the communication unit 107 are provided by a communication program that operates on the CPU 1000 .
- the present embodiment is not limited thereto, and part or all of the message generating unit 101 , the distributing unit 102 , the message processing unit 103 , the acquiring unit 104 , the connection managing unit 105 , the device managing unit 106 , and the communication unit 107 may be provided by hardware circuits that cooperate with one another.
- the communication unit 107 includes connection units 107 a and 107 b identified by respective pieces of unique identification information (identification IDs).
- the connection units 107 a and 107 b are also referred to as a connection unit (#1) and a connection unit (#2), respectively.
- the connection units 107 a and 107 b correspond to WebSocket connections defined by RFC6455.
- the connection units 107 a and 107 b are formed in response to a connection request by WebSocket and establish the connection #1 and the connection #2, respectively, by WebSocket.
- the message generating unit 101 generates a message to be transmitted from the client device 10 serving as a transmitter to the client device 10 serving as a receiver.
- the message generating unit 101 generates a message including a control command.
- the distributing unit 102 transfers a message transmitted from the message generating unit 101 to the communication unit 107 .
- the distributing unit 102 requests the communication unit 107 to transmit the message to any one of the relay servers 20 .
- the distributing unit 102 requests the communication unit 107 to transmit the message to one of a first relay server 20 and a second relay server 20 out of the relay servers 20 .
- the distributing unit 102 receives the identification information on the connection unit 107 a or the connection unit 107 b serving as a destination from the connection managing unit 105 described below, thereby switching destinations in subsequent distribution.
- the message processing unit 103 performs predetermined processing based on a message transmitted from the acquiring unit 104 , which will be described later.
- the message processing unit 103 changes the state of the client device 10 based on the control command included in the message.
- the acquiring unit 104 transfers a message received from the connection unit 107 a or the connection unit 107 b to the message processing unit 103 .
- the acquiring unit 104 receives the identification information on the connection unit 107 a or the connection unit 107 b serving as a receiver from the connection managing unit 105 , thereby switching receivers in subsequent acquisition.
- the connection managing unit 105 establishes and terminates a connection by the connection units 107 a and 107 b .
- the connection managing unit 105 performs shift processing on the connection units 107 a and 107 b used by the distributing unit 102 and the acquiring unit 104 .
- the shift processing will be described later in detail.
- the device managing unit 106 stores the identification information on another client device 10 serving as a communication partner that performs interactive communications with the client device 10 in the RAM 1002 and/or the storage 1005 .
- the communication program according to the first embodiment is stored in a computer connected to the network 40 , such as the Internet, and provided by being downloaded via the network 40 .
- the communication program according to the first embodiment may be provided or distributed via the network 40 , such as the Internet.
- the communication program according to the first embodiment may be recorded and provided in a computer-readable recording medium, such as a compact disc (CD) and a digital versatile disc (DVD), as an installable or executable file.
- a computer-readable recording medium such as a compact disc (CD) and a digital versatile disc (DVD), as an installable or executable file.
- the communication program may be stored and provided in the ROM 1001 .
- the communication program according to the first embodiment has a module configuration including the units described above (the message generating unit 101 , the distributing unit 102 , the message processing unit 103 , the acquiring unit 104 , the connection managing unit 105 , the device managing unit 106 , and the communication unit 107 ).
- the CPU 1000 reads and executes the communication program from the storage 1005 to load the units on a main memory (e.g., the RAM 1002 ). The units thus are generated on the main memory.
- the relay server 20 includes a CPU, a ROM, a RAM, a storage, and a communication I/F. Because the relay server 20 has a configuration equivalent to that of a typical computer, detailed explanation of the hardware configuration thereof will be omitted.
- the relay server 20 according to the first embodiment functions as a WebSocket server. When receiving a request to establish a WebSocket connection from the client device 10 , the relay server 20 establishes a connection with the client device 10 according to the procedure defined by RFC6455.
- the relay server 20 stores therein a corresponding relation between the pieces of identification information on the client devices 10 serving as a pair that performs interactive communications.
- the relay server 20 uses the corresponding relation to transfer a message transmitted from one client device 10 to another client device 10 that makes a pair with the one client device 10 .
- the relay server 20 functions as a relay for interactive communications performed between a plurality of client devices 10 .
- the instructing unit 300 a for example, periodically transmits a request to acquire the present total number of WebSocket connections to the relay servers 20 respectively.
- the relay servers 20 acquire the number of WebSocket connections connected to the respective relay servers 20 and transmit the result to the instructing unit 300 a .
- the instructing unit 300 a determines whether to execute scale-out or scale-in of the relay servers 20 .
- the instructing unit 300 a calculates the upper-limit number of connectable WebSocket connections from the value in performance of the relay servers 20 .
- the instructing unit 300 a then calculates the ratio of the present number of connections to the upper-limit number to compare the calculated ratio with a threshold. If the ratio exceeds the threshold in all the relay servers 20 , the instructing unit 300 a determines to execute scale-out (addition of an instance of a new relay server 20 ). By contrast, if the ratio falls below the threshold in a specific relay server 20 , the instructing unit 300 a determines to execute scale-in (discard of an instance of the relay server 20 ).
- the instructing unit 300 a determines to execute scale-in, the instructing unit 300 a issues, to the relay server 20 the instance of which is to be discarded, a shift instruction to shift connections of the client devices 10 connected thereto to another relay server 20 .
- the shift instruction includes identification information for identifying the destination relay server 20 to which the connections are to be shifted.
- the relay server 20 that receives the shift instruction transmits the shift instruction to the client devices 10 connected to the relay server 20 .
- the shift instruction is received by the client devices 10 and transferred to the respective connection managing units 105 .
- the connection managing units 105 in the respective client devices 10 start the shift processing, which will be described later.
- the following describes processing performed to establish a connection and terminate the connection between the client devices 10 in the communication system according to the first embodiment. Specifically, the following describes connection establishment processing and message transmission processing performed by the client devices 10 a and 10 b according to the first embodiment with reference to FIGS. 7A and 7B .
- the client device 10 b serving as a home device first establishes a WebSocket connection with the relay server 20 , and the client device 10 a serving as an information processor and a communication partner of the client device 10 b then establishes the WebSocket connection with the relay server 20 .
- the connection managing unit 105 of the client device 10 b starts connection establishment processing for a connection with the relay server 20 in response to a predetermined event, such as a user operation and a power-on operation performed on the client device 10 b . Specifically, the connection managing unit 105 of the client device 10 b transmits, to the relay server 20 , a connection establishment request including client identification information (referred to as “B”) for identifying the client device 10 b and forms the connection unit 107 a in the communication unit 107 (Step S 10 ).
- a connection establishment request including client identification information (referred to as “B”) for identifying the client device 10 b and forms the connection unit 107 a in the communication unit 107 (Step S 10 ).
- the relay server 20 stores the client identification information “B” transmitted from the client device 10 b in a storage area of the relay server 20 or an external database (Step S 11 ). In response to the connection establishment request, the relay server 20 performs connection establishment processing for a connection of the client device 10 b with the relay server 20 .
- connection managing unit 105 of the client device 10 a transmits, to the relay server 20 , a connection establishment request including client identification information (referred to as “A”) on the client device 10 a and the client identification information “B” on the client device 10 b with which the client device 10 a desires to perform communications and forms the connection unit 107 a in the communication unit 107 (Step S 12 ).
- the client device 10 a is informed of the client identification information “B” on the client device 10 b serving as a communication partner in advance.
- the relay server 20 stores therein a corresponding relation (referred to as a corresponding relation “A-B”) between the client identification information “A” included in the connection establishment request transmitted from the client device 10 a and the client identification information “B” transmitted from the client device 10 b (Step S 13 ).
- the relay server 20 performs connection establishment processing for a connection of the client device 10 a with the relay server 20 . This processing enables the client device 10 a and the client device 10 b to perform interactive communications via the relay server 20 .
- the relay server 20 notifies the client device 10 b serving as a communication partner of the client device 10 a that a new connection is established with the client device 10 a (Step S 14 ).
- This notification is referred to as a new connection notification.
- the new connection notification includes the client identification information “A” on the client device 10 a with which the connection is established.
- the client device 10 b receives the new connection notification via the connection unit 107 a and transfers it to the device managing unit 106 . Based on the client identification information “A” included in the received new connection notification, the device managing unit 106 creates a list of the identification information (device list).
- FIG. 8A illustrates an example of the device list created based on the client identification information “A” received at Step S 12 according to the first embodiment.
- the device list stores therein the client identification information “A”.
- the device managing unit 106 stores the created device list in the RAM 1002 and/or the storage 1005 .
- the device managing unit 106 adds the client identification information included in the received new connection notification to the list.
- the client device 10 a adds the client identification information “B” on the client device 10 b serving as a communication partner to the device list of its own device managing unit 106 when the connection establishment is completed.
- FIG. 7B illustrates an example of processing performed when the client device 10 b outputs a message.
- the client device 10 b transmits a message including the client identification information “B” on the client device 10 b serving as a source and the client identification information “A” of the client device 10 a serving as a destination to the relay server 20 (Step S 20 ).
- the relay server 20 interprets the message to extract the pieces of client identification information “A” and “B” from the message.
- the relay server 20 refers to the corresponding relation “A-B” stored in the connection establishment processing (Step S 21 ) to determine whether the pieces of client identification information “A” and “B” are a pair that performs interactive communications. If the relay server 20 determines that the pieces of client identification information “A” and “B” are a pair, the relay server 20 transfers the message to the client device 10 a (Step S 22 ).
- the relay server 20 determines that the pieces of client identification information “A” and “B” are not a pair, the relay server 20 transmits an error message to the client device 10 b , for example.
- the relay server 20 manages the corresponding relation between the pieces of identification information on the client devices 10 that perform interactive communications. Let us assume a case where the corresponding relation “A-B” is stored in the relay server 20 , and another client device 10 having client identification information “C” issues a connection establishment request to the relay server 20 .
- the connection establishment request indicates that the client identification information on a communication partner is “A”.
- the relay server 20 stores therein two corresponding relations “A-B” and “A-C”.
- the client device 10 b also receives the new connection notification on the client device 10 having the client identification information “C” and adds the client identification information “C” to the device list.
- FIG. 8B illustrates an example of the device list obtained by adding the client identification information “C” to the device list illustrated in FIG. 8A .
- connection termination processing performed by the client devices 10 a and 10 b according to the first embodiment with reference to FIG. 9 .
- the client devices 10 a and 10 b and the client device 10 having the client identification information “C” are connected to the relay server 20 .
- the relay server 20 stores therein two corresponding relations “A-B” and “B-C”.
- the connection managing unit 105 of the client device 10 a transmits a connection termination notification including the client identification information “A” to the relay server 20 in response to a predetermined event, such as a user operation (Step S 30 ).
- the relay server 20 refers to the stored corresponding relations between the pieces of client identification information to search for the client identification information (client identification information “B” in this example) having a corresponding relation with the client identification information “A”.
- the relay server 20 acquires the corresponding relations “A-B” and “B-C”.
- the relay server 20 Based on the acquired corresponding relation “A-B”, the relay server 20 notifies the client device 10 b that a connection termination notification is transmitted from the client device 10 a .
- This notification is referred to as a removal notification (Step S 31 ).
- the removal notification includes the client identification information “A” on the client device 10 a serving as the transmitter of the connection termination notification.
- the client device 10 b transfers the received removal notification via the connection unit 107 a to the device managing unit 106 .
- the device managing unit 106 deletes the client identification information “A” from the device list (Step S 32 ).
- FIG. 8C illustrates an example of the device list obtained by deleting the client identification information “A” from the device list illustrated in FIG. 8B .
- the relay server 20 deletes the client identification information “A” and the corresponding relation “B-C” including the client identification information “A” stored in the relay server 20 (Step S 33 ).
- the relay server 20 notifies the client device 10 a of completion of the processing (Step S 34 ).
- the client device 10 a cuts the WebSocket connection with the relay server 20 (Step S 35 ) and deletes the client identification information “B” on the client device 10 b serving as a communication partner from the device list in its own device managing unit 106 .
- the series of termination processing is thus ended.
- the embodiment is not limited thereto.
- the relay server 20 may transmit a removal notification to another client device 10 having a corresponding relation with the first client device 10 .
- the removal notification may have a structure of a will in the message queueing telemetry transport (MQTT), for example.
- the client device 10 dynamically stores therein the client identification information on another client device 10 currently being a communication partner of the client device 10 .
- FIGS. 10A and 10B schematically illustrate the processing for shifting the relay servers 20 according to the first embodiment.
- the communication system includes two relay servers 20 a and 20 b , three client devices 10 d , 10 e , and 10 f having pieces of client identification information “D”, “E”, and “F”, respectively, and the instructing unit 300 a .
- the client devices 10 d , 10 e , and 10 f establish WebSocket connections with the relay server 20 a.
- the client device 10 d serves as a communication partner of the client devices 10 e and 10 f .
- the client device 10 d stores the pieces of client identification information “E” and “F” in the device list.
- the client devices 10 e and 10 f store the client identification information “D” in the device list.
- the relay server 20 a stores therein corresponding relations “D-E” and “D-F”.
- FIG. 10B illustrates a state where the connections of the client devices 10 d to 10 f are shifted to the relay server 20 b in response to the shift instruction.
- the shift instruction includes identification information on the relay server 20 b serving as a destination.
- the identification information on the relay server 20 b serving as a destination may be an Internet Protocol (IP) address of the relay server 20 b on the network 40 , for example.
- IP Internet Protocol
- FIG. 11 is an exemplary sequence diagram of a process performed by the client device in the processing for shifting the relay servers according to the first embodiment.
- components common to those in FIGS. 5, 6, and 10 are denoted by same reference numerals, and detailed explanation thereof will be omitted.
- the process illustrated in FIG. 11 is common to the client devices 10 d , 10 e , and 10 f .
- the client device 10 d represents the client devices 10 d , 10 e , and 10 f if not otherwise specified.
- the client device 10 d creates the connection unit 107 a in the communication unit 107 , and the connection unit 107 a establishes a connection between the client device 10 d and the relay server 20 a .
- the connection unit 107 b is not created yet.
- the instructing unit 300 a transmits a shift instruction including the identification information on the relay server 20 b serving as a destination to the client devices 10 d , 10 e , and 10 f connected to the relay server 20 a (Step S 100 ). If the client device 10 d receives the shift instruction transmitted from the instructing unit 300 a , the client device 10 d transfers the received shift instruction to the connection managing unit 105 .
- the connection managing unit 105 issues a connection establishment request to the relay server 20 b specified by the shift instruction and starts processing for establishing a WebSocket connection with the relay server 20 b according to the procedure defined by RFC6455 (Step S 101 ).
- the connection unit 107 b is newly created in the communication unit 107 .
- the connection unit 107 b performs processing for establishing the WebSocket connection with the relay server 20 b . If the connection unit 107 b succeeds in establishing a connection with the relay server 20 b , the connection unit 107 b notifies the connection managing unit 105 of the success (Step S 102 ).
- connection managing unit 105 If the connection managing unit 105 receives the success notification from the connection unit 107 b , the connection managing unit 105 transmits an establishment completion notification indicating completion of establishment of a connection with the relay server 20 b serving as a destination to the connection unit 107 a that maintains the connection with the relay server 20 a serving as an origin (Step S 103 ).
- the connection unit 107 a transmits, to the relay server 20 a , the establishment completion notification including the client identification information “D” on the client device 10 d serving as a source. If the connection unit 107 a succeeds in transmitting the establishment completion notification, the connection unit 107 a notifies the connection managing unit 105 of the success (Step S 104 ).
- the relay server 20 a receives the establishment completion notification transmitted from the connection unit 107 a of the client device 10 d based on the processing at Step S 104 , the relay server 20 a refers to the stored corresponding relations to transfer the establishment completion notification to the client devices 10 e and 10 f having corresponding relations with the client device 10 d .
- the processing of transferring the establishment completion notification corresponds to the processing of transferring the new connection notification described at Step S 14 in FIG. 7A .
- the connection managing unit 105 transmits a device list acquisition request to the device managing unit 106 (Step S 105 ).
- the device managing unit 106 acquires a device list (Step S 106 ).
- the device managing unit 106 acquires the client identification information on the client device currently being in communication with the client device 10 d .
- the connection managing unit 105 waits until it receives establishment completion notifications corresponding to all the pieces of client identification information included in the acquired device list.
- the client devices 10 e and 10 f being in communication with the relay server 20 a also receive the shift instruction from the instructing unit 300 a .
- the client devices 10 e and 10 f also perform the processing from Step S 101 to Step S 104 in response to the shift instruction, thereby transmitting an establishment completion notification to the client device 10 d from the respective connection units 107 a via the relay server 20 a .
- the connection managing unit 105 of the client device 10 d waits until it receives the establishment completion notifications corresponding to the pieces of client identification information “E” and “F” stored in the device list acquired at Step S 106 .
- connection managing unit 105 determines that it receives the establishment completion notifications corresponding to all the pieces of client identification information included in the acquired device list at Step S 107 , the process is shifted to Step S 108 .
- the connection managing unit 105 issues, to the distributing unit 102 , a switching instruction to switch connection units so as to transmit a message subsequently received from the message generating unit 101 using the connection unit 107 b newly created at Step S 101 .
- the distributing unit 102 performs predetermined processing (e.g., setting of destination information added to the message) to transmit the message to the relay server 20 b , for example. If the processing is completed, the distributing unit 102 notifies the connection managing unit 105 of completion of the switching (Step S 109 ).
- connection managing unit 105 If the connection managing unit 105 receives the switching completion notification from the distributing unit 102 , the connection managing unit 105 transmits a transmission termination notification (FIN) to the relay server 20 a using the connection unit 107 a (Step S 110 ).
- the transmission termination notification notifies the relay server 20 a that no more message is to be transmitted from the client device 10 d via the connection unit 107 a .
- the connection managing unit 105 transmits the transmission termination notification including the client identification information “D” indicating the client device 10 d serving as a source. If the connection unit 107 a succeeds in transmitting the connection termination notification to the relay server 20 a , the connection unit 107 a notifies the connection managing unit 105 of the success (Step S 111 ).
- the relay server 20 a If the relay server 20 a receives the transmission termination notification from the client device 10 d , the relay server 20 a transfers the received transmission termination notification to the client devices 10 e and 10 f having corresponding relations with the client device 10 d in the same manner as that of the establishment completion notification. Similarly to the processing of transferring the establishment completion notification, the processing of transferring the transmission termination notification also corresponds to the processing of transferring the new connection notification performed at Step S 14 in FIG. 7A .
- connection managing unit 105 waits for transmission termination notifications transmitted from the client devices 10 e and 10 f (Step S 112 ).
- the connection managing unit 105 can determine that no more message is to be transmitted from any partner to itself, that is, to the client device 10 d via the connection unit 107 a . If the connection managing unit 105 receives the transmission termination notifications from both of the client devices 10 e and 10 f , the connection managing unit 105 transmits a connection termination request to the connection unit 107 a according to the procedure defined by RFC6455 (Step S 113 ). In response to this, the connection unit 107 a cuts the connection with the relay server 20 a.
- connection unit 107 a If the connection unit 107 a succeeds in cutting the connection, the connection unit 107 a notifies the connection managing unit 105 of the success (Step S 114 ). If the connection managing unit 105 receives the notification indicating the success in cutting the connection from the connection unit 107 a , the connection managing unit 105 notifies the instructing unit 300 a of completion of the shift performed in response to the shift instruction received at Step S 100 (Step S 115 ).
- the client devices 10 d , 10 e , and 10 f can shift the connections from the relay server 20 a to which they are connected to the relay server 20 b as follows: the client devices 10 d , 10 e , and 10 f switch the transmission destination of a message to the relay server 20 b at a timing when they determine that connections are established between the relay server 20 b serving as a destination and the respective connection units 107 b and that the client devices 10 d , 10 e , and 10 f can perform interactive communications with the relay server 20 b .
- This mechanism can prevent instantaneous interruption in transmission of the message when the connections are shifted from the relay server 20 a to the relay server 20 b.
- the client devices 10 d , 10 e , and 10 f terminates the connections via the connection units 107 a at a timing when they determine that no more message is to be transmitted to or received from the relay server 20 a serving as an origin via the respective connection units 107 a .
- This mechanism enables prompt release of resource consumption.
- FIG. 12 illustrates an exemplary configuration of a communication system according to the first modification of the first embodiment.
- an instructing unit 300 b according to the first modification of the first embodiment transmits a shift instruction to the client devices 10 via the relay server 20 to which the client devices 10 are connected.
- the instructing unit 300 b acquires the number of WebSocket connections from the relay servers 20 . Based on the information on the number of WebSocket connections acquired from the relay servers 20 , the instructing unit 300 b determines whether to shift the connection destination of all the client devices 10 connected to a certain relay server 20 to another relay server 20 , for example.
- the instructing unit 300 b shifts the connections of all the client devices 10 connected to the relay server 20 having the number of WebSocket connections exceeding a threshold out of the relay servers 20 to another relay server 20 .
- the relay server 20 serving as a destination may be determined by selecting the relay server 20 having the smallest number of WebSocket connections out of the numbers of WebSocket connections in order, for example.
- the instructing unit 300 b transmits a shift instruction including the identification information (e.g., the IP address) on the relay server 20 serving as a destination to the relay server 20 serving as an origin.
- the relay server 20 serving as an origin duplicates and transmits the shift instruction to all the client devices 10 connected to the relay server 20 serving as an origin. Subsequent processing is the same as the processing from Step S 101 in FIG. 11 .
- FIG. 13 illustrates an exemplary configuration of a communication system according to the second modification of the first embodiment. While the instructing unit 300 a according to the first embodiment is independent hardware, such as the mediation server 30 , instructing units 300 c according to the second modification of the first embodiment are provided in respective relay servers 20 ′ as illustrated in FIG. 13 .
- the instructing unit 300 c monitors various states of the relay server 20 ′ to which the instructing unit 300 c belongs (e.g., the number of WebSocket connections, the CPU usage rate, the memory usage, and the operating state of other devices).
- the instructing units 300 c of the respective relay servers 20 ′ may perform communications with one another to monitor the relay servers 20 ′ besides the relay server 20 to which each instructing unit 300 c belongs.
- the instructing unit 300 c can issue a shift instruction when determining that a failure occurs in the relay server 20 ′ to which the instructing unit 300 c belongs, for example.
- FIG. 14 illustrates an exemplary configuration of a communication system according to the third modification of the first embodiment.
- the communication system illustrated in FIG. 14 is obtained by adding a determining unit 310 to the configuration of the communication system illustrated in FIG. 1 .
- An instructing unit 300 d issues a termination instruction to a specific relay server 20 .
- client devices 10 ′ have a slightly different configuration to make an inquiry on a shift destination, which will be described later.
- the embodiment is not limited thereto.
- the instructing unit 300 d according to the third modification of the first embodiment issues a termination instruction to a specific relay server 20 but issues no instruction indicating the relay server 20 to which the client devices 10 ′ connected to the specific relay server 20 supplied with the termination instruction are to be shifted.
- the relay server 20 that receives the termination instruction transmits the shift instruction including no identification information on the relay server 20 serving as a destination to the client devices 10 ′.
- the client devices 10 ′ inquires of the determining unit 310 to which relay server 20 the client devices 10 ′ are to be shifted. Similarly to the instructing unit 300 b according to the first modification of the first embodiment, the determining unit 310 acquires the number of WebSocket connections from the relay servers 20 . Based on the information on the number of WebSocket connections acquired from the relay servers 20 , the determining unit 310 determines the relay server 20 serving as a destination. The determining unit 310 outputs the identification information on the relay server 20 determined to be the destination as a response to the inquiry from the client devices 10 ′. The client devices 10 ′ perform the processing from Step S 101 in FIG. 11 on the relay server 20 specified in the response, thereby performing the processing for shifting the relay servers 20 .
- the client devices 10 may transmit no new connection notification or no removal notification. Instead of transmitting the notifications, the client devices 10 may store therein a history of the client identification information on the client device 10 serving as a transmitter of a message previously transmitted to the respective client devices 10 and create the device list based on the history.
- the relay server 20 adds the client identification information on the client device 10 b serving as a transmitter to the message transferred to the client device 10 a .
- the acquiring unit 104 of the client device 10 a transfers the client identification information on the transmitter added to the message to the device managing unit 106 .
- the device managing unit 106 stores the client identification information transferred from the acquiring unit 104 in the storage 1005 , for example, in an accumulative manner. With this mechanism, the device managing unit 106 of the client device 10 a can manage the client identification information on the client device 10 b that has transmitted a message to the client device 10 a.
- the transmission termination notification according to the fifth modification of the first embodiment includes no client identification information on the client device 10 serving as a transmitter. In this case, the connection managing unit 105 waits until it receives transmission termination notifications of the number of client devices 10 included in the device list.
- connection managing unit 105 of the client device 10 d waits until it receives two transmission termination notifications.
- the client device 10 to switch the connection of the client device 10 from the relay server 20 serving as an origin to the relay server 20 serving as a destination, the client device 10 according to the first embodiment and the modifications thereof establishes a connection with the relay server 20 serving as a destination before cutting the connection with the relay server 20 serving as an origin.
- This mechanism can prevent the client device 10 from being momentarily incapable of performing communications in association with the switching of the connection.
- the client devices 10 transmit, to one another, an establishment completion notification indicating completion of the connection with the relay server 20 serving as a destination.
- the client devices 10 switch the relay servers 20 to which they transmit a message when all the client devices 10 connected to the same relay server 20 complete establishment of the connection. This mechanism can prevent instantaneous interruption in transmission of the message due to difference between the client devices 10 in the timing when they complete establishing the connection.
- the client devices 10 transmit the transmission termination notification to one another.
- the client devices 10 cut the old connection at a timing when the client devices 10 determine that no more message is to be transmitted to them.
- This mechanism can release the resource consumption at a timing when the connection becomes unnecessary, thereby promptly making the relay server 20 capable of being shut down.
- this mechanism can reduce the charge for use of the instance of the relay server 20 .
- the client device 10 always manages the device list of the client devices 10 that perform communications with itself. In the processing for shifting the relay servers 20 , the client device 10 waits until it receives the transmission termination notification from all the client devices 10 included in the device list. Even if a plurality of pairs of client devices 10 perform interactive communications, this mechanism can appropriately control the timing to cut the connection with the relay server 20 serving as an origin.
- the system configuration of the message broker system may be the same as that of the communication system according to the first embodiment described with reference to FIG. 1 .
- the message broker system may have the system configuration in which the client devices 10 are connected to the relay servers 20 via a communication channel, such as the network 40 , to perform interactive communications among the client devices 10 .
- the relay servers 20 function as broker servers that relay messages.
- the messages transmitted and received by the message broker system each include an address referred to as a topic.
- the client device 10 referred to as a publisher
- a client referred to as a subscriber
- the broker server distributes the message to all the subscribers who subscribe to the topic.
- connection establishment processing and connection termination processing performed by the client devices 10 and processing for shifting the broker servers (relay servers 20 ) in the message broker system.
- a broker server 21 corresponds to the relay server 20
- client devices 10 g and 10 h correspond to the client device 10 a serving as a computer.
- the pieces of client identification information on the client devices 10 g and 10 h are “G” and “H”, respectively.
- the client device 10 g first establishes a WebSocket connection with the broker server 21 , and the client device 10 h then establishes a WebSocket connection with the broker server 21 , for example.
- the client device 10 g performs processing for establishing a connection with the broker server 21 (Step S 40 ). If the connection is established, the client device 10 g subscribes to a topic “group 1” for managing a group of communication partners (Step S 41 ).
- the connection managing unit 105 of the client device 10 g stores the information on the topic “group 1” to which the client device 10 g subscribes in the RAM 1002 or the storage 1005 .
- the client device 10 g transmits a message “join G” including the client identification information “G” to the topic “group 1” to which the client device 10 g subscribes (Step S 42 ).
- the message “join G” notifies other client devices (e.g., the client device 10 h ) that subscribe to the same topic “group 1” that the client device 10 g joins in as a communication partner.
- the client device 10 h performs the same connection establishment processing (Step S 43 ). If the connection with the broker server 21 is established, the client device 10 h subscribes to the topic “group 1” (Step S 44 ). The client device 10 h transmits a message “join H” including the client identification information “H” to the topic “group 1” (Step S 45 ). The message “join H” is transmitted to the client device 10 g that subscribes to the topic “group 1” (Step S 46 ).
- the client device 10 g If the client device 10 g receives the message “join H”, the client device 10 g adds the client identification information “H” to the device list in its own connection managing unit 105 , thereby updating the device list.
- the client devices 10 g and 10 h may periodically transmit the pieces of client identification information “G” and “H” in the messages “join G” and “join H”, respectively, thereby keeping the respective device lists up-to-date.
- FIG. 15B illustrates an example of processing performed by the client device 10 h to terminate a connection.
- the client device 10 h transmits a message “remove H” including the client identification information “H” as a message indicating removal to the same topic “group 1” as that in the establishment of the connection (Step S 50 ).
- the message “remove H” is distributed to the client device 10 g via the broker server 21 (Step S 51 ).
- the client device 10 g If the client device 10 g receives the message “remove H”, the client device 10 g deletes the client identification information “H” from the device list in the connection managing unit 105 of the client device 10 g based on the client identification information “H” included in the received message “remove H”. With this processing, the client device 10 g can keep the device list for managing the client device that performs communications with the client device 10 g up-to-date.
- the process for issuing the removal notification is not limited thereto.
- the client device 10 h may issue the removal notification using a will function defined by a message protocol, such as MQTT.
- MQTT message protocol
- the client device 10 h registers a message similar to the removal notification in the broker server 21 as a will defined by MQTT.
- the broker server 21 transmits the removal notification to the client device 10 g that subscribes to the topic “group 1” based on the will.
- the process for switching the broker servers 21 is different from the process from Step S 101 on in the sequence diagram illustrated in FIG. 11 in the processing at Step S 103 for transmitting an establishment completion notification and the processing at Step S 110 for transmitting a transmission termination notification.
- the connection unit 107 b of the client device 10 g completes establishment of a connection with the broker server 21 serving as a destination
- the client device 10 g transmits, to the topic “group 1”, an establishment completion notification, such as “ESTABLISH G” including the client identification information “G” on the client device 10 g serving as a transmitter.
- the client device 10 g transmits a transmission termination notification, such as “FIN G”, including the client identification information “G” on the client device 10 g serving as a transmitter as a notification indicating that no more message is to be transmitted from the client device 10 g via the connection unit 107 a to the broker server 21 serving as an origin.
- a transmission termination notification such as “FIN G”
- the client device 10 h terminates a WebSocket connection with the broker server 20 (Step S 52 ).
- the communication system according to the first embodiment is also applicable to the message broker system, and the message broker system can provide the same advantageous effects as those of the first embodiment.
- the message broker system can provide the same advantageous effects as those of the first embodiment without changing the configuration of the conventional message broker, thereby saving time and effort in development.
- the following describes still another application example of the first embodiment where the communication system according to the first embodiment is applied to a video compositing system.
- the system configuration of the video compositing system may be the same as that of the communication system according to the first embodiment described with reference to FIG. 1 .
- the video compositing system may have the system configuration in which the client devices 10 are connected to the relay servers 20 via a communication channel, such as the network 40 , to perform interactive communications among the client devices 10 .
- FIG. 16 schematically illustrates a configuration of a video compositing system according to the conventional technology.
- the video compositing system includes a plurality of video servers 11 and a video compositing server 22 .
- the video servers 11 transmit video sources 50 a , 50 b , and 50 c .
- the video compositing server 22 composites the video sources 50 a , 50 b , and 50 c transmitted from the video servers 11 and transmits a composited video source to one or more viewers 12 .
- the video compositing server 22 transmits composite video obtained by compositing the video sources 50 a , 50 b , and 50 c to the viewers 12 .
- the viewers 12 correspond to the client device 10 a serving as a computer illustrated in FIG. 3 , for example.
- the viewers 12 display the composite video transmitted from the video compositing server 22 based on an installed video display program.
- the viewer 12 can specify a layout for compositing video in the video compositing server 22 in advance.
- the video compositing server 22 composites the video sources 50 a , 50 b , and 50 c based on the layout specified by the viewer 12 and transmits the composite video to the viewer 12 that specifies the layout.
- the video compositing server 22 composites the video sources 50 a , 50 b , and 50 c based on layouts specified by the respective viewers 12 and transmits composite video 51 a and 51 b to the respective viewers 12 that specify the layouts.
- video compositing servers 22 a and 22 b correspond to the relay servers 20 in FIG. 1 .
- Video servers 11 a , 11 b , and 11 c and viewers 12 a and 12 b correspond to the client devices 10 in FIG. 1 .
- the video servers 11 a , 11 b , and 11 c transmit the video sources 50 a , 50 b , and 50 c , respectively.
- An instructing unit 300 e transmits a shift instruction to the video servers 11 a , 11 b , and 11 c and the viewers 12 a and 12 b.
- the video servers 11 a , 11 b , and 11 c have pieces of client identification information “Va”, “Vb”, and “Vc”, respectively.
- the viewers 12 a and 12 b have pieces of client identification information “Ba” and “Bb”, respectively.
- the following describes processing performed by the video servers 11 a , 11 b , and 11 c and the viewers 12 a and 12 b to establish a connection with the video compositing server 22 a , for example, with reference to FIG. 17A .
- the video compositing server 22 a If the video compositing server 22 a receives a connection establishment request from a client device of one type out of the two types of client devices of the video servers 11 a , 11 b , and 11 c and the viewers 12 a and 12 b , the video compositing server 22 a transmits a new connection notification to client devices of other type.
- the video compositing server 22 a receives a connection establishment request from the viewer 12 a serving as a client device of the one type, for example.
- the video compositing server 22 a transmits a new connection notification indicating that the viewer 12 a is to be newly connected to the video compositing server 22 b to the video servers 11 a , 11 b , and 11 c serving as client devices of the other type based on stored corresponding relations.
- the video servers 11 a , 11 b , and 11 c receive the new connection notification of the viewer 12 a , they update the respective device lists based on the client identification information “Ba” included in the received new connection request.
- the device managing unit 106 of the video servers 11 a , 11 b , and 11 c stores therein the device list including the pieces of client identification information “Ba” and “Bb” on the viewers 12 a and 12 b , respectively.
- the device managing unit 106 of the viewers 12 a and 12 b stores therein the device list including the pieces of client identification information “Va”, “Vb”, and “Vc” on the video servers 11 a , 11 b , and 11 c , respectively.
- the video compositing server 22 a stores therein corresponding relations between the video servers 11 a , 11 b , and 11 c and the viewers 12 a and 12 b.
- the video servers 11 a , 11 b , and 11 c and the viewers 12 a and 12 b perform the processing to terminate connections with the video compositing server 22 a , for example, in the same manner as described above. Specifically, if the video compositing server 22 a receives a removal notification from a client device of one type out of the two types of client devices of the video servers 11 a , 11 b , and 11 c and the viewers 12 a and 12 b connected to the video compositing server 22 a , the video compositing server 22 a transmits the removal notification to client devices of other type.
- the video compositing server 22 a receives a removal notification from the viewer 12 a serving as a client device of the one type, for example.
- the video compositing server 22 a transmits a removal notification indicating to the effect that the viewer 12 a is to be removed to the video servers 11 a , 11 b , and 11 c serving as client devices of the other type based on the stored corresponding relations. If the video servers 11 a , 11 b , and 11 c receive the removal notification of the viewer 12 a , they update the respective device lists based on the client identification information “Ba” included in the received removal notification.
- the video servers 11 a , 11 b , and 11 c and the viewers 12 a and 12 b receive a shift instruction from the instructing unit 300 e , they perform the processing from Step S 101 on in FIG. 11 .
- the video servers 11 a , 11 b , and 11 c and the viewers 12 a and 12 b thus perform the processing for shifting connections from the video compositing server 22 a to which they are connected to the video compositing server 22 b serving as a destination, for example (see FIG. 17B ).
- the client device 10 according to the first embodiment and the modifications thereof transmits the transmission termination notification in the switching of the relay servers 20 .
- the client device 10 in the communication system according to the second embodiment adds a value that uniquely varies based on a predetermined rule, such as a serial number in ascending order, to a message to be transmitted without transmitting the transmission termination notification. Based on the serial number, the client device 10 detects completion of switching of the relay servers 20 .
- FIG. 18 illustrates components of the client device 10 greatly relating to the operation according to the second embodiment (the acquiring unit 104 , the connection managing unit 105 , the connection units 107 a , and the connection unit 107 b illustrated in FIGS. 5 and 6 ).
- the communication processing is described below appropriately with reference to FIGS. 1, 5, and 6 .
- Step S 108 in FIG. 11 the processing to Step S 108 in FIG. 11 is performed, for example. Specifically, assume that the connection unit 107 a is connected to the relay server 20 serving as an origin, and the connection unit 107 b is connected to the relay server 20 serving as a destination.
- the distributing unit 102 illustrated in FIG. 5 adds a serial number (sequence number) for identifying the order of messages to a message transmitted from the message generating unit 101 .
- Transmission of data via the network 40 is typically carried out by a packet unit by dividing the data into a predetermined size and adding header information or the like thereto.
- the distributing unit 102 for example, generates the sequence numbers for the respective packets and stores them in headers. In the following description, the sequence number is a value incremented by 1.
- the acquiring unit 104 extracts the sequence number from the received message and checks that the value of the extracted sequence number sequentially increases in each message. After the connection managing unit 105 issues a switching instruction to the distributing unit 102 at Step S 108 in FIG. 11 , the connection managing unit 105 issues a wait request to the acquiring unit 104 as illustrated in FIG. 18 .
- the acquiring unit 104 monitors the sequence numbers added to the messages transmitted from the connection unit 107 a and the connection unit 107 b .
- the acquiring unit 104 waits until it receives, from the connection unit 107 b , a message (message having a sequence number “4”) next to a sequence number (“3” in this example) of the last message received from the connection unit 107 a .
- the acquiring unit 104 waits until it receives, from the connection unit 107 b , a message with a sequence number having a value larger by 1 than the largest sequence number out of the sequence numbers added to the messages received from the connection unit 107 a.
- the acquiring unit 104 determines that switching from the connection unit 107 a to the connection unit 107 b is completed and returns the processing to the connection managing unit 105 .
- the connection managing unit 105 issues a connection termination request for the connection unit 107 a connected to the relay server 20 serving as an origin. With this process, the connection managing unit 105 can determine that no more message is to be transmitted hereafter from any communication partner to the client device 10 via the connection unit 107 a.
- FIG. 19 is an exemplary flowchart of the processing performed by the acquiring unit 104 according to the second embodiment.
- the acquiring unit 104 receives a message from the connection unit 107 a or the connection unit 107 b .
- the acquiring unit 104 acquires the sequence number added to the received message.
- Step S 202 the acquiring unit 104 determines whether the sequence number acquired at Step S 201 is a number (number having a value larger by 1) next to the largest sequence number of the acquired sequence numbers. If the acquiring unit 104 determines that the sequence number is not the number next to the largest sequence number (No at Step S 202 ), the processing is returned to Step S 200 , and the acquiring unit 104 performs the processing on the next message.
- Step S 203 the acquiring unit 104 acquires source information (connection ID) indicating whether the message with the sequence number is received from the connection unit 107 a or the connection unit 107 b .
- the acquiring unit 104 stores the source information associated with the sequence number acquired at Step S 201 in the RAM 1002 or the like.
- the acquiring unit 104 compares the source information acquired at Step S 203 with the source information associated with a sequence number (number having a value smaller by 1) previous to the sequence number acquired at Step S 201 to determine whether the pieces of source information indicate different sources.
- the source information (connection ID) acquired at Step S 203 indicates the connection unit 107 b
- the source information associated with the previous sequence number indicates the connection unit 107 a
- the acquiring unit 104 determines that the sources are different. If the acquiring unit 104 determines that the sources are the same (No at Step S 204 ), the processing is returned to Step S 200 .
- Step S 205 the acquiring unit 104 notifies the connection managing unit 105 of completion of switching.
- the processing at Step S 205 corresponds to the processing from Step S 109 to Step S 111 in FIG. 11 , for example.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
- This application is based upon and claims the benefit of priority from Japanese Patent Application No. 2016-014859, filed on Jan. 28, 2016; the entire contents of which are incorporated herein by reference.
- Embodiments described herein relate generally to a communication device, a communication system, and a computer program product.
- Widely known are interactive communication systems in which a plurality of client devices are connected to one another via a relay server on the Internet (e.g., Japanese Patent Application Laid-open No. 2011-077890 and Japanese Patent Application Laid-open No. 2008-311852). A first client device out of the client devices establishes a connection with the relay server and maintains the connected state. A second client device also establishes a connection with the relay server. When the first client device, for example, outputs a message after the connection is established between the first and the second client devices and the relay server, the relay server transfers the message to the second client device. In a case where the number of client devices increases, a plurality of relay servers may be provided.
- In such interactive communication systems, a certain number of relay servers out of the relay servers may possibly be shut down (referred to as scale-in). The interactive communication systems execute scale-in at times when fewer users use the systems, such as night-time, to reduce power consumption or carry out maintenance of the relay servers.
- When the conventional interactive communication systems described above execute scale-in, there is such a problem that client devices connected to the relay servers to be shut down are momentarily incapable of performing communications.
- Specifically, when a relay server is shut down, client devices connected to the relay server fail to perform communications if they remain in that state. The client devices need to be switched to another available relay server. After the relay servers are switched, a client device serving as a transmitter of a message and a client device serving as a receiver thereof fail to transmit and receive the message until both of them can establish a connection.
-
FIG. 1 is a block diagram schematically illustrating an exemplary configuration of a communication system applicable to a first embodiment; -
FIG. 2 is a block diagram more specifically illustrating the exemplary configuration of the communication system applicable to the first embodiment; -
FIG. 3 is a block diagram of an exemplary hardware configuration of a client device serving as an information processor; -
FIG. 4 is a block diagram of an exemplary hardware configuration of a client device serving as a home device; -
FIG. 5 is an exemplary functional block diagram for explaining functions of the client device according to the first embodiment; -
FIG. 6 is an exemplary functional block diagram for explaining functions of a communication unit according to the first embodiment; -
FIGS. 7A and 7B are diagrams for explaining connection establishment processing and message transmission processing performed by the client devices according to the first embodiment; -
FIGS. 8A to 8C are diagrams of examples of a device list according to the first embodiment; -
FIG. 9 is a diagram for explaining connection termination processing performed by the client devices according to the first embodiment; -
FIGS. 10A and 10B are diagrams schematically illustrating processing for shifting relay servers according to the first embodiment; -
FIG. 11 is an exemplary sequence diagram of a process performed by the client device in the processing for shifting the relay servers according to the first embodiment; -
FIG. 12 is a block diagram of an exemplary configuration of a communication system according to a first modification of the first embodiment; -
FIG. 13 is a block diagram of an exemplary configuration of a communication system according to a second modification of the first embodiment; -
FIG. 14 is a block diagram of an exemplary configuration of a communication system according to a third modification of the first embodiment; -
FIGS. 15A and 15B are diagrams for explaining processing performed to establish a connection and terminate a connection in a case where the communication system according to the first embodiment is applied to a message broker system; -
FIG. 16 is a diagram schematically illustrating a configuration of a video compositing system according to the conventional technique; -
FIGS. 17A and 17B are diagrams for explaining connection establishment processing and connection termination processing performed by a video compositing system according to another application example of the first embodiment; -
FIG. 18 is a diagram for explaining communication processing according to a second embodiment; and -
FIG. 19 is an exemplary flowchart of processing performed by an acquiring unit according to the second embodiment. - A communication device according to an embodiment performs communications with one or more devices via a relay server. To switch a connection destination from a first relay server serving as an origin to a second relay server serving as a destination, the communication device establishes a connection with the second relay server, switches a transmission destination of a message from the first relay server to the second relay server, and cuts a connection with the first relay server.
- Exemplary embodiments of a communication device, a communication system, and a computer program product are described below.
-
FIG. 1 schematically illustrates an exemplary configuration of a communication system applicable to a first embodiment. The communication system illustrated inFIG. 1 is a remote control system that controls equipment from a remote information terminal via a communication channel. Thecommunication system 1 includes a plurality ofclient devices 10, a plurality ofrelay servers 20, and an instructingunit 300 a. In an actual configuration of the communication system, as specifically illustrated inFIG. 2 , for example, theclient devices 10, therelay servers 20, and a mediation server 30 functioning as the instructingunit 300 a are connected in a communicable manner with one another via anetwork 40, such as the Internet. - The
client device 10 is a communication device and may be a smartphone (multifunctional mobile phone) or a tablet computer serving as a portable information processor, for example. Theclient device 10 is not limited thereto and may be a desktop computer. Alternatively, theclient device 10 may be a device including a central processing unit (CPU) and a communication interface (I/F) and connectable to thenetwork 40 out of home devices installed in a user's house, for example. Examples of the device include, but are not limited to, a video recorder, an air conditioner, etc. - The embodiments employ a protocol conforming to WebSocket as a protocol used by the
client devices 10 and therelay servers 20 to perform interactive communications. WebSocket is developed by the Internet Engineering Task Force (IETF), and the specification of the protocol is disclosed as RFC6455 (refer to RFC 6455 The WebSocket Protocol, (searched on Dec. 8, 2015) (URL: http://tools.ietf.org/html/rfc6455)). The WebSocket Protocol operates on the Transmission Control Protocol (TCP). - The
client device 10 functions as a WebSocket client. Therelay server 20 functions as a WebSocket server. In the example illustrated inFIG. 1 , a plurality ofclient devices 10 are connected to one of therelay servers 20 by WebSocket connections (represented by “WS” inFIG. 1 ). -
FIGS. 3 and 4 illustrate exemplary hardware configurations of theclient device 10.FIG. 3 illustrates an exemplary hardware configuration of aclient device 10 a serving as an information processor. - As illustrated in
FIG. 3 , theclient device 10 a includes aCPU 1000, a read only memory (ROM) 1001, a random access memory (RAM) 1002, a graphics I/F 1003, adisplay device 1004, astorage 1005, aninput device 1006, a data I/F 1007, and a communication I/F 1008. These units are connected in a communicable manner with one another via abus 1010. - The
storage 1005 is a non-volatile memory, such as a hard disk drive and a flash memory, and stores therein a computer program and various types of data for operating theCPU 1000. The ROM 1001 stores therein in advance a computer program and data used to start theclient device 10, for example. Based on the computer programs stored in thestorage 1005 and the ROM 1001, theCPU 1000 controls the entire operation of theclient device 10 a using theRAM 1002 as a work memory. - The graphics I/F 1003 converts display information generated based on the computer program by the
CPU 1000 into display signals and supplies them to thedisplay device 1004. Thedisplay device 1004 includes a liquid-crystal display (LCD) and a drive circuit that drives the LCD, for example, and displays a screen based on the display signals supplied from the graphics I/F 1003. Theinput device 1006 outputs signals corresponding to a user operation. Theinput device 1006 may be a touch panel integrated with thedisplay device 1004. - The data I/
F 1007 inputs and outputs data from and to an external device and may be a universal serial bus (USB), for example. The communication I/F 1008 uses the Transmission Control Protocol/Internet Protocol (TCP/IP) as its communication protocol and controls communications via thenetwork 40. -
FIG. 4 illustrates an exemplary hardware configuration of aclient device 10 b serving as a home device. InFIG. 4 , components common to those inFIG. 3 are denoted by same reference numerals, and detailed explanation thereof will be omitted. As illustrated inFIG. 4 , theclient device 10 b includes theCPU 1000, the ROM 1001, theRAM 1002, thestorage 1005, theinput device 1006, the data I/F 1007, and the communication I/F 1008, a functional unit I/F 1020, afunctional unit 1021. Theclient device 10 b has a substantially same configuration as that of theclient device 10 a serving as an information processor illustrated inFIG. 3 . - The
client device 10 b is different from theclient device 10 a in that it includes the functional unit I/F 1020 and thefunctional unit 1021 instead of the graphics I/F 1003 and thedisplay device 1004. Thefunctional unit 1021 provides functions as a home device of theclient device 10 b. In a case where theclient device 10 b is a video recorder, for example, thefunctional unit 1021 has a television signal receiving function or the like. The functional unit I/F 1020 is an interface of theCPU 1000 for thefunctional unit 1021. -
FIG. 5 is an exemplary functional block diagram for explaining functions of theclient device 10 according to the first embodiment. The configuration illustrated inFIG. 5 is applicable to both of theclient device 10 a serving as an information processor and theclient device 10 b serving as a home device. - As illustrated in
FIG. 5 , theclient device 10 includes amessage generating unit 101, a distributingunit 102, amessage processing unit 103, an acquiringunit 104, aconnection managing unit 105, adevice managing unit 106, and acommunication unit 107. - The
message generating unit 101, the distributingunit 102, themessage processing unit 103, the acquiringunit 104, theconnection managing unit 105, thedevice managing unit 106, and thecommunication unit 107 are provided by a communication program that operates on theCPU 1000. The present embodiment, however, is not limited thereto, and part or all of themessage generating unit 101, the distributingunit 102, themessage processing unit 103, the acquiringunit 104, theconnection managing unit 105, thedevice managing unit 106, and thecommunication unit 107 may be provided by hardware circuits that cooperate with one another. - As illustrated in
FIG. 6 , for example, thecommunication unit 107 includes 107 a and 107 b identified by respective pieces of unique identification information (identification IDs). Inconnection units FIG. 6 , the 107 a and 107 b are also referred to as a connection unit (#1) and a connection unit (#2), respectively. Theconnection units 107 a and 107 b correspond to WebSocket connections defined by RFC6455. Theconnection units 107 a and 107 b are formed in response to a connection request by WebSocket and establish theconnection units connection # 1 and theconnection # 2, respectively, by WebSocket. - The
message generating unit 101 generates a message to be transmitted from theclient device 10 serving as a transmitter to theclient device 10 serving as a receiver. In the remote control system, for example, themessage generating unit 101 generates a message including a control command. - The distributing
unit 102 transfers a message transmitted from themessage generating unit 101 to thecommunication unit 107. The distributingunit 102 requests thecommunication unit 107 to transmit the message to any one of therelay servers 20. The distributingunit 102, for example, requests thecommunication unit 107 to transmit the message to one of afirst relay server 20 and asecond relay server 20 out of therelay servers 20. The distributingunit 102 receives the identification information on theconnection unit 107 a or theconnection unit 107 b serving as a destination from theconnection managing unit 105 described below, thereby switching destinations in subsequent distribution. - The
message processing unit 103 performs predetermined processing based on a message transmitted from the acquiringunit 104, which will be described later. In the remote control system, for example, themessage processing unit 103 changes the state of theclient device 10 based on the control command included in the message. - The acquiring
unit 104 transfers a message received from theconnection unit 107 a or theconnection unit 107 b to themessage processing unit 103. The acquiringunit 104 receives the identification information on theconnection unit 107 a or theconnection unit 107 b serving as a receiver from theconnection managing unit 105, thereby switching receivers in subsequent acquisition. - The
connection managing unit 105 establishes and terminates a connection by the 107 a and 107 b. When receiving a shift instruction from the instructingconnection units unit 300 a, which will be described later, theconnection managing unit 105 performs shift processing on the 107 a and 107 b used by the distributingconnection units unit 102 and the acquiringunit 104. The shift processing will be described later in detail. - The
device managing unit 106 stores the identification information on anotherclient device 10 serving as a communication partner that performs interactive communications with theclient device 10 in theRAM 1002 and/or thestorage 1005. - The communication program according to the first embodiment is stored in a computer connected to the
network 40, such as the Internet, and provided by being downloaded via thenetwork 40. The communication program according to the first embodiment may be provided or distributed via thenetwork 40, such as the Internet. - Alternatively, the communication program according to the first embodiment may be recorded and provided in a computer-readable recording medium, such as a compact disc (CD) and a digital versatile disc (DVD), as an installable or executable file. Still alternatively, the communication program may be stored and provided in the ROM 1001.
- The communication program according to the first embodiment has a module configuration including the units described above (the
message generating unit 101, the distributingunit 102, themessage processing unit 103, the acquiringunit 104, theconnection managing unit 105, thedevice managing unit 106, and the communication unit 107). In actual hardware, theCPU 1000 reads and executes the communication program from thestorage 1005 to load the units on a main memory (e.g., the RAM 1002). The units thus are generated on the main memory. - The
relay server 20 according to the first embodiment includes a CPU, a ROM, a RAM, a storage, and a communication I/F. Because therelay server 20 has a configuration equivalent to that of a typical computer, detailed explanation of the hardware configuration thereof will be omitted. Therelay server 20 according to the first embodiment functions as a WebSocket server. When receiving a request to establish a WebSocket connection from theclient device 10, therelay server 20 establishes a connection with theclient device 10 according to the procedure defined by RFC6455. - The
relay server 20 stores therein a corresponding relation between the pieces of identification information on theclient devices 10 serving as a pair that performs interactive communications. Therelay server 20 uses the corresponding relation to transfer a message transmitted from oneclient device 10 to anotherclient device 10 that makes a pair with the oneclient device 10. As described above, therelay server 20 functions as a relay for interactive communications performed between a plurality ofclient devices 10. - The instructing
unit 300 a according to the first embodiment, for example, periodically transmits a request to acquire the present total number of WebSocket connections to therelay servers 20 respectively. In response to the acquisition request, therelay servers 20 acquire the number of WebSocket connections connected to therespective relay servers 20 and transmit the result to theinstructing unit 300 a. Based on the information on the number of connections acquired from therelay servers 20, the instructingunit 300 a determines whether to execute scale-out or scale-in of therelay servers 20. - The instructing
unit 300 a, for example, calculates the upper-limit number of connectable WebSocket connections from the value in performance of therelay servers 20. The instructingunit 300 a then calculates the ratio of the present number of connections to the upper-limit number to compare the calculated ratio with a threshold. If the ratio exceeds the threshold in all therelay servers 20, the instructingunit 300 a determines to execute scale-out (addition of an instance of a new relay server 20). By contrast, if the ratio falls below the threshold in aspecific relay server 20, the instructingunit 300 a determines to execute scale-in (discard of an instance of the relay server 20). - If the instructing
unit 300 a determines to execute scale-in, the instructingunit 300 a issues, to therelay server 20 the instance of which is to be discarded, a shift instruction to shift connections of theclient devices 10 connected thereto to anotherrelay server 20. The shift instruction includes identification information for identifying thedestination relay server 20 to which the connections are to be shifted. Therelay server 20 that receives the shift instruction transmits the shift instruction to theclient devices 10 connected to therelay server 20. The shift instruction is received by theclient devices 10 and transferred to the respectiveconnection managing units 105. When receiving the shift instruction, theconnection managing units 105 in therespective client devices 10 start the shift processing, which will be described later. - The following describes processing performed to establish a connection and terminate the connection between the
client devices 10 in the communication system according to the first embodiment. Specifically, the following describes connection establishment processing and message transmission processing performed by the 10 a and 10 b according to the first embodiment with reference toclient devices FIGS. 7A and 7B . - In
FIG. 7A , theclient device 10 b serving as a home device, for example, first establishes a WebSocket connection with therelay server 20, and theclient device 10 a serving as an information processor and a communication partner of theclient device 10 b then establishes the WebSocket connection with therelay server 20. - The
connection managing unit 105 of theclient device 10 b starts connection establishment processing for a connection with therelay server 20 in response to a predetermined event, such as a user operation and a power-on operation performed on theclient device 10 b. Specifically, theconnection managing unit 105 of theclient device 10 b transmits, to therelay server 20, a connection establishment request including client identification information (referred to as “B”) for identifying theclient device 10 b and forms theconnection unit 107 a in the communication unit 107 (Step S10). - The
relay server 20 stores the client identification information “B” transmitted from theclient device 10 b in a storage area of therelay server 20 or an external database (Step S11). In response to the connection establishment request, therelay server 20 performs connection establishment processing for a connection of theclient device 10 b with therelay server 20. - Subsequently, the
connection managing unit 105 of theclient device 10 a transmits, to therelay server 20, a connection establishment request including client identification information (referred to as “A”) on theclient device 10 a and the client identification information “B” on theclient device 10 b with which theclient device 10 a desires to perform communications and forms theconnection unit 107 a in the communication unit 107 (Step S12). Theclient device 10 a is informed of the client identification information “B” on theclient device 10 b serving as a communication partner in advance. - The
relay server 20 stores therein a corresponding relation (referred to as a corresponding relation “A-B”) between the client identification information “A” included in the connection establishment request transmitted from theclient device 10 a and the client identification information “B” transmitted from theclient device 10 b (Step S13). In response to the connection establishment request, therelay server 20 performs connection establishment processing for a connection of theclient device 10 a with therelay server 20. This processing enables theclient device 10 a and theclient device 10 b to perform interactive communications via therelay server 20. - The
relay server 20 notifies theclient device 10 b serving as a communication partner of theclient device 10 a that a new connection is established with theclient device 10 a (Step S14). This notification is referred to as a new connection notification. The new connection notification includes the client identification information “A” on theclient device 10 a with which the connection is established. Theclient device 10 b receives the new connection notification via theconnection unit 107 a and transfers it to thedevice managing unit 106. Based on the client identification information “A” included in the received new connection notification, thedevice managing unit 106 creates a list of the identification information (device list). -
FIG. 8A illustrates an example of the device list created based on the client identification information “A” received at Step S12 according to the first embodiment. In the example illustrated inFIG. 8A , the device list stores therein the client identification information “A”. Thedevice managing unit 106 stores the created device list in theRAM 1002 and/or thestorage 1005. When receiving a new connection notification, thedevice managing unit 106 adds the client identification information included in the received new connection notification to the list. Similarly to this, theclient device 10 a adds the client identification information “B” on theclient device 10 b serving as a communication partner to the device list of its owndevice managing unit 106 when the connection establishment is completed. -
FIG. 7B illustrates an example of processing performed when theclient device 10 b outputs a message. Theclient device 10 b transmits a message including the client identification information “B” on theclient device 10 b serving as a source and the client identification information “A” of theclient device 10 a serving as a destination to the relay server 20 (Step S20). - The
relay server 20 interprets the message to extract the pieces of client identification information “A” and “B” from the message. Therelay server 20 refers to the corresponding relation “A-B” stored in the connection establishment processing (Step S21) to determine whether the pieces of client identification information “A” and “B” are a pair that performs interactive communications. If therelay server 20 determines that the pieces of client identification information “A” and “B” are a pair, therelay server 20 transfers the message to theclient device 10 a (Step S22). - By contrast, if the
relay server 20 determines that the pieces of client identification information “A” and “B” are not a pair, therelay server 20 transmits an error message to theclient device 10 b, for example. - As described above, the
relay server 20 manages the corresponding relation between the pieces of identification information on theclient devices 10 that perform interactive communications. Let us assume a case where the corresponding relation “A-B” is stored in therelay server 20, and anotherclient device 10 having client identification information “C” issues a connection establishment request to therelay server 20. The connection establishment request indicates that the client identification information on a communication partner is “A”. In this case, therelay server 20 stores therein two corresponding relations “A-B” and “A-C”. - The
client device 10 b also receives the new connection notification on theclient device 10 having the client identification information “C” and adds the client identification information “C” to the device list.FIG. 8B illustrates an example of the device list obtained by adding the client identification information “C” to the device list illustrated inFIG. 8A . - The following describes connection termination processing performed by the
10 a and 10 b according to the first embodiment with reference toclient devices FIG. 9 . In this example, the 10 a and 10 b and theclient devices client device 10 having the client identification information “C” are connected to therelay server 20. Therelay server 20 stores therein two corresponding relations “A-B” and “B-C”. - The
connection managing unit 105 of theclient device 10 a transmits a connection termination notification including the client identification information “A” to therelay server 20 in response to a predetermined event, such as a user operation (Step S30). In response to the connection termination notification, therelay server 20 refers to the stored corresponding relations between the pieces of client identification information to search for the client identification information (client identification information “B” in this example) having a corresponding relation with the client identification information “A”. As a result of the search, therelay server 20 acquires the corresponding relations “A-B” and “B-C”. - Based on the acquired corresponding relation “A-B”, the
relay server 20 notifies theclient device 10 b that a connection termination notification is transmitted from theclient device 10 a. This notification is referred to as a removal notification (Step S31). The removal notification includes the client identification information “A” on theclient device 10 a serving as the transmitter of the connection termination notification. Theclient device 10 b transfers the received removal notification via theconnection unit 107 a to thedevice managing unit 106. Based on the removal notification, thedevice managing unit 106 deletes the client identification information “A” from the device list (Step S32).FIG. 8C illustrates an example of the device list obtained by deleting the client identification information “A” from the device list illustrated inFIG. 8B . - Subsequently, the
relay server 20 deletes the client identification information “A” and the corresponding relation “B-C” including the client identification information “A” stored in the relay server 20 (Step S33). Therelay server 20 notifies theclient device 10 a of completion of the processing (Step S34). In response to the processing completion notification, theclient device 10 a cuts the WebSocket connection with the relay server 20 (Step S35) and deletes the client identification information “B” on theclient device 10 b serving as a communication partner from the device list in its owndevice managing unit 106. The series of termination processing is thus ended. - While the removal notification is transmitted from the
client device 10 in this example, the embodiment is not limited thereto. When therelay server 20 detects forced disconnection in oneclient device 10 or disconnection because of unexpected reason, for example, therelay server 20 may transmit a removal notification to anotherclient device 10 having a corresponding relation with thefirst client device 10. The removal notification may have a structure of a will in the message queueing telemetry transport (MQTT), for example. - With the processing performed by the
client device 10 to establish and terminate a connection described above, theclient device 10 dynamically stores therein the client identification information on anotherclient device 10 currently being a communication partner of theclient device 10. - The following describes processing for shifting the
relay servers 20 according to the first embodiment.FIGS. 10A and 10B schematically illustrate the processing for shifting therelay servers 20 according to the first embodiment. As illustrated inFIG. 10A , the communication system includes tworelay servers 20 a and 20 b, three 10 d, 10 e, and 10 f having pieces of client identification information “D”, “E”, and “F”, respectively, and theclient devices instructing unit 300 a. The 10 d, 10 e, and 10 f establish WebSocket connections with the relay server 20 a.client devices - The
client device 10 d serves as a communication partner of the 10 e and 10 f. Theclient devices client device 10 d stores the pieces of client identification information “E” and “F” in the device list. The 10 e and 10 f store the client identification information “D” in the device list. The relay server 20 a stores therein corresponding relations “D-E” and “D-F”.client devices - Let us assume a case where the instructing
unit 300 a issues, to theclient devices 10 d to 10 f, a shift instruction to shift the connections of theclient devices 10 d to 10 f from the relay server 20 a to therelay server 20 b.FIG. 10B illustrates a state where the connections of theclient devices 10 d to 10 f are shifted to therelay server 20 b in response to the shift instruction. The shift instruction includes identification information on therelay server 20 b serving as a destination. The identification information on therelay server 20 b serving as a destination may be an Internet Protocol (IP) address of therelay server 20 b on thenetwork 40, for example. -
FIG. 11 is an exemplary sequence diagram of a process performed by the client device in the processing for shifting the relay servers according to the first embodiment. InFIG. 11 , components common to those inFIGS. 5, 6, and 10 are denoted by same reference numerals, and detailed explanation thereof will be omitted. The process illustrated inFIG. 11 is common to the 10 d, 10 e, and 10 f. In the following description, theclient devices client device 10 d represents the 10 d, 10 e, and 10 f if not otherwise specified.client devices - Before the start of the process in the sequence diagram illustrated in
FIG. 11 , theclient device 10 d creates theconnection unit 107 a in thecommunication unit 107, and theconnection unit 107 a establishes a connection between theclient device 10 d and the relay server 20 a. At this time, establishment of a connection between theclient device 10 d and therelay server 20 b is not started yet, and theconnection unit 107 b is not created yet. - In
FIG. 11 , the instructingunit 300 a transmits a shift instruction including the identification information on therelay server 20 b serving as a destination to the 10 d, 10 e, and 10 f connected to the relay server 20 a (Step S100). If theclient devices client device 10 d receives the shift instruction transmitted from the instructingunit 300 a, theclient device 10 d transfers the received shift instruction to theconnection managing unit 105. - In response to the received shift instruction, the
connection managing unit 105 issues a connection establishment request to therelay server 20 b specified by the shift instruction and starts processing for establishing a WebSocket connection with therelay server 20 b according to the procedure defined by RFC6455 (Step S101). As a result, theconnection unit 107 b is newly created in thecommunication unit 107. Theconnection unit 107 b performs processing for establishing the WebSocket connection with therelay server 20 b. If theconnection unit 107 b succeeds in establishing a connection with therelay server 20 b, theconnection unit 107 b notifies theconnection managing unit 105 of the success (Step S102). - If the
connection managing unit 105 receives the success notification from theconnection unit 107 b, theconnection managing unit 105 transmits an establishment completion notification indicating completion of establishment of a connection with therelay server 20 b serving as a destination to theconnection unit 107 a that maintains the connection with the relay server 20 a serving as an origin (Step S103). Theconnection unit 107 a transmits, to the relay server 20 a, the establishment completion notification including the client identification information “D” on theclient device 10 d serving as a source. If theconnection unit 107 a succeeds in transmitting the establishment completion notification, theconnection unit 107 a notifies theconnection managing unit 105 of the success (Step S104). - If the relay server 20 a receives the establishment completion notification transmitted from the
connection unit 107 a of theclient device 10 d based on the processing at Step S104, the relay server 20 a refers to the stored corresponding relations to transfer the establishment completion notification to the 10 e and 10 f having corresponding relations with theclient devices client device 10 d. The processing of transferring the establishment completion notification corresponds to the processing of transferring the new connection notification described at Step S14 inFIG. 7A . - The
connection managing unit 105 transmits a device list acquisition request to the device managing unit 106 (Step S105). In response to the device list acquisition request, thedevice managing unit 106 acquires a device list (Step S106). Based on the acquired device list, thedevice managing unit 106 acquires the client identification information on the client device currently being in communication with theclient device 10 d. At Step S107, theconnection managing unit 105 waits until it receives establishment completion notifications corresponding to all the pieces of client identification information included in the acquired device list. - Similarly to the
client device 10 d, the 10 e and 10 f being in communication with the relay server 20 a also receive the shift instruction from the instructingclient devices unit 300 a. The 10 e and 10 f also perform the processing from Step S101 to Step S104 in response to the shift instruction, thereby transmitting an establishment completion notification to theclient devices client device 10 d from therespective connection units 107 a via the relay server 20 a. Theconnection managing unit 105 of theclient device 10 d waits until it receives the establishment completion notifications corresponding to the pieces of client identification information “E” and “F” stored in the device list acquired at Step S106. - If the
connection managing unit 105 determines that it receives the establishment completion notifications corresponding to all the pieces of client identification information included in the acquired device list at Step S107, the process is shifted to Step S108. At Step S108, theconnection managing unit 105 issues, to the distributingunit 102, a switching instruction to switch connection units so as to transmit a message subsequently received from themessage generating unit 101 using theconnection unit 107 b newly created at Step S101. In response to the switching instruction, the distributingunit 102 performs predetermined processing (e.g., setting of destination information added to the message) to transmit the message to therelay server 20 b, for example. If the processing is completed, the distributingunit 102 notifies theconnection managing unit 105 of completion of the switching (Step S109). - If the
connection managing unit 105 receives the switching completion notification from the distributingunit 102, theconnection managing unit 105 transmits a transmission termination notification (FIN) to the relay server 20 a using theconnection unit 107 a (Step S110). The transmission termination notification notifies the relay server 20 a that no more message is to be transmitted from theclient device 10 d via theconnection unit 107 a. Theconnection managing unit 105 transmits the transmission termination notification including the client identification information “D” indicating theclient device 10 d serving as a source. If theconnection unit 107 a succeeds in transmitting the connection termination notification to the relay server 20 a, theconnection unit 107 a notifies theconnection managing unit 105 of the success (Step S111). - If the relay server 20 a receives the transmission termination notification from the
client device 10 d, the relay server 20 a transfers the received transmission termination notification to the 10 e and 10 f having corresponding relations with theclient devices client device 10 d in the same manner as that of the establishment completion notification. Similarly to the processing of transferring the establishment completion notification, the processing of transferring the transmission termination notification also corresponds to the processing of transferring the new connection notification performed at Step S14 inFIG. 7A . - If the
connection managing unit 105 receives the success notification from theconnection unit 107 a, theconnection managing unit 105 waits for transmission termination notifications transmitted from the 10 e and 10 f (Step S112).client devices - By receiving the transmission termination notifications from both of the
10 e and 10 f, theclient devices connection managing unit 105 can determine that no more message is to be transmitted from any partner to itself, that is, to theclient device 10 d via theconnection unit 107 a. If theconnection managing unit 105 receives the transmission termination notifications from both of the 10 e and 10 f, theclient devices connection managing unit 105 transmits a connection termination request to theconnection unit 107 a according to the procedure defined by RFC6455 (Step S113). In response to this, theconnection unit 107 a cuts the connection with the relay server 20 a. - If the
connection unit 107 a succeeds in cutting the connection, theconnection unit 107 a notifies theconnection managing unit 105 of the success (Step S114). If theconnection managing unit 105 receives the notification indicating the success in cutting the connection from theconnection unit 107 a, theconnection managing unit 105 notifies the instructingunit 300 a of completion of the shift performed in response to the shift instruction received at Step S100 (Step S115). - With the process described above, the
10 d, 10 e, and 10 f according to the first embodiment can shift the connections from the relay server 20 a to which they are connected to theclient devices relay server 20 b as follows: the 10 d, 10 e, and 10 f switch the transmission destination of a message to theclient devices relay server 20 b at a timing when they determine that connections are established between therelay server 20 b serving as a destination and therespective connection units 107 b and that the 10 d, 10 e, and 10 f can perform interactive communications with theclient devices relay server 20 b. This mechanism can prevent instantaneous interruption in transmission of the message when the connections are shifted from the relay server 20 a to therelay server 20 b. - Furthermore, the
10 d, 10 e, and 10 f according to the first embodiment terminates the connections via theclient devices connection units 107 a at a timing when they determine that no more message is to be transmitted to or received from the relay server 20 a serving as an origin via therespective connection units 107 a. This mechanism enables prompt release of resource consumption. - The following describes a first modification of the first embodiment. While the instructing
unit 300 a according to the first embodiment directly transmits the shift instruction to theclient devices 10, the embodiment is not limited thereto.FIG. 12 illustrates an exemplary configuration of a communication system according to the first modification of the first embodiment. As illustrated inFIG. 12 , an instructingunit 300 b according to the first modification of the first embodiment transmits a shift instruction to theclient devices 10 via therelay server 20 to which theclient devices 10 are connected. - In the example illustrated in
FIG. 12 , the instructingunit 300 b acquires the number of WebSocket connections from therelay servers 20. Based on the information on the number of WebSocket connections acquired from therelay servers 20, the instructingunit 300 b determines whether to shift the connection destination of all theclient devices 10 connected to acertain relay server 20 to anotherrelay server 20, for example. - The instructing
unit 300 b, for example, shifts the connections of all theclient devices 10 connected to therelay server 20 having the number of WebSocket connections exceeding a threshold out of therelay servers 20 to anotherrelay server 20. Therelay server 20 serving as a destination may be determined by selecting therelay server 20 having the smallest number of WebSocket connections out of the numbers of WebSocket connections in order, for example. - The instructing
unit 300 b transmits a shift instruction including the identification information (e.g., the IP address) on therelay server 20 serving as a destination to therelay server 20 serving as an origin. When receiving the shift instruction, therelay server 20 serving as an origin duplicates and transmits the shift instruction to all theclient devices 10 connected to therelay server 20 serving as an origin. Subsequent processing is the same as the processing from Step S101 inFIG. 11 . - The following describes a second modification of the first embodiment.
FIG. 13 illustrates an exemplary configuration of a communication system according to the second modification of the first embodiment. While the instructingunit 300 a according to the first embodiment is independent hardware, such as the mediation server 30, instructingunits 300 c according to the second modification of the first embodiment are provided inrespective relay servers 20′ as illustrated inFIG. 13 . - In this case, the instructing
unit 300 c monitors various states of therelay server 20′ to which theinstructing unit 300 c belongs (e.g., the number of WebSocket connections, the CPU usage rate, the memory usage, and the operating state of other devices). The instructingunits 300 c of therespective relay servers 20′ may perform communications with one another to monitor therelay servers 20′ besides therelay server 20 to which each instructingunit 300 c belongs. With this configuration, the instructingunit 300 c can issue a shift instruction when determining that a failure occurs in therelay server 20′ to which theinstructing unit 300 c belongs, for example. - The following describes a third modification of the first embodiment.
FIG. 14 illustrates an exemplary configuration of a communication system according to the third modification of the first embodiment. The communication system illustrated inFIG. 14 is obtained by adding a determiningunit 310 to the configuration of the communication system illustrated inFIG. 1 . Aninstructing unit 300 d issues a termination instruction to aspecific relay server 20. Furthermore,client devices 10′ have a slightly different configuration to make an inquiry on a shift destination, which will be described later. - While the shift instruction according to the first embodiment includes the identification information on the
relay server 20 serving as a destination, the embodiment is not limited thereto. The instructingunit 300 d according to the third modification of the first embodiment issues a termination instruction to aspecific relay server 20 but issues no instruction indicating therelay server 20 to which theclient devices 10′ connected to thespecific relay server 20 supplied with the termination instruction are to be shifted. Therelay server 20 that receives the termination instruction transmits the shift instruction including no identification information on therelay server 20 serving as a destination to theclient devices 10′. - When receiving the shift instruction from the
relay server 20, theclient devices 10′ inquires of the determiningunit 310 to whichrelay server 20 theclient devices 10′ are to be shifted. Similarly to theinstructing unit 300 b according to the first modification of the first embodiment, the determiningunit 310 acquires the number of WebSocket connections from therelay servers 20. Based on the information on the number of WebSocket connections acquired from therelay servers 20, the determiningunit 310 determines therelay server 20 serving as a destination. The determiningunit 310 outputs the identification information on therelay server 20 determined to be the destination as a response to the inquiry from theclient devices 10′. Theclient devices 10′ perform the processing from Step S101 inFIG. 11 on therelay server 20 specified in the response, thereby performing the processing for shifting therelay servers 20. - The following describes a fourth modification of the first embodiment. While the
client devices 10 according to the first embodiment transmit the new connection notification and the removal notification to one another, thereby updating the device lists in the respectiveconnection managing units 105 to the latest state, the embodiment is not limited thereto. Theclient devices 10 may transmit no new connection notification or no removal notification. Instead of transmitting the notifications, theclient devices 10 may store therein a history of the client identification information on theclient device 10 serving as a transmitter of a message previously transmitted to therespective client devices 10 and create the device list based on the history. - In this case, in transmission of a message at Step S22 in
FIG. 7B , for example, therelay server 20 adds the client identification information on theclient device 10 b serving as a transmitter to the message transferred to theclient device 10 a. When receiving the message, the acquiringunit 104 of theclient device 10 a transfers the client identification information on the transmitter added to the message to thedevice managing unit 106. Thedevice managing unit 106 stores the client identification information transferred from the acquiringunit 104 in thestorage 1005, for example, in an accumulative manner. With this mechanism, thedevice managing unit 106 of theclient device 10 a can manage the client identification information on theclient device 10 b that has transmitted a message to theclient device 10 a. - The following describes a fifth modification of the first embodiment. While the transmission termination notification transmitted at Step S110 in
FIG. 11 according to the first embodiment includes the client identification information on theclient device 10 serving as a transmitter, the embodiment is not limited thereto. The transmission termination notification according to the fifth modification of the first embodiment includes no client identification information on theclient device 10 serving as a transmitter. In this case, theconnection managing unit 105 waits until it receives transmission termination notifications of the number ofclient devices 10 included in the device list. - As illustrated in
FIGS. 10A and 10B , for example, let us assume a case where the connection destination of the 10 d, 10 e, and 10 f is shifted from the relay server 20 a (refer toclient devices FIG. 10A ) to therelay server 20 b (refer toFIG. 10B ). In this case, theconnection managing unit 105 of theclient device 10 d, for example, waits until it receives two transmission termination notifications. - As described above, to switch the connection of the
client device 10 from therelay server 20 serving as an origin to therelay server 20 serving as a destination, theclient device 10 according to the first embodiment and the modifications thereof establishes a connection with therelay server 20 serving as a destination before cutting the connection with therelay server 20 serving as an origin. This mechanism can prevent theclient device 10 from being momentarily incapable of performing communications in association with the switching of the connection. - The
client devices 10 according to the first embodiment and the modifications thereof transmit, to one another, an establishment completion notification indicating completion of the connection with therelay server 20 serving as a destination. Theclient devices 10 switch therelay servers 20 to which they transmit a message when all theclient devices 10 connected to thesame relay server 20 complete establishment of the connection. This mechanism can prevent instantaneous interruption in transmission of the message due to difference between theclient devices 10 in the timing when they complete establishing the connection. - The
client devices 10 according to the first embodiment and the modifications thereof transmit the transmission termination notification to one another. Theclient devices 10 cut the old connection at a timing when theclient devices 10 determine that no more message is to be transmitted to them. This mechanism can release the resource consumption at a timing when the connection becomes unnecessary, thereby promptly making therelay server 20 capable of being shut down. In a case where the instance of therelay server 20 is charged by time unit, for example, this mechanism can reduce the charge for use of the instance of therelay server 20. - The
client device 10 according to the first embodiment and the modifications thereof always manages the device list of theclient devices 10 that perform communications with itself. In the processing for shifting therelay servers 20, theclient device 10 waits until it receives the transmission termination notification from all theclient devices 10 included in the device list. Even if a plurality of pairs ofclient devices 10 perform interactive communications, this mechanism can appropriately control the timing to cut the connection with therelay server 20 serving as an origin. - Let us assume a case of a communication system in which the
client devices 10 are mobile terminals and home devices, and the mobile terminals perform remote control on the home devices, for example. In the switching of therelay servers 20 according to the conventional technology, there is a time lag after an instruction of control is issued before completion is actually detected, thereby deteriorating usability for a user. In another example, let us assume a case of a communication system that transmits a message requiring immediacy, such as an emergency notification in a disaster. In the switching of therelay servers 20 according to the conventional technology, delay in the notification leads to delay in an initial response, resulting in occurrence of a problem. By applying the communication system according to the first embodiment and the modifications thereof to the cases described above, these problems can be solved. - The following describes another application example of the first embodiment where the communication system according to the first embodiment is applied to a message broker system. The system configuration of the message broker system may be the same as that of the communication system according to the first embodiment described with reference to
FIG. 1 . In other words, the message broker system may have the system configuration in which theclient devices 10 are connected to therelay servers 20 via a communication channel, such as thenetwork 40, to perform interactive communications among theclient devices 10. - In the message broker system, the
relay servers 20 function as broker servers that relay messages. The messages transmitted and received by the message broker system each include an address referred to as a topic. After being connected to the broker server (relay server 20), the client device 10 (referred to as a publisher) that desires to transmit a message transmits the message using the topic as a destination. A client (referred to as a subscriber) who wants to receive the message connects the broker server in advance and notifies the broker server of the name of the topic to which the client wants to subscribe. If the publisher transmits a message to the topic, the broker server distributes the message to all the subscribers who subscribe to the topic. - The following describes connection establishment processing and connection termination processing performed by the
client devices 10 and processing for shifting the broker servers (relay servers 20) in the message broker system. - The following describes processing performed by the
client devices 10 to establish a connection and terminate a connection in a case where the communication system according to the first embodiment is applied to the message broker system with reference toFIGS. 15A and 15B . InFIGS. 15A and 15B , abroker server 21 corresponds to therelay server 20, and 10 g and 10 h correspond to theclient devices client device 10 a serving as a computer. The pieces of client identification information on the 10 g and 10 h are “G” and “H”, respectively.client devices - In
FIG. 15A , theclient device 10 g first establishes a WebSocket connection with thebroker server 21, and theclient device 10 h then establishes a WebSocket connection with thebroker server 21, for example. - The
client device 10 g performs processing for establishing a connection with the broker server 21 (Step S40). If the connection is established, theclient device 10 g subscribes to a topic “group 1” for managing a group of communication partners (Step S41). Theconnection managing unit 105 of theclient device 10 g, for example, stores the information on the topic “group 1” to which theclient device 10 g subscribes in theRAM 1002 or thestorage 1005. - The
client device 10 g transmits a message “join G” including the client identification information “G” to the topic “group 1” to which theclient device 10 g subscribes (Step S42). The message “join G” notifies other client devices (e.g., theclient device 10 h) that subscribe to the same topic “group 1” that theclient device 10 g joins in as a communication partner. - Subsequently, the
client device 10 h performs the same connection establishment processing (Step S43). If the connection with thebroker server 21 is established, theclient device 10 h subscribes to the topic “group 1” (Step S44). Theclient device 10 h transmits a message “join H” including the client identification information “H” to the topic “group 1” (Step S45). The message “join H” is transmitted to theclient device 10 g that subscribes to the topic “group 1” (Step S46). - If the
client device 10 g receives the message “join H”, theclient device 10 g adds the client identification information “H” to the device list in its ownconnection managing unit 105, thereby updating the device list. The 10 g and 10 h may periodically transmit the pieces of client identification information “G” and “H” in the messages “join G” and “join H”, respectively, thereby keeping the respective device lists up-to-date.client devices -
FIG. 15B illustrates an example of processing performed by theclient device 10 h to terminate a connection. To terminate the connection, theclient device 10 h transmits a message “remove H” including the client identification information “H” as a message indicating removal to the same topic “group 1” as that in the establishment of the connection (Step S50). The message “remove H” is distributed to theclient device 10 g via the broker server 21 (Step S51). - If the
client device 10 g receives the message “remove H”, theclient device 10 g deletes the client identification information “H” from the device list in theconnection managing unit 105 of theclient device 10 g based on the client identification information “H” included in the received message “remove H”. With this processing, theclient device 10 g can keep the device list for managing the client device that performs communications with theclient device 10 g up-to-date. - The process for issuing the removal notification is not limited thereto. The
client device 10 h, for example, may issue the removal notification using a will function defined by a message protocol, such as MQTT. In this case, after establishing a connection, theclient device 10 h registers a message similar to the removal notification in thebroker server 21 as a will defined by MQTT. When the connection with theclient device 10 h is cut, thebroker server 21 transmits the removal notification to theclient device 10 g that subscribes to the topic “group 1” based on the will. - The process for switching the
broker servers 21 is different from the process from Step S101 on in the sequence diagram illustrated inFIG. 11 in the processing at Step S103 for transmitting an establishment completion notification and the processing at Step S110 for transmitting a transmission termination notification. In the present application example of the first embodiment, when theconnection unit 107 b of theclient device 10 g completes establishment of a connection with thebroker server 21 serving as a destination, theclient device 10 g transmits, to the topic “group 1”, an establishment completion notification, such as “ESTABLISH G” including the client identification information “G” on theclient device 10 g serving as a transmitter. Similarly to this, when transmission is terminated, theclient device 10 g transmits a transmission termination notification, such as “FIN G”, including the client identification information “G” on theclient device 10 g serving as a transmitter as a notification indicating that no more message is to be transmitted from theclient device 10 g via theconnection unit 107 a to thebroker server 21 serving as an origin. After the transmission termination notification is transmitted, theclient device 10 h terminates a WebSocket connection with the broker server 20 (Step S52). - As described above, the communication system according to the first embodiment is also applicable to the message broker system, and the message broker system can provide the same advantageous effects as those of the first embodiment. Especially when the first embodiment is applied to the message broker system, the message broker system can provide the same advantageous effects as those of the first embodiment without changing the configuration of the conventional message broker, thereby saving time and effort in development.
- The following describes still another application example of the first embodiment where the communication system according to the first embodiment is applied to a video compositing system. The system configuration of the video compositing system may be the same as that of the communication system according to the first embodiment described with reference to
FIG. 1 . In other words, the video compositing system may have the system configuration in which theclient devices 10 are connected to therelay servers 20 via a communication channel, such as thenetwork 40, to perform interactive communications among theclient devices 10. -
FIG. 16 schematically illustrates a configuration of a video compositing system according to the conventional technology. The video compositing system includes a plurality ofvideo servers 11 and avideo compositing server 22. Thevideo servers 11 transmit 50 a, 50 b, and 50 c. Thevideo sources video compositing server 22 composites the 50 a, 50 b, and 50 c transmitted from thevideo sources video servers 11 and transmits a composited video source to one ormore viewers 12. Thevideo compositing server 22 transmits composite video obtained by compositing the 50 a, 50 b, and 50 c to thevideo sources viewers 12. Theviewers 12 correspond to theclient device 10 a serving as a computer illustrated inFIG. 3 , for example. Theviewers 12 display the composite video transmitted from thevideo compositing server 22 based on an installed video display program. - The
viewer 12 can specify a layout for compositing video in thevideo compositing server 22 in advance. Thevideo compositing server 22 composites the 50 a, 50 b, and 50 c based on the layout specified by thevideo sources viewer 12 and transmits the composite video to theviewer 12 that specifies the layout. In the example illustrated inFIG. 16 , thevideo compositing server 22 composites the 50 a, 50 b, and 50 c based on layouts specified by thevideo sources respective viewers 12 and transmits 51 a and 51 b to thecomposite video respective viewers 12 that specify the layouts. - The following describes processing performed by the client devices to establish a connection and terminate a connection in the video compositing system according to the present application example of the first embodiment with reference to
FIGS. 17A and 17B . InFIGS. 17A and 17B ,video compositing servers 22 a and 22 b correspond to therelay servers 20 inFIG. 1 . 11 a, 11 b, and 11 c andVideo servers viewers 12 a and 12 b correspond to theclient devices 10 inFIG. 1 . The 11 a, 11 b, and 11 c transmit thevideo servers 50 a, 50 b, and 50 c, respectively. Anvideo sources instructing unit 300 e transmits a shift instruction to the 11 a, 11 b, and 11 c and thevideo servers viewers 12 a and 12 b. - The
11 a, 11 b, and 11 c have pieces of client identification information “Va”, “Vb”, and “Vc”, respectively. Thevideo servers viewers 12 a and 12 b have pieces of client identification information “Ba” and “Bb”, respectively. The following describes processing performed by the 11 a, 11 b, and 11 c and thevideo servers viewers 12 a and 12 b to establish a connection with thevideo compositing server 22 a, for example, with reference toFIG. 17A . - If the
video compositing server 22 a receives a connection establishment request from a client device of one type out of the two types of client devices of the 11 a, 11 b, and 11 c and thevideo servers viewers 12 a and 12 b, thevideo compositing server 22 a transmits a new connection notification to client devices of other type. - Let us assume a case where the
video compositing server 22 a receives a connection establishment request from theviewer 12 a serving as a client device of the one type, for example. In this case, thevideo compositing server 22 a transmits a new connection notification indicating that theviewer 12 a is to be newly connected to the video compositing server 22 b to the 11 a, 11 b, and 11 c serving as client devices of the other type based on stored corresponding relations. If thevideo servers 11 a, 11 b, and 11 c receive the new connection notification of thevideo servers viewer 12 a, they update the respective device lists based on the client identification information “Ba” included in the received new connection request. - When the
11 a, 11 b, and 11 c and thevideo servers viewers 12 a and 12 b establish connections with thevideo compositing server 22 a, for example, thedevice managing unit 106 of the 11 a, 11 b, and 11 c stores therein the device list including the pieces of client identification information “Ba” and “Bb” on thevideo servers viewers 12 a and 12 b, respectively. Thedevice managing unit 106 of theviewers 12 a and 12 b stores therein the device list including the pieces of client identification information “Va”, “Vb”, and “Vc” on the 11 a, 11 b, and 11 c, respectively. Thevideo servers video compositing server 22 a stores therein corresponding relations between the 11 a, 11 b, and 11 c and thevideo servers viewers 12 a and 12 b. - The
11 a, 11 b, and 11 c and thevideo servers viewers 12 a and 12 b perform the processing to terminate connections with thevideo compositing server 22 a, for example, in the same manner as described above. Specifically, if thevideo compositing server 22 a receives a removal notification from a client device of one type out of the two types of client devices of the 11 a, 11 b, and 11 c and thevideo servers viewers 12 a and 12 b connected to thevideo compositing server 22 a, thevideo compositing server 22 a transmits the removal notification to client devices of other type. - Let us assume a case where the
video compositing server 22 a receives a removal notification from theviewer 12 a serving as a client device of the one type, for example. In this case, thevideo compositing server 22 a transmits a removal notification indicating to the effect that theviewer 12 a is to be removed to the 11 a, 11 b, and 11 c serving as client devices of the other type based on the stored corresponding relations. If thevideo servers 11 a, 11 b, and 11 c receive the removal notification of thevideo servers viewer 12 a, they update the respective device lists based on the client identification information “Ba” included in the received removal notification. - If the
11 a, 11 b, and 11 c and thevideo servers viewers 12 a and 12 b receive a shift instruction from the instructingunit 300 e, they perform the processing from Step S101 on inFIG. 11 . The 11 a, 11 b, and 11 c and thevideo servers viewers 12 a and 12 b thus perform the processing for shifting connections from thevideo compositing server 22 a to which they are connected to the video compositing server 22 b serving as a destination, for example (seeFIG. 17B ). - The following describes a second embodiment. The
client device 10 according to the first embodiment and the modifications thereof transmits the transmission termination notification in the switching of therelay servers 20. By contrast, theclient device 10 in the communication system according to the second embodiment adds a value that uniquely varies based on a predetermined rule, such as a serial number in ascending order, to a message to be transmitted without transmitting the transmission termination notification. Based on the serial number, theclient device 10 detects completion of switching of therelay servers 20. - The following describes the communication processing according to the second embodiment with reference to
FIG. 18 . The communication system according to the second embodiment has the same configuration as that of the communication system according to the first embodiment described with reference toFIG. 1 .FIG. 18 illustrates components of theclient device 10 greatly relating to the operation according to the second embodiment (the acquiringunit 104, theconnection managing unit 105, theconnection units 107 a, and theconnection unit 107 b illustrated inFIGS. 5 and 6 ). The communication processing is described below appropriately with reference toFIGS. 1, 5, and 6 . - In the example illustrated in
FIG. 18 , the processing to Step S108 inFIG. 11 is performed, for example. Specifically, assume that theconnection unit 107 a is connected to therelay server 20 serving as an origin, and theconnection unit 107 b is connected to therelay server 20 serving as a destination. - The distributing
unit 102 illustrated inFIG. 5 adds a serial number (sequence number) for identifying the order of messages to a message transmitted from themessage generating unit 101. Transmission of data via thenetwork 40 is typically carried out by a packet unit by dividing the data into a predetermined size and adding header information or the like thereto. The distributingunit 102, for example, generates the sequence numbers for the respective packets and stores them in headers. In the following description, the sequence number is a value incremented by 1. - In
FIG. 18 , the acquiringunit 104 extracts the sequence number from the received message and checks that the value of the extracted sequence number sequentially increases in each message. After theconnection managing unit 105 issues a switching instruction to the distributingunit 102 at Step S108 inFIG. 11 , theconnection managing unit 105 issues a wait request to the acquiringunit 104 as illustrated inFIG. 18 . - The acquiring
unit 104 monitors the sequence numbers added to the messages transmitted from theconnection unit 107 a and theconnection unit 107 b. The acquiringunit 104 waits until it receives, from theconnection unit 107 b, a message (message having a sequence number “4”) next to a sequence number (“3” in this example) of the last message received from theconnection unit 107 a. Specifically, the acquiringunit 104 waits until it receives, from theconnection unit 107 b, a message with a sequence number having a value larger by 1 than the largest sequence number out of the sequence numbers added to the messages received from theconnection unit 107 a. - If the acquiring
unit 104 receives the message, the acquiringunit 104 determines that switching from theconnection unit 107 a to theconnection unit 107 b is completed and returns the processing to theconnection managing unit 105. Theconnection managing unit 105 issues a connection termination request for theconnection unit 107 a connected to therelay server 20 serving as an origin. With this process, theconnection managing unit 105 can determine that no more message is to be transmitted hereafter from any communication partner to theclient device 10 via theconnection unit 107 a. -
FIG. 19 is an exemplary flowchart of the processing performed by the acquiringunit 104 according to the second embodiment. At Step S200, the acquiringunit 104 receives a message from theconnection unit 107 a or theconnection unit 107 b. At Step S201, the acquiringunit 104 acquires the sequence number added to the received message. - At Step S202, the acquiring
unit 104 determines whether the sequence number acquired at Step S201 is a number (number having a value larger by 1) next to the largest sequence number of the acquired sequence numbers. If the acquiringunit 104 determines that the sequence number is not the number next to the largest sequence number (No at Step S202), the processing is returned to Step S200, and the acquiringunit 104 performs the processing on the next message. - On the other hand, if the acquiring
unit 104 determines that the sequence number is the number next to the largest sequence number (Yes at Step S202), the processing is shifted to Step S203. At Step S203, the acquiringunit 104 acquires source information (connection ID) indicating whether the message with the sequence number is received from theconnection unit 107 a or theconnection unit 107 b. The acquiringunit 104 stores the source information associated with the sequence number acquired at Step S201 in theRAM 1002 or the like. - At Step S204, the acquiring
unit 104 compares the source information acquired at Step S203 with the source information associated with a sequence number (number having a value smaller by 1) previous to the sequence number acquired at Step S201 to determine whether the pieces of source information indicate different sources. In a case where the source information (connection ID) acquired at Step S203 indicates theconnection unit 107 b, and the source information associated with the previous sequence number indicates theconnection unit 107 a, for example, the acquiringunit 104 determines that the sources are different. If the acquiringunit 104 determines that the sources are the same (No at Step S204), the processing is returned to Step S200. - By contrast, if the acquiring
unit 104 determines that the sources are different (Yes at Step S204), the processing is shifted to Step S205. At Step S205, the acquiringunit 104 notifies theconnection managing unit 105 of completion of switching. The processing at Step S205 corresponds to the processing from Step S109 to Step S111 inFIG. 11 , for example. - While certain embodiments have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the inventions. Indeed, the novel embodiments described herein may be embodied in a variety of other forms; furthermore, various omissions, substitutions and changes in the form of the embodiments described herein may be made without departing from the spirit of the inventions. The accompanying claims and their equivalents are intended to cover such forms or modifications as would fall within the scope and spirit of the inventions.
Claims (16)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2016-014859 | 2016-01-28 | ||
| JP2016014859A JP6559587B2 (en) | 2016-01-28 | 2016-01-28 | COMMUNICATION DEVICE, COMMUNICATION SYSTEM, AND COMMUNICATION PROGRAM |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| US20170222919A1 true US20170222919A1 (en) | 2017-08-03 |
| US10320663B2 US10320663B2 (en) | 2019-06-11 |
Family
ID=59386201
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US15/257,169 Active 2037-01-12 US10320663B2 (en) | 2016-01-28 | 2016-09-06 | Communication device, communication system, and computer program product for performing interactive communication via relay servers |
Country Status (2)
| Country | Link |
|---|---|
| US (1) | US10320663B2 (en) |
| JP (1) | JP6559587B2 (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20190288975A1 (en) * | 2016-11-25 | 2019-09-19 | Mitsubishi Heavy Industries Machinery Systems, Ltd. | Client, broker, communication system, communication method, and program |
| US11315408B1 (en) * | 2018-09-28 | 2022-04-26 | CauZway, LLC | Emergency communications system |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP7669153B2 (en) * | 2021-02-09 | 2025-04-28 | 東芝テック株式会社 | Information processing system, server device, client device, and information processing method |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6272148B1 (en) * | 1997-09-22 | 2001-08-07 | Kabushiki Kaisha Toshiba | Scheme for reliable communications via radio and wire networks using transport layer connection |
| US20050265284A1 (en) * | 2003-10-10 | 2005-12-01 | Hsu Liangchi Alan | Apparatus, and associated method, for facilitating communication handoff in multiple-network radio communication system |
| US20140052986A1 (en) * | 2012-08-17 | 2014-02-20 | Kabushiki Kaisha Toshiba | Information handling device, information output device, and recording medium |
| US20150256622A1 (en) * | 2014-03-10 | 2015-09-10 | Kabushiki Kaisha Toshiba | Connection management device, communication system, connection management method, and computer program product |
Family Cites Families (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20050058063A1 (en) * | 2003-09-15 | 2005-03-17 | Dell Products L.P. | Method and system supporting real-time fail-over of network switches |
| JP2008225644A (en) * | 2007-03-09 | 2008-09-25 | Nec Corp | Gateway device, load balancing method for gateway device and load balancing program of gateway device |
| JP4268200B2 (en) | 2007-06-13 | 2009-05-27 | 古河電気工業株式会社 | Redundant data relay device and encrypted communication method using redundant data relay device |
| US8488468B2 (en) * | 2008-07-09 | 2013-07-16 | Nec Corporation | Group conference system, conference server, session switching control method and session switching control program |
| WO2010073656A1 (en) * | 2008-12-26 | 2010-07-01 | パナソニック株式会社 | Communication terminal, communication method, and program |
| JP4831224B2 (en) | 2009-09-30 | 2011-12-07 | 沖電気工業株式会社 | Relay device and program, relay system, and communication system |
| JP6378057B2 (en) | 2014-11-13 | 2018-08-22 | 株式会社東芝 | Connection control device, connection control method, connection control system, and computer program |
-
2016
- 2016-01-28 JP JP2016014859A patent/JP6559587B2/en active Active
- 2016-09-06 US US15/257,169 patent/US10320663B2/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6272148B1 (en) * | 1997-09-22 | 2001-08-07 | Kabushiki Kaisha Toshiba | Scheme for reliable communications via radio and wire networks using transport layer connection |
| US20050265284A1 (en) * | 2003-10-10 | 2005-12-01 | Hsu Liangchi Alan | Apparatus, and associated method, for facilitating communication handoff in multiple-network radio communication system |
| US20140052986A1 (en) * | 2012-08-17 | 2014-02-20 | Kabushiki Kaisha Toshiba | Information handling device, information output device, and recording medium |
| US20150256622A1 (en) * | 2014-03-10 | 2015-09-10 | Kabushiki Kaisha Toshiba | Connection management device, communication system, connection management method, and computer program product |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20190288975A1 (en) * | 2016-11-25 | 2019-09-19 | Mitsubishi Heavy Industries Machinery Systems, Ltd. | Client, broker, communication system, communication method, and program |
| US10911391B2 (en) * | 2016-11-25 | 2021-02-02 | Mitsubishi Heavy Industries Machinery Systems, Ltd. | Client, broker, communication system, communication method, and program |
| US11315408B1 (en) * | 2018-09-28 | 2022-04-26 | CauZway, LLC | Emergency communications system |
Also Published As
| Publication number | Publication date |
|---|---|
| US10320663B2 (en) | 2019-06-11 |
| JP2017135611A (en) | 2017-08-03 |
| JP6559587B2 (en) | 2019-08-14 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112350981B (en) | Method, device and system for switching communication protocol | |
| US10917307B2 (en) | Transparent middlebox graceful entry and exit | |
| EP2455899B1 (en) | Apparatus and method for synchronizing data in connected devices | |
| CN111917838B (en) | Micro-service-based processing method and device, storage medium and electronic device | |
| EP3557877A1 (en) | Control method and device | |
| EP2933982A1 (en) | Media stream transfer method and user equipment | |
| CN113810264B (en) | Information transmission method, device, electronic equipment and storage medium | |
| US20150127837A1 (en) | Relay apparatus and data transfer method | |
| EP4287591A1 (en) | Data transmission method and apparatus, and server, storage medium and program product | |
| CN112751907B (en) | Information processing method, information processing apparatus, storage medium, and electronic apparatus | |
| US10320663B2 (en) | Communication device, communication system, and computer program product for performing interactive communication via relay servers | |
| EP3217596B1 (en) | Communication terminal, communication system, and data transmission method | |
| CN111556359A (en) | Screen projection system and method based on television box | |
| KR20220039530A (en) | Method, device, electronic equipment for adjusting the number of instances and readble storage medium | |
| US20030225890A1 (en) | State token for thin client devices | |
| CN107835445B (en) | MQTT protocol-based television control method, mobile terminal and television | |
| CN111787088B (en) | Method and device for processing small program data | |
| US7730417B2 (en) | Terminal apparatus, network system, window display method, and computer program | |
| JP7259099B2 (en) | Multi-route communication system and route selection system | |
| CN115567518A (en) | Device, system and method for reorienting camera of cloud desktop | |
| CN113301088B (en) | Message processing method, device and system, electronic equipment and readable storage medium | |
| WO2022042592A1 (en) | Screen projection method and apparatus, electronic device, and computer-readable medium | |
| US20190098351A1 (en) | Method for managing the access right to an item of digital content | |
| JP2015041146A (en) | Server device, client device, system, information processing method, and program | |
| KR102093749B1 (en) | Content displaying system and method using multi-device base on web-browser |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| AS | Assignment |
Owner name: KABUSHIKI KAISHA TOSHIBA, JAPAN Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:KAWAZOE, HIROSHI;AJITOMI, DAISUKE;MINAMI, KEISUKE;AND OTHERS;SIGNING DATES FROM 20161018 TO 20161021;REEL/FRAME:040589/0959 |
|
| STPP | Information on status: patent application and granting procedure in general |
Free format text: NOTICE OF ALLOWANCE MAILED -- APPLICATION RECEIVED IN OFFICE OF PUBLICATIONS |
|
| STPP | Information on status: patent application and granting procedure in general |
Free format text: PUBLICATIONS -- ISSUE FEE PAYMENT VERIFIED |
|
| STCF | Information on status: patent grant |
Free format text: PATENTED CASE |
|
| MAFP | Maintenance fee payment |
Free format text: PAYMENT OF MAINTENANCE FEE, 4TH YEAR, LARGE ENTITY (ORIGINAL EVENT CODE: M1551); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY Year of fee payment: 4 |