CN109474646B - Communication connection method, device, system and storage medium - Google Patents

Communication connection method, device, system and storage medium Download PDF

Info

Publication number
CN109474646B
CN109474646B CN201710799309.5A CN201710799309A CN109474646B CN 109474646 B CN109474646 B CN 109474646B CN 201710799309 A CN201710799309 A CN 201710799309A CN 109474646 B CN109474646 B CN 109474646B
Authority
CN
China
Prior art keywords
page data
private
area network
equipment
application client
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.)
Active
Application number
CN201710799309.5A
Other languages
Chinese (zh)
Other versions
CN109474646A (en
Inventor
熊欢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201710799309.5A priority Critical patent/CN109474646B/en
Publication of CN109474646A publication Critical patent/CN109474646A/en
Application granted granted Critical
Publication of CN109474646B publication Critical patent/CN109474646B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/14Session management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K17/00Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations
    • G06K17/0022Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations arrangements or provisious for transferring data to distant stations, e.g. from a sensing device
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Abstract

The application discloses a communication connection method, which is applied to a page processing module in first equipment and comprises the following steps: when it is determined that a connection is to be established with a second device in the local area network in response to an operation on a first page presented by a first device, sending a page data request to an application server through the wide area network; receiving page data sent by the application server in response to the page data request through the wide area network; acquiring a private IP and a port number of the second device in the local area network; and establishing communication connection between the first device and the second device in the local area network according to the private IP and the port number of the second device by executing a logic code in the page data. The application also provides a corresponding device, a system and a storage medium.

Description

Communication connection method, device, system and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a communication connection method, apparatus, system, and storage medium.
Background
A Local Area Network (LAN) is a computer communication Network formed by connecting various computers, external devices, databases, etc. within a Local geographical Area (such as a school, a factory, or a gateway), generally within several kilometers of a square circle. It can be connected with remote local area network, data base or processing centre by means of data communication network or special-purpose data circuit to form an information processing system with large range.
Taking a home wifi router scenario as an example, multiple devices, such as a television box, a computer, a mobile phone, and the like, can be connected under the same wifi router, and after the devices are connected with wifi, the router allocates the devices to one unique private IP, which is invisible to the internet, of the devices, and at this time, the devices are called as being in the same local area network.
Disclosure of Invention
Embodiments of the present application provide a communication connection method, apparatus, system, and storage medium, so that a device in a local area network can implement connection with other devices in the same local area network by executing a logic code in web page data, and the technical problems of high connection cost and low efficiency of devices in the local area network are solved.
The embodiment of the application provides a communication connection method, which is applied to a page processing module in first equipment and comprises the following steps:
when it is determined that a connection is to be established with a second device in the local area network in response to an operation on a first page presented by a first device, sending a page data request to an application server through the wide area network;
receiving page data sent by the application server in response to the page data request through the wide area network;
acquiring a private IP and a port number of the second device in the local area network;
and establishing communication connection between the first device and the second device in the local area network according to the private IP and the port number of the second device by executing a logic code in the page data.
Optionally, the page data request includes an egress IP of the first device;
the obtaining the private IP and the port number of the second device in the local area network includes:
and receiving the private IP and the port number of the second device in the local area network, which are sent by the application server in response to the page data request, wherein the private IP and the port number of the second device in the local area network are determined by the application server according to the outlet IP of the first device.
Optionally, the obtaining the private IP and the port number of the second device in the local area network includes:
scanning a graphic identification code of the second device, wherein the graphic identification code carries a private IP and a port number of the second device in the local area network, and when the second device is accessed to the local area network, an application client of the second device acquires the private IP of the second device and generates the graphic identification code according to the private IP and the port number of the second device;
acquiring a private IP and a port number of the second equipment in the local area network by analyzing the graphic identification code;
and when the private IP and the port number of the second device in the local area network are acquired, sending the page data request to the application server.
Optionally, the method further comprises:
displaying a second page according to the page data, wherein the second page is displayed with the identifier of the second device;
wherein the establishing of the communication connection between the first device and the second device in the local area network comprises:
and responding to the operation of the identification of the second equipment, executing the logic code, and establishing communication connection with the second equipment according to the private IP and the port number of the second equipment.
Optionally, the method further comprises:
and sending the media content or the link of the media content in the first device to an application client in the second device through the established communication connection, so that the application client in the second device sends the media content to the device associated with the application client for display, or obtains the media content according to the link of the media content and sends the media content to the device associated with the application client for display.
The embodiment of the present application further provides a communication connection method, including:
receiving a page data request sent by a first device through a wide area network when the first device is connected with a second device in the local area network;
responding to the page data request, sending page data corresponding to the page data request to the first equipment through a wide area network, so that after the first equipment acquires the private IP and the port number of the second equipment in the local area network, executing a logic code in the page data, and establishing communication connection in the local area network with the second equipment according to the private IP and the port number of the second equipment.
Optionally, the method further comprises:
receiving an outlet IP, a private IP and a port number of the second device, wherein the outlet IP, the private IP and the port number are sent by a router, and the outlet IP is determined according to the private IP when the router receives the private IP and the port number sent by an application client in the second device;
storing the outlet IP of the second device in a database in association with the private IP and the port number;
wherein the page data request includes an egress IP of the first device, the method further comprising:
searching a private IP and a port number of second equipment corresponding to the outlet IP in the local area network in the database according to the outlet IP of the first equipment;
and responding to the page data request, and sending the private IP and the port number of the second equipment in the local area network to the first equipment through a wide area network.
The embodiment of the present application further provides a communication connection method, including:
sending the private IP and the port number of first equipment to an application server through a wide area network, so that the application server stores the private IP and the port number of the first equipment in a local area network and the outlet IP of the first equipment in a database in an associated manner, and responding to a page data request sent by second equipment, and sending page data corresponding to the page data request, the private IP and the port number of the first equipment in the local area network to the second equipment;
and receiving a connection request sent by the second equipment, and establishing communication connection in the local area network with the second equipment, wherein the second equipment executes the logic code in the page data, and sends the connection request to the first equipment according to the private IP and the port number of the first equipment in the local area network.
The embodiment of the present application further provides a communication connection method, including:
when a first device accesses a local area network, acquiring a private IP of a second device;
acquiring and displaying a graphic identification code according to the private IP and the port number of the first equipment, so that a second equipment scans the graphic identification code when the second equipment is connected with the first equipment in a local area network, and acquires the private IP and the port number of the first equipment in the local area network by analyzing the graphic identification code;
and receiving a connection request sent by the second equipment, and establishing communication connection in the local area network with the second equipment, wherein the second equipment executes logic codes in page data requested by an application server, and sends the connection request to the first equipment according to the private IP and the port number of the first equipment in the local area network.
The present application also provides a communication connection system, including:
the first device sends a page data request to the application server through the wide area network when the connection with the second device in the local area network is to be established;
the application server responds to the page data request and sends page data corresponding to the page data request to the first equipment through the wide area network;
the first device acquires the private IP and the port number of the second device in the local area network, and executes the logic code in the page data so as to establish communication connection in the local area network with the second device according to the private IP and the port number of the second device in the local area network.
Optionally, the obtaining, by the first device, the private IP and the port number of the second device in the local area network includes:
when the second device accesses the local area network, the application client in the second device acquires the private IP of the second device in the local area network and sends the private IP and the port number of the second device in the local area network to the application server;
the application server stores the private IP and the port number of the second equipment and the outlet IP of the second equipment in a database in a correlation manner;
wherein the page data request includes an egress IP of the first device,
the application server searches a private IP and a port number of the second equipment in the local area network corresponding to the corresponding outlet IP in the database according to the outlet IP of the first equipment in the page data request;
and the first device receives the private IP and the port number of the second device in the local area network, which are sent by the application server in response to the page data request.
Optionally, the obtaining, by the first device, the private IP and the port number of the second device in the local area network includes:
the second device acquires the private IP and the port number of the second device in the local area network when the second device accesses the local area network;
the application client side in the second equipment generates and displays the graphic identification code of the second equipment;
and the first equipment scans the pattern identification code when the first equipment is connected with the second equipment in the local area network, and obtains the private IP and the port number of the second equipment in the local area network by analyzing the pattern identification code.
Optionally, the system further comprises:
the first device sends the media content or the link of the media content in the first device to the application client in the second device through the established communication connection,
and the application client in the second device sends the media content to the device associated with the application client for displaying, or acquires the media content according to the link of the media content and sends the media content to the device associated with the application client for displaying.
The present application example also provides a communication connection apparatus, including:
a page data request unit for sending a page data request to the application server through the wide area network when it is determined that a connection is to be established with a second device in the local area network in response to an operation on a first page displayed by a first device;
a page data receiving unit, configured to receive, via the wide area network, page data sent by the application server in response to the page data request;
an obtaining unit, configured to obtain a private IP and a port number of the second device in the local area network;
a communication connection establishing unit, configured to establish, by executing a logic code in the page data, a communication connection between the first device and the second device in the local area network according to the private IP and the port number of the second device.
Optionally, the page data request includes an exit IP of the first device, and the obtaining unit is configured to:
and receiving the private IP and the port number of the second device in the local area network, which are sent by the application server in response to the page data request, wherein the private IP and the port number of the second device in the local area network are determined by the application server according to the outlet IP of the first device.
Optionally, the obtaining unit is configured to:
scanning a graphic identification code of the second device, wherein the graphic identification code carries a private IP and a port number of the second device in the local area network, and when the second device is accessed to the local area network, an application client of the second device acquires the private IP of the second device and generates the graphic identification code according to the private IP and the port number of the second device;
acquiring a private IP and a port number of the second equipment in the local area network by analyzing the graphic identification code;
and when the private IP and the port number of the second device in the local area network are acquired, sending the page data request to the application server.
The present application example also provides a communication connection apparatus, including:
the receiving unit is used for receiving a page data request sent by a first device through a wide area network when the first device is connected with a second device in the local area network;
a sending unit, configured to send, in response to the page data request, page data corresponding to the page data request to the first device through a wide area network, so that after the first device obtains a private IP and a port number of the second device in the local area network, the first device executes a logic code in the page data, and establishes a communication connection with the second device in the local area network according to the private IP and the port number of the second device.
The present application example also provides a communication connection apparatus, including:
a private IP and port number sending unit, configured to send a private IP and a port number of a first device to an application server through a wide area network, so that the application server stores the private IP and the port number of the first device in a local area network in association with an egress IP of the first device in a database, and sends, in response to a page data request sent by a second device, page data corresponding to the page data request, the private IP and the port number of the first device in the local area network to the second device;
a first connection request receiving unit, configured to receive a connection request sent by the second device, and establish a communication connection in the local area network with the second device, where the second device executes a logic code in the page data, and sends the connection request to the first device according to a private IP and a port number of the first device in the local area network.
The present application example also provides a communication connection apparatus, including:
a private IP obtaining unit, configured to obtain a private IP of the second device when the first device accesses the local area network;
the graphic identification code acquisition unit is used for acquiring and displaying a graphic identification code according to the private IP and the port number of the first equipment, so that the second equipment scans the graphic identification code when the second equipment is connected with the first equipment in the local area network, and the private IP and the port number of the first equipment in the local area network are acquired by analyzing the graphic identification code;
a second connection request receiving unit, configured to receive a connection request sent by the second device, and establish a communication connection in the local area network with the second device, where the second device executes a logic code in page data requested by an application server, and sends the connection request to the first device according to a private IP and a port number of the first device in the local area network.
The present examples also provide a computer-readable storage medium storing computer-readable instructions that can cause at least one processor to perform the method as described above.
By adopting the scheme provided by the application, the equipment in the local area network can be connected with other equipment in the same local area network by executing the logic codes in the webpage data.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a system architecture diagram to which an example of the present application relates;
FIG. 2 is a flow diagram of an example communication connection method of the present application;
FIG. 3 is a first page view of page h5 of an example of the present application;
FIG. 4 is a second page view of the page of h5, an example of the present application;
FIG. 5 is a third page view of the page h5 of an example of the present application;
FIG. 6 is a flow diagram of another example communication connection method of the present application;
FIG. 7 is a flow diagram of another example communication connection method of the present application;
FIG. 8 is a flow diagram of another example communication connection method of the present application;
FIG. 9 is a message interaction diagram illustrating an embodiment of the present application obtaining a private IP and a port number for communication connection via an application server;
FIG. 10 is a message interaction diagram illustrating another embodiment of the present application for obtaining private IP and port numbers via a graphical identifier for communication connection;
FIG. 11 is a schematic diagram of an exemplary communication link apparatus of the present application;
FIG. 12 is a schematic view of another example communication link apparatus of the present application;
FIG. 13 is a schematic diagram of another example communication link apparatus of the present application;
FIG. 14 is a schematic diagram of another example communication link apparatus of the present application; and
FIG. 15 is a block diagram of a computing device in an example of the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The application provides a communication connection method, a communication connection device, a communication connection system and a storage medium, and a system architecture applied to the method, the communication connection device and the communication connection system is shown in figure 1. The system architecture includes: a first device 101, a second device 102, a router 103 and an application server 105. The first device 101 and the second device 102 are in the same local area network and are both connected to the internet 104 through the router 103, and the router 103 and the application server 105 are connected through the internet 104. After the wifi is connected between the first device 101 and the second device 102, the router allocates the wifi to a unique private IP of each of the first device 101 and the second device 102, and the allocated IP segment is invisible to the internet. The first device 101 may be a portable mobile terminal, such as a mobile phone, a PDA, etc., the second device 102 may be a communication connection box of a device, such as a television box of a television, and the second device 102 may be a device separate from the device or may be integrated into the device. The first device 101 and the second device 102 may implement communication connection in a local area network, for example, a mobile phone and a television box of a television in the same local area network, where the mobile phone sends a picture on the mobile phone to the television box through the local area network, and the television box displays the received picture on the television.
In some examples, if two devices in the local area network need to communicate, for example, the first device 101 and the second device 102 in fig. 1 need to communicate, the two devices relay and issue data through the application server. For example, the first device 101 communicates with the second device 102, the second device 102 and the first device 101 establish a connection with the remote application server 105, the second device 102 or the first device 101 sends data to the remote application server 105 via the same user identity information, and the remote application server 105 forwards the data back to the other party according to the user identity information. For example, the first device 101 is a mobile phone, the second device 102 is a television box, and when the user wants to send the picture on the mobile phone to the television box for further display on the television, the picture on the mobile phone is sent to the remote application server 105 first, and the application server 105 sends the received picture to the television box for further display on the television. The scheme has very low transmission real-time property and transmission efficiency, and has long delay time and larger resources at the application server 105 end when the data volume is large.
In other examples, when the first device 101 and the second device 102 are to communicate, a tcp connection is established based on a private IP and a port in the local area network without performing a relay through the remote application server 105, and then data is transmitted. In the local area network, the private IP is distributed after wifi is connected, and the port has no public record. For example, to perform tcp communication between a handset and a tv box in the same wifi, one party needs to know the private IP and port number in the local area network of the other party, so as to initiate a standard tcp connection. Taking the example of sending the content on the mobile phone to the television box and then projecting the screen to the television, the content can be based on the public protocol standard of DLNA or the scheme based on the apple proprietary airplay protocol. An application client is required to be installed on both the mobile phone and the television box, and the application client is required to be capable of realizing a DLNA protocol or an apple-based private airplane protocol. When the application of the service providing party (such as a television box) is started, the private IP and port number of the television box monitored by the user in the local area network are broadcasted to the whole network in the IP broadcasting mode of the local area network. A party wishing to initiate connection, such as a mobile phone, monitors broadcast messages according to a protocol standard, and at the moment, if a plurality of television boxes providing services exist in the same local area network, a plurality of television boxes are identified, and the private IP and port number of each television box are acquired at the same time. At this time, the user selects a certain box for connection, specifically, according to the private IP and port number of the selected television box, a communication connection is established with the television box, and further, subsequent data transmission is performed.
In this example, both parties that need to communicate must install apps, which is cost prohibitive for scenarios that are used by the user infrequently, e.g., the user may only need to download and install one app for a temporary communication. In addition, the private IP and port number of the communication partner and the subsequent communication flow are obtained in the lan, and if the router or firewall of the lan shields the IP broadcast, the communication connection cannot be established. The stability of the instance to the local environment is also heavily dependent.
In order to solve the above technical problem, the present application proposes a communication connection method, applied to a first device 101 shown in fig. 1, as shown in fig. 2, the method includes the following steps:
step 201: when it is determined that a connection is to be established with a second device in the local area network in response to an operation on a first page exposed by the first device, a page data request is sent to the application server over the wide area network.
When the first device 101 is to establish a communication connection with the second device 102, the first device 101 requests page data from a remote application server over a wide area network, which may be the internet. For example, when the first device 101 is a mobile terminal such as a mobile phone, a computer, a PD, or the like, and the second device 102 is a tv box, the picture or video on the mobile terminal is sent to the tv box, and then when the tv is viewed on a large screen, the mobile terminal first requests the application server for page data, where the page data includes a logic code for connecting and communicating with the tv box. The user can request the page data through multiple entries on the mobile, and then a page is presented according to the page data, wherein the page is an HTML5 page (h5) page, for example, the user can input a website of the h5 page in a browser, so that the page data of the h5 page is requested from an application server. In addition, the user can click the WeChat public number in the WeChat to request page data of the h5 page from the application server, such as the public number page shown in FIG. 3, when the user clicks the public number: when the icon 301 of the device is connected, the page processing template in the WeChat requests h5 page data from the application server.
For a specific process of page data request, a page processing template in the first device firstly sends a page data request message to the router 103, when a user requests h5 page data by means of inputting a website through a browser, the page processing template is the browser, and when the user requests h5 page data through a public number in the WeChat, the page processing module is the browser module in the WeChat. The page data request message comprises that the first equipment is a private IP in the local area network, wherein after the first equipment is accessed into the local area network, the router distributes the private IP to the first equipment. The router 103 determines the outlet IP of the first device according to the private IP of the first device, records the outlet IP of the first device and the corresponding private IP at the same time, and sends the request message to the application server according to the outlet IP.
Step 202: and receiving page data sent by the application server in response to the page data request through the wide area network.
As shown in step 201, after the first device sends the page data request message to the application server, the application server returns the page data corresponding to the request message to the router 103, and meanwhile, a packet header of a network packet transmitting the page data carries an exit IP of the first device, after receiving the network packet, the router obtains the exit IP of the first device, and meanwhile, according to a recorded corresponding relationship between the exit IP and the private IP, determines the private IP of the first device, and further according to the private IP of the first device, sends the page data to the first device. The page data includes logic code to communicatively couple with a second device.
Step 203: and acquiring the private IP and the port number of the second equipment in the local area network.
When the first device wants to establish a communication connection with a second device in the same lan, the logic code in the page data acquired in step 202 is needed to execute the connection, and a private IP and port number of the second device in the lan are also needed. The private IP and the port number of the second equipment are obtained, the private IP and the port number of the second equipment can be obtained by the application server while the page data request is sent to the application server, and then the private IP and the port number are returned to the first equipment together with the page data; the private IP and port number of the second device may also be obtained by scanning the pattern identifier of the second device.
Step 204: and establishing communication connection between the first device and the second device in the local area network according to the private IP and the port number of the second device by executing a logic code in the page data.
The page data obtained in step 202 includes a logic code for establishing a connection with the second device in the local area network, and when the connection with the second device is established, the logic code is executed to establish a communication connection with the device according to the private IP and the port number of the second device in the local area network. And after the communication connection is established, subsequent data transmission can be carried out.
When establishing a communication connection with a second device, a remote application server is firstly accessed to request h5 page data, the domain name of the accessed server is the domain name of the remote application server, and when the second device is connected, the second device in the local area, such as a television box of a television, cannot possess the domain name, so that the cross-domain access problem exists. Conventional cross-domain technologies, such as ajax or iframe, can result in small data transmission and no two-way communication. Therefore, the communication connection method selects a websocket communication scheme, wherein the h5 page supports the websocket protocol standard, so that the problem of cross-domain access can be solved, the two-way communication with the second equipment in the same local area network can be realized, and the transmission quantity of the established connection data is large.
By adopting the communication connection method provided by the application, when a first device (for example, a mobile terminal) in a local area needs to establish a connection with a second device (for example, a television box), and is used for projecting the media content in the first device onto a device (for example, a television) associated with the second device for display, an application APP does not need to be additionally installed, only one h5 page needs to be opened, logic codes in page data of the h5 page are executed, the communication connection with the second device is realized, and the h5 page supports the websocket protocol standard, can realize duplex communication with the second device, and the established communication connection has a large data transmission quantity.
In some examples, where the page data request includes an egress IP of the first device, in step 203, the obtaining the private IP and the port number of the second device in the local area network includes the following steps:
step S11: and receiving the private IP and the port number of the second device in the local area network, which are sent by the application server in response to the page data request, wherein the private IP and the port number of the second device in the local area network are determined by the application server according to the outlet IP of the first device.
In this example, the private IP and port number of the second device in the local area network are obtained from the application server, which is based on the first device 101 having the same egress IP as the second device 102. The application server stores the private IP and the port number of the second device, and the private IP and the port number are stored in association with the outlet IP of the second device. The page data request initiated by the second device comprises an exit IP of the first device, when the application server receives the page data request, besides obtaining page data corresponding to the page data request, the application server searches the private IP and the port number of the second device with the same exit IP according to the exit IP of the first device, and sends the searched private IP and port number of the second device with the same exit IP and the page data to the first device. When a plurality of second devices with the same outlet IP exist in the local area network, the application server sends the searched private IPs and port numbers of the plurality of second devices to the first device.
In some examples, in step S11, when the application server determines the private ip and the port number of the second device in the local area network according to the egress ip of the first device, the method includes the following steps:
step S21: and the application server receives the private IP and the port number of the second equipment in the local area network uploaded by the application client in the second equipment, and stores the private IP and the port number in association with the outlet IP of the second equipment.
After the second device, such as a tv box, is accessed to WiFi, the router assigns the private IP of the second device, and at the same time, a port in the second device for establishing a communication connection is a fixed port, the second device uploads the private IP assigned by the router and a port number of the fixed port to which the private IP belongs to the fixed port to the application server 105, specifically, the second device first sends a request message carrying the private IP and the port number to the router, a packet header of a network packet sending the request message carries the private IP of the second device, after receiving the network packet, the router determines an egress IP of the second device according to the private IP, sends the determined egress IP, the private IP of the second device, and the port number to the application server, the application server uses the egress IP of the second device as a recorded key, and uses the IP and the port number of the second device as one item in a list, stored under the key. Because the outlet IP in the Internet is distributed and purchased by a unified mechanism, only the outlet IP can be routed in the whole network, when a request is sent to the application server, the router or an operator certainly converts the private IP of the second equipment into the outlet IP and forwards the outlet IP outwards, and therefore the application server can obtain the outlet IP, the private IP and the port number of the second equipment sent by the router.
Step S22: and searching the private IP and the port number of the second equipment in the local area network corresponding to the corresponding outlet IP according to the outlet IP of the first equipment.
And the application server stores the private IP and the port number of the second equipment and the outlet IP of the second equipment in a correlation manner, and the second equipment and the first equipment have the same outlet IP, so that the application server searches the private IP and the port number of the equipment with the same outlet IP according to the outlet IP of the first equipment.
The application also provides another example for obtaining the private IP and port number of the second device. As shown below, this example includes the following steps:
step S31: and scanning a graphic identification code of the second equipment, wherein the graphic identification code carries the private IP and the port number of the second equipment in the local area network, and when the second equipment is accessed to the local area network, an application client of the second equipment acquires the private IP of the second equipment and generates the graphic identification code according to the private IP and the port number of the second equipment.
The second device is provided with an application APP which is connected and communicated with other devices in the local area network, the second device can generate the graphic identification code by itself, and can also request an application server, the application server generates the graphic identification code of the second device, and then the graphic identification code is sent to the second device. The url of the h5 page is carried in the pattern identifier, and in this example, the private ip and port number of the second device in the local area network are carried in the url. After the second device obtains the pattern recognition code, when the APP in the second device is started, the pattern recognition code is displayed on the APP page, wherein the APP page and the pattern recognition code are displayed by a device managed by the second device, for example, by a television associated with a television box. When the first device wants to establish communication connection with the second device, the component with the scanning function on the first device scans the pattern identification code.
Step S32: and acquiring the private IP and the port number of the second equipment in the local area network by analyzing the graphic identification code.
As described in step S31, the url of the h5 page is carried in the graph identifier, and the url carries the private IP and the port number of the second device in the lan, and by analyzing the graph identifier, the url of the h5 page can be obtained, and the private IP and the port number of the second device in the lan can be obtained according to the url. The pattern recognition code may be a two-dimensional code.
Step S33: and when the private IP and the port number of the second device in the local area network are acquired, sending the page data request to the application server.
And the image identification code carries the url of the h5 page, when the mobile terminal scans the image identification code, the image identification code is analyzed to obtain the url, and h5 page data is requested to an application server according to the obtained url.
In some examples, the communication connection method proposed by the present application further includes the following steps:
step S41: and displaying a second page according to the page data, wherein the second page is displayed with the identifier of the second device.
And after receiving the h5 page data, a page processing module in the first device displays an h5 page according to the page data. For example, in fig. 3, when the user clicks the icon 301, h5 page data is requested from the application server, and then the h5 page shown in fig. 4 is displayed according to the received page data. In the h5 page shown in fig. 4, the identities of the second devices in the local area network with the first device are shown, there are 3 second devices that can connect with the first device in the h5 page shown in fig. 4, and the user clicks on the identity of one of the second devices to connect with the corresponding second device. For example, the user clicks the identifier 401 of the device 1 in fig. 4 to establish a communication connection with the device 1. This example corresponds to the situation that a plurality of connectable devices are provided on the same lan, for example, in a room, media contents such as photos on a mobile phone can be displayed on a smart television, and also can be displayed on other smart devices such as a smart projector, and at this time, identifiers of each connectable device are displayed on a second page of the display, for example, the smart television, the smart projector, and the like.
Step S42: wherein the establishing of the communication connection between the first device and the second device in the local area network comprises: and responding to the operation of the identification of the second equipment, executing the logic code, and establishing communication connection with the second equipment according to the private IP and the port number of the second equipment.
When the first device establishes communication connection with the second device, the connection is executed by the logic code in the page data, specifically, a port used for establishing connection in the first device is a fixed port, the first device executes the logic code, and sends a connection request to an application client in the second device according to the private ip and port number of the second device, the request also includes the private ip and port number of the first device, and after receiving the connection request, the application client in the second device establishes a socket with the first device, and establishes connection. And the logic code establishes duplex connection with the application client in the second device in a ws:// IP port mode, and at the moment, the two parties can perform duplex communication.
In some examples, the communication connection method proposed by the present application further includes the following steps:
and sending the media content or the link of the media content in the first device to an application client in the second device through the established communication connection, so that the application client in the second device sends the media content to the device associated with the application client for display, or obtains the media content according to the link of the media content and sends the media content to the device associated with the application client for display.
After the first device establishes a connection with an application client in the second device, data transmission can be performed between the first device and the second device. For example, when the first device is a cell phone and the second device is a television box, wherein the television box is associated with a television. And the mobile phone sends the picture in the mobile phone to the television box through the established connection, and the television box displays the picture on the television. When the video played on the mobile phone is required to be voted to the television, the mobile phone sends the url of the video to the television box through the established connection, and the television box obtains the video stream of the video to be played according to the url to the corresponding media server. After the mobile phone is in communication connection with the television box, the page diagram shown in fig. 5 is displayed, the user selects media content to be projected on the television, for example, a picture on the mobile phone, by clicking the icon 501, the user can also display an input box after clicking the icon, the user can input a link of a video in the input box and send the link to the television box, and the television box acquires the video according to the link and plays the video on the television.
The logic code in the page data of the h5 page supports the wessocket protocol standard in the process of executing communication. The protocol is shown in table 1 below:
Figure GDA0003242970930000181
Figure GDA0003242970930000191
TABLE 1
The communication process after the first equipment and the second equipment are connected comprises the following steps:
(1) and (3) handshake process: after the connection is established, the first device initiatively initiates a request with a command of 0x0001 to the app end of the second device, and submits a command list supported by the first device (if the current picture is supported, the command list is 0x1001) to the app of the second device through the established websocket connection.
(2) The app of the second device includes 0x1001 in the return list if it supports the projection of the picture type or the reception processing of the picture file.
(3) The first device performs a picture selection process, and after the selection is completed, the picture is encoded in base64 and sent to the second device app through command 0x 1001.
(5) And after the second device app receives and decodes the picture successfully, returning a 0x1002 command, and attaching a corresponding return code.
The present application also proposes a communication connection method, applied to the application server 105 shown in fig. 1, as shown in fig. 6, including the following steps:
step 601: and receiving a page data request sent by the first device through the wide area network when the first device is to establish connection with the second device in the local area network.
When the first device 101 is to establish a communication connection with the second device 102, the first device 101 requests page data from a remote application server over a wide area network, which may be the internet. For example, when the first device 101 is a mobile terminal such as a mobile phone, a computer, a PD, or the like, and the second device 102 is a tv box, the picture or video on the mobile terminal is sent to the tv box, and then when the tv is viewed on a large screen, the mobile terminal first requests the application server for page data, where the page data includes a logic code for connecting and communicating with the tv box. The user can request the page data through multiple entries on the mobile, and then a page is presented according to the page data, wherein the page is an HTML5 page (h5) page, for example, the user can input a website of the h5 page in a browser, so that the page data of the h5 page is requested from an application server. In addition, the user may click on a WeChat public number in the WeChat, and request page data of h5 page from the application server, such as the public number page shown in FIG. 3, when the user clicks on the public number: when the icon 301 of the device is connected, the page processing template in the WeChat requests h5 page data from the application server.
For a specific process of page data request, a page processing template in the first device firstly sends a page data request message to the router 103, when a user requests h5 page data by means of inputting a website through a browser, the page processing template is the browser, and when the user requests h5 page data through a public number in the WeChat, the page processing module is the browser module in the WeChat. The page data request message comprises that the first equipment is a private IP in the local area network, wherein after the first equipment is accessed into the local area network, the router distributes the private IP to the first equipment. The router 103 determines the outlet IP of the first device according to the private IP of the first device, records the outlet IP of the first device and the corresponding private IP at the same time, and sends the request message to the application server according to the outlet IP.
Step 602: responding to the page data request, sending page data corresponding to the page data request to the first equipment through a wide area network, so that after the first equipment acquires the private IP and the port number of the second equipment in the local area network, executing a logic code in the page data, and establishing communication connection in the local area network with the second equipment according to the private IP and the port number of the second equipment.
As described in the above step, after the first device sends the page data request message to the application server, the application server returns the page data corresponding to the request message to the router 103, and the packet header of the network packet transmitting the page data carries the outlet IP of the first device, and after receiving the network packet, the router obtains the outlet IP of the first device, and determines the private IP of the first device according to the recorded corresponding relationship between the outlet IP and the private IP, and then sends the page data to the first device according to the private IP of the first device. The page data includes logic code to communicatively couple with a second device. When the connection with the second device is established, the logic code is executed, and the communication connection with the device is established according to the private IP and the port number of the second device in the local area network.
By adopting the communication connection method provided by the application, when a first device (for example, a mobile terminal) in a local area needs to establish a connection with a second device (for example, a television box), and is used for projecting the media content in the first device onto a device (for example, a television) associated with the second device for display, an application APP does not need to be additionally installed, only one h5 page needs to be opened, logic codes in page data of the h5 page are executed, the communication connection with the second device is realized, and the h5 page supports the websocket protocol standard, can realize duplex communication with the second device, and the established communication connection has a large data transmission quantity.
In some examples, the communication connection method proposed by the present application further includes the following steps:
step S61: and receiving an outlet IP, a private IP and a port number of the second equipment, which are sent by a router, wherein the outlet IP is determined according to the private IP when the router receives the private IP and the port number sent by an application client in the second equipment.
After the second device, such as a television box, is accessed to WiFi, the router assigns the private IP of the second device, and at the same time, a port in the second device for establishing communication connection is a fixed port, the second device uploads the private IP assigned by the router and a port number of the fixed port to which the private IP belongs to the fixed port to the application server 105, specifically, the second device first sends a request message carrying the private IP and the port number to the router, a packet header of a network packet sending the request message carries the private IP of the second device, after receiving the network packet, the router determines the outlet IP of the second device according to the private IP, and sends the determined outlet IP, the private IP of the second device, and the port number to the application server, because the outlet IP in the internet is assigned and purchased by a unified mechanism, only in this way, routing can be performed in the whole network, and when a request is sent to the application server, the router itself or the operator will certainly convert the private IP of the second device into the egress IP and forward the egress IP to the outside, so that the application server can obtain the egress IP, the private IP, and the port number of the second device sent by the router.
Step S62: and storing the outlet IP of the second equipment in a database in association with the private IP and the port number.
The application server takes the outlet IP of the second device as a recorded key, and the private IP and the port number of the second device as one item in the list, and stores the item in the key.
Wherein the page data request includes an egress IP of the first device, the method further comprising:
step S63: searching a private IP and a port number of second equipment corresponding to the outlet IP in the local area network in the database according to the outlet IP of the first equipment; and responding to the page data request, and sending the private IP and the port number of the second equipment in the local area network to the first equipment through a wide area network.
And the application server stores the private IP and the port number of the second equipment and the outlet IP of the second equipment in a correlation manner, and the second equipment and the first equipment have the same outlet IP, so that the application server searches the private IP and the port number of the second equipment with the same outlet IP according to the outlet IP of the first equipment. And sending the private ip and port number of the second device in the local area network to the first device together with the page data.
The present application further proposes a communication connection method, applied to an application client in the second device 102 illustrated in fig. 1, as shown in fig. 7, including the following steps:
step 701: the private IP and the port number of the first device are sent to an application server through a wide area network, so that the application server stores the private IP and the port number of the first device in a local area network and the outlet IP of the first device in a database in an associated mode, and page data corresponding to the page data request, the private IP and the port number of the first device in the local area network are sent to the second device in response to the page data request sent by the second device.
After the first device, such as a tv box, is accessed to WiFi, the router assigns a private IP to the first device, and a port in the first device for establishing a communication connection is a fixed port, the first device uploads the private IP assigned by the router and a port number of the fixed port to which the private IP belongs to the fixed port to the application server 105, specifically, the first device first sends a request message carrying the private IP and the port number to the router, a packet header of a network packet sending the request message carries the private IP of the first device, after receiving the network packet, the router determines an egress IP of the first device according to the private IP, sends the determined egress IP, the private IP of the first device, and the port number to the application server, the application server uses the egress IP of the first device as a recorded key, and uses the IP and the port number of the first device as one item in a list, stored under the key. Because the outlet IP in the Internet is distributed and purchased by a unified mechanism, only routing in the whole network can be realized, when a request is sent to the application server, the router or an operator certainly converts the private IP of the first equipment into the outlet IP and forwards the outlet IP outwards, and the application server can obtain the outlet IP, the private IP and the port number of the first equipment sent by the router.
And the application server stores the private IP and the port number of the first device and the outlet IP of the first device in a correlation manner, and the first device and the second device have the same outlet IP, so that the application server searches the private IP and the port number of the first device with the same outlet IP according to the outlet IP of the second device. And sending the searched private ip and port number of the first device in the local area network to the second device together with the page data.
Step 702: and receiving a connection request sent by the second equipment, and establishing communication connection in the local area network with the second equipment, wherein the second equipment executes the logic code in the page data, and sends the connection request to the first equipment according to the private IP and the port number of the first equipment in the local area network.
When the second device establishes communication connection with the first device, the connection is executed by the logic code in the page data, specifically, a port used for establishing connection in the second device is a fixed port, the second device executes the logic code, and sends a connection request to an application client in the first device according to the private ip and port number of the first device, the request also includes the private ip and port number of the first device, and after receiving the connection request, the application client in the first device establishes a socket with the second device, and establishes connection. And the logic code establishes duplex connection with the application client in the first device in a ws:// IP port mode, and at the moment, the two parts can perform duplex communication.
By adopting the communication connection method provided by the application, when a second device (for example, a mobile terminal) in a local area needs to establish connection with a first device (for example, a television box) and is used for projecting the media content in the second device to a device (for example, a television) associated with the first device for display, an application APP does not need to be additionally installed, only one h5 page needs to be opened, logic codes in page data of the h5 page are executed, communication connection with the first device is realized, and the h5 page supports the websocket protocol standard, can realize duplex communication with the first device, and the established communication connection has a large data transmission quantity.
The present application also proposes a communication connection method, which is applied to an application client in the second device 102 shown in fig. 1, as shown in fig. 8, the method includes the following steps:
step 801: and when the first equipment accesses the local area network, acquiring the private IP of the second equipment.
When a first device accesses the local area network, a router allocates a private ip to the first device, a port used for performing communication connection with other devices in the first device is a fixed port, and an application client in the first device acquires a port number of the fixed port and the private ip allocated by the router.
Step 802: and acquiring and displaying the pattern identification code according to the private IP and the port number of the first equipment, so that the second equipment scans the pattern identification code when the second equipment is connected with the first equipment in the local area network, and acquires the private IP and the port number of the first equipment in the local area network by analyzing the pattern identification code.
The first device is provided with an application APP which is connected and communicated with other devices in the local area network, the first device can generate the graph identification code by itself, and can also request an application server, the application server generates the image identification code of the first device, and then the image identification code is sent to the first device. The url of the h5 page is carried in the pattern identifier, and in this example, the private ip and port number of the first device in the local area network are carried in the url. After the first device obtains the pattern identification code, when the APP in the first device is started, the pattern identification code is displayed on the APP page, wherein the APP page and the pattern identification code are displayed by a device associated with the first device, for example, by a television associated with a television box. When the second device wants to establish communication connection with the first device, the component with the scanning function on the second device scans the pattern identification code. And after scanning the graph identification code, obtaining the url by analyzing the graph identification code, and further obtaining the private ip and the port number of the first equipment in the local area network according to the url.
Step 803: and receiving a connection request sent by the second equipment, and establishing communication connection in the local area network with the second equipment, wherein the second equipment executes logic codes in page data requested by an application server, and sends the connection request to the first equipment according to the private IP and the port number of the first equipment in the local area network.
When the second device establishes communication connection with the first device, the connection is executed by the logic code in the page data, specifically, a port used for establishing connection in the second device is a fixed port, the second device executes the logic code, and sends a connection request to an application client in the first device according to the private ip and port number of the first device, the request also includes the private ip and port number of the first device, and after receiving the connection request, the application client in the first device establishes a socket with the second device, and establishes connection. And the logic code establishes duplex connection with the application client in the first device in a ws:// IP port mode, and at the moment, the two parts can perform duplex communication.
By adopting the communication connection method provided by the application, when a second device (for example, a mobile terminal) in a local area needs to establish connection with a first device (for example, a television box) and is used for projecting the media content in the second device to a device (for example, a television) associated with the first device for display, an application APP does not need to be additionally installed, only one h5 page needs to be opened, logic codes in page data of the h5 page are executed, communication connection with the first device is realized, and the h5 page supports the websocket protocol standard, can realize duplex communication with the first device, and the established communication connection has a large data transmission quantity.
The present application further provides a communication connection system, including:
the first device sends a page data request to the application server through the wide area network when the connection with the second device in the local area network is to be established;
the application server responds to the page data request and sends page data corresponding to the page data request to the first equipment through the wide area network;
the first device acquires the private IP and the port number of the second device in the local area network, and executes the logic code in the page data so as to establish communication connection in the local area network with the second device according to the private IP and the port number of the second device in the local area network.
In some examples, the first device obtaining the private IP and port number of the second device in the local area network includes:
when the second device accesses the local area network, the application client in the second device acquires the private IP of the second device in the local area network and sends the private IP and the port number of the second device in the local area network to the application server;
the application server stores the private IP and the port number of the second equipment and the outlet IP of the second equipment in a database in a correlation manner;
wherein the page data request includes an egress IP of the first device,
the application server searches a private IP and a port number of the second equipment in the local area network corresponding to the corresponding outlet IP in the database according to the outlet IP of the first equipment in the page data request;
and the first device receives the private IP and the port number of the second device in the local area network, which are sent by the application server in response to the page data request.
In some examples, the obtaining, by the first device, the private IP and port number of the second device in the local area network includes:
the second device acquires the private IP and the port number of the second device in the local area network when the second device accesses the local area network;
the application client side in the second equipment generates and displays the graphic identification code of the second equipment;
and the first equipment scans the pattern identification code when the first equipment is connected with the second equipment in the local area network, and obtains the private IP and the port number of the second equipment in the local area network by analyzing the pattern identification code.
In some examples, the communication connection system proposed in the present application further includes:
the first device sends the media content or the link of the media content in the first device to the application client in the second device through the established communication connection,
and the application client in the second device sends the media content to the device associated with the application client for displaying, or acquires the media content according to the link of the media content and sends the media content to the device associated with the application client for displaying.
In the communication connection system provided by the application, when the first device is a mobile phone, the second device is a television box, and the application server obtains a private IP and a port number of the second device in a local area network to establish subsequent connection, a message interaction diagram of the system is shown in fig. 9, and the communication connection system mainly includes the following steps:
step 901: the television box sends its private IP and port number in the local area network to the router. When the television box is accessed to the local area network, the router allocates the private IP of the television box, and the television box sends the private IP allocated by the router and the port number of the port in the television box for establishing communication connection with other equipment to the router.
Step 902: the router determines the export IP of the television box according to the private IP of the television box.
Step 903: and the router sends the outlet IP, the private IP and the port number of the television box to a remote application server through the Internet.
Step 904: and the application server stores the outlet IP of the television box in association with the private IP and the port number in a database.
Step 905: the mobile phone sends a page data request message to the router, and the request message carries the private IP of the mobile phone in the local area network.
Step 906: the router determines an outlet IP according to the private IP of the mobile phone and stores the mapping relation between the outlet IP of the mobile phone and the private IP.
Step 907: the router requests h5 page data from the application server, and the request carries the export IP of the mobile phone.
Step 908: and the application server searches the private IP and the port number of the television box with the same outlet IP according to the outlet IP of the mobile phone. And simultaneously searching page data corresponding to the page data request.
Step 909: and the application server sends the page data and the private IP and the port number of the television box to the router. The outlet IP of the mobile phone is carried in the packet header in the transmitted network
Step 910: and the router searches the private IP and the port number of the mobile phone in the saved outlet IP and the corresponding private IP and port number of the mobile phone according to the outlet IP of the mobile phone, and sends the page data and the private IP and port number of the television box to the mobile phone according to the private IP and port number.
Step 911: and the mobile phone executes the logic code in the page data and initiates connection to the television box according to the private IP and the port number of the television box.
Step 912: after the connection is established, the mobile phone communicates with the television box, for example, the picture in the mobile phone is sent to the television associated with the television box for display.
In the communication connection system provided by the application, when the first device is a mobile phone and the second device is a television box, and the private IP and the port number of the television box in the local area network are obtained by scanning the graphical identification code of the television box to establish subsequent connection, a message interaction diagram of the system is shown in fig. 10, and the communication connection system mainly includes the following steps:
step 1001: the APP in the television box shows the image identification code of the television box, the image identification code can be a two-dimensional code, and the two-dimensional code can be generated by the APP and also can be generated by the APP request application server and returned to the APP. The generated two-dimensional code carries url of h5 page, and the url carries private IP and port number of the television box. When the television box is accessed to the local area network, the router allocates the private IP of the television box, and a port in the television box for establishing communication connection with other equipment is a fixed port.
Step 1002: and the mobile phone scans the two-dimensional code, analyzes the two-dimensional code to obtain url of the h5 page, and simultaneously obtains the private IP and the port number of the television box.
Step 1003: the mobile phone sends a page data request message to the router, and the request message carries the private IP of the mobile phone in the local area network.
Step 1004: the router determines an outlet IP according to the private IP of the mobile phone and stores the mapping relation between the outlet IP of the mobile phone and the private IP.
Step 1005: the router requests h5 page data from the application server.
Step 1006: and the application server searches the page data corresponding to the page data request.
Step 1007: the application server sends the page data to the router. The packet header in the network is sent to carry the outlet IP of the mobile phone.
Step 1008: the router searches the private IP and the port number of the mobile phone in the saved outlet IP of the mobile phone and the corresponding private IP and the port number according to the outlet IP of the mobile phone, and sends the page data to the mobile phone according to the private IP and the port number.
Step 1009: and the mobile phone executes the logic code in the page data and initiates connection to the television box according to the private IP and the port number of the television box.
Step 1010: after the connection is established, the mobile phone communicates with the television box, for example, the picture in the mobile phone is sent to the television associated with the television box for display.
In some examples, the present application further provides a communication connection apparatus 1100, which is applied to a page processing module in a first device, as shown in fig. 11, and includes
A page data request unit 1101 for sending a page data request to the application server through the wide area network when it is determined that a connection is to be established with a second device in the local area network in response to an operation on a first page presented by a first device;
a page data receiving unit 1102, configured to receive, through the wide area network, page data sent by the application server in response to the page data request;
an obtaining unit 1103, configured to obtain a private IP and a port number of the second device in the local area network;
a communication connection establishing unit 1104, configured to establish a communication connection between the first device and the second device in the local area network according to the private IP and the port number of the second device by executing a logic code in the page data.
In some examples, where the page data request includes an egress IP of the first device, the obtaining unit 1103 is configured to:
and receiving the private IP and the port number of the second device in the local area network, which are sent by the application server in response to the page data request, wherein the private IP and the port number of the second device in the local area network are determined by the application server according to the outlet IP of the first device.
In some examples, the obtaining unit 1103 is configured to:
scanning a graphic identification code of the second device, wherein the graphic identification code carries a private IP and a port number of the second device in the local area network, and when the second device is accessed to the local area network, an application client of the second device acquires the private IP of the second device and generates the graphic identification code according to the private IP and the port number of the second device;
acquiring a private IP and a port number of the second equipment in the local area network by analyzing the graphic identification code;
and when the private IP and the port number of the second device in the local area network are acquired, sending the page data request to the application server.
The present application further provides a communication connection apparatus 1200 applied to an application server, as shown in fig. 12, including:
a receiving unit 1201, configured to receive a page data request sent by a first device through a wide area network when a connection is to be established with a second device in a local area network;
a sending unit 1202, configured to send, in response to the page data request, page data corresponding to the page data request to the first device through a wide area network, so that after the first device obtains a private IP and a port number of the second device in the local area network, the first device executes a logic code in the page data, and establishes a communication connection in the local area network with the second device according to the private IP and the port number of the second device.
The present application further provides a communication connection apparatus 1300, applied to the second device 102, as shown in fig. 13, including:
a private IP and port number sending unit 1301, configured to send a private IP and a port number of a first device to an application server through a wide area network, so that the application server stores the private IP and the port number of the first device in a local area network in association with an egress IP of the first device in a database, and sends, in response to a page data request sent by a second device, page data corresponding to the page data request, the private IP and the port number of the first device in the local area network to the second device;
a first connection request receiving unit 1302, configured to receive a connection request sent by the second device, and establish a communication connection in the local area network with the second device, where the second device executes a logic code in the page data, and sends the connection request to the first device according to a private IP and a port number of the first device in the local area network.
The present application further provides a communication connection apparatus 1400, applied to the second device 102, as shown in fig. 14, including:
a private IP obtaining unit 1401, configured to obtain a private IP of the second device when the first device accesses the local area network;
a graph identifier obtaining unit 1402, configured to obtain and display a graph identifier according to the private IP and the port number of the first device, so that a second device scans the graph identifier when a connection is to be established with the first device in a local area network, and obtains the private IP and the port number of the first device in the local area network by analyzing the graph identifier;
a second connection request receiving unit 1403, configured to receive a connection request sent by the second device, and establish a communication connection in the local area network with the second device, where the second device executes logic codes in page data requested by an application server, and sends the connection request to the first device according to a private IP and a port number of the first device in the local area network.
The present application also provides a computer-readable storage medium storing computer-readable instructions that can cause at least one processor to perform the method as described above.
Fig. 15 shows a composition configuration diagram of a computing device in which the communication connection means is located. As shown in fig. 15, the computing device includes one or more processors (CPUs) 1502, a communication module 1504, a memory 1506, a user interface 1510, and a communication bus 1508 for interconnecting these components.
The processor 1502 can receive and transmit data via the communication module 1504 to enable network communications and/or local communications.
The user interface 1510 includes one or more output devices 1512 including one or more speakers and/or one or more visual displays. The user interface 1510 also includes one or more input devices 1514 including, for example, a keyboard, a mouse, a voice command input unit or microphone, a touch screen display, a touch-sensitive input pad, a gesture-capture camera or other input buttons or controls, and the like.
The memory 1506 may be a high-speed random access memory such as DRAM, SRAM, DDR RAM, or other random access solid state memory devices; or non-volatile memory, such as one or more magnetic disk storage devices, optical disk storage devices, flash memory devices, or other non-volatile solid-state storage devices.
The memory 1506 stores a set of instructions executable by the processor 1502, including:
an operating system 1516 including programs for handling various basic system services and for performing hardware related tasks;
the application 1518 includes various application programs for communication connection, which can implement the processing flow in the above examples, and may include some or all of the units or modules in the communication connection device, for example. At least one of the units in the communication connection may store machine executable instructions. The processor 1502 may be capable of performing the functions of at least one of the above units or modules by executing machine-executable instructions in at least one of the units in the memory 1506.
It should be noted that not all steps and modules in the above flows and structures are necessary, and some steps or modules may be omitted according to actual needs. The execution order of the steps is not fixed and can be adjusted as required. The division of each module is only for convenience of describing adopted functional division, and in actual implementation, one module may be divided into multiple modules, and the functions of multiple modules may also be implemented by the same module, and these modules may be located in the same device or in different devices.
The hardware modules in the embodiments may be implemented in hardware or a hardware platform plus software. The software includes machine-readable instructions stored on a non-volatile storage medium. Thus, embodiments may also be embodied as software products.
In various examples, the hardware may be implemented by specialized hardware or hardware executing machine-readable instructions. For example, the hardware may be specially designed permanent circuits or logic devices (e.g., special purpose processors, such as FPGAs or ASICs) for performing the specified operations. Hardware may also include programmable logic devices or circuits temporarily configured by software (e.g., including a general purpose processor or other programmable processor) to perform certain operations.
In addition, each example of the present application can be realized by a data processing program executed by a data processing apparatus such as a computer. It is clear that a data processing program constitutes the present application. Further, the data processing program, which is generally stored in one storage medium, is executed by directly reading the program out of the storage medium or by installing or copying the program into a storage device (such as a hard disk and/or a memory) of the data processing device. Such a storage medium therefore also constitutes the present application, which also provides a non-volatile storage medium in which a data processing program is stored, which data processing program can be used to carry out any one of the above-mentioned method examples of the present application.
The corresponding machine-readable instructions of the modules of fig. 15 may cause an operating system or the like operating on the computer to perform some or all of the operations described herein. The nonvolatile computer-readable storage medium may be a memory provided in an expansion board inserted into the computer or written to a memory provided in an expansion unit connected to the computer. A CPU or the like mounted on the expansion board or the expansion unit may perform part or all of the actual operations according to the instructions.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (16)

1. A communication connection method is characterized in that a page processing module applied to an instant messaging client in first equipment comprises the following steps:
displaying an icon for connecting equipment in a public number page of the instant messaging client, receiving the operation of a user aiming at the icon, and sending a page data request to a remote application server through a wide area network;
receiving page data sent in response to the page data request and private IP and port numbers of a plurality of second devices in the same local area network with the first device from the remote application server, and displaying the identification of each second device;
responding to the operation of the user on the identification of one second device, executing the logic code in the page data, and performing the following processing:
establishing duplex connection with an application client in the second equipment according to the private IP and the port number of the second equipment;
after the connection is established, sending a command request to an application client in the second device, wherein the command request carries a first command list corresponding to the current release supporting type of the first device, so that the application client in the second device returns a second command list corresponding to the release supporting type of the application client;
when the second command list contains a command for projecting a video, sending the command carrying the video stream uniform resource locator URL to the application client in the second device, and receiving a video start-playing status code returned by the application client in the second device.
2. The method of claim 1, wherein the logic code supports the websocket protocol standard.
3. The method according to claim 1, wherein the page data request includes an egress IP of the first device, and the remote application server searches private IPs and port numbers of a plurality of second devices having the same egress IP according to the egress IP of the first device.
4. The method of claim 1, wherein the establishing a duplex connection with an application client in the second device according to the private IP and port number of the second device comprises:
and executing the logic code to establish duplex connection in a ws:// IP port mode.
5. The method of claim 1, wherein the application client in the second device obtains the media content according to the URL and sends the media content to the device associated therewith for presentation.
6. A method of communication connection, comprising:
receiving a page data request sent by first equipment through a wide area network, wherein the first equipment displays an icon for connecting equipment in a public number page of an instant messaging client, and the page data request is sent when the operation of a user for the icon is received;
responding to the page data request, sending page data corresponding to the page data request and private IP and port numbers of a plurality of second devices in the same local area network with the first device to the first device through a wide area network, so that the first device displays the identification of each second device; responding to the operation of the user on the identification of one second device, executing the logic code in the page data, and performing the following processing: establishing duplex connection with an application client in the second equipment according to the private IP and the port number of the second equipment; after the connection is established, sending a command request to an application client in the second device, wherein the command request carries a first command list corresponding to the current release supporting type of the first device, so that the application client in the second device returns a second command list corresponding to the release supporting type of the application client; when the second command list contains a command for projecting a video, sending the command carrying the video stream uniform resource locator URL to the application client in the second device, and receiving a video start-playing status code returned by the application client in the second device.
7. The method of claim 6, wherein the logic code supports the websocket protocol standard.
8. A communication connection system, comprising:
the first equipment displays an icon for connecting the equipment in a public number page of the instant messaging client, receives the operation of a user aiming at the icon, and sends a page data request to a remote application server through a wide area network;
the remote application server responds to the page data request and sends page data corresponding to the page data request and private IP and port numbers of a plurality of second devices in the same local area network with the first device to the first device through the wide area network;
the first equipment displays the identification of each second equipment; responding to the operation of the user on the identification of one second device, executing the logic code in the page data, and performing the following processing: establishing duplex connection with an application client in the second equipment according to the private IP and the port number of the second equipment; after the connection is established, sending a command request to an application client in the second device, wherein the command request carries a first command list corresponding to the current release supporting type of the first device, so that the application client in the second device returns a second command list corresponding to the release supporting type of the application client; when the second command list contains a command for projecting a video, sending the command carrying the video stream uniform resource locator URL to the application client in the second device, and receiving a video start-playing status code returned by the application client in the second device.
9. The system of claim 8, wherein the logic code supports the websocket protocol standard.
10. The system according to claim 8, wherein the page data request includes an egress IP of the first device, and the remote application server is configured to search private IPs and port numbers of a plurality of second devices having the same egress IP according to the egress IP of the first device.
11. A communication connection apparatus, comprising:
the page data request unit is used for displaying an icon for connecting equipment in a public number page of the instant messaging client, receiving the operation of a user on the icon, and sending a page data request to a remote application server through a wide area network;
a page data receiving unit, configured to receive, over the wide area network, page data sent by the remote application server in response to the page data request, and private IPs and port numbers of a plurality of second devices in the same local area network as the first device;
the communication connection establishing unit is used for showing the identification of each second device; responding to the operation of the user on the identification of one second device, executing the logic code in the page data, and performing the following processing: establishing duplex connection with an application client in the second equipment according to the private IP and the port number of the second equipment; after the connection is established, sending a command request to an application client in the second device, wherein the command request carries a first command list corresponding to the current release supporting type of the first device, so that the application client in the second device returns a second command list corresponding to the release supporting type of the application client; when the second command list contains a command for projecting a video, sending the command carrying the video stream uniform resource locator URL to the application client in the second device, and receiving a video start-playing status code returned by the application client in the second device.
12. The apparatus of claim 11, wherein the logic code supports the websocket protocol standard.
13. The apparatus according to claim 11, wherein the page data request includes an egress IP of the first device, and the remote application server searches private IPs and port numbers of a plurality of second devices having the same egress IP according to the egress IP of the first device.
14. A communication connection apparatus, comprising:
the system comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a page data request sent by first equipment through a wide area network, the first equipment displays an icon for connecting equipment in a public number page of an instant messaging client, and the page data request is sent when the operation of a user for the icon is received;
a sending unit, configured to send, in response to the page data request, page data corresponding to the page data request and private IPs and port numbers of multiple second devices in the same local area network as the first device to the first device through a wide area network, so that the first device displays an identifier of each second device; responding to the operation of the user on the identification of one second device, executing the logic code in the page data, and performing the following processing: establishing duplex connection with an application client in the second equipment according to the private IP and the port number of the second equipment; after the connection is established, sending a command request to an application client in the second device, wherein the command request carries a first command list corresponding to the current release supporting type of the first device, so that the application client in the second device returns a second command list corresponding to the release supporting type of the application client; when the second command list contains a command for projecting a video, sending the command carrying the video stream uniform resource locator URL to the application client in the second device, and receiving a video start-playing status code returned by the application client in the second device.
15. A computer-readable storage medium storing computer-readable instructions for causing at least one processor to perform the method of any one of claims 1-7.
16. A computing device comprising a memory and a processor, the memory having stored therein computer-readable instructions that, when executed by the processor, implement the method of any of claims 1 to 7.
CN201710799309.5A 2017-09-07 2017-09-07 Communication connection method, device, system and storage medium Active CN109474646B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710799309.5A CN109474646B (en) 2017-09-07 2017-09-07 Communication connection method, device, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710799309.5A CN109474646B (en) 2017-09-07 2017-09-07 Communication connection method, device, system and storage medium

Publications (2)

Publication Number Publication Date
CN109474646A CN109474646A (en) 2019-03-15
CN109474646B true CN109474646B (en) 2021-10-19

Family

ID=65657928

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710799309.5A Active CN109474646B (en) 2017-09-07 2017-09-07 Communication connection method, device, system and storage medium

Country Status (1)

Country Link
CN (1) CN109474646B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110191350A (en) * 2019-05-28 2019-08-30 上海哔哩哔哩科技有限公司 Multiterminal throw screen method, computer equipment and storage medium
CN110457496A (en) * 2019-06-18 2019-11-15 北京世纪超星信息技术发展有限责任公司 A method of passing through cloud server sharing media content
CN113645308B (en) * 2021-08-18 2022-09-16 平安普惠企业管理有限公司 Mobile terminal TCP communication, device, equipment and storage medium
CN116708532B (en) * 2023-08-03 2023-10-20 腾讯科技(深圳)有限公司 Local area network connection method, device, computer equipment and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105657055A (en) * 2016-03-07 2016-06-08 北京视信互动科技有限公司 Local area network equipment finding method and device oriented to WEB page
CN106686754A (en) * 2016-12-06 2017-05-17 厦门中控生物识别信息技术有限公司 Data interaction method and data interaction system
CN106850384A (en) * 2017-01-12 2017-06-13 深圳市先河系统技术有限公司 A kind of method and mobile terminal for realizing accessing equipment in LAN

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130070308A (en) * 2011-12-19 2013-06-27 삼성전자주식회사 Method and apparatus for dynamic policy interworking between pcrf and nat
KR102208113B1 (en) * 2013-02-28 2021-01-27 엘지전자 주식회사 Apparatus and method for processing a multimedia commerce service
US20140347565A1 (en) * 2013-05-21 2014-11-27 Aliphcom Media devices configured to interface with information appliances
CN104378416A (en) * 2014-10-29 2015-02-25 乐视网信息技术(北京)股份有限公司 Method and device for main control equipment to control controlled equipment
CN106559690A (en) * 2016-11-15 2017-04-05 武汉斗鱼网络科技有限公司 The live method and system for throwing screen are realized based on multicast on a kind of intelligent television

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105657055A (en) * 2016-03-07 2016-06-08 北京视信互动科技有限公司 Local area network equipment finding method and device oriented to WEB page
CN106686754A (en) * 2016-12-06 2017-05-17 厦门中控生物识别信息技术有限公司 Data interaction method and data interaction system
CN106850384A (en) * 2017-01-12 2017-06-13 深圳市先河系统技术有限公司 A kind of method and mobile terminal for realizing accessing equipment in LAN

Also Published As

Publication number Publication date
CN109474646A (en) 2019-03-15

Similar Documents

Publication Publication Date Title
AU2013206552B2 (en) Application discovery
CN109474646B (en) Communication connection method, device, system and storage medium
CN105409183B (en) For realizing the system and equipment of any network function client or server in HTML5 is applied
US10034057B2 (en) Message processing method, device, gateway, STB and IPTV
CN108965103B (en) Electronic device, server and method for providing conversation content
EP3996355B1 (en) Method for transferring media stream and user equipment
AU2010256543A1 (en) Systems and methods for creating virtual universal plug-and-play systems
US20130080560A1 (en) System and Method for Sharing Digital Data on a Presenter Device to a Plurality of Participant Devices
CN105407369A (en) Web application based terminal communication method and device
CN103004186B (en) Between computer equipment, configure the apparatus and method of high definition video phone
EP3026844B1 (en) Apparatus, system, and method of selecting relay device in conferencing system, and carrier medium
CN104871481B (en) The method and apparatus of power management based on cloud for local network device
US20140258444A1 (en) Network cloud communication for ip camera
KR101366671B1 (en) System and method for providing callcenter service through web
EP3136248B1 (en) Access management system, communication system, recording medium and access management method
CN106572382A (en) Multi-screen interaction method and system and extensible messaging and presence protocol (XMPP) system
US20150358263A1 (en) Communication between a web application instance connected to a connection server and a calling entity other than said connection server
EP3029933B1 (en) Apparatus, system, and method of controlling session, and carrier means
KR101236500B1 (en) Apparatus for social network service relay service for small embedded apparatus and method thereof
US20190124071A1 (en) Access to network data from a plurality of sources using a single identification value
EP3029882B1 (en) Apparatus, system, and method for determining destination for state information and carrier means
CN113381864B (en) Digital audiovisual site control method, system and storage medium
KR102271571B1 (en) MEDIA SERVER FOR PROVIDING webRTC-BASED VIDEO CHATTING SERVICE AND SYSTEM THEREOF
CN108270995B (en) Communication method and system between terminal and video monitoring equipment
US11234032B2 (en) Method of managing the right of access to a digital content

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant