CN109474646A - Communication connecting method, device, system and storage medium - Google Patents

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

Info

Publication number
CN109474646A
CN109474646A CN201710799309.5A CN201710799309A CN109474646A CN 109474646 A CN109474646 A CN 109474646A CN 201710799309 A CN201710799309 A CN 201710799309A CN 109474646 A CN109474646 A CN 109474646A
Authority
CN
China
Prior art keywords
equipment
area network
private
port numbers
local area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710799309.5A
Other languages
Chinese (zh)
Other versions
CN109474646B (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

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

This application discloses a kind of communication connecting methods, applied to the page processing module in the first equipment, include: when the operation of the first page in response to being shown to the first equipment and determination sends page data request to application server by wide area network when establishing connection with the second equipment in local area network;The page data sent by application server responses described in the wide area network reception in the page data request;Obtain private ip and port numbers of second equipment in the local area network;First equipment and communication connection of second equipment in the local area network are established according to the private ip and port numbers of second equipment by executing the logical code in the page data.Present invention also provides corresponding device, system and storage mediums.

Description

Communication connecting method, device, system and storage medium
Technical field
This application involves field of communication technology more particularly to communication connecting method, device, system and storage mediums.
Background technique
Local area network (Local Area Network, LAN) is (such as school, a work in the geographic range of a part In factory or organ), usually have an area of within several kms, by various computers, external equipment and database etc. are linked up mutually The computer communication network of composition.It can by data communication network or exclusive data circuit, with the local area network in a distant place, database or Processing center is connected, and constitutes a large range of information processing system.
By taking family wifi router scene as an example, under the same wifi router, multiple equipment, such as electricity can connect Depending on box, computer, mobile phone etc., after these equipment connect wifi, the respectively unique private of these equipment is distributed to by router Have under IP, and this private ip distributed is invisible to internet, these equipment are known as in the same local area network at this time.
Summary of the invention
The embodiment of the present application provides a kind of communication connecting method, device, system and storage medium, so that in local area network Equipment can be realized by the logical code in execution web data and is attached with the other equipment in same local area network, be solved The technical issues of equipment link cost is high in local area network, low efficiency.
The embodiment of the present application provides a kind of communication connecting method, applied to the page processing module in the first equipment, packet It includes:
When the first page in response to being shown to the first equipment operation and determination will be built with the second equipment in local area network When vertical connection, page data request is sent to application server by wide area network;
The page data sent by application server responses described in the wide area network reception in the page data request;
Obtain private ip and port numbers of second equipment in the local area network;
By executing the logical code in the page data, according to the private ip of second equipment and port Number, establish first equipment and communication connection of second equipment in the local area network.
Optionally, wherein include the outlet IP of first equipment in the page data request;
The private ip that second equipment is obtained in the local area network and port numbers include:
Second equipment that the application server responses are sent in the page data request is received in the local Private ip and port numbers in net, wherein private ip and port numbers of second equipment in the local area network are answered by described It is determined with server according to the outlet IP of first equipment.
Optionally, the private ip for obtaining second equipment in the local area network and port numbers include:
The graphical identification code of second equipment is scanned, second equipment is carried in the graphical identification code in the local Private ip and port numbers in net, wherein when second equipment accesses the local area network, the application visitor of second equipment Family end obtains the private ip of second equipment, and generates the figure according to the private ip of second equipment and port numbers and know Other code;
Private ip and port of second equipment in the local area network are obtained by parsing the graphical identification code Number;
Wherein, when getting private ip and port numbers of second equipment in the local area network, to the application Server sends the page data request.
Optionally, the method further includes:
Second page is shown according to the page data, and the mark for having second equipment is shown in the second page;
Wherein, described to establish first equipment with communication connection of second equipment in the local area network and include:
In response to the operation of the mark to second equipment, the logical code is executed, according to second equipment The private ip and port numbers are established with second equipment and are communicated to connect.
Optionally, the method further includes:
By the communication connection of foundation, the chain of media content or media content in first equipment is received and sent To the applications client in second equipment, so that the applications client in second equipment sends the media content It is shown on to equipment associated with it, or media content is obtained according to the link of the media content, and the media content is sent out It is sent in equipment associated with it and shows.
Present application example also provides a kind of communication connecting method, comprising:
The first equipment is received when to establish connection with the second equipment in local area network, the page number sent by wide area network According to request;
In response to the page data request, sent and the page data request by wide area network to first equipment Corresponding page data, so that first equipment obtains private ip and port numbers of second equipment in the local area network Afterwards, the logical code in the page data is executed, it is and described with according to the private ip and port numbers of second equipment Second equipment establishes the communication connection in the local area network.
Optionally, the method further includes:
Receiving router send second equipment outlet IP, private ip and port numbers, wherein the outlet IP by When the router receives the private ip and port numbers of the transmission of the applications client in second equipment, according to described Private ip and determine;
The outlet IP of second equipment is associated with preservation in the database with the private ip, port numbers;
It wherein, include the outlet IP of first equipment in the page data request, the method further includes:
Corresponding second equipment of corresponding outlet IP is searched in the database according to the outlet IP of first equipment to exist Private ip and port numbers in the local area network;
In response to the page data request, second equipment is sent described to first equipment by wide area network Private ip and port numbers in local area network.
Present application example additionally provides a kind of communication connecting method, comprising:
The private ip of the firstth equipment, port numbers are sent to application server by wide area network, so that the application takes First equipment private ip in a local network, port numbers are associated with the outlet IP of first equipment and are stored in number by business device It, will page number corresponding with the page data request in response to the page data request that second equipment is sent according in library Second equipment is sent to according to, first equipment private ip in a local network, port numbers;
The connection request that second equipment is sent is received, establishes the communication in the local area network with second equipment Connection, wherein second equipment executes the logical code in the page data, in a local network according to first equipment Private ip, port numbers to first equipment send the connection request.
Present application example additionally provides a kind of communication connecting method, comprising:
When the first equipment access to LAN, the private ip of second equipment is obtained;
Graphical identification code is obtained according to the private ip of first equipment and port numbers and is shown, is wanted so that the second equipment is worked as The graphical identification code is scanned when establishing connection with first equipment in local area network, is obtained by parsing the graphical identification code Take private ip and port numbers of first equipment in the local area network;
The connection request that second equipment is sent is received, establishes the communication in the local area network with second equipment Connection, wherein second equipment executes the logical code into the page data that application server is requested, according to described first Equipment private ip in a local network, port numbers send the connection request to first equipment.
Present application example additionally provides a kind of communication connecting system, comprising:
First equipment is sent out by wide area network to application server when to establish connection with the second equipment in local area network Send page data request;
The application server is sent out by the wide area network to first equipment in response to the page data request Send page data corresponding with the page data request;
First equipment, obtains the private ip and port numbers of second equipment in the local area network, described in execution Logical code in page data, with the private ip and port numbers according to second equipment in the local area network, with Second equipment establishes the communication connection in the local area network.
Optionally, first equipment obtains private ip and port numbers packet of second equipment in the local area network It includes:
Applications client in second equipment obtains described the when second equipment accesses the local area network The private ip of two equipment in a local network, and its private ip and port numbers in the local area network is sent to the application and is taken Business device;
The application server, by the outlet of the private ip of second equipment and port numbers and second equipment IP association saves in the database;
It wherein, include the outlet IP of first equipment in the page data request,
The application server, the outlet IP of the first equipment according to the page data request, in the data The corresponding private ip and port numbers for exporting corresponding second equipment of IP in the local area network is searched in library;
First equipment, receives the application server responses in the page data request, and described the second of transmission Private ip and port numbers of the equipment in the local area network.
Optionally, wherein first equipment obtains private ip and port of second equipment in the local area network Number include:
Second equipment obtains second equipment in the office when second equipment accesses the local area network Private ip and port numbers in the net of domain;
Applications client in second equipment, generates the graphical identification code of second equipment and displaying;
First equipment scans the figure identification when to establish connection with second equipment in local area network Code obtains private ip and port numbers of second equipment in the local area network by parsing the graphical identification code.
Optionally, the system further comprises:
First equipment, by the communication connection of foundation, by the media content or media in first equipment The link of content is sent to the applications client in second equipment,
Applications client in second equipment sends the media content in equipment associated with it and shows, Or media content is obtained according to the link of the media content, and send the media content in equipment associated with it and open up Show.
Present application example also provides a kind of communication link, comprising:
Page data request unit, for when the operation in response to the first page shown to the first equipment and determination will be with When the second equipment in local area network establishes connection, page data request is sent to application server by wide area network;
Page data receiving unit, for passing through application server responses described in the wide area network reception in the page number The page data sent according to request;
Acquiring unit, for obtaining private ip and port numbers of second equipment in the local area network;
Communication connection establishment unit, for being set according to described second by executing the logical code in the page data The standby private ip and port numbers establish first equipment and communication link of second equipment in the local area network It connects.
Optionally, wherein in the page data request include first equipment outlet IP, the acquiring unit, For:
Second equipment that the application server responses are sent in the page data request is received in the local Private ip and port numbers in net, wherein private ip and port numbers of second equipment in the local area network are answered by described It is determined with server according to the outlet IP of first equipment.
Optionally, the acquiring unit, is used for:
The graphical identification code of second equipment is scanned, second equipment is carried in the graphical identification code in the local Private ip and port numbers in net, wherein when second equipment accesses the local area network, the application visitor of second equipment Family end obtains the private ip of second equipment, and generates the figure according to the private ip of second equipment and port numbers and know Other code;
Private ip and port of second equipment in the local area network are obtained by parsing the graphical identification code Number;
Wherein, when getting private ip and port numbers of second equipment in the local area network, to the application Server sends the page data request.
Present application example also provides a kind of communication link, comprising:
Receiving unit passes through wide area for receiving the first equipment when to establish connection with the second equipment in local area network Net the page data request sent;
Transmission unit is sent and institute by wide area network to first equipment in response to the page data request The corresponding page data of page data request is stated, so that first equipment obtains second equipment in the local area network After private ip and port numbers, the logical code in the page data is executed, according to the private ip of second equipment And port numbers, the communication connection in the local area network is established with second equipment.
Present application example also provides a kind of communication link, comprising:
Private ip, port numbers transmission unit, for being sent to the private ip of the firstth equipment, port numbers by wide area network Application server, so that the application server is by first equipment private ip in a local network, port numbers and described the The outlet IP association of one equipment saves in the database, will be with institute in response to the page data request that second equipment is sent State the corresponding page data of page data request, first equipment private ip in a local network, port numbers be sent to it is described Second equipment;
First connection request receiving unit, the connection request sent for receiving second equipment, sets with described second It is standby to establish the communication connection in the local area network, wherein second equipment executes the logical code in the page data, The connection request is sent to first equipment according to first equipment private ip in a local network, port numbers.
Present application example also provides a kind of communication link, comprising:
Private ip acquiring unit, for obtaining the private ip of second equipment when the first equipment access to LAN;
Graphical identification code acquiring unit, for obtaining graphical identification code according to the private ip and port numbers of first equipment And show, so that the second equipment scans the graphical identification code when to establish connection with first equipment in local area network, Private ip and port numbers of first equipment in the local area network are obtained by parsing the graphical identification code;
Second connection request receiving unit, the connection request sent for receiving second equipment, sets with described second It is standby to establish the communication connection in the local area network, wherein second equipment executes the page number requested to application server Logical code in sends institute to first equipment according to first equipment private ip in a local network, port numbers State connection request.
Present application example also provides a kind of computer readable storage medium, is stored with computer-readable instruction, can make to A few processor executes method as described above.
Using above scheme provided by the present application, the equipment in local area network passes through the logical code in execution web data just It can be achieved to be attached with the other equipment in same local area network.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention without any creative labor, may be used also for those of ordinary skill in the art To obtain other drawings based on these drawings.
Fig. 1 is the system architecture figure that present application example is related to;
Fig. 2 is the flow chart of one instance communications connection method of the application;
Fig. 3 is the first page figure in the one example h5 page of the application;
Fig. 4 is the second page figure in the one example h5 page of the application;
Fig. 5 is the third page figure in the one example h5 page of the application;
Fig. 6 is the flow chart of another instance communications connection method of the application;
Fig. 7 is the flow chart of another instance communications connection method of the application;
Fig. 8 is the flow chart of another instance communications connection method of the application;
Fig. 9 is the message friendship that one example of the application obtains private ip by application server and port numbers are communicatively coupled Mutually figure;
Figure 10 is that another example of the application obtains private ip by graphical identification code and port numbers are communicatively coupled Interacting message figure;
Figure 11 is the structural schematic diagram of one instance communications attachment device of the application;
Figure 12 is the structural schematic diagram of another instance communications attachment device of the application;
Figure 13 is the structural schematic diagram of another instance communications attachment device of the application;
Figure 14 is the structural schematic diagram of another instance communications attachment device of the application;And
Figure 15 is that the calculating equipment in present application example forms structural schematic diagram.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that the described embodiment is only a part of the embodiment of the present invention, instead of all the embodiments.Based on this Embodiment in invention, every other reality obtained by those of ordinary skill in the art without making creative efforts Example is applied, shall fall within the protection scope of the present invention.
This application provides communication connecting method, device, system and storage medium, the method, apparatus and system are answered System architecture, as shown in Figure 1.The system architecture includes: the first equipment 101, the second equipment 102, router 103 and application Server 105.Wherein, the first equipment 101 and the second equipment 102 are in the same local area network, all by router 103 and mutually 104 connection of networking, router 103 are connect with application server 105 by internet 104.First equipment 101 and the second equipment After 102 connect wifi, distributed under the first equipment 101 and the respective unique private ip of the second equipment 102 by router, and This IP sections of distribution belongs to invisible to internet.First equipment 101 can be portable mobile termianl, such as mobile phone, PDA It can be the communication connection box of equipment Deng, second equipment 102, such as the TV box of TV, which can be With the independent equipment of the equipment, it is also desirably integrated into the equipment.First equipment 101 and the second equipment 102 may be implemented The TV box of mobile phone and TV in communication connection in local area network, such as the same local area network, mobile phone is by the figure on mobile phone Piece is sent to TV box by local area network, and TV box shows the picture received on TV.
In some instances, two equipment in local area network are communicated if necessary, the first equipment of example as shown in figure 1 101 will be communicated with the second equipment 102, by the way of issuing again through application server transfer.For example, the first equipment 101 It is communicated between the second equipment 102, the second equipment 102 and the first equipment 101 are all established with remote application server 105 and connected It connects, data are sent to remote application server via identical subscriber identity information by the second equipment 102 or the first equipment 101 105, remote application server 105 is forwarded back to again according to subscriber identity information come another party.For example, the first equipment 101 is mobile phone, Second equipment 102 is TV box, when the picture on mobile phone is sent to TV box by user, and then displaying on TV When, the picture on mobile phone is first sent to long-range application server 105, and application server 105 is sent by the picture received TV box is given, and then is shown on TV.The program transmits real-time and efficiency of transmission is all very low, when data volume is big, prolongs The slow time is long, and the resource at 105 end of application server is also bigger.
In other examples, when the first equipment 101 will be communicated with the second equipment 102, without remote application service Device 105 carries out transfer and establishes tcp connection in a local network based on the private ip in local area network, port, transmit data again later. In a local network, it is just distributed since private ip is connected into after wifi, the ground of port also not public record.Such as it is same Mobile phone and TV box under wifi will carry out tcp communication, it is necessary to which one knows private ip in the local area network of another party, end Slogan, to initiate the tcp connection of a standard.To send TV box for the content on mobile phone, and then throws screen and arrive TV For, it can the publicly-owned consensus standard based on DLNA or the scheme based on the privately owned airplay agreement of apple.Mobile phone and TV box On applications client will be installed, which will can be realized the agreement of DLNA or the privately owned airplay based on apple Agreement.In the application starting for providing service one side (such as TV box), in a local network by the TV box oneself monitored Private ip, port numbers are broadcasted in a manner of the IP broadcast of local area network to the whole network.Wish the side initiated the connection, such as mobile phone, according to association Quasi- listening broadcast message of assessing a bid for tender just will recognise that more at this time if there is multiple TV boxes for providing and servicing under same local area network A TV box, while obtaining the private ip and port numbers of each TV box.User selects some box to connect at this time, Specifically, it according to the private ip and port numbers of the TV box of selection, establishes and communicates to connect with the TV box, and then after progress Continuous data transmission.
In this example, the both sides communicated must install app, the field that this behavior uses user once in a while For scape, cost is excessively high, for example, user may only for provisional communication once, it is also necessary to downloading installation one app.In addition, obtaining The private ip and port numbers and subsequent communication process of communication counterpart, all in local area network, if the router of local area network or Firewall shields IP broadcast, then communication connection can not establish.The example is also larger to the stability dependency of home environment.
In order to solve the above technical problems, present applicant proposes a kind of communication connecting methods, set using shown in Fig. 1 first Standby 101, as shown in Fig. 2, method includes the following steps:
Step 201: when the first page in response to being shown to the first equipment operation and determination will be in local area network When two equipment establish connection, page data request is sent to application server by wide area network.
When the first equipment 101 will be established with the second equipment 102 to be communicated to connect, the first equipment 101 is by wide area network to remote The application server request page data of journey, the wide area network can be internet.For example, when the first equipment 101 is that hand is mechanical, electrical The mobile terminals such as brain, PD, the second equipment 102 be the TV box period of the day from 11 p.m. to 1 a.m, by mobile terminal picture or video be sent to TV box Son, and then when carrying out large-size screen monitors viewing on TV, first mobile terminal are to application server request page data, the page data In include logical code for being attached and communicating with TV box.User can pass through multiple entry requests in movement The page data, and then according to the page data displayed page, which is the HTML5 page (h5) page, such as user can To input the website of the h5 page in a browser, thus to the page data of the application server request h5 page.In addition, user Wechat public platform can also be clicked in wechat, to the page data of the application server request h5 page, the public as shown in Figure 3 In number page, public platform when the user clicks: when connecting the icon 301 of equipment, page processing template in wechat is to application service Device requests h5 page data.
For the process of specific page data request, the page processing template in the first equipment first asks page data Message is asked to be sent to router 103, when user requests h5 page data in such a way that browser inputs network address, at the page Reason template is browser, and when user requests h5 page data by the public platform in wechat, which is wechat In browser module.In the page data request message include the first equipment be private ip in a local network, wherein when first After equipment access to LAN, the first equipment private ip is distributed to by router.Router 103 is according to the private ip of first equipment Determine that the outlet IP of first equipment, router record the outlet IP and corresponding private ip of first equipment, Jin Ergen simultaneously The request message is sent to application server according to the outlet IP.
Step 202: being sent by application server responses described in the wide area network reception in the page data request Page data.
As depicted at step 201, after page data request message is sent to application server by the first equipment, application service Page data corresponding with the request message is returned to routing 103 by device, the network packet of page data described in simultaneous transmission The outlet IP of first equipment is carried in packet header, after router receives the network packet, obtains going out for first equipment Mouth IP, while the corresponding relationship of the outlet IP and private ip according to record, determine the private ip of first equipment, and then basis The page data is sent to first equipment by the private ip of first equipment.Include in the page data to The logical code that second equipment is communicatively coupled.
Step 203: obtaining private ip and port numbers of second equipment in the local area network.
When the first equipment will be established with the second equipment in the same local area network to be communicated to connect, in addition to needing step 202 Logical code in the page data of middle acquisition to execute connection, while also needing the second equipment in a local network privately owned IP and port numbers.The private ip and port numbers of the second equipment are obtained, the same of page data request can be sent to application server When, the private ip and port numbers of the second equipment are obtained by application server, and then the first equipment is returned to together with page data; The private ip and port numbers of the second equipment can also be obtained by way of scanning the graphical identification code of the second equipment.
Step 204: by executing the logical code in the page data, according to the private ip of second equipment And port numbers, establish first equipment and communication connection of second equipment in the local area network.
It include establishing connection with the second equipment in local area network to realize in the page data obtained in step 202 Logical code executes the logical code when establishing with the connection of the second equipment, according to the second equipment in a local network privately owned IP and port numbers establish the communication connection with the equipment.Subsequent data transmission can be carried out after establishing communication connection.
When establishing communication connection with the second equipment, long-range application server request h5 page data is accessed first, is visited The domain name for the server asked is the domain name of remote application server, and when being attached with the second equipment, second in local sets It is standby, such as the TV box of TV, it is impossible to possess domain name, so there can be cross-domain access problem.Such as using ajax or The cross-domain technology of the tradition such as iframe, can make volume of transmitted data small, and can not two-way communication.Thus the application communication connecting method It has selected using websocket communication plan, wherein the h5 page supports websocket protocol standard, can not only solve cross-domain The problem of access, can also be realized and establish two-way communication, and the connection data established with the second equipment in the same local area network Transmission quantity is big.
Using communication connecting method provided by the present application, the first equipment (such as mobile terminal) in local will be set with second When standby (such as TV box) establishes connection, to by the media content in the first equipment throw screen to the second equipment is associated sets When showing on standby (such as TV), do not need additionally to install using APP, it is only necessary to open a h5 page, execute the h5 page Logical code in page data realizes the communication connection with the second equipment, and the h5 page supports websocket protocol mark Standard can realize duplex communication with the second equipment, and the communication connection established, volume of transmitted data are big.
In some instances, wherein include the outlet IP of first equipment in the page data request, in above-mentioned step In rapid 203, when executing the private ip and port numbers for obtaining second equipment in the local area network, including following step It is rapid:
Step S11: the application server responses are received and are existed in second equipment that the page data request is sent Private ip and port numbers in the local area network, wherein private ip and port numbers of second equipment in the local area network It is determined by the application server according to the outlet IP of first equipment.
In this example, the second equipment private ip in a local network and port numbers, the reality are obtained from application server Example is based on the first equipment 101 and the outlet IP having the same of the second equipment 102.The private of the second equipment is preserved at application server There are IP and port numbers, and the private ip and port numbers are associated with preservation with the outlet IP of second equipment.What the second equipment was initiated It include the outlet IP of first equipment in the page data request, application server is receiving the page data request When, other than obtaining page data corresponding with the page data request, also according to the outlet IP of first equipment, look into The private ip and port numbers of the second equipment of identical outlet IP are looked for, and second equipment with identical outlet IP will be found Private ip and port numbers are transmitted across first equipment together with the page data.It is multiple with phase when existing in a local network When with the second equipment for exporting IP, application server can send out the private ip of the multiple second equipment found and port numbers Give first equipment.
In some instances, in above-mentioned steps S11, the application server going out according to first equipment is being executed When mouth ip determines privately owned ip and port numbers of second equipment in the local area network, comprising the following steps:
Step S21: the application server receives the applications client in second equipment uploads described second and sets Standby private ip and port numbers in the local area network, and by the private ip and the outlet IP of port numbers and second equipment Association saves.
Second equipment, such as TV box distribute to the second equipment private ip by router, together after accessing WiFi When the second equipment in for establishes communication connection port be one fixation port, the private that the second equipment distributes router There are the port numbers of IP and affiliated fixed port to be uploaded to application server 105, specifically, the second equipment will carry the private first There is the request message of IP and port numbers to be sent to router, sends and carry this in the packet header of the network packet of the request message and second set After router receives the network packet, its outlet IP of the second equipment is determined according to the private ip for standby private ip, will be determining Outlet IP, the private ip of the second equipment, port numbers are sent to application server, and application server is by the outlet IP of the second equipment As the key of record, the private ip and port numbers of the second equipment are stored under the key as one in list.Due to internet Middle outlet IP is by unified mechanism distribution and to buy, when could only in this way be routed in the whole network, therefore request to be sent to application server, Router oneself or operator are bound to switch to the private ip of the second equipment to export IP to be forwarded outward again, thus application server Outlet IP, private ip and the port numbers of the second equipment of router transmission can be obtained.
Step S22: existed according to corresponding second equipment of the corresponding outlet IP of the outlet IP of first equipment lookup Private ip and port numbers in the local area network.
The private ip of second equipment and port numbers are associated with preservation, and second with the outlet IP of the second equipment by application server Equipment and the first equipment outlet IP having the same, then application server is searched according to the outlet IP of the first equipment with identical Export the private ip and port numbers of the equipment of IP.
The application also proposes another example, to obtain the private ip and port numbers of the second equipment.As follows, the example The following steps are included:
Step S31: the graphical identification code of second equipment is scanned, second equipment is carried in the graphical identification code and exists Private ip and port numbers in the local area network, wherein when second equipment accesses the local area network, second equipment Applications client obtain the private ip of second equipment, and institute is generated according to the private ip of second equipment and port numbers State graphical identification code.
The application APP for being attached and communicating with the other equipment in local area network, the second equipment are installed in the second equipment Oneself the graphical identification code can be generated, can also be requested to application server, which is generated by application server Video identification code, be then forwarded to second equipment later.The url that the h5 page is carried in the graphical identification code, in the reality In example, second equipment privately owned ip in a local network and port numbers are carried in the url.Second equipment obtains the figure and knows After other code, after application APP starting in second equipment, this using showing the figure identification on the APP page Code, wherein this using the APP page and the graphical identification code by with the displaying of the equipment of second equipment management, such as by with electricity Depending on the associated television presentation of box.When first equipment is wanted to establish communication connection with second equipment, by having in the first equipment Graphical identification code described in the component scans of scanning function.
Step S32: it is privately owned in the local area network that second equipment is obtained by the parsing graphical identification code IP and port numbers.
As described in step S31, the url of the h5 page is carried in the graphical identification code, described second is carried in the url and sets Standby private ip and port numbers in a local network can obtain the url of the h5 page, according to this by parsing the graphical identification code Url can obtain second equipment private ip in a local network and port numbers.Wherein, which can be two dimension Code.
Step S33: where when getting private ip and port numbers of second equipment in the local area network, to The application server sends the page data request.
The url that the h5 page is carried in described image identification code, after the graphical identification code described in the mobile scanning terminal, solution The video identification code is analysed, the url is obtained, h5 page data is requested to application server according to the url of acquisition.
In some instances, the communication connecting method that the application proposes, further includes steps of
Step S41: second page is shown according to the page data, shows there is second equipment in the second page Mark.
After page processing module in first equipment receives the h5 page data, h5 pages is shown according to the page data Face.For example, in Fig. 3, when the user clicks after icon 301, h5 page data is requested to application server, and then according to receiving Page data show the h5 page as shown in Figure 4.In the h5 page shown in Fig. 4, displaying has with the first equipment with one The mark of the second equipment in local area network, in the h5 page shown in Fig. 4 there are 3 can be attached with the first equipment Two equipment, user click the mark of one of them the second equipment, to be attached with corresponding second equipment.Such as user clicks The mark 401 of equipment 1 in Fig. 4 is established with equipment 1 and is communicated to connect.The example corresponds under the same local area network with multiple The case where connectable device, for example, indoors, the media contents such as photo on mobile phone can be shown on smart television, it can also To be shown on other smart machines such as smart projector, at this point, in the second page of displaying show have it is attachable each The mark of equipment, for example, smart television, smart projector etc., user, which can according to need, connects different equipment, so as to go smoothly Media content on machine is shown on different smart machines.
Step S42: where described to establish first equipment and communication link of second equipment in the local area network Connecing includes: operation in response to the mark to second equipment, the logical code is executed, according to the institute of second equipment Private ip and port numbers are stated, establishes and communicates to connect with second equipment.
First equipment is executed when establishing communication connection with the second equipment by the logical code in the page data The connection, specifically, the port in the first equipment for establishing connection are a fixed port, are patrolled described in the execution of the first equipment Code is collected, connection request is sent according to the applications client of the privately owned ip and port numbers of second equipment into the second equipment, It simultaneously further include the privately owned ip and port numbers of the first equipment in the request, the applications client in the second equipment receives the company After connecing request, the socket between first equipment is established, connection is established.The logical code is with ws: the //side IP:port Applications client in formula and the second equipment carries out duplexing establishment of connection, and both sides can carry out duplex communication at this time.
In some instances, the communication connecting method that the application proposes, further includes steps of
By the communication connection of foundation, the chain of media content or media content in first equipment is received and sent To the applications client in second equipment, so that the applications client in second equipment sends the media content It is shown on to equipment associated with it, or media content is obtained according to the link of the media content, and the media content is sent out It is sent in equipment associated with it and shows.
It, can between the first equipment and the second equipment after the applications client in the first equipment and the second equipment establishes connection To carry out the transmission of data.For example, when the first equipment is mobile phone, the second equipment is the TV box period of the day from 11 p.m. to 1 a.m, wherein TV box and electricity Depending on association.Picture in mobile phone is sent to TV box by the connection of the foundation by mobile phone, and TV box is in turn by the figure Piece is shown on TV.When in the video ballot to TV for wanting to play on mobile phone, the url of the video is passed through institute by mobile phone The connection for stating foundation is sent to TV box, and TV box goes corresponding media server to obtain the view of the video according to the url Frequency stream plays out.After mobile phone and TV box establish communication connection, page figure as shown in Figure 5 is shown, user passes through a little Icon 501 is hit, selection will throw screen to the media content on TV, such as the picture on mobile phone, after user clicks an icon, It can also show that with input frame, user can input the link of a video in the input frame, be sent to the electricity for the link Depending on box, the TV box obtains the video according to the link, and then plays the video on TV.
Logical code in the page data of the h5 page supports websoocket Protocol Standard during executing communication Standard, the communication connecting method that the application proposes, extension devises its protocol header, to solve the transmission of various data.Agreement is such as Shown in the following table 1:
Table 1
Communication process after connection is established for the first equipment and the second equipment, comprising the following steps:
(1) handshake procedure: after a connection setup, the first equipment actively initiates order to the end app of the second equipment and is The request of 0x0001, the command list (CLIST) that oneself is supported (supporting if throwing picture in list to be 0x1001 as current) pass through and have built The app of the second equipment is submitted in vertical websocket connection.
(2) if the app of the second equipment supports the projection of picture type or the reception processing of picture file, list is returned In include 0x1001.
(3) first equipment carry out selecting workflow graph, and after the completion of selection, picture will be encoded with base64, by ordering 0x1001 It is sent to the second equipment app.
(5) second equipment app are received and successfully decoded is gives the return of 0x1002 order after picture, and are enclosed corresponding Return code.
The application also proposed a kind of communication connecting method, be applied to application server 105 shown in Fig. 1, such as Fig. 6 institute Show, comprising the following steps:
Step 601: receiving the first equipment when to establish connection with the second equipment in local area network, sent by wide area network Page data request.
When the first equipment 101 will be established with the second equipment 102 to be communicated to connect, the first equipment 101 is by wide area network to remote The application server request page data of journey, the wide area network can be internet.For example, when the first equipment 101 is that hand is mechanical, electrical The mobile terminals such as brain, PD, the second equipment 102 be the TV box period of the day from 11 p.m. to 1 a.m, by mobile terminal picture or video be sent to TV box Son, and then when carrying out large-size screen monitors viewing on TV, first mobile terminal are to application server request page data, the page data In include logical code for being attached and communicating with TV box.User can pass through multiple entry requests in movement The page data, and then according to the page data displayed page, which is the HTML5 page (h5) page, such as user can To input the website of the h5 page in a browser, thus to the page data of the application server request h5 page.In addition, user A wechat public platform can also be clicked in wechat, to the page data of the application server request h5 page, public affairs as shown in Figure 3 In crowd's page, public platform when the user clicks: when connecting the icon 301 of equipment, the page processing template in wechat takes to application Business device requests h5 page data.
For the process of specific page data request, the page processing template in the first equipment first asks page data Message is asked to be sent to router 103, when user requests h5 page data in such a way that browser inputs network address, at the page Reason template is browser, and when user requests h5 page data by the public platform in wechat, which is wechat In browser module.In the page data request message include the first equipment be private ip in a local network, wherein when first After equipment access to LAN, the first equipment private ip is distributed to by router.Router 103 is according to the private ip of first equipment Determine that the outlet IP of first equipment, router record the outlet IP and corresponding private ip of first equipment, Jin Ergen simultaneously The request message is sent to application server according to the outlet IP.
Step 602: in response to the page data request, being sent and the page by wide area network to first equipment The corresponding page data of request of data, so that first equipment obtains private ip of second equipment in the local area network And after port numbers, the logical code in the page data is executed, according to the private ip of second equipment and port Number, the communication connection in the local area network is established with second equipment.
Described in step as above, after page data request message is sent to application server by the first equipment, application service Page data corresponding with the request message is returned to routing 103 by device, the network packet of page data described in simultaneous transmission The outlet IP of first equipment is carried in packet header, after router receives the network packet, obtains going out for first equipment Mouth IP, while the corresponding relationship of the outlet IP and private ip according to record, determine the private ip of first equipment, and then basis The page data is sent to first equipment by the private ip of first equipment.Include in the page data to The logical code that second equipment is communicatively coupled.When establishing with the connection of the second equipment, the logical code is executed, according to the Two equipment private ip in a local network and port numbers establish the communication connection with the equipment.
Using communication connecting method provided by the present application, the first equipment (such as mobile terminal) in local will be set with second When standby (such as TV box) establishes connection, to by the media content in the first equipment throw screen to the second equipment is associated sets When showing on standby (such as TV), do not need additionally to install using APP, it is only necessary to open a h5 page, execute the h5 page Logical code in page data realizes the communication connection with the second equipment, and the h5 page supports websocket protocol mark Standard can realize duplex communication with the second equipment, and the communication connection established, volume of transmitted data are big.
In some instances, the communication connecting method that the application proposes, further includes steps of
Step S61: outlet IP, private ip and the port numbers for second equipment that receiving router is sent, wherein described When outlet IP is received the private ip and port numbers of the transmission of the applications client in second equipment by the router, It is determined according to the private ip.
Second equipment, such as TV box distribute to the second equipment private ip by router, together after accessing WiFi When the second equipment in for establishes communication connection port be one fixation port, the private that the second equipment distributes router There are the port numbers of IP and affiliated fixed port to be uploaded to application server 105, specifically, the second equipment will carry the private first There is the request message of IP and port numbers to be sent to router, sends and carry this in the packet header of the network packet of the request message and second set After router receives the network packet, its outlet IP of the second equipment is determined according to the private ip for standby private ip, will be determining Outlet IP, the private ip of the second equipment, port numbers are sent to application server, since internet middle outlet IP is by unified machine Structure distribution and purchase, when could only in this way be routed in the whole network, therefore request to be sent to application server, router oneself or operator It is bound to switch to the private ip of the second equipment to export IP and forward outward again, thus application server can obtain router transmission The second equipment outlet IP, private ip and port numbers.
Step S62: the outlet IP of second equipment is associated with preservation in the database with the private ip, port numbers.
By the outlet IP of the second equipment as the key of record, the private ip and port numbers of the second equipment are done application server For one in list, it is stored under the key.
It wherein, include the outlet IP of first equipment in the page data request, the method further includes:
Step S63: corresponding outlet IP corresponding the is searched in the database according to the outlet IP of first equipment Private ip and port numbers of two equipment in the local area network;In response to the page data request, by wide area network to described First equipment sends private ip and port numbers of second equipment in the local area network.
The private ip of second equipment and port numbers are associated with preservation, and second with the outlet IP of the second equipment by application server Equipment and the first equipment outlet IP having the same, then application server is searched according to the outlet IP of the first equipment with identical Export the private ip and port numbers of the second equipment of IP.And the second equipment privately owned ip in a local network and port numbers will be found Occur together with page data to the first equipment.
The application also proposes a kind of communication connecting method, applied to the application client in the second equipment 102 described in Fig. 1 End, as shown in fig. 7, comprises following steps:
Step 701: the private ip of the firstth equipment, port numbers being sent to by application server by wide area network, so that institute It states application server and is associated with first equipment private ip in a local network, port numbers with the outlet IP of first equipment It saves in the database, it, will be corresponding with the page data request in response to the page data request that second equipment is sent Page data, first equipment private ip in a local network, port numbers be sent to second equipment.
First equipment, such as TV box distribute to the first equipment private ip by router, together after accessing WiFi When the first equipment in for establishes communication connection port be one fixation port, the private that the first equipment distributes router There are the port numbers of IP and affiliated fixed port to be uploaded to application server 105, specifically, the first equipment will carry the private first There is the request message of IP and port numbers to be sent to router, sends and carry this in the packet header of the network packet of the request message and first set After router receives the network packet, its outlet IP of the first equipment is determined according to the private ip for standby private ip, will be determining Outlet IP, the private ip of the first equipment, port numbers are sent to application server, and application server is by the outlet IP of the first equipment As the key of record, the private ip and port numbers of the first equipment are stored under the key as one in list.Due to internet Middle outlet IP is by unified mechanism distribution and to buy, when could only in this way be routed in the whole network, therefore request to be sent to application server, Router oneself or operator are bound to switch to the private ip of the first equipment to export IP to be forwarded outward again, thus application server Outlet IP, private ip and the port numbers of the first equipment of router transmission can be obtained.
The private ip of first equipment and port numbers are associated with preservation, and first with the outlet IP of the first equipment by application server Equipment and the second equipment outlet IP having the same, then application server is searched according to the outlet IP of the second equipment with identical Export the private ip and port numbers of the first equipment of IP.And by first equipment found privately owned ip in a local network and Port numbers occur together with the page data to second equipment.
Step 702: receiving the connection request that second equipment is sent, establish with second equipment in the local area network In communication connection, wherein second equipment executes the logical code in the page data, is existed according to first equipment Private ip, port numbers in local area network send the connection request to first equipment.
Second equipment is executed when establishing communication connection with the first equipment by the logical code in the page data The connection, specifically, the port in the second equipment for establishing connection are a fixed port, are patrolled described in the execution of the second equipment Code is collected, connection request is sent according to the applications client of the privately owned ip and port numbers of first equipment into the first equipment, It simultaneously further include the privately owned ip and port numbers of the first equipment in the request, the applications client in the first equipment receives the company After connecing request, the socket between second equipment is established, connection is established.The logical code is with ws: the //side IP:port Applications client in formula and the first equipment carries out duplexing establishment of connection, and both sides can carry out duplex communication at this time.
Using communication connecting method provided by the present application, the second equipment (such as mobile terminal) in local will be set with first When standby (such as TV box) establishes connection, to by the media content in the second equipment throw screen to the first equipment is associated sets When showing on standby (such as TV), do not need additionally to install using APP, it is only necessary to open a h5 page, execute the h5 page Logical code in page data realizes the communication connection with the first equipment, and the h5 page supports websocket protocol mark Standard can realize duplex communication with the first equipment, and the communication connection established, volume of transmitted data are big.
The application also proposes a kind of communication connecting method, using the application client in the second equipment 102 shown in Fig. 1 End, as shown in figure 8, method includes the following steps:
Step 801: when the first equipment access to LAN, obtaining the private ip of second equipment.
When the first equipment accesses the local area network, there is router to distribute privately owned ip to first equipment, in the first equipment Port to be communicatively coupled with other equipment is a fixed port, and it is solid that the applications client in the first equipment obtains this The port numbers of fixed end mouthful and the privately owned ip of router distribution.
Step 802: obtaining graphical identification code according to the private ip of first equipment and port numbers and show, so that second Equipment scans the graphical identification code when to establish connection with first equipment in local area network, by parsing the figure Identification code obtains private ip and port numbers of first equipment in the local area network.
The application APP for being attached and communicating with the other equipment in local area network, the first equipment are installed in the first equipment Oneself the graphical identification code can be generated, can also be requested to application server, which is generated by application server Video identification code, be then forwarded to first equipment later.The url that the h5 page is carried in the graphical identification code, in the reality In example, first equipment privately owned ip in a local network and port numbers are carried in the url.First equipment obtains the figure and knows After other code, after application APP starting in first equipment, this using showing the figure identification on the APP page Code, wherein this using the APP page and the graphical identification code by being shown with the associated equipment of first equipment, such as by with electricity Depending on the associated television presentation of box.When second equipment is wanted to establish communication connection with first equipment, by having in the second equipment Graphical identification code described in the component scans of scanning function.After scanning the graphical identification code, by parsing the graphical identification code, obtain The url, and then the first equipment privately owned ip in a local network and port numbers are obtained according to the url.
Step 803: receiving the connection request that second equipment is sent, establish with second equipment in the local area network In communication connection, wherein second equipment execute to application server request page data in logical code, according to First equipment private ip in a local network, port numbers send the connection request to first equipment.
Second equipment is executed when establishing communication connection with the first equipment by the logical code in the page data The connection, specifically, the port in the second equipment for establishing connection are a fixed port, are patrolled described in the execution of the second equipment Code is collected, connection request is sent according to the applications client of the privately owned ip and port numbers of first equipment into the first equipment, It simultaneously further include the privately owned ip and port numbers of the first equipment in the request, the applications client in the first equipment receives the company After connecing request, the socket between second equipment is established, connection is established.The logical code is with ws: the //side IP:port Applications client in formula and the first equipment carries out duplexing establishment of connection, and both sides can carry out duplex communication at this time.
Using communication connecting method provided by the present application, the second equipment (such as mobile terminal) in local will be set with first When standby (such as TV box) establishes connection, to by the media content in the second equipment throw screen to the first equipment is associated sets When showing on standby (such as TV), do not need additionally to install using APP, it is only necessary to open a h5 page, execute the h5 page Logical code in page data realizes the communication connection with the first equipment, and the h5 page supports websocket protocol mark Standard can realize duplex communication with the first equipment, and the communication connection established, volume of transmitted data are big.
The application also proposes a kind of communication connecting system, comprising:
First equipment is sent out by wide area network to application server when to establish connection with the second equipment in local area network Send page data request;
The application server is sent out by the wide area network to first equipment in response to the page data request Send page data corresponding with the page data request;
First equipment, obtains the private ip and port numbers of second equipment in the local area network, described in execution Logical code in page data, with the private ip and port numbers according to second equipment in the local area network, with Second equipment establishes the communication connection in the local area network.
In some instances, first equipment obtains private ip and end of second equipment in the local area network Slogan includes:
Applications client in second equipment obtains described the when second equipment accesses the local area network The private ip of two equipment in a local network, and its private ip and port numbers in the local area network is sent to the application and is taken Business device;
The application server, by the outlet of the private ip of second equipment and port numbers and second equipment IP association saves in the database;
It wherein, include the outlet IP of first equipment in the page data request,
The application server, the outlet IP of the first equipment according to the page data request, in the data The corresponding private ip and port numbers for exporting corresponding second equipment of IP in the local area network is searched in library;
First equipment, receives the application server responses in the page data request, and described the second of transmission Private ip and port numbers of the equipment in the local area network.
In some instances, wherein first equipment obtains private ip of second equipment in the local area network And port numbers include:
Second equipment obtains second equipment in the office when second equipment accesses the local area network Private ip and port numbers in the net of domain;
Applications client in second equipment, generates the graphical identification code of second equipment and displaying;
First equipment scans the figure identification when to establish connection with second equipment in local area network Code obtains private ip and port numbers of second equipment in the local area network by parsing the graphical identification code.
In some instances, the communication connecting system that the application proposes further comprises:
First equipment, by the communication connection of foundation, by the media content or media in first equipment The link of content is sent to the applications client in second equipment,
Applications client in second equipment sends the media content in equipment associated with it and shows, Or media content is obtained according to the link of the media content, and send the media content in equipment associated with it and open up Show.
The communication connecting system that the application proposes, when first equipment is mobile phone, second equipment is TV box, It is described when by the second equipment of application server acquisition, private ip and port numbers carry out subsequent establishment of connection in a local network The interacting message figure of system is as shown in figure 9, mainly comprise the steps that
Step 901: its private ip and port numbers in a local network is sent to router by TV box.When TV box After access to LAN, by the private ip of router distribution TV box, the private ip and TV that TV box distributes router Router is sent to establish the port numbers of the port of communication connection with other equipment in box.
Step 902: router determines the outlet IP of the TV box according to the private ip of TV box.
Step 903: outlet IP, private ip and the port numbers of TV box are sent to long-range by router by internet Application server.
Step 904: the outlet IP of TV box is associated with private ip and port numbers and is stored in database by application server In.
Step 905: mobile phone sends page data request message to router, carries the mobile phone in local in the request message Private ip in net.
Step 906: router determines outlet IP according to the private ip of mobile phone, and save the outlet IP of the mobile phone with it is privately owned The mapping relations of IP.
Step 907: router requests h5 page data to application server, and the outlet of the mobile phone is carried in the request IP。
Step 908: application server according to the outlet IP of mobile phone search it is identical outlet IP TV box private ip and Port numbers.Page data corresponding with the page data request is searched simultaneously.
Step 909: the private ip and port numbers of page data and TV box are sent to router by application server.Hair The outlet IP of carrying mobile phone in the packet header in network sent
Step 910: router is according to the outlet IP of mobile phone, at the outlet IP of the mobile phone of preservation and corresponding private ip and end The private ip and port numbers that mobile phone is searched in slogan, according to the private ip and port numbers by the page data and TV box Privately owned ip and port numbers are sent to mobile phone.
Step 911: mobile phone executes the logical code in page data, according to the private ip of TV box and port numbers to electricity It is initiated the connection depending on box.
Step 912: after establishing connection, mobile phone is communicated with TV box, for example, by the picture in mobile phone be sent to Displaying on the associated TV of TV box.
The communication connecting system that the application proposes, when first equipment is mobile phone, second equipment is TV box, Graphical identification code by scanning TV box obtains TV box, and private ip and port numbers carry out subsequent company in a local network Connect when establishing, the interacting message figure of the system is as shown in Figure 10, mainly comprises the steps that
Step 1001: the APP in TV box shows the video identification code of the TV box, which can be Two dimensional code, the two dimensional code can be the APP and generate, and is also possible to the APP request application server, is given birth to by application server At, and return to the APP.The two dimensional code generated carries the url of the h5 page, which carries private ip and the end of TV box Slogan.After TV box access to LAN, by the private ip of router distribution TV box, in TV box to other The port that equipment establishes communication connection is a fixed port.
Step 1002: mobile phone scans the two dimensional code, parses the two dimensional code and obtains the url of the h5 page, while obtaining TV The private ip and port numbers of box.
Step 1003: mobile phone sends page data request message to router, carries the mobile phone in office in the request message Private ip in the net of domain.
Step 1004: router determines outlet IP according to the private ip of mobile phone, and save the outlet IP of the mobile phone with it is privately owned The mapping relations of IP.
Step 1005: router requests h5 page data to application server.
Step 1006: application server searches page data corresponding with the page data request.
Step 1007: page data is sent to router by application server.Hand is carried in packet header in the network of transmission The outlet IP of machine.
Step 1008: router according to the outlet IP of mobile phone, in the outlet IP of the mobile phone of preservation and corresponding private ip and The private ip and port numbers that mobile phone is searched in port numbers, are sent to hand for the page data according to the private ip and port numbers Machine.
Step 1009: mobile phone executes the logical code in page data, according to the private ip of TV box and port numbers to TV box initiates the connection.
Step 1010: after establishing connection, mobile phone is communicated with TV box, for example, sending the picture in mobile phone to With the displaying on the associated TV of TV box.
In some instances, the application also provides a kind of communication link 1100, applied to the page in the first equipment Processing module, as shown in figure 11, including
Page data request unit 1101, for being determined when the operation in response to the first page shown to the first equipment When establishing connection with the second equipment in local area network, page data request is sent to application server by wide area network;
Page data receiving unit 1102, for passing through application server responses described in the wide area network reception in the page The page data that face data request is sent;
Acquiring unit 1103, for obtaining private ip and port numbers of second equipment in the local area network;
Communication connection establishment unit 1104, for by executing the logical code in the page data, according to described the The private ip and port numbers of two equipment establish first equipment and communication of second equipment in the local area network Connection.
In some instances, wherein include the outlet IP of first equipment, the acquisition in the page data request Unit 1103, is used for:
Second equipment that the application server responses are sent in the page data request is received in the local Private ip and port numbers in net, wherein private ip and port numbers of second equipment in the local area network are answered by described It is determined with server according to the outlet IP of first equipment.
In some instances, the acquiring unit 1103, is used for:
The graphical identification code of second equipment is scanned, second equipment is carried in the graphical identification code in the local Private ip and port numbers in net, wherein when second equipment accesses the local area network, the application visitor of second equipment Family end obtains the private ip of second equipment, and generates the figure according to the private ip of second equipment and port numbers and know Other code;
Private ip and port of second equipment in the local area network are obtained by parsing the graphical identification code Number;
Wherein, when getting private ip and port numbers of second equipment in the local area network, to the application Server sends the page data request.
The application also provides a kind of communication link 1200, is applied to application server, as shown in figure 12, comprising:
Receiving unit 1201 passes through for receiving the first equipment when to establish connection with the second equipment in local area network The page data request that wide area network is sent;
Transmission unit 1202, for being sent to first equipment by wide area network in response to the page data request Page data corresponding with the page data request, so that first equipment obtains second equipment in the local area network In private ip and port numbers after, the logical code in the page data is executed, according to the private of second equipment There are IP and port numbers, establishes the communication connection in the local area network with second equipment.
The application also provides a kind of communication link 1300, is applied to the second equipment 102, as shown in figure 13, comprising:
Private ip, port numbers transmission unit 1301, for being sent out the private ip of the firstth equipment, port numbers by wide area network Application server is given, so that private ip, port numbers and institute of the application server by first equipment in a local network The outlet IP association for stating the first equipment saves in the database, will in response to the page data request that second equipment is sent Page data corresponding with the page data request, first equipment private ip in a local network, port numbers are sent to Second equipment;
First connection request receiving unit 1302, the connection request sent for receiving second equipment, with described the Two equipment establish the communication connection in the local area network, wherein second equipment executes the logic in the page data Code sends the connection request to first equipment according to first equipment private ip in a local network, port numbers.
The application also provides a kind of communication link 1400, is applied to the second equipment 102, as shown in figure 14, comprising:
Private ip obtains single 1401, for obtaining the private ip of second equipment when the first equipment access to LAN;
Graphical identification code acquiring unit 1402 is known for obtaining figure according to the private ip and port numbers of first equipment Other code is simultaneously shown, so that the second equipment scans the figure identification when to establish connection with first equipment in local area network Code obtains private ip and port numbers of first equipment in the local area network by parsing the graphical identification code;
Second connection request receiving unit 1403, the connection request sent for receiving second equipment, with described the Two equipment establish the communication connection in the local area network, wherein second equipment executes the page requested to application server Logical code in face data is sent out according to first equipment private ip in a local network, port numbers to first equipment Send the connection request.
The application also provides a kind of computer readable storage medium, is stored with computer-readable instruction, can make at least one A processor executes method as described above.
Figure 15 shows the composite structural diagram of the calculating equipment where communication link.As shown in figure 15, which sets Standby includes one or more processor (CPU) 1502, communication module 1504, memory 1506, user interface 1510, Yi Jiyong In the communication bus 1508 for interconnecting these components.
Processor 1502 can send and receive data by communication module 1504 to realize network communication and/or locally lead to Letter.
User interface 1510 includes one or more output equipments 1512 comprising one or more speakers and/or one A or multiple visual displays.User interface 1510 also includes one or more input equipments 1514 comprising such as, key Disk, mouse, voice command input unit or loudspeaker, touch screen displays, touch sensitive tablet, posture capture camera or other are defeated Enter button or control etc..
Memory 1506 can be high-speed random access memory, such as DRAM, SRAM, DDR RAM or other deposit at random Take solid storage device;Or nonvolatile memory, such as one or more disk storage equipments, optical disc memory apparatus, sudden strain of a muscle Deposit equipment or other non-volatile solid-state memory devices.
The executable instruction set of 1506 storage processor 1502 of memory, comprising:
Operating system 1516, including the journey for handling various basic system services and for executing hardware dependent tasks Sequence;
Using 1518, including the various application programs for communication connection, this application program can be realized above-mentioned each reality Process flow in example, for example may include unit or module some or all of in communication link.Communication link tipping At least one unit in each unit set can store machine-executable instruction.Processor 1502 is by executing memory Machine-executable instruction in 1506 in each unit at least one unit, and then can be realized in above-mentioned each unit or module The function of at least one module.
It should be noted that step and module not all in above-mentioned each process and each structure chart be all it is necessary, can To ignore certain steps or module according to the actual needs.Each step execution sequence be not it is fixed, can according to need into Row adjustment.The division of each module is intended merely to facilitate the division functionally that description uses, and in actual implementation, a module can It is realized with point by multiple modules, the function of multiple modules can also be realized by the same module, these modules can be located at same In a equipment, it can also be located in different equipment.
Hardware module in each embodiment can in hardware or hardware platform adds the mode of software to realize.Above-mentioned software Including machine readable instructions, it is stored in non-volatile memory medium.Therefore, each embodiment can also be presented as software product.
In each example, hardware can be by special hardware or the hardware realization of execution machine readable instructions.For example, hardware can be with Permanent circuit or logical device (such as application specific processor, such as FPGA or ASIC) specially to design are used to complete specifically to grasp Make.Hardware also may include programmable logic device or circuit by software provisional configuration (as included general processor or other Programmable processor) for executing specific operation.
In addition, each example of the application can pass through the data processor by data processing equipment such as computer execution To realize.Obviously, data processor constitutes the application.In addition, being commonly stored data processing in one storage medium Program is by directly reading out storage medium or the storage by program being installed or being copied to data processing equipment for program It is executed in equipment (such as hard disk and/or memory).Therefore, such storage medium also constitutes the application, and present invention also provides one Kind non-volatile memory medium, wherein being stored with data processor, this data processor can be used for executing in the application State any one of method example example.
The corresponding machine readable instructions of Figure 15 module can make operating system operated on computer etc. to complete to retouch here The some or all of operation stated.Non-volatile computer readable storage medium storing program for executing can be institute in the expansion board in insertion computer In the memory of setting or write the memory being arranged in the expanding element being connected to a computer.Be mounted on expansion board or CPU on expanding element etc. can be according to instruction execution part and whole practical operations.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of the present invention.

Claims (15)

1. a kind of communication connecting method, which is characterized in that applied to the page processing module in the first equipment, comprising:
When the operation of the first page in response to showing to the first equipment, determination will establish connection with the second equipment in local area network When, page data request is sent to application server by wide area network;
The page data sent by application server responses described in the wide area network reception in the page data request;
Obtain private ip and port numbers of second equipment in the local area network;
It is built by executing the logical code in the page data according to the private ip and port numbers of second equipment Found first equipment and communication connection of second equipment in the local area network.
2. according to the method described in claim 1, wherein, in the page data request including the outlet of first equipment IP;
The private ip that second equipment is obtained in the local area network and port numbers include:
Second equipment that the application server responses are sent in the page data request is received in the local area network Private ip and port numbers, wherein private ip and port numbers of second equipment in the local area network are taken by the application Business device is determined according to the outlet IP of first equipment.
3. the method according to claim 1, wherein described obtain second equipment in the local area network Private ip and port numbers include:
The graphical identification code of second equipment is scanned, second equipment is carried in the graphical identification code in the local area network Private ip and port numbers, wherein when second equipment access the local area network when, the applications client of second equipment The private ip of second equipment is obtained, and generates the figure according to the private ip of second equipment and port numbers and identifies Code;
Private ip and port numbers of second equipment in the local area network are obtained by parsing the graphical identification code;
Wherein, when getting private ip and port numbers of second equipment in the local area network, Xiang Suoshu application service Device sends the page data request.
4. according to the method described in claim 1, further comprising:
Second page is shown according to the page data, and the mark for having second equipment is shown in the second page;
Wherein, described to establish first equipment with communication connection of second equipment in the local area network and include:
In response to the operation of the mark to second equipment, the logical code is executed, according to second equipment Private ip and port numbers are established with second equipment and are communicated to connect.
5. according to the method described in claim 1, further comprising:
By the communication connection of foundation, the link of media content or media content in first equipment is sent to institute State the applications client in the second equipment so that the applications client in second equipment by the media content be sent to It is shown in associated equipment, or media content is obtained according to the link of the media content, and send the media content to It is shown in equipment associated with it.
6. a kind of communication connecting method characterized by comprising
The first equipment is received when to establish connection with the second equipment in local area network, is asked by the page data that wide area network is sent It asks;
It is corresponding with the page data request to first equipment transmission by wide area network in response to the page data request Page data so that first equipment obtain second equipment in the local area network private ip and port numbers after, The logical code in the page data is executed, with according to the private ip and port numbers of second equipment, with described Two equipment establish the communication connection in the local area network.
7. according to the method described in claim 6, further comprising:
Outlet IP, private ip and the port numbers for second equipment that receiving router is sent, wherein the outlet IP is by described When router receives the private ip and port numbers of the transmission of the applications client in second equipment, according to described privately owned IP and determine;
The outlet IP of second equipment is associated with preservation in the database with the private ip, port numbers;
It wherein, include the outlet IP of first equipment in the page data request, the method further includes:
Corresponding second equipment of corresponding outlet IP is searched in the database according to the outlet IP of first equipment described Private ip and port numbers in local area network;
In response to the page data request, second equipment is sent in the local to first equipment by wide area network Private ip and port numbers in net.
8. a kind of communication connecting system characterized by comprising
First equipment sends page to application server by wide area network when to establish connection with the second equipment in local area network Face data request;
The application server, in response to the page data request, by the wide area network to first equipment send with The corresponding page data of the page data request;
First equipment obtains private ip and port numbers of second equipment in the local area network, executes the page Logical code in data, it is and described with the private ip and port numbers according to second equipment in the local area network Second equipment establishes the communication connection in the local area network.
9. system according to claim 8, first equipment obtain private of second equipment in the local area network There is IP and port numbers include:
Applications client in second equipment obtains described second and sets when second equipment accesses the local area network Standby private ip in a local network, and its private ip and port numbers in the local area network is sent to the application service Device;
The application server closes the private ip of second equipment and the outlet IP of port numbers and second equipment UNPROFOR is deposited in the database;
It wherein, include the outlet IP of first equipment in the page data request,
The application server, the outlet IP of the first equipment according to the page data request, in the database Search the corresponding private ip and port numbers for exporting corresponding second equipment of IP in the local area network;
First equipment receives the application server responses in the page data request, second equipment of transmission Private ip and port numbers in the local area network.
10. system according to claim 8, wherein first equipment obtains second equipment in the local area network In private ip and port numbers include:
Second equipment obtains second equipment in the local area network when second equipment accesses the local area network In private ip and port numbers;
Applications client in second equipment, generates the graphical identification code of second equipment and displaying;
First equipment scans the graphical identification code when to establish connection with second equipment in local area network, leads to It crosses and parses the graphical identification code and obtain private ip and port numbers of second equipment in the local area network.
11. a kind of communication link characterized by comprising
Page data request unit, for when the operation in response to the first page shown to the first equipment and determination is wanted and local When the second equipment in net establishes connection, page data request is sent to application server by wide area network;
Page data receiving unit, for being asked by application server responses described in the wide area network reception in the page data Seek the page data of transmission;
Acquiring unit, for obtaining private ip and port numbers of second equipment in the local area network;
Communication connection establishment unit, for passing through the logical code executed in the page data, according to second equipment The private ip and port numbers establish first equipment and communication connection of second equipment in the local area network.
12. device according to claim 11, wherein include the outlet of first equipment in the page data request IP, the acquiring unit, is used for:
Second equipment that the application server responses are sent in the page data request is received in the local area network Private ip and port numbers, wherein private ip and port numbers of second equipment in the local area network are taken by the application Business device is determined according to the outlet IP of first equipment.
13. device according to claim 11, which is characterized in that the acquiring unit is used for:
The graphical identification code of second equipment is scanned, second equipment is carried in the graphical identification code in the local area network Private ip and port numbers, wherein when second equipment access the local area network when, the applications client of second equipment The private ip of second equipment is obtained, and generates the figure according to the private ip of second equipment and port numbers and identifies Code;
Private ip and port numbers of second equipment in the local area network are obtained by parsing the graphical identification code;
Wherein, when getting private ip and port numbers of second equipment in the local area network, Xiang Suoshu application service Device sends the page data request.
14. a kind of communication link characterized by comprising
Receiving unit is sent out for receiving the first equipment when to establish connection with the second equipment in local area network by wide area network The page data request sent;
Transmission unit, for being sent and the page to first equipment by wide area network in response to the page data request Face data requests corresponding page data, so as to obtain second equipment privately owned in the local area network for first equipment After IP and port numbers, the logical code in the page data is executed, according to the private ip of second equipment and end Slogan establishes the communication connection in the local area network with second equipment.
15. a kind of computer readable storage medium, is stored with computer-readable instruction, at least one processor can be made to execute such as The described in any item methods of claim 1-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 true CN109474646A (en) 2019-03-15
CN109474646B 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)

Cited By (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
CN113645308A (en) * 2021-08-18 2021-11-12 平安普惠企业管理有限公司 Mobile terminal TCP communication, device, equipment and storage medium
CN116708532A (en) * 2023-08-03 2023-09-05 腾讯科技(深圳)有限公司 Local area network connection method, device, computer equipment and readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140325091A1 (en) * 2011-12-19 2014-10-30 Samsung Electronics Co., Ltd. Method and apparatus for dynamic policy interworking between pcrf and nat
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
CN105122288A (en) * 2013-02-28 2015-12-02 Lg电子株式会社 Apparatus and method for processing a multimedia commerce service
CN105657055A (en) * 2016-03-07 2016-06-08 北京视信互动科技有限公司 Local area network equipment finding method and device oriented to WEB page
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
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

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140325091A1 (en) * 2011-12-19 2014-10-30 Samsung Electronics Co., Ltd. Method and apparatus for dynamic policy interworking between pcrf and nat
CN105122288A (en) * 2013-02-28 2015-12-02 Lg电子株式会社 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
CN105657055A (en) * 2016-03-07 2016-06-08 北京视信互动科技有限公司 Local area network equipment finding method and device oriented to WEB page
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
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

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
码农突围: ""Super Video,一款直播、点播、投屏并有的APP"", 《HTTPS://BLOG.CSDN.NET/HEJJUNLIN/ARTICLE/DETAILS/53006176》 *

Cited By (6)

* 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
CN113645308A (en) * 2021-08-18 2021-11-12 平安普惠企业管理有限公司 Mobile terminal TCP communication, device, equipment and storage medium
CN113645308B (en) * 2021-08-18 2022-09-16 平安普惠企业管理有限公司 Mobile terminal TCP communication, device, equipment and storage medium
CN116708532A (en) * 2023-08-03 2023-09-05 腾讯科技(深圳)有限公司 Local area network connection method, device, computer equipment and readable storage medium
CN116708532B (en) * 2023-08-03 2023-10-20 腾讯科技(深圳)有限公司 Local area network connection method, device, computer equipment and readable storage medium

Also Published As

Publication number Publication date
CN109474646B (en) 2021-10-19

Similar Documents

Publication Publication Date Title
US8819549B2 (en) Method and system for mutidimensional virtual online support center
CN109474646A (en) Communication connecting method, device, system and storage medium
JP4944940B2 (en) Media information sharing system and media information sharing method
US9092462B2 (en) Method, apparatus, and system for processing media resource playlist in local area network
CN101946493A (en) Method and system for providing connectivity between clients connected to the internet
US9172594B1 (en) IPv6 to web architecture
US20130080560A1 (en) System and Method for Sharing Digital Data on a Presenter Device to a Plurality of Participant Devices
EP3026844B1 (en) Apparatus, system, and method of selecting relay device in conferencing system, and carrier medium
US10757195B2 (en) Device interconnection and service discovery via a communication cloud
JP5359998B2 (en) Information processing system, information processing method, and information processing program
JP2015211474A (en) Method for opening communication path using relay server active connection for mobile terminal
CN109963171A (en) Transmitting of Multi-media Information method, transmission device and storage medium
CN106850384A (en) A kind of method and mobile terminal for realizing accessing equipment in LAN
CN106572382A (en) Multi-screen interaction method and system and extensible messaging and presence protocol (XMPP) system
EP2421226A1 (en) Method of p2p video communication implemented on web page
WO2014172968A1 (en) Method for carrying out multi-screen interaction through social network
EP2879363A1 (en) Apparatus, system, and method of managing counterpart terminal information, and carrier medium
US20110067070A1 (en) Display apparatus and driving method thereof
CN102572603B (en) A kind of for providing the method and apparatus of interactive message request for video user
CN102222096B (en) Method and device for providing multi-media resource access service
EP2854368B1 (en) Transmission management system, management method, and carrier means
EP3029933B1 (en) Apparatus, system, and method of controlling session, and carrier means
WO2015003455A1 (en) Method for conducting multi-screen interaction over social network
US20070239827A1 (en) Global chat system
JP6471058B2 (en) Web access method, program, terminal, and system for transmitting management identifier unique to household using Web browser

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