WO2013120325A1 - 浏览器与浏览器直通的方法、装置和通信系统 - Google Patents

浏览器与浏览器直通的方法、装置和通信系统 Download PDF

Info

Publication number
WO2013120325A1
WO2013120325A1 PCT/CN2012/075524 CN2012075524W WO2013120325A1 WO 2013120325 A1 WO2013120325 A1 WO 2013120325A1 CN 2012075524 W CN2012075524 W CN 2012075524W WO 2013120325 A1 WO2013120325 A1 WO 2013120325A1
Authority
WO
WIPO (PCT)
Prior art keywords
user
browser
message
identifier
communication group
Prior art date
Application number
PCT/CN2012/075524
Other languages
English (en)
French (fr)
Inventor
关国锋
朱建峰
范家星
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2013120325A1 publication Critical patent/WO2013120325A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]

Definitions

  • the present invention relates to the field of communications, and in particular, to a method, an apparatus, and a communication system for a browser to communicate with a browser.
  • BACKGROUND In a traditional web service architecture, communication between browsers relies on a shared web application server in the network as a relay server, that is, a main server is run by a relay server such as a web application server, and browsing
  • the device is generally only responsible for running the Presentation Layer logic; the browser and the Web application server use the traditional HTTP protocol for communication. If the communication between browsers is not demanding real-time, this communication method is barely acceptable. With the further development of Web applications and network technologies, users are increasingly demanding real-time performance.
  • Point-to-point full-duplex communication cannot be achieved.
  • the communication between the browser and the web application server is based on the HTTP protocol, such as traditional HTTP polling or Comet technology, to obtain real-time information; since the traditional HTTP polling is half-duplex, the Comet technology based on the HTTP protocol needs to be in two The two-way communication is realized on the connection, so that the server resources are relatively expensive, and the point-to-point full-duplex communication cannot be realized between the browser and the back-end server.
  • the embodiment of the invention provides a method, a device and a communication system for a browser to communicate with a browser, so as to implement point-to-point full-duplex communication between the browser and the browser, thereby effectively avoiding system performance bottlenecks.
  • An embodiment of the present invention provides a method for a browser to communicate with a browser.
  • the method includes: receiving, by using a transmission control protocol TCP connection established with a first browser, a message sent by the first user through the first browser.
  • the message includes an identifier of the second user;
  • An embodiment of the present invention provides a device for directly connecting a browser and a browser, where the device includes: a receiving module, configured to receive a first user pass through a TCP connection established by a first browser And the message sent by the first browser, where the message includes an identifier of the second user;
  • An obtaining module configured to query a message forwarding table according to the identifier of the second user, to obtain an IP address and a port of the second browser that matches the identifier of the second user;
  • a sending module configured to send the message to the second browser by using a TCP connection established with the second browser according to the acquired IP address and port of the browser.
  • the embodiment of the present invention provides a communication system, where the communication system includes a gateway, a first browser, and a second browser.
  • the first browser is configured to connect to the TCP through a transmission control protocol established with the gateway.
  • the gateway sends a message;
  • the gateway is configured to receive, by using a TCP connection established with the first browser, a message sent by the first user by using the first browser, where the message includes an identifier of the second user, and the identifier is queried according to the identifier of the second user.
  • a message forwarding table obtaining an IP address and a port of the second browser that matches the identifier of the second user, according to the obtained IP address and port of the second browser, by establishing with the second browser a TCP connection, sending the message to the second browser;
  • the second browser is configured to receive, by using a TCP connection established with the gateway, a message sent by the first user forwarded by the browser and the device directly connected by the browser.
  • the first user passes the first user through the TCP connection established by the gateway with the second browser because the gateway can query the message forwarding table according to the second user identifier.
  • a message sent by a browser to the gateway is forwarded to the second browser. Therefore, on the one hand, the gateway is only responsible for message forwarding between the browser and the browser, and does not cause a system performance bottleneck, and the message is sent in real time. Strong, able to meet the application scenarios with high requirements for real-time; another On the other hand, the main business logic and calculation of the message are distributed in the browser. The gateway does not need to undertake the main business logic and calculation, and does not need to spend additional resources to implement protocol conversion between HTTP and the browser, thus saving the overhead.
  • FIG. 1 is a schematic flowchart of a method for directly connecting a browser and a browser according to an embodiment of the present invention
  • FIG. 2 is a first browser, a second browser, and a WebSocket gateway in a method for directly connecting a browser and a browser according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a device for directly connecting a browser and a browser according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of a device for directly connecting a browser and a browser according to another embodiment of the present invention
  • FIG. 6 is a schematic structural diagram of a communication system provided by an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of a communication system provided by an embodiment of the present invention.
  • FIG. 1 is a flowchart showing a method for directly connecting a browser and a browser according to an embodiment of the present invention. Intention.
  • the method illustrated in FIG. 1 is that the communication protocol in which the browser is a web page browser, the gateway is a Web socket gateway, and the web socket gateway communicates with the browser is an HTML5 standard WebSocket protocol, and the execution body thereof may be a Web socket gateway.
  • S101 Receive, by using a Transmission Control Protocol (TCP) connection established by the first browser, a message sent by the first user by using the first browser, where the message includes an identifier of the second user.
  • TCP Transmission Control Protocol
  • the browser when the user accesses the gateway, the browser sends an application download request to the gateway to download the web application from the Websocket gateway to the browser. Thereafter, the browser runs the web application to request to establish a Transmission Control Protocol (TCP) connection with the Websocket gateway.
  • TCP Transmission Control Protocol
  • the specific manner may be that, when the communication starts, the first user may send a handshake request message based on the HTTP format to the Websocket gateway through the first browser.
  • the WebSocket gateway feeds back a handshake response message to the first browser, it indicates that a TCP connection has been established between the first browser and the WebSocket gateway, and the subsequent first browser and the WebSocket gateway are transmitted through the TCP connection.
  • Messages are WebSocket protocol messages based on the WebSocket protocol.
  • the first user is established by using the first browser.
  • the identifier of the second user included in the message sent by the TCP connection may be the ID of the user communication group to which the second user belongs, and the identifier of the second user may also include the ID of the user communication group to which the second user belongs and the The user ID of the second user, that is, the ID of the user communication group to which the second user belongs and the user ID of the second user are used to identify the second user, or the identifier of the second user may be the user ID of the second user. .
  • the definition of the identity of the first user is similar to the definition of the identity of the second user.
  • first user and second user It is only used to distinguish between different users, not specifically “first user” and “second user”.
  • these different users may be any two different users under the same user communication group, or may be the next user of the same user communication group and all users except the user in the user communication group.
  • the message forwarding table is a table that needs to be queried in order to find the destination address of the message when the gateway forwards the message, and records the identifier of the user, the IP address and port of the browser, and the identifier and browser of the user.
  • the message forwarding table may record the ID of the user communication group and the correspondence between the user communication group and the browser's IP address and port, and record the ID of the user under the user communication group to which the user belongs, The IP address and port of the browser and the correspondence between the user and the browser's IP address and port in the user's communication group of the user, or record the ID of a user, the IP address and port of the browser, and a user and browser. Correspondence between the IP address and the port.
  • the message forwarding table can be updated at any time based on the handshake request message sent by the user through the browser or the operation performed on the user communication group.
  • the update of the message forwarding table in the Websocket gateway may be completed by the handshake request message sent by the first user through the first browser or the operation performed on the user communication group.
  • the Websocket gateway extracts the identifier of the first user, the IP address and port of the first browser from the handshake request message, and the The identifier of the first user, the IP address and port of the first browser, and the correspondence between the identifier of the first user and the IP address and port of the first browser are recorded in the message forwarding table; for example, the first user passes the When a browser logs in to the Websocket gateway, creates a user communication group and joins the user communication group, the Websocket gateway is based on the first user.
  • the websocket gateway applies, according to the first user, the first user to join the user communication group created by the second user, and identifies the identifier of the first user, the IP address and port of the first browser, and the identifier of the first user with the first browser.
  • the correspondence between the IP address and the port is recorded in the message forwarding table.
  • the update of the message forwarding table in the Websocket gateway may be performed by the second user sending a handshake request message or an operation message through the second browser.
  • the Websocket gateway receives the second user through a TCP connection established with the second browser before receiving the message sent by the first user through the first browser through a transmission control protocol TCP connection established with the first browser.
  • the handshake message sent by the second browser where the handshake message includes the identifier of the second user, an IP address and a port of the second browser, and extracts the number from the handshake request message.
  • An identifier of the second user, an IP address and a port of the second browser; an identifier of the second user, an IP address and port of the second browser, and an identifier of the second user and an IP of the second browser The correspondence between the address and the port is recorded in the message forwarding table.
  • the Websocket gateway completes the update of the message forwarding table in the above manner.
  • the Websocket gateway may also complete the update of the message forwarding table by using the following manner, that is, Receiving, by the second user, an operation message for operating the user communication group by using the second browser; updating the message forwarding table according to the operation message, where the operation message includes a user communication group creation message or a user communication group plus Incoming request message.
  • updating the message forwarding table according to the operation message specifically includes: recording user communication group information in the operation message and information of the second user in a message transfer
  • updating the message forwarding table according to the operation message specifically includes: recording information of the second user in the operation message in a message forwarding table
  • the user communication group to which the second user belongs is a user communication group for which the user is requested to join, wherein the information of the second user includes the identifier of the second user and the corresponding relationship between the IP address of the second browser and the port.
  • the message forwarding table records the identifier of the user, the IP address and port of the browser, and the correspondence between the identifier of the user and the IP address and port of the browser. Therefore, the Websocket gateway can query the message forwarding table according to the second user identifier to obtain the The IP address and port of the second browser that the identifier of the second user matches, may be the ID of the user communication group to which the second user belongs according to the identifier of the second user, or include the second user The ID of the user communication group and the user ID of the second user, or the user ID of the second user are implemented in three ways.
  • Embodiment 1 If the identifier of the second user is the ID of the user communication group to which the second user belongs, the Websocket gateway may first query the message forwarding table according to the ID of the user communication group to which the second user belongs. .
  • the message forwarding table records the correspondence between the user communication group of the second user and the IP address and port of the second browser. Therefore, the Websocket gateway can obtain the second user according to the correspondence.
  • the IP address and port of the second browser whose ID of the user communication group matches.
  • the Websocket gateway obtains an IP address and a port of the second browser that matches the ID of the user communication group to which the second user belongs according to the ID of the user communication group to which the second user belongs, and therefore,
  • This implementation is suitable for multicasting of messages. That is, the Websocket gateway does not need to know the user ID of a specific user, and can multicast the message to the user of the second user.
  • the browser corresponding to all users under the letter group.
  • Embodiment 2 if the identifier of the second user includes the ID of the user communication group to which the second user belongs and the user ID of the second user, that is, the second user communicates with the user to which the second user belongs The ID of the group and the user ID of the second user are jointly identified.
  • the Websocket gateway first queries the message forwarding table according to the ID of the user communication group to which the second user belongs and the user ID of the second user.
  • the message forwarding table records a correspondence list between the user of the user communication group of the second user and the IP address and port of the second browser, where the user relationship of the second user belongs to the correspondence relationship list.
  • Each user in the group corresponds to an IP address and a port of each browser.
  • the Websocket gateway can obtain an ID of the communication group with the user to which the second user belongs and a user of the second user according to the correspondence relationship list.
  • the ID matches the IP address and port of the second browser.
  • the Websocket gateway obtains an ID of the communication group with the user to which the second user belongs and the second according to the ID of the user communication group to which the second user belongs and the user ID of the second user.
  • the user's user ID matches the IP address and port of the second browser. Therefore, this embodiment is suitable for communication between members of the user communication group, and since the ID of the user communication group to which the second user belongs is used and The two elements of the second user's user ID jointly identify one user. Therefore, the message is not sent to the communication group other than the user communication group to which the second user belongs, so that the intra-group communication has good confidential information.
  • Embodiment 3 If the identifier of the second user is the user ID of the second user, the Websocket gateway may first query the message forwarding table according to the user ID of the second user.
  • the message forwarding table records the correspondence between the IP address and the port of the second user and the second browser. Therefore, the Websocket gateway can obtain the user ID of the second user according to the correspondence.
  • the IP address and port of the second browser In this embodiment, Websocket The gateway obtains an IP address and a port of the second browser that matches the user ID of the second user according to the user ID of the second user. Therefore, the implementation manner can not only implement different users in the same user communication group. The communication between them is also suitable for communication between users of different user communication groups.
  • S103 Send the message to the second browser by using a TCP connection established with the second browser according to the obtained IP address and port of the second browser.
  • the second browser when the second user accesses the gateway, the second browser sends an application download request to the gateway, and downloads the web application from the Websocket gateway. Go to the second browser. Thereafter, the second browser runs the web application to request to establish a Transmission Control Protocol (TCP) connection with the Websocket gateway.
  • TCP Transmission Control Protocol
  • the second user may send a handshake request message based on the HTTP format to the Websocket gateway through the second browser when the communication starts.
  • the WebSocket gateway feeds back a response message of the handshake success to the second browser, it indicates that a TCP connection has been established between the second browser and the WebSocket gateway, and then the second browser and the WebSocket gateway are transmitted through the TCP connection.
  • Messages are WebSocket protocol messages based on the WebSocket protocol.
  • the Websocket gateway can establish a TCP connection with the second browser according to the IP address and port of the second browser obtained in step S102. The message is sent to the second browser.
  • the method for the direct connection between the browser and the browser provided by the embodiment of the present invention is as follows: the IP address and port of the second browser obtained by the gateway according to the second user identifier querying the message forwarding table are established by using the second browser.
  • the TCP connection forwards the message sent by the first user to the gateway through the first browser to the second browser. Therefore, on the one hand, the gateway is only responsible for the browser and the browser.
  • the message forwarding between the two does not lead to system performance bottlenecks.
  • the real-time performance of the message is strong, and the application scenario with high real-time requirements can be satisfied.
  • the main business logic and calculation of the message are distributed in the browser. The gateway does not need to undertake the main business logic and calculations, without the need to spend additional resources to achieve
  • Protocol conversion between HTTP and browser thus saving overhead.
  • FIG. 2 illustrates communication between users in the same user communication group, that is, the user communication group of the first user corresponding to the first browser communicates with the user of the second user corresponding to the second browser.
  • a group is the same user communication group.
  • the interaction between the first browser, the second browser, and the WebSocket gateway mainly includes:
  • the first browser sends a web page loading request to the WebSocket gateway.
  • the WebSocket gateway returns a response of the web page loading request to the first browser.
  • the first browser sends the created user communication group information to the WebSocket gateway.
  • the user communication group information includes the ID of the created user communication group (hereinafter referred to as "the ID of the user communication group to which the first user belongs") and the user ID of the user under the user communication group to which the first user belongs.
  • the WebSocket gateway updates the message forwarding table.
  • the method includes: recording an ID of a user communication group to which the first user belongs, a user ID of the first user, an IP address and a port of the first browser, and a correspondence between the first user and the IP address and port of the first browser in the message transfer Published.
  • the process includes: S, 201, the second browser.
  • S, 202, WebSocket gateway to The second browser returns a response of the web page loading request;
  • S, 203, the second browser sends a request for the second user to join the communication user group to the WebSocket gateway;
  • S, 204, the WebSocket gateway updates the message forwarding table, including: ID of the user communication group to which the user belongs (since this embodiment is the communication between users in the same user communication group, therefore, the ID of the user communication group to which the second user belongs is also the ID of the user communication group to which the first user belongs), and the second user
  • ID, the IP address and port of the second browser, and the correspondence between the user ID of the second user and the IP address and port of the second browser are recorded in the message forwarding table.
  • the first browser sends a web application download request to the WebSocket gateway.
  • the web application download request is that when the first user accesses the gateway, the first browser sends the access request to the WebSocket gateway.
  • the WebSocket gateway downloads the web application to the first browser.
  • the first browser runs the web application.
  • the first browser sends a handshake request to the WebSocket gateway through the web application.
  • the first browser may send a handshake request message based on the HTTP format to the WebSocket gateway to request to establish a TCP connection with the WebSocket gateway.
  • the handshake request message includes a user ID of the first user, an ID of the user communication group to which the first user belongs, and an IP address and port of the first browser.
  • the information may be formed by adding a cell to the handshake request message.
  • WebSocket Gateway updates the message forwarding table.
  • the WebSocket gateway parses the handshake request message and extracts the user of the first user contained therein.
  • the WebSocket gateway returns a response message of the handshake request message to the first browser.
  • the process includes: S, 205, the second browser sends a web application download request to the WebSocket gateway; , 206, the WebSocket gateway downloads the web application to the second browser; S, 207, the second browser runs the web application; S, 208, the first browser sends a handshake request message to the WebSocket gateway through the web application, wherein The user ID of the second user, the ID of the user communication group to which the second user belongs, and the IP address and port of the second browser may be formed by adding a cell to the handshake request message; S, 209, WebSocket gateway Updating the message forwarding table, that is, the WebSocket gateway parses the handshake request message, extracts the user ID of the second user included therein, the ID of the user communication group to which the second user belongs, and the IP address and port of the second browser, and then The correspondence between the user ID of the second user and the IP
  • the first browser sends a message to the WebSocket gateway.
  • the message is received by the second user.
  • the WebSocket gateway parses the message that the receiving object is the second user.
  • the process includes: after extracting the user ID of the second user from the message that the receiving object is the second user, the WebSocket gateway queries the message forwarding table according to the user ID of the second user. Obtaining the first relationship between the user ID of the second user in the message forwarding table and the IP address and port of the second browser.
  • the TCP connection between the browser and the WebSocket gateway that is, the IP address and port of the second browser or the user communication are first searched by the correspondence between the user ID of the second user and the IP address and port of the second browser.
  • a list of browser IP addresses and ports of the members in the group, and the TCP connection between the second browser and the WebSocket gateway is found by the IP address and port pair of the second browser.
  • the WebSocket gateway sends a message to the second browser that the receiving object is the second user. After obtaining the TCP connection between the second browser and the WebSocket gateway, the WebSocket gateway sends the message receiving object to the second user to the second browser through the TCP connection between the second browser and the WebSocket gateway.
  • the second browser returns a response message to the WebSocket gateway.
  • the response message is a confirmation that the second browser sends a message to the WebSocket gateway that the receiving object is the second user.
  • the WebSocket gateway forwards the response message to the first browser.
  • the process is similar to S211 to S215 in the foregoing process, except that the message is received by the first user, and therefore, no description is made herein.
  • FIG. 3 it is a schematic diagram of a device structure of a browser and a browser through the embodiment of the present invention. For the convenience of description, only parts related to the embodiment of the present invention are shown.
  • the device of the browser and the browser through the example of FIG. 3 may be a gateway, such as a WebSocket gateway, which includes a receiving module 301, an obtaining module 302, and a sending module 303, where:
  • the receiving module 301 is configured to receive, by using a transmission control protocol TCP connection established with the first browser, a message sent by the first user by using the first browser, where the message includes an identifier of the second user.
  • a transmission control protocol TCP connection established with the first browser
  • the browser sends a message to the WebSocket gateway illustrated in FIG.
  • the application download request downloads the web application from the WebSocket gateway sampled in Figure 3 to the browser. Thereafter, the browser runs the web application to request a TCP connection with the WebSocket gateway as illustrated in FIG.
  • the specific manner may be that, when the communication starts, the first user may send a handshake request message based on the HTTP format to the WebSocket gateway illustrated in FIG. 3 through the first browser.
  • the WebSocket gateway illustrated in FIG. 3 feeds back a handshake success response message to the first browser, it indicates that a TCP connection has been established between the first browser and the WebSocket gateway of the example of FIG. 3, and the subsequent first browser and the attached
  • the messages transmitted by the TCP socket between the WebSocket gateways shown in Figure 3 are all WebSocket protocol messages based on the WebSocket protocol.
  • the identifier of the second user included in the message (WebSocket protocol message) sent by the first user through the TCP connection established with the first browser may be the user of the second user.
  • the ID of the communication group, the identifier of the second user may also include the ID of the user communication group to which the second user belongs and the user ID of the second user, that is, the ID of the user communication group to which the second user belongs and the second user.
  • the user IDs jointly identify the second user, or the identifier of the second user may also be the user ID of the second user.
  • the definition of the identity of the first user is similar to the definition of the identity of the second user.
  • the "first user” and the “second user” are only used to distinguish different users, instead of specifically referring to "first user” and “second user”. .
  • these different users may be any two different users under the same user communication group, or may be the next user of the same user communication group and all users except the user in the user communication group.
  • the obtaining module 302 is configured to query the message forwarding table according to the identifier of the second user, and obtain an IP address and a port of the second browser that matches the identifier of the second user.
  • the sending module 303 is configured to send the message to the second browser by using a TCP connection established with the second browser according to the obtained IP address and port of the browser.
  • each functional module is merely an example, and the actual application may be considered according to requirements, such as configuration requirements of the corresponding hardware or convenience of implementation of the software.
  • the above function assignment is completed by different functional modules, that is, the internal structure of the gateway is divided into different functional modules to complete all or part of the functions described above.
  • the corresponding functional modules in this embodiment may be implemented by corresponding hardware, or may be executed by corresponding hardware.
  • the foregoing receiving module may have the foregoing A browser-established transmission control protocol TCP connection receives hardware of a message sent by the first user through the first browser, such as a receiver, or a general processor or other hardware capable of executing a corresponding computer program to perform the aforementioned functions.
  • the device may be configured to execute the foregoing foregoing, according to the identifier query message forwarding table of the second user, to obtain the IP address and port function of the second browser that matches the identifier of the second user.
  • the acquirer may also be a general processor or other hardware device capable of executing a corresponding computer program to perform the aforementioned functions (the various embodiments provided in the present specification may apply the above described principles).
  • the obtaining module 302 illustrated in FIG. 3 is specifically configured to use the user communication group to which the second user belongs. ID querying the message forwarding table, where the message forwarding table records the correspondence between the IP address and the port of the user communication group to which the second user belongs and the second browser; The correspondence between the user communication group of the second user and the IP address and port of the second browser And obtaining an IP address and a port of the second browser that matches the ID of the user communication group to which the second user belongs.
  • message multicast can be implemented. That is, the Websocket gateway does not need to know the user ID of the specific user, and can multicast the message to the browser corresponding to all users in the user communication group to which the second user belongs.
  • the identifier of the second user includes an ID of a user communication group to which the second user belongs and a user ID of the second user, that is, the second user uses the first
  • the acquiring module 302 of the example of FIG. 3 is specifically used according to the ID of the user communication group to which the second user belongs and the ID of the second user's user communication group.
  • the user ID of the second user queries the message forwarding table, where the message forwarding table records a correspondence list between the user of the user communication group of the second user and the IP address and port of the second browser; Obtaining a correspondence list between the user of the user communication group of the second user to which the second user belongs and the IP address and port of the second browser, and obtaining the ID of the communication group with the user to which the second user belongs and the second
  • the user's user ID matches the IP address and port of the second browser.
  • the device of the example of the browser and the browser is suitable for communication between members of the user communication group, and is jointly identified by the two elements of the user communication group of the second user and the user ID of the second user. A user, therefore, the message is not sent to the communication group outside the user communication group to which the second user belongs, so that the intra-group communication has good confidential information.
  • the obtaining module 302 illustrated in FIG. 3 is specifically configured to query the message according to the user ID of the second user.
  • a forwarding table wherein the message forwarding table records a correspondence between an IP address and a port of the second user and the second browser; and the second user and the second browser recorded according to the message forwarding table
  • the device of the example of the browser and the browser is not only capable of realizing communication between different users under the same user communication group, but also for communication between users of different user communication groups.
  • the device of the example browser and the browser can further include a handshake message receiving module 701, an ear-out module 702 and a first update module 703, as shown in FIG. 4, which is provided by another embodiment of the present invention.
  • Device that communicates directly with the browser where:
  • the handshake message receiving module 701 is configured to receive, by using a TCP connection established with the second browser, a handshake message sent by the second user by using the second browser, where the handshake message includes the identifier of the second user, The IP address and port of the second browser;
  • the extraction module 702 is configured to extract, from the handshake request message, the identifier of the second user, an IP address and a port of the second browser,
  • the first update module 703 is configured to record, in the message forwarding table, a correspondence between the identifier of the second user and an IP address and a port of the second browser.
  • the message forwarding table is a table that needs to be queried when the Websocket gateway forwards the message in order to find the destination address of the message, and records the identifier of the user and the IP of the browser. Address and port and the correspondence between the user's identity and the browser's IP address and port.
  • the message forwarding table may record the ID of the user communication group and the correspondence between the user communication group and the browser's IP address and port, and record a certain The ID of the user in the user communication group to which the user belongs, the IP address and port of the browser, and the correspondence between the user and the browser's IP address and port in the user's communication group to which the user belongs, or record the ID of a user or the browser. IP address and port and the correspondence between a user and the browser's IP address and port.
  • the message forwarding table can be updated at any time according to a handshake request message sent by the user through the browser or an operation performed on the user communication group.
  • the update of the message forwarding table in the Websocket gateway may be completed by the handshake request message sent by the first user through the first browser or the operation performed on the user communication group.
  • the handshake message receiving module 701 receives the handshake message through a TCP connection established with the second browser, and the extraction module 702 handshakes from the handshake.
  • the identifier of the first user, the IP address and port of the first browser are extracted from the request message, and the first update module 703 identifies the identifier of the first user, the IP address and port of the first browser, and the identifier of the first user.
  • the correspondence with the IP address and port of the first browser is recorded in the message forwarding table.
  • the update of the message forwarding table in the Websocket gateway may be completed by the first user performing an operation on the user communication group by using the first browser. That is, the device of the browser and the browser in the example of FIG. 3 may further include an operation message receiving module 801, a second update module 802, and a device for directly connecting the browser and the browser according to another embodiment of the present invention as shown in FIG. , among them:
  • the operation message receiving module 801 is configured to receive an operation message that is sent by the second user by using the second browser to operate the user communication group, where the operation message is: a user communication group creation message or a user communication group join request Message
  • the second update module 802 is configured to update the message forwarding table according to the operation message.
  • the Websocket gateway passes the first user according to the first user.
  • the user communication group created by the first browser records the created user communication group information and the correspondence between the identifier of the first user and the IP address and port of the first browser in the message forwarding table, where the user communication group information includes ID of the user communication group created And the user ID of the user in the created user communication group; for example, when the first user applies to join the user communication group created by user B (hereinafter referred to as "second user"), the Websocket gateway passes the first user according to the first user.
  • the first browser applies to join the user communication group created by the second user, and associates the identifier of the first user, the IP address and port of the first browser, and the identifier of the first user with the IP address and port of the first browser. Recorded in the message forwarding table.
  • the operation message receiving module 801 receives an operation message that is sent by the second user to the user communication group and is sent by the second browser.
  • the second update module 802 updates the message forwarding table according to the operation message, where the operation message includes the user communication group. Create a message or user communication group join request message.
  • the second update module 802 is specifically configured to record the user communication group information in the operation message and the information of the second user in a message forwarding table;
  • the operation message is a user communication group join request message, and the second update module 802 is specifically configured to record the information of the second user in the operation message in the message forwarding table, and the user communication group to which the second user belongs is The user communication group that is requested to join, wherein the information of the second user includes the identifier of the second user and the corresponding relationship between the IP address of the second browser and the port.
  • the module that implements the functions of the modules 701 and 702 and the module that implements the functions of the modules 801 and 802 may exist in the device of the browser and the browser directly connected in the embodiment of the present invention, and The manner in which the functional modules are divided is not limited to the above description.
  • FIG. 6 a communication system provided by an embodiment of the present invention. For the convenience of description, only the parts related to the embodiment of the present invention are shown.
  • Figure 6 illustrates an exemplary communication system including a first browser 901, a second browser 903, and a gateway 902, wherein:
  • a first browser 901 configured to send a message to the gateway by using a Transmission Control Protocol TCP connection established with the gateway 902;
  • the gateway 902 is configured to receive, by using a TCP connection established with the first browser 901, a message that is sent by the first user by using the first browser 901, including the identifier of the second user, and query the message according to the identifier of the second user.
  • the TCP connection sends the message to the second browser 903.
  • the browser and the browser through device of any of the examples of FIG. 3 to FIG. 5 of the embodiment of the present invention may be applied, and information interaction, execution process, and the like between each module/unit may be
  • the embodiment of the method of the present invention is based on the same concept, and the technical effects thereof are the same as those of the method embodiment of the present invention.
  • the module division in the gateway to implement the functions of the embodiments of the present invention is not limited to the above examples.
  • the second browser 903 is configured to receive, by using a TCP connection established with the gateway 902, the message sent by the first user forwarded by the browser and the device directly connected by the browser.
  • the program may be stored in a computer readable storage medium, and the storage medium may include: Read only memory (ROM, Read Only Memory), random access memory (RAM), disk or optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

本发明实施例提供浏览器与浏览器直通的方法、装置和通信系统,该方法包括:通过与第一浏览器建立的传输控制协议TCP连接接收第一用户通过所述第一浏览器发送的消息,所述消息包括第二用户的标识;根据所述第二用户标识查询消息转发表,获得与所述第二用户的标识匹配的第二浏览器的IP地址和端口;根据所述获得的第二浏览器的IP地址和端口,通过与所述第二浏览器建立的TCP连接,将所述消息发送至所述第二浏览器,从而在浏览器与浏览器之间实现点到点的全双工通信,有效避免系统性能瓶颈。

Description

浏览器与浏览器直通的方法、 装置和通信系统 技术领域 本发明涉及通信领域, 尤其涉及浏览器与浏览器直通的方法、 装置和通 信系统。 背景技术 在传统的 Web服务架构下,浏览器之间的通信都是依靠网络中共享的 Web 应用服务器作为中继服务器, 即, 由 Web应用服务器等中继服务器运行主要 的业务逻辑与计算, 浏览器一般只负责运行显示层( Presentation Layer )逻辑; 浏览器与 Web应用服务器之间采用的是基于传统 HTTP协议进行通信。 如果 浏览器之间的通信对实时性要求不高, 这种通信方式勉强还能被接受。 随着 Web应用以及网络技术的进一步发展, 用户对实时性要求越来越高, 这就需要浏览器之间能够进行点对点的、全双工的高效通信,数据必须能够实 时地双向流动。 例如, 一些 Web实时协作、 Web多人游戏, 需要同组成员之 间进行实时交互、 分享数据。 在这些对实时性要求较高的应用场景下, 现有技 术方案仍然采用的是传统的 Web服务架构, 其依靠的是基于传统的 HTTP协 议的技术, 包括 HTTP轮询或者 Comet的技术, 实现浏览器与 Web应用服务 器之间进行实时通信。 上述现有技术方案提供的浏览器之间的通信存在以下缺点: 1 ) Web应用服务器易成为系统性能瓶颈。 由于浏览器只负责运行显示层 逻辑, Web应用服务器运行主要的业务逻辑与计算, 因此容易成为系统性能瓶 颈。
2 )无法实现点对点的全双工通信。 浏览器与 Web应用服务器之间通信是 基于 HTTP协议, 例如传统的 HTTP轮询或者 Comet技术, 以获取实时信息; 由于传统的 HTTP轮询是半双工, 基于 HTTP协议的 Comet技术需要在两条 连接上实现双向通信, 因此比较耗费服务器资源,在浏览器与后端服务器之间 无法 ^艮好地实现点对点的全双工的通信。
3 ) 资源浪费严重。 由于采用的 HTTP协议所承载的信息往往只有几个字 节, 而 HTTP头过大(近 1K ), 即无效信息载荷多, 因此, 频繁的轮询造成系 统带宽消耗大、 延迟高。 发明内容
本发明实施例提供浏览器与浏览器直通的方法、装置和通信系统, 以在浏 览器与浏览器之间实现点到点的全双工通信, 有效避免系统性能瓶颈。
本发明实施例提供一种浏览器与浏览器直通的方法, 所述方法包括: 通过 与第一浏览器建立的传输控制协议 TCP连接接收第一用户通过所述第一浏览 器发送的消息, 所述消息包括第二用户的标识;
根据所述第二用户标识查询消息转发表,获得与所述第二用户的标识匹配 的第二浏览器的 IP地址和端口; 根据所述获得的第二浏览器的 IP地址和端口, 通过与所述第二浏览器建 立的 TCP连接, 将所述消息发送至所述第二浏览器。
本发明实施例提供一种浏览器与浏览器直通的装置, 所述装置包括: 接收 模块, 用于通过与第一浏览器建立的传输控制协议 TCP连接接收第一用户通 过所述第一浏览器发送的消息, 所述消息包括第二用户的标识;
获取模块, 用于根据所述第二用户的标识查询消息转发表, 获得与所述第 二用户的标识匹配的第二浏览器的 IP地址和端口;
发送模块, 用于根据所述获得的浏览器的 IP地址和端口, 通过与所述第 二浏览器建立的 TCP连接, 将所述消息发送至所述第二浏览器。
本发明实施例提供一种通信系统, 所述通信系统包括网关、第一浏览器和 第二浏览器; 所述第一浏览器, 用于通过与所述网关建立的传输控制协议 TCP连接向 所述网关发送消息;
所述网关, 用于通过与第一浏览器建立的 TCP连接接收第一用户通过所 述第一浏览器发送的消息, 所述消息包括第二用户的标识,根据所述第二用户 的标识查询消息转发表, 获得与所述第二用户的标识匹配的第二浏览器的 IP 地址和端口, 根据所述获得的第二浏览器的 IP地址和端口, 通过与所述第二 浏览器建立的 TCP连接, 将所述消息发送至所述第二浏览器;
所述第二浏览器, 用于通过与所述网关建立的 TCP连接接收所述浏览器 与浏览器直通的装置转发的所述第一用户发送的消息。
从上述本发明实施例可知,由于网关可以根据第二用户标识查询消息转发 表而获得的第二浏览器的 IP地址和端口,通过与第二浏览器建立的 TCP连接, 将第一用户通过第一浏览器发送至网关的消息转发至所述第二浏览器, 因此, 一方面, 网关只负责浏览器与浏览器之间的消息转发, 不会导致系统性能瓶颈 的情况, 消息发送的实时性强, 能够满足对实时性要求较高的应用场景; 另一 方面,对消息的主要业务逻辑与计算分布在浏览器, 网关不需要承担主要的业 务逻辑与计算, 无需耗费额外资源实现 HTTP与浏览器之间的协议转换, 因此 节省了开销。
附图说明
为了更清楚地说明本发明实施例的技术方案,下面将对现有技术或实施例 描述中所需要使用的附图作筒单地介绍,显而易见地, 下面描述中的附图仅仅 是本发明的一些实施例,对于本领域技术人员来讲,还可以如这些附图获得其 他的附图。
图 1是本发明实施例提供的浏览器与浏览器直通的方法流程示意图; 图 2是本发明实施例提供的浏览器与浏览器直通的方法中第一浏览器、第 二浏览器和 WebSocket网关之间的交互示意图;
图 3是本发明实施例提供的浏览器与浏览器直通的装置结构示意图; 图 4是本发明另一实施例提供的浏览器与浏览器直通的装置结构示意图; 图 5是本发明另一实施例提供的浏览器与浏览器直通的装置结构示意图; 图 6是本发明实施例提供的通信系统结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是 全部的实施例。基于本发明中的实施例, 本领域技术人员所获得的所有其他实 施例, 都属于本发明保护的范围。
请参阅附图 1 , 是本发明实施例提供的浏览器与浏览器直通的方法流程示 意图。附图 1示例的方法是以浏览器是网页(Web )浏览器、 网关是 WebSocket 网关、 WebSocket网关与浏览器进行通信的通信协议是 HTML5标准 WebSocket 协议为例进行, 其执行主体可以是 WebSocket网关, 主要包括步骤:
S101 , 通过与第一浏览器建立的传输控制协议 TCP连接接收第一用户通 过所述第一浏览器发送的消息, 所述消息包括第二用户的标识。
在本发明实施例中, 用户在访问网关时, 浏览器向网关发送一个应用程序 下载请求, 从 Websocket网关下载 Web应用程序到浏览器。 此后, 浏览器运 行所述 Web 应用程序, 以请求与 Websocket 网关建立传输控制协议 ( Transmission Control Protocol, TCP )连接。 具体方式可以是, 在通信开始 时,第一用户可以通过第一浏览器向 Websocket网关发送一个基于 HTTP格式 的握手请求消息。当 WebSocket网关向第一浏览器反馈一个握手成功的响应消 息时, 表示第一浏览器与 WebSocket网关之间已经建立起 TCP连接, 后续第 一浏览器与 WebSocket 网关之间通过该 TCP连接进行传输的消息都是基于 WebSocket协议的 WebSocket协议消息。
需要说明的是, 在本发明实施例中, 第一用户通过与第一浏览器建立的
TCP连接发送的消息(WebSocket协议消息)所包括的第二用户的标识可以是 第二用户所属用户通信组的 ID, 第二用户的标识也可以包括第二用户所属用 户通信组的 ID和所述第二用户的用户 ID, 即, 使用第二用户所属用户通信组 的 ID和所述第二用户的用户 ID共同标识第二用户,或者,第二用户的标识还 可以是第二用户的用户 ID。 第一用户的标识的定义与第二用户的标识的定义 类似。
还需要进一步说明的是, 在本发明实施例中, "第一用户"和 "第二用户" 仅仅用于区分不同的用户, 而不是特指 "第一个用户" 和 "第二个用户"。 换 言之, 这些不同的用户可能是同一用户通信组下任意不同的两个用户,也可能 是同一用户通信组下一个用户和该用户通信组下除了该用户之外的所有用户。
S102,根据所述第二用户标识查询消息转发表,获得与所述第二用户的标 识匹配的第二浏览器的 IP地址和端口。
在本发明实施例中,消息转发表是网关转发消息时为了找到所述消息的目 的地址而需要查询的表, 其记录有用户的标识、 浏览器的 IP地址和端口以及 用户的标识与浏览器的 IP地址和端口的对应关系, 例如, 消息转发表可以记 录用户通信组的 ID以及该用户通信组与浏览器的 IP地址和端口的对应关系, 记录某用户所属用户通信组下用户的 ID、 浏览器的 IP地址和端口以及某用户 所属用户通信组下用户与浏览器的 IP地址和端口的对应关系列表, 或者, 记 录某用户的 ID、浏览器的 IP地址和端口以及某用户与浏览器的 IP地址和端口 的对应关系。消息转发表可根据用户通过浏览器发送的握手请求消息或者对用 户通信组进行的操作而随时更新。
作为本发明一个实施例, Websocket网关中的消息转发表的更新可以是第 一用户通过第一浏览器发送的握手请求消息或者对用户通信组进行的操作而 完成。 例如, 第一用户通过向 Websocket网关发送握手请求消息与 Websocket 网关进行初次握手时, Websocket网关从所述握手请求消息中析取第一用户的 标识、 第一浏览器的 IP地址和端口, 将所述第一用户的标识、 第一浏览器的 IP地址和端口以及第一用户的标识与第一浏览器的 IP地址和端口的对应关系 记录在消息转发表中;又如,第一用户通过第一浏览器登录到 Websocket网关, 创建一个用户通信组并加入该用户通信组时, Websocket网关根据该第一用户 通过第一浏览器创建的用户通信组,将创建的用户通信组信息以及第一用户的 标识与第一浏览器的 IP地址和端口的对应关系记录在消息转发表中, 其中, 用户通信组信息包括创建的用户通信组的 ID和所述创建的用户通信组下用户 的用户 ID; 再如, 第一用户申请加入用户 B (以下以 "第二用户" 指代)创 建的用户通信组时, Websocket网关根据该第一用户通过第一浏览器申请加入 第二用户创建的用户通信组, 将第一用户的标识、 第一浏览器的 IP地址和端 口以及第一用户的标识与第一浏览器的 IP地址和端口的对应关系记录在消息 转发表中。
作为本发明另一个实施例, Websocket网关中的消息转发表的更新可以是 第二用户通过第二浏览器发送握手请求消息或者操作消息而进行。 例如, Websocket网关在通过与第一浏览器建立的传输控制协议 TCP连接接收第一用 户通过所述第一浏览器发送的消息之前, 通过与第二浏览器建立的 TCP连接 接收所述第二用户通过所述第二浏览器发送的握手消息,所述握手消息中包含 所述第二用户的标识、 所述第二浏览器的 IP地址和端口; 从所述握手请求消 息中析取所述第二用户的标识、 所述第二浏览器的 IP地址和端口; 将所述第 二用户的标识、 第二浏览器的 IP地址和端口以及第二用户的标识与所述第二 浏览器的 IP地址和端口的对应关系记录在所述消息转发表中。 Websocket网关 通过上述方式完成对消息转发表的更新。 再如, Websocket网关在通过与第一 浏览器建立的传输控制协议 TCP连接接收第一用户通过所述第一浏览器发送 的消息之前, 也可以通过下述方式完成对消息转发表的更新, 即, 接收第二用 户通过第二浏览器发送的对用户通信组进行操作的操作消息;根据所述操作消 息更新所述消息转发表,该操作消息包括用户通信组创建消息或用户通信组加 入请求消息。若所述操作消息为用户通信组创建消息, 则根据所述操作消息更 新所述消息转发表具体包括:将所述操作消息中的用户通信组信息和所述第二 用户的信息记录在消息转发表中; 若所述操作消息为用户通信组加入请求消 息, 则根据所述操作消息更新所述消息转发表具体包括: 将所述操作消息中的 第二用户的信息记录在消息转发表中,且所述第二用户所属的用户通信组为其 请求加入的用户通信组, 其中, 第二用户的信息包括第二用户的标识和第二浏 览器的 IP地址、 端口的对应关系。
由于消息转发表记录有用户的标识、 浏览器的 IP地址和端口以及用户的 标识与浏览器的 IP地址和端口的对应关系, 因此, Websocket网关可以根据第 二用户标识查询消息转发表,获得与所述第二用户的标识匹配的第二浏览器的 IP地址和端口, 其可以根据所述第二用户的标识是所述第二用户所属用户通 信组的 ID,或包括所述第二用户所属用户通信组的 ID和所述第二用户的用户 ID, 或是所述第二用户的用户 ID分为三种方式实施。
实施方式一: 若所述第二用户的标识为所述第二用户所属用户通信组的 ID, 则 Websocket网关首先可以才艮据所述第二用户所属用户通信组的 ID查询 所述消息转发表。由于消息转发表记录有所述第二用户所属用户通信组与所述 第二浏览器的 IP地址和端口的对应关系, 因此, Websocket网关在可以根据所 述对应关系, 获得与所述第二用户所属用户通信组的 ID匹配的第二浏览器的 IP地址和端口。 在这种实施方式中, Websocket网关是根据所述第二用户所属 用户通信组的 ID,获得与所述第二用户所属用户通信组的 ID匹配的第二浏览 器的 IP地址和端口, 因此, 这种实施方式适合消息的组播, 即, Websocket 网关不需要知道具体用户的用户 ID, 即可将消息组播至第二用户所属用户通 信组下所有用户对应的浏览器。
实施方式二:若所述第二用户的标识包括所述第二用户所属用户通信组的 ID和所述第二用户的用户 ID, 即, 所述第二用户使用所述第二用户所属用户 通信组的 ID和所述第二用户的用户 ID两个元素共同标识,则 Websocket网关 首先根据所述第二用户所属用户通信组的 ID和所述第二用户的用户 ID查询所 述消息转发表。由于所述消息转发表记录有所述第二用户所属用户通信组下用 户与所述第二浏览器的 IP地址和端口的对应关系列表, 该对应关系列表中, 所述第二用户所属用户通信组下每一个用户与每一个浏览器的 IP地址和端口 对应, 因此, Websocket网关可以根据所述对应关系列表, 获得与所述第二用 户所属用户通信组的 ID和所述第二用户的用户 ID匹配的第二浏览器的 IP地 址和端口。 在这种实施方式中, Websocket网关是根据所述第二用户所属用户 通信组的 ID和所述第二用户的用户 ID,获得与所述第二用户所属用户通信组 的 ID和所述第二用户的用户 ID匹配的第二浏览器的 IP地址和端口, 因此, 这种实施方式适合用户通信组下成员之间的通信, 并且, 由于是用第二用户所 属用户通信组的 ID和所述第二用户的用户 ID两个元素共同标识一个用户,因 此, 消息不会发送至第二用户所属用户通信组之外的通信组,使得这种组内通 信具有良好的保密信息。
实施方式三: 若所述第二用户的标识为所述第二用户的用户 ID , 则 Websocket网关首先可以根据所述第二用户的用户 ID查询所述消息转发表。 由于消息转发表记录有所述第二用户与所述第二浏览器的 IP地址和端口的对 应关系, 因此, Websocket网关可以根据所述对应关系, 获得与所述第二用户 的用户 ID匹配的第二浏览器的 IP地址和端口。在这种实施方式中, Websocket 网关是根据所述第二用户的用户 ID,获得与所述第二用户的用户 ID匹配的第 二浏览器的 IP地址和端口, 因此, 这种实施方式不仅可以实现相同用户通信 组下不同用户之间的通信, 也适合不同用户通信组之间的用户的通信。
S103 , 根据所述获得的第二浏览器的 IP地址和端口, 通过与所述第二浏 览器建立的 TCP连接, 将所述消息发送至所述第二浏览器。
与第一浏览器与 WebSocket网关之间建立 TCP连接类似, 在本发明实施 例中,第二用户在访问网关时,第二浏览器向网关发送一个应用程序下载请求, 从 Websocket网关下载 Web应用程序到第二浏览器。 此后, 第二浏览器运行 所述 Web应用程序,以请求与 Websocket网关建立传输控制协议( Transmission Control Protocol, TCP )连接。 具体方式可以是, 在通信开始时, 第二用户可 以通过第二浏览器向 Websocket 网关发送一个基于 HTTP格式的握手请求消 息。 当 WebSocket网关向第二浏览器反馈一个握手成功的响应消息时,表示第 二浏览器与 WebSocket 网关之间已经建立起 TCP连接, 后续第二浏览器与 WebSocket网关之间通过该 TCP连接进行传输的消息都是基于 WebSocket协 议的 WebSocket协议消息。
由于第二浏览器与 Websocket网关已经建立 TCP连接, 因此, Websocket 网关可以根据在步骤 S102中获得的第二浏览器的 IP地址和端口,通过与所述 第二浏览器建立的 TCP连接, 将所述消息发送至所述第二浏览器。
从上述本发明实施例提供的浏览器与浏览器直通的方法可知,由于网关可 以根据第二用户标识查询消息转发表而获得的第二浏览器的 IP地址和端口, 通过与第二浏览器建立的 TCP连接, 将第一用户通过第一浏览器发送至网关 的消息转发至所述第二浏览器, 因此, 一方面, 网关只负责浏览器与浏览器之 间的消息转发, 不会导致系统性能瓶颈的情况, 消息发送的实时性强, 能够满 足对实时性要求较高的应用场景; 另一方面,对消息的主要业务逻辑与计算分 布在浏览器, 网关不需要承担主要的业务逻辑与计算,无需耗费额外资源实现
HTTP与浏览器之间的协议转换, 因此节省了开销。
以下以第一浏览器、第二浏览器和 WebSocket网关之间的交互为例,进一 步说明本发明实施例提供的浏览器与浏览器直通的方法。 需要说明的是, 附图 2示例的是同一用户通信组内用户之间的通信, 即, 第一浏览器对应的第一用 户所属用户通信组与第二浏览器对应的第二用户所属用户通信组是同一用户 通信组。 请参阅附图 2, 第一浏览器、 第二浏览器和 WebSocket网关之间的交 互主要包括:
5201 , 第一浏览器向 WebSocket网关发送 Web页面加载请求。
5202, WebSocket网关向第一浏览器返回 Web页面加载请求的响应。
5203,第一浏览器将创建的用户通信组信息发送至 WebSocket网关。用户 通信组信息包括创建的用户通信组的 ID (以下筒称 "第一用户所属用户通信 组的 ID" )和所述第一用户所属用户通信组下用户的用户 ID。
5204, WebSocket网关更新消息转发表。 包括: 将第一用户所属用户通信 组的 ID、第一用户的用户 ID、第一浏览器的 IP地址和端口以及第一用户与第 一浏览器的 IP地址和端口的对应关系记录在消息转发表中。
与第一浏览器类似,当第二用户通过第二浏览器申请加入第一用户创建的 用户通信组, 即第一用户所属用户通信组时, 其过程依次包括: S,201 , 第二 浏览器向 WebSocket网关发送 Web页面加载请求; S,202, WebSocket网关向 第二浏览器返回 Web页面加载请求的响应; S,203, 第二浏览器向 WebSocket 网关发送第二用户加入通信用户组的请求; S,204, WebSocket 网关更新消息 转发表, 包括: 将第二用户所属用户通信组的 ID (由于本实施例是同一用户 通信组内用户之间的通信, 因此, 第二用户所属用户通信组的 ID也是第一用 户所属用户通信组的 ID )、 第二用户的用户 ID、 第二浏览器的 IP地址和端口 以及第二用户的用户 ID与第二浏览器的 IP地址和端口的对应关系记录在消息 转发表中。
5205, 第一浏览器向 WebSocket网关发送 Web应用程序下载请求。
Web应用程序下载请求是在第一用户访问网关时,第一浏览器在接收这一 访问请求后向 WebSocket网关发送。
5206, WebSocket网关将 Web应用程序下载到第一浏览器。
5207, 第一浏览器运行 Web应用程序。
5208, 第一浏览器通过 Web应用程序向 WebSocket网关发送握手请求消 在通信开始时, 第一浏览器可以向 WebSocket 网关发送一个基于 HTTP 格式的握手请求消息, 以请求与 WebSocket网关建立 TCP连接。 该握手请求 消息包含第一用户的用户 ID、第一用户所属用户通信组的 ID以及第一浏览器 的 IP地址和端口, 这些信息可以通过在握手请求消息中新增信元而成。
5209, WebSocket网关更新消息转发表。
WebSocket网关通过解析握手请求消息, 析取其中包含的第一用户的用户
ID、 第一用户所属用户通信组的 ID以及第一浏览器的 IP地址和端口, 然后, 将这些信息以及第一用户的用户 ID与第一浏览器的 IP地址和端口的对应关系 记录在消息转发表中, 完成对消息转发表的更新。
5210, WebSocket网关向第一浏览器返回握手请求消息的响应消息。
与第一浏览器类似, 当第二用户通过第二浏览器运行 Web 应用程序与 WebSocket 网关交互时, 其过程依次包括: S,205, 第二浏览器向 WebSocket 网关发送 Web应用程序下载请求; S,206, WebSocket网关将 Web应用程序下 载到第二浏览器; S,207, 第二浏览器运行 Web应用程序; S,208, 第一浏览器 通过 Web应用程序向 WebSocket网关发送握手请求消息, 其中包含第二用户 的用户 ID、 第二用户所属用户通信组的 ID以及第二浏览器的 IP地址和端口, 这些信息可以通过在握手请求消息中新增信元而成; S,209, WebSocket 网关 更新消息转发表, 即, WebSocket网关通过解析握手请求消息, 析取其中包含 的第二用户的用户 ID、 第二用户所属用户通信组的 ID 以及第二浏览器的 IP 地址和端口, 然后, 将这些信息第二用户的用户 ID与第二浏览器的 IP地址和 端口的对应关系记录在消息转发表中, 完成对消息转发表的更新; S,210, WebSocket网关向第二浏览器返回握手请求消息的响应消息。
5211 , 第一浏览器向 WebSocket网关发送消息。
该消息的接收对象为第二用户。
5212, WebSocket网关解析接收对象为第二用户的消息。
该过程包括: WebSocket网关从接收对象为第二用户的消息中析取第二用 户的用户 ID后, 根据第二用户的用户 ID, 查询消息转发表。 通过所述消息转 发表中第二用户的用户 ID与第二浏览器的 IP地址、 端口的对应关系, 获取第 二浏览器与 WebSocket网关之间的 TCP连接, 即, 先由第二用户的用户 ID与 第二浏览器的 IP地址、 端口的对应关系, 查找到第二浏览器的 IP地址和端口 或者用户通信组中成员的浏览器 IP地址和端口的列表, 由第二浏览器的 IP地 址、 端口对找到第二浏览器与 WebSocket网关之间的 TCP连接。
S213, WebSocket网关向第二浏览器发送接收对象为第二用户的消息。 在获取第二浏览器与 WebSocket网关之间的 TCP连接后, WebSocket网 关将接收对象为第二用户的消息户通过第二浏览器与 WebSocket 网关之间的 TCP连接发送至第二浏览器。
5214, 第二浏览器向 WebSocket网关返回响应消息。
该响应消息是第二浏览器对 WebSocket 网关发送的接收对象为第二用户 的消息的确认。
5215, WebSocket网关将响应消息转发至第一浏览器。
后续若第二用户需要通过第二浏览器发送消息至第一用户,其过程与上述 过程中的 S211至 S215类似, 只是消息的接收对象是第一用户, 因此, 此处不 做赘述。
请参阅附图 3, 是本发明实施例提供的浏览器与浏览器直通的装置结构示 意图。 为了便于说明, 仅仅示出了与本发明实施例相关的部分。 附图 3示例的 浏览器与浏览器直通的装置可以是网关, 例如 WebSocket网关,其包括接收模 块 301、 获取模块 302和发送模块 303, 其中:
接收模块 301 ,用于通过与第一浏览器建立的传输控制协议 TCP连接接收 第一用户通过所述第一浏览器发送的消息, 所述消息包括第二用户的标识。 在本实施例中, 用户在访问附图 3示例的装置(附图 3示例的装置可以应 用在 Websocket网关中, 以下以 WebSocket网关指代)时, 浏览器向附图 3示 例的 WebSocket网关发送一个应用程序下载请求,从附图 3示例的 WebSocket 网关下载 Web应用程序到浏览器。 此后, 浏览器运行所述 Web应用程序, 以 请求与附图 3示例的 WebSocket网关建立 TCP连接。 具体方式可以是, 在通 信开始时,第一用户可以通过第一浏览器向附图 3示例的 WebSocket网关发送 一个基于 HTTP格式的握手请求消息。当附图 3示例的 WebSocket网关向第一 浏览器反馈一个握手成功的响应消息时, 表示第一浏览器与附图 3 示例的 WebSocket网关之间已经建立起 TCP连接, 后续第一浏览器与附图 3示例的 WebSocket网关之间通过该 TCP连接进行传输的消息都是基于 WebSocket协 议的 WebSocket协议消息。
需要说明的是,在附图 3示例的装置中, 第一用户通过与第一浏览器建立 的 TCP连接发送的消息( WebSocket协议消息)所包括的第二用户的标识可以 是第二用户所属用户通信组的 ID, 第二用户的标识也可以包括第二用户所属 用户通信组的 ID和所述第二用户的用户 ID, 即, 使用第二用户所属用户通信 组的 ID和所述第二用户的用户 ID共同标识第二用户,或者,第二用户的标识 还可以是第二用户的用户 ID。 第一用户的标识的定义与第二用户的标识的定 义类似。
还需要进一步说明的是, 在本发明实施例中, "第一用户"和 "第二用户" 仅仅用于区分不同的用户, 而不是特指 "第一个用户" 和 "第二个用户"。 换 言之, 这些不同的用户可能是同一用户通信组下任意不同的两个用户,也可能 是同一用户通信组下一个用户和该用户通信组下除了该用户之外的所有用户。 获取模块 302, 用于根据所述第二用户的标识查询消息转发表, 获得与所 述第二用户的标识匹配的第二浏览器的 IP地址和端口。 发送模块 303, 用于 根据所述获得的浏览器的 IP地址和端口, 通过与所述第二浏览器建立的 TCP 连接, 将所述消息发送至所述第二浏览器。
需要说明的是, 以上浏览器与浏览器直通的装置的实施方式中,各功能模 块的划分仅是举例说明, 实际应用中可以根据需要, 例如相应硬件的配置要求 或者软件的实现的便利考虑, 而将上述功能分配由不同的功能模块完成, 即将 所述网关的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分 功能。 而且, 实际应用中, 本实施例中的相应的功能模块可以是由相应的硬件 实现, 也可以由相应的硬件执行相应的软件完成, 例如, 前述的接收模块, 可 以是具有执行前述通过与第一浏览器建立的传输控制协议 TCP连接接收第一 用户通过所述第一浏览器发送的消息的硬件, 例如接收器,也可以是能够执行 相应计算机程序从而完成前述功能的一般处理器或者其他硬件设备;再如前述 的获取模块, 可以是具有执行前述根据所述第二用户的标识查询消息转发表, 获得与所述第二用户的标识匹配的第二浏览器的 IP地址和端口功能的硬件, 例如获取器,也可以是能够执行相应计算机程序从而完成前述功能的一般处理 器或者其他硬件设备(本说明书提供的各个实施例都可应用上述描述原则)。
在附图 3示例的装置中,若第二用户的标识为所述第二用户所属用户通信 组的 ID, 则附图 3示例的获取模块 302具体用于根据所述第二用户所属用户 通信组的 ID查询所述消息转发表, 所述消息转发表记录有所述第二用户所属 用户通信组与所述第二浏览器的 IP地址和端口的对应关系; 才艮据所述消息转 发表记录的第二用户所属用户通信组与第二浏览器的 IP地址和端口的对应关 系,获得与所述第二用户所属用户通信组的 ID匹配的第二浏览器的 IP地址和 端口。 此种情况能实现消息组播, 即, Websocket网关不需要知道具体用户的 用户 ID, 即可将消息组播至第二用户所属用户通信组下所有用户对应的浏览 器。
在附图 3示例的装置中,若所述第二用户的标识包括所述第二用户所属用 户通信组的 ID和所述第二用户的用户 ID, 即, 所述第二用户使用所述第二用 户所属用户通信组的 ID和所述第二用户的用户 ID两个元素共同标识,则附图 3示例的获取模块 302具体用于根据所述第二用户所属用户通信组的 ID和所 述第二用户的用户 ID查询所述消息转发表, 所述消息转发表记录有所述第二 用户所属用户通信组下用户与所述第二浏览器的 IP地址和端口的对应关系列 表;根据所述消息转发表记录的第二用户所属用户通信组下用户与所述第二浏 览器的 IP地址和端口的对应关系列表, 获得与所述第二用户所属用户通信组 的 ID和所述第二用户的用户 ID匹配的第二浏览器的 IP地址和端口。 本示例 的浏览器与浏览器直通的装置适合用户通信组下成员之间的通信, 并且, 由于 是用第二用户所属用户通信组的 ID和所述第二用户的用户 ID两个元素共同标 识一个用户, 因此, 消息不会发送至第二用户所属用户通信组之外的通信组, 使得这种组内通信具有良好的保密信息。
在附图 3示例的装置中, 若所述第二用户的标识为第二用户的用户 ID, 则附图 3示例的获取模块 302具体用于根据所述第二用户的用户 ID查询所述 消息转发表, 所述消息转发表记录有所述第二用户与所述第二浏览器的 IP地 址和端口的对应关系;据所述消息转发表记录的第二用户与所述第二浏览器的
IP地址和端口的对应关系, 获得与所述第二用户的用户 ID匹配的第二浏览器 的 IP地址和端口。 本示例的浏览器与浏览器直通的装置不仅可以实现相同用 户通信组下不同用户之间的通信, 也适合不同用户通信组之间的用户的通信。
附图 3 示例的浏览器与浏览器直通的装置可以进一步包括握手消息接收 模块 701、 析耳 ^莫块 702和第一更新模块 703, 如附图 4所示本发明另一实施 例提供的浏览器与浏览器直通的装置, 其中:
握手消息接收模块 701 ,用于通过与第二浏览器建立的 TCP连接接收所述 第二用户通过所述第二浏览器发送的握手消息,所述握手消息中包含所述第二 用户的标识、 所述第二浏览器的 IP地址和端口;
析取模块 702, 用于从所述握手请求消息中析取所述第二用户的标识、 所 述第二浏览器的 IP地址和端口;
第一更新模块 703 , 用于将所述第二用户的标识与所述第二浏览器的 IP 地址和端口的对应关系记录在所述消息转发表中。
在附图 3示例的浏览器与浏览器直通的装置中, 消息转发表是 Websocket 网关转发消息时为了找到所述消息的目的地址而需要查询的表,其记录有用户 的标识、 浏览器的 IP地址和端口以及用户的标识与浏览器的 IP地址和端口的 对应关系, 例如, 消息转发表可以记录用户通信组的 ID以及该用户通信组与 浏览器的 IP地址和端口的对应关系,记录某用户所属用户通信组下用户的 ID、 浏览器的 IP地址和端口以及某用户所属用户通信组下用户与浏览器的 IP地址 和端口的对应关系列表, 或者, 记录某用户的 ID、 浏览器的 IP地址和端口以 及某用户与浏览器的 IP地址和端口的对应关系。 消息转发表可根据用户通过 浏览器发送的握手请求消息或者对用户通信组进行的操作而随时更新。 作为本发明一个实施例, Websocket网关中的消息转发表的更新可以是第 一用户通过第一浏览器发送的握手请求消息或者对用户通信组进行的操作而 完成。 例如, 第一用户通过向 Websocket网关发送握手请求消息与 Websocket 网关进行初次握手时, 握手消息接收模块 701通过与第二浏览器建立的 TCP 连接接收所述握手消息,析取模块 702从所述握手请求消息中析取第一用户的 标识、 第一浏览器的 IP地址和端口, 第一更新模块 703将所述第一用户的标 识、 第一浏览器的 IP地址和端口以及第一用户的标识与第一浏览器的 IP地址 和端口的对应关系记录在消息转发表中。 作为本发明另一个实施例, Websocket网关中的消息转发表的更新可以是 第一用户通过第一浏览器对用户通信组进行的操作而完成。即附图 3示例的浏 览器与浏览器直通的装置可以进一步包括操作消息接收模块 801 第二更新模 块 802, 如附图 5所示本发明另一实施例提供的浏览器与浏览器直通的装置, 其中:
操作消息接收模块 801 , 用于接收所述第二用户通过所述第二浏览器发送 的对用户通信组进行操作的操作消息, 所述操作消息为: 用户通信组创建消息 或用户通信组加入请求消息;
第二更新模块 802, 用于根据所述操作消息更新所述消息转发表。
在附图 5示例的浏览器与浏览器直通的装置中,第一用户通过第一浏览器 登录到 Websocket 网关, 创建一个用户通信组并加入该用户通信组时, Websocket网关根据该第一用户通过第一浏览器创建的用户通信组, 将创建的 用户通信组信息以及第一用户的标识与第一浏览器的 IP地址和端口的对应关 系记录在消息转发表中, 其中, 用户通信组信息包括创建的用户通信组的 ID 和所述创建的用户通信组下用户的用户 ID; 再如, 第一用户申请加入用户 B (以下以 "第二用户" 指代)创建的用户通信组时, Websocket网关根据该第 一用户通过第一浏览器申请加入第二用户创建的用户通信组,将第一用户的标 识、 第一浏览器的 IP地址和端口以及第一用户的标识与第一浏览器的 IP地址 和端口的对应关系记录在消息转发表中。
操作消息接收模块 801 接收第二用户通过第二浏览器发送的对用户通信 组进行操作的操作消息;第二更新模块 802根据所述操作消息更新所述消息转 发表, 该操作消息包括用户通信组创建消息或用户通信组加入请求消息。
若所述操作消息为用户通信组创建消息,则第二更新模块 802具体用于将 所述操作消息中的用户通信组信息和所述第二用户的信息记录在消息转发表 中; 若所述操作消息为用户通信组加入请求消息, 则第二更新模块 802具体用 于将所述操作消息中的第二用户的信息记录在消息转发表中,且所述第二用户 所属的用户通信组为其请求加入的用户通信组, 其中, 第二用户的信息包括第 二用户的标识和第二浏览器的 IP地址、 端口的对应关系。
应当理解的是, 在上述实施例中, 实现模块 701、 702功能的模块和实现 模块 801、 802功能的模块可以同时存在于本发明实施例所述的浏览器与浏览 器直通的装置中, 且功能模块的划分方式不限于上述描述。
请参阅附图 6, 本发明实施例提供的一种通信系统。 为了便于说明, 仅仅 示出了与本发明实施例相关的部分。 附图 6 示例的通信系统包括第一浏览器 901、 第二浏览器 903和网关 902, 其中:
第一浏览器 901 ,用于通过与网关 902建立的传输控制协议 TCP连接向所 述网关发送消息; 网关 902,用于通过与第一浏览器 901建立的 TCP连接接收第一用户通过 所述第一浏览器 901发送的包括第二用户的标识的消息,根据所述第二用户的 标识查询消息转发表,获得与所述第二用户的标识匹配的第二浏览器 903的 IP 地址和端口, 根据所述获得的第二浏览器 903的 IP地址和端口, 通过与所述 第二浏览器 903建立的 TCP连接, 将所述消息发送至所述第二浏览器 903。
应当理解的是,网关 902中可以应用本发明实施例附图 3至附图 5任一示 例的浏览器与浏览器直通的装置, 各模块 /单元之间的信息交互、 执行过程等 内容, 由于与本发明方法实施例基于同一构思, 其带来的技术效果与本发明方 法实施例相同, 具体内容可参见本发明方法实施例中的叙述, 此处不再赘述。 当然, 网关中实现本发明实施例功能的模块划分也不限于以上示例。
第二浏览器 903,用于通过与网关 902建立的 TCP连接接收所述浏览器与 浏览器直通的装置转发的所述第一用户发送的消息。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步 骤是可以通过程序来指令相关的硬件来完成,比如以下各种方法的一种或多种 或全部:
通过与第一浏览器建立的传输控制协议 TCP连接接收第一用户通过所述 第一浏览器发送的消息, 所述消息包括第二用户的标识;
根据所述第二用户标识查询消息转发表,获得与所述第二用户的标识匹配 的第二浏览器的 IP地址和端口;
根据所述获得的第二浏览器的 IP地址和端口, 通过与所述第二浏览器建 立的 TCP连接, 将所述消息发送至所述第二浏览器。 本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步 骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读 存储介质中, 存储介质可以包括: 只读存储器(ROM, Read Only Memory ), 随机存取存储器(RAM, Random Access Memory ), 磁盘或光盘等。
以上对本发明实施例提供的浏览器与浏览器直通的方法、装置和通信系统 述, 以上实施例的说明只是用于帮助理解本发明的方法及其核心思想; 同时, 对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围 上均会有改变之处, 综上所述, 本说明书内容不应理解为对本发明的限制。

Claims

权 利 要 求
1、 一种浏览器与浏览器直通的方法, 其特征在于, 所述方法包括: 通过与第一浏览器建立的传输控制协议 TCP连接接收第一用户通过所述 第一浏览器发送的消息, 所述消息包括第二用户的标识;
根据所述第二用户标识查询消息转发表,获得与所述第二用户的标识匹配 的第二浏览器的 IP地址和端口;
根据所述获得的第二浏览器的 IP地址和端口, 通过与所述第二浏览器建 立的 TCP连接, 将所述消息发送至所述第二浏览器。
2、 根据权利要求 1所述的方法, 其特征在于, 所述第二用户的标识为所 述第二用户所属用户通信组的 ID; 或者, 所述第二用户的标识包括所述第二 用户所属用户通信组的 ID和所述第二用户的用户 ID; 或者, 所述第二用户的 标识为所述第二用户的用户 ID。
3、 根据权利要求 2所述的方法, 其特征在于, 若所述第二用户的标识为 所述第二用户所属用户通信组的 ID, 则所述根据所述第二用户标识查询消息 转发表, 获得与所述第二用户的标识匹配的第二浏览器的 IP地址和端口, 具 体包括:
根据所述第二用户所属用户通信组的 ID查询所述消息转发表, 所述消息 转发表记录有所述第二用户所属用户通信组与所述第二浏览器的 IP地址和端 口的对应关系;
根据所述对应关系, 获得与所述第二用户所属用户通信组的 ID匹配的第 二浏览器的 IP地址和端口。
4、 根据权利要求 2所述的方法, 其特征在于, 若所述第二用户的标识包 括所述第二用户所属用户通信组的 ID和所述第二用户的用户 ID,则所述根据 所述第二用户标识查询消息转发表,获得与所述第二用户的标识匹配的第二浏 览器的 IP地址和端口, 具体包括:
根据所述第二用户所属用户通信组的 ID和所述第二用户的用户 ID查询所 述消息转发表,所述消息转发表记录有所述第二用户所属用户通信组下用户与 所述第二浏览器的 IP地址和端口的对应关系列表;
根据所述对应关系列表, 获得与所述第二用户所属用户通信组的 ID和所 述第二用户的用户 ID匹配的第二浏览器的 IP地址和端口。
5、 根据权利要求 2所述的方法, 其特征在于, 若所述第二用户的标识为 所述第二用户的用户 ID, 则所述根据所述第二用户标识查询消息转发表, 获 得与所述第二用户的标识匹配的第二浏览器的 IP地址和端口, 具体包括: 根据所述第二用户的用户 ID查询所述消息转发表, 所述消息转发表记录 有所述第二用户与所述第二浏览器的 IP地址和端口的对应关系;
根据所述对应关系, 获得与所述第二用户的用户 ID匹配的第二浏览器的
IP地址和端口。
6、 根据权利要求 1所述的方法, 其特征在于, 在所述通过与第一浏览器 建立的传输控制协议 TCP连接接收第一用户通过所述第一浏览器发送的消息 之前, 所述方法还包括:
通过与第二浏览器建立的 TCP连接接收所述第二用户通过所述第二浏览 器发送的握手消息, 所述握手消息中包含所述第二用户的标识、所述第二浏览 器的 IP地址和端口; 从所述握手请求消息中析取所述第二用户的标识、 所述第二浏览器的 IP 地址和端口;
将所述第二用户的标识与所述第二浏览器的 IP地址和端口的对应关系记 录在所述消息转发表中。
7、 根据权利要求 1或 6所述的方法, 其特征在于, 在所述通过与第一浏 览器建立的传输控制协议 TCP连接接收第一用户通过所述第一浏览器发送的 消息之前, 所述方法还包括:
接收所述第二用户通过所述第二浏览器发送的对用户通信组进行操作的 操作消息,所述操作消息为:用户通信组创建消息或用户通信组加入请求消息; 根据所述操作消息更新所述消息转发表。
8、 根据权利要求 7所述的方法, 其特征在于, 所述根据所述操作消息更 新所述消息转发表, 具体包括:
若所述操作消息为用户通信组创建消息,则将所述操作消息中的用户通信 组信息和所述第二用户的信息记录在消息转发表中;
若所述操作消息为用户通信组加入请求消息,则将所述操作消息中的第二 用户的信息记录在消息转发表中,且所述第二用户所属的用户通信组为其请求 加入的用户通信组;
所述第二用户的信息包括第二用户的标识和第二浏览器的 IP地址、 端口 的对应关系。
9、 一种浏览器与浏览器直通的装置, 其特征在于, 所述装置包括: 接收模块, 用于通过与第一浏览器建立的传输控制协议 TCP连接接收第 一用户通过所述第一浏览器发送的消息, 所述消息包括第二用户的标识; 获取模块, 用于根据所述第二用户的标识查询消息转发表, 获得与所述第 二用户的标识匹配的第二浏览器的 IP地址和端口;
发送模块, 用于根据所述获得的浏览器的 IP地址和端口, 通过与所述第 二浏览器建立的 TCP连接, 将所述消息发送至所述第二浏览器。
10、 根据权利要求 9所述的装置, 其特征在于, 其特征在于, 所述第二用 户的标识为所述第二用户所属用户通信组的 ID; 或者, 所述第二用户的标识 包括所述第二用户所属用户通信组的 ID和所述第二用户的用户 ID; 或者, 所 述第二用户的标识为所述第二用户的用户 ID。
11、 根据权利要求 10所述的装置, 其特征在于, 若所述第二用户的标识 为所述第二用户所属用户通信组的 ID, 则所述获取模块具体用于: 根据所述 第二用户所属用户通信组的 ID查询所述消息转发表, 所述消息转发表记录有 所述第二用户所属用户通信组与所述第二浏览器的 IP地址和端口的对应关 系; 根据所述对应关系, 获得与所述第二用户所属用户通信组的 ID匹配的第 二浏览器的 IP地址和端口。
12、 根据权利要求 10所述的装置, 其特征在于, 若所述第二用户的标识 包括所述第二用户所属用户通信组的 ID和所述第二用户的用户 ID,则所述获 取模块具体用于: 根据所述第二用户所属用户通信组的 ID和所述第二用户的 用户 ID查询所述消息转发表, 所述消息转发表记录有所述第二用户所属用户 通信组下用户与所述第二浏览器的 IP地址和端口的对应关系列表; 才艮据所述 对应关系列表, 获得与所述第二用户所属用户通信组的 ID和所述第二用户的 用户 ID匹配的第二浏览器的 IP地址和端口。
13、 根据权利要求 10所述的装置, 其特征在于, 若所述第二用户的标识 为所述第二用户的用户 ID, 则所述获取模块具体用于: 根据所述第二用户的 用户 ID查询所述消息转发表, 所述消息转发表记录有所述第二用户与所述第 二浏览器的 IP地址和端口的对应关系; 根据所述对应关系, 获得与所述第二 用户的用户 ID匹配的第二浏览器的 IP地址和端口。
14、 根据权利要求 9所述的装置, 其特征在于, 所述装置还包括: 握手消息接收模块, 用于通过与第二浏览器建立的 TCP连接接收所述第 二用户通过所述第二浏览器发送的握手消息,所述握手消息中包含所述第二用 户的标识、 所述第二浏览器的 IP地址和端口;
析取模块, 用于从所述握手请求消息中析取所述第二用户的标识、所述第 二浏览器的 IP地址和端口;
第一更新模块, 用于将所述第二用户的标识与所述第二浏览器的 IP地址 和端口的对应关系记录在所述消息转发表中。
15、 根据权利要求 9或 14所述的装置, 其特征在于, 所述装置还包括: 操作消息接收模块,用于接收所述第二用户通过所述第二浏览器发送的对 用户通信组进行操作的操作消息, 所述操作消息为: 用户通信组创建消息或用 户通信组加入请求消息;
第二更新模块, 用于根据所述操作消息更新所述消息转发表。
16、 根据权利要求 15所述的装置, 其特征在于, 所述第二更新模块具体 用于:
若所述操作消息为用户通信组创建消息,则将所述操作消息中的用户通信 组信息和所述第二用户的信息记录在消息转发表中;
若所述操作消息为用户通信组加入请求消息,则将所述操作消息中的第二 用户的信息记录在消息转发表中,且所述第二用户所属的用户通信组为其请求 加入的用户通信组;
所述第二用户的信息包括第二用户的标识和第二浏览器的 IP地址、 端口 的对应关系。
17、 一种通信系统, 其特征在于, 所述通信系统包括网关、 第一浏览器和 第二浏览器;
所述第一浏览器, 用于通过与所述网关建立的传输控制协议 TCP连接向 所述网关发送消息;
所述网关, 用于通过与所述第一浏览器建立的 TCP连接接收第一用户通 过所述第一浏览器发送的消息, 所述消息包括第二用户的标识; 根据所述第二 用户的标识查询消息转发表,获得与所述第二用户的标识匹配的第二浏览器的
IP地址和端口; 根据所述获得的第二浏览器的 IP地址和端口, 通过与所述第 二浏览器建立的 TCP连接, 将所述消息发送至所述第二浏览器;
所述第二浏览器, 用于通过与所述网关建立的 TCP连接接收所述网关转 发的所述第一用户发送的消息。
PCT/CN2012/075524 2012-02-15 2012-05-15 浏览器与浏览器直通的方法、装置和通信系统 WO2013120325A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210033965.1A CN102594886B (zh) 2012-02-15 2012-02-15 浏览器与浏览器直通的方法、装置和通信系统
CN201210033965.1 2012-02-15

Publications (1)

Publication Number Publication Date
WO2013120325A1 true WO2013120325A1 (zh) 2013-08-22

Family

ID=46483081

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/075524 WO2013120325A1 (zh) 2012-02-15 2012-05-15 浏览器与浏览器直通的方法、装置和通信系统

Country Status (2)

Country Link
CN (1) CN102594886B (zh)
WO (1) WO2013120325A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210326195A1 (en) * 2018-05-22 2021-10-21 Express Scripts Strategic Development, Inc. Interconnected framework for distributed data realization
CN115277656A (zh) * 2022-07-26 2022-11-01 广州鑫景信息科技服务有限公司 基于印卡机的电子工票复写系统以及存储介质

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014101159A1 (zh) * 2012-12-31 2014-07-03 华为技术有限公司 设置、处理交互式连接建立ice地址的方法、装置和服务器
CN104219257B (zh) * 2013-05-29 2018-05-11 华为终端(东莞)有限公司 一种网页实时通信方法、系统及服务器和客户端
US20140379800A1 (en) * 2013-06-25 2014-12-25 Actiontec Electronics, Inc. Systems and methods for sharing digital information between mobile devices of friends and family by loading application components onto embedded devices
CN103647703B (zh) * 2013-12-12 2017-02-22 北京奇虎科技有限公司 一种浏览器进行通信的方法和一种浏览器终端
CN103873564B (zh) * 2014-02-28 2018-09-25 浪潮通用软件有限公司 一种在多服务器负载均衡条件下实现SignalR双工通信的方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101102287A (zh) * 2006-07-03 2008-01-09 阿里巴巴公司 一种通过浏览器实现文件传送的方法及系统
WO2008072886A1 (en) * 2006-12-13 2008-06-19 Koan Hyun Cho The method and system of connecting internet using keyword based on dns
WO2010127327A1 (en) * 2009-05-01 2010-11-04 Kaazing Corporation Enterprise client-server system and methods of providing web application support through distributed emulation of websocket communications
CN102185923A (zh) * 2011-05-16 2011-09-14 广州市动景计算机科技有限公司 一种移动通讯设备终端网页浏览方法

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR0171386B1 (ko) * 1996-05-02 1999-03-30 양승택 월드-와이드 웹을 통한 x.500 디렉토리 접속방법
JP3436471B2 (ja) * 1997-05-26 2003-08-11 沖電気工業株式会社 電話通信方法及び電話通信システム
JP3511875B2 (ja) * 1998-01-13 2004-03-29 横河電機株式会社 通信制御システム
KR20060082353A (ko) * 2005-01-12 2006-07-18 와이더댄 주식회사 실행가능 웹 컨텐트 제공 및 처리 시스템 및 방법
CN101534302B (zh) * 2009-04-16 2012-07-11 杭州华三通信技术有限公司 一种提供tcp服务的方法、系统和相关装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101102287A (zh) * 2006-07-03 2008-01-09 阿里巴巴公司 一种通过浏览器实现文件传送的方法及系统
WO2008072886A1 (en) * 2006-12-13 2008-06-19 Koan Hyun Cho The method and system of connecting internet using keyword based on dns
WO2010127327A1 (en) * 2009-05-01 2010-11-04 Kaazing Corporation Enterprise client-server system and methods of providing web application support through distributed emulation of websocket communications
CN102185923A (zh) * 2011-05-16 2011-09-14 广州市动景计算机科技有限公司 一种移动通讯设备终端网页浏览方法

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210326195A1 (en) * 2018-05-22 2021-10-21 Express Scripts Strategic Development, Inc. Interconnected framework for distributed data realization
US11740952B2 (en) * 2018-05-22 2023-08-29 Express Scripts Strategic Development, Inc. Interconnected framework for distributed data realization
CN115277656A (zh) * 2022-07-26 2022-11-01 广州鑫景信息科技服务有限公司 基于印卡机的电子工票复写系统以及存储介质

Also Published As

Publication number Publication date
CN102594886B (zh) 2015-04-29
CN102594886A (zh) 2012-07-18

Similar Documents

Publication Publication Date Title
US11522734B2 (en) Method for controlling a remote service access path and relevant device
WO2013120325A1 (zh) 浏览器与浏览器直通的方法、装置和通信系统
WO2017045276A1 (zh) 终端互联方法、装置和存储介质
WO2013097401A1 (zh) 浏览器客户端与后端服务器直通的方法、网关和通信系统
CN111294399B (zh) 一种数据传输方法和装置
US11856065B2 (en) Data transmission for service integration between a virtual private cloud and an intranet
US8700820B2 (en) Method for accessing USB device attached to home gateway, home gateway and terminal
WO2022262465A1 (zh) 基于opc ua的时间敏感网络集中用户配置方法及系统
WO2013102335A1 (zh) 一种网关握手、通信方法、网关及Web通信系统
US10367893B1 (en) Method and apparatus of performing peer-to-peer communication establishment
KR101898492B1 (ko) 전자 장치 및 전자 장치의 제어 방법
CN114745255B (zh) 硬件芯片、dpu、服务器、通信方法及相关装置
WO2013178099A1 (zh) 一种实现远程桌面的系统、方法、客户端和服务中心
WO2011029248A1 (zh) 一种实现多协议接入的方法及接口平台
CN110505244A (zh) 远程隧道访问技术网关以及服务器
WO2017028399A1 (zh) 通信数据传输方法及系统
WO2023123899A1 (zh) 网络切片接入方法、装置、系统和存储介质
WO2011015020A1 (zh) 文件传输方法、系统及客户端
JP7401564B2 (ja) 通信方法及び関連デバイス
US20120307824A1 (en) Method and network access device for enabling data forwarding between different physical mediums
WO2007019809A1 (fr) Procede et systeme d'etablissement d'un canal direct point par point
WO2013185696A2 (zh) 一种数据处理的方法与设备
WO2015024373A1 (zh) 一种虚拟机通信方法及装置
WO2023186109A1 (zh) 节点访问方法以及数据传输系统
Cui et al. Research and Implementation of WEBRTC Signaling via websocket-based for real-time multimedia communications

Legal Events

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

Ref document number: 12868738

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12868738

Country of ref document: EP

Kind code of ref document: A1