CN115665084A - Screen projection method and device - Google Patents

Screen projection method and device Download PDF

Info

Publication number
CN115665084A
CN115665084A CN202211679730.XA CN202211679730A CN115665084A CN 115665084 A CN115665084 A CN 115665084A CN 202211679730 A CN202211679730 A CN 202211679730A CN 115665084 A CN115665084 A CN 115665084A
Authority
CN
China
Prior art keywords
upnp
hgu
message
response
equipment
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
CN202211679730.XA
Other languages
Chinese (zh)
Other versions
CN115665084B (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.)
Wuhan Yangtze Optical Technology Co ltd
Original Assignee
Wuhan Yangtze Optical Technology 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 Wuhan Yangtze Optical Technology Co ltd filed Critical Wuhan Yangtze Optical Technology Co ltd
Priority to CN202211679730.XA priority Critical patent/CN115665084B/en
Publication of CN115665084A publication Critical patent/CN115665084A/en
Application granted granted Critical
Publication of CN115665084B publication Critical patent/CN115665084B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the invention discloses a screen projection method and a screen projection device, wherein the method comprises the following steps: by carrying out network address conversion on the UPNP message and the response UPNP message, information interaction between the first HGU and the second HGU is realized, and the target HGU and the target second equipment are determined from the second HGU, so that the UPNP message is prevented from being exposed in an external network, the safety of the first equipment is improved, and the effectiveness of the determination of the target HGU and the target second equipment is improved. And the information interaction between the first HGU and the target HGU is realized by carrying out network address conversion on the UPNP control message and the response UPNP control message, and finally, the cross-HGU screen projection between the first equipment and the target second equipment can be realized.

Description

Screen projection method and device
Technical Field
The invention relates to the technical field of screen projection, in particular to a screen projection method and device.
Background
In order to meet broadband requirements, some users may set multiple HGUs in a single user home or in other use environments, and different devices may be hung under different HGUs.
Disclosure of Invention
The invention mainly aims to provide a screen projection method and a screen projection device, which can solve the problem that the cross-HGU screen projection cannot be realized in a DLNA (digital living network alliance) mode based on UPNP (unified Power network processor) in the prior art.
In order to achieve the above object, a first aspect of the present invention provides a screen projection method, where the method is applied to a first HGU, where the first HGU is an HGU that hangs down a first device, and the first device is a device that initiates screen projection, and the method includes:
receiving a UPNP message sent by the first equipment, performing network address conversion on the UPNP message to obtain a first UPNP message, and forwarding the first UPNP message to a second HGU through an OLT PON; the second HGU is used for authenticating the first UPNP message, if the first UPNP message passes the authentication, the first UPNP message is sent to second equipment, response UPNP message of the second equipment responding to the first UPNP message is received, network address conversion is carried out on the response UPNP message, a first response UPNP message is obtained, and the first response UPNP message is forwarded to the first HGU through the OLT PON; the second HGU is hung under the same OLT PON port as the first HGU, and the second equipment is hung under the second HGU;
authenticating the first response UPNP message, if the first response UPNP message passes the authentication, performing network address conversion on the first response UPNP message to obtain a second response UPNP message, and sending the second response UPNP message to the first equipment; the first equipment is used for generating a second equipment list which can be connected with the first equipment by utilizing the received second response UPNP message and displaying the second equipment list on a page, so that a user can select and receive target second equipment which is projected by the first equipment;
receiving a UPNP control message generated when the first equipment initiates screen projection, wherein the UPNP control message comprises the target second equipment selected by a user, carrying out network address conversion on the UPNP control message to obtain a first UPNP control message, and forwarding the first UPNP control message to a target HGU (hybrid head management unit) hanging the target second equipment through an OLT (optical line terminal) PON (passive optical network); the target HGU is used for carrying out network address conversion on the first UPNP control message to obtain a second UPNP control message, sending the second UPNP control message to the target second equipment, receiving a response UPNP control message obtained by responding to the second UPNP control message from the target second equipment, carrying out network address conversion on the response UPNP control message to obtain a first response UPNP control message, and sending the first response UPNP control message to the first HGU;
and performing network address conversion on the first response UPNP control message to obtain a target response UPNP control message, and sending the target response UPNP control message to the first equipment to realize screen projection.
With reference to the first aspect, in a possible implementation manner, the performing network address translation on the first response UPNP packet includes:
and converting the destination address of the first response UPNP message from the WAN IP and the port of the first HGU into the IP address and the port of the first equipment.
With reference to the first aspect, in a possible implementation manner, the performing network address translation on the UPNP control packet includes:
and converting the source address of the UPNP control message from the IP address and the port of the first equipment into the WAN IP and the port of the first HGU.
With reference to the first aspect, in a possible implementation manner, the performing network address translation on the first response UPNP control packet includes:
and converting the destination address of the first response UPNP control message from the WAN IP and the port of the first HGU into the IP address and the port of the first equipment.
In order to achieve the above object, a second aspect of the present invention provides a screen-casting method, where the method is applied to a second HGU, the second HGU is an HGU that is hooked at the same OLT PON port as the first HGU, the first HGU is an HGU that is hooked with a first device, and the first device is a device that initiates screen casting, where the method includes:
authenticating a first UPNP message, wherein the first UPNP message is obtained by a first HGU after network address conversion is carried out on the received UPNP message, the UPNP message is sent by first equipment hung under the first HGU, the first UPNP message is forwarded and received by an OLT PON, and the first HGU and a second HGU are hung under the same OLT PON port;
if the authentication is passed, the first UPNP message is sent to second equipment hung under the second HGU; the second equipment is used for responding to the first UPNP message, obtaining a response UPNP message and sending the response UPNP message to a second HGU;
receiving the response UPNP message, performing network address conversion on the response UPNP message to obtain a first response UPNP message, and sending the first response UPNP message to the first HGU; the first HGU is used for authenticating the first response UPNP message, if the authentication is passed, network address conversion is carried out on the first response UPNP message to obtain a second response UPNP message, the second response UPNP message is sent to the first equipment, the first equipment is used for generating a second equipment list which can be connected with the first equipment by using the received second response UPNP message and displaying the second equipment list on a page so that a user can select and receive target second equipment which is subjected to screen projection by the first equipment, the first HGU is used for receiving a UPNP control message generated when the screen projection is initiated by the first equipment after the user selects the target second equipment, network address conversion is carried out on the UPNP control message to obtain a first UPNP control message, and the first UPNP control message is forwarded to the target HGU through the OLT; the target HGU is an HGU of a second device hanging the target;
if the target HGU is the target HGU, performing network address conversion on the first UPNP control message to obtain a second UPNP control message, and forwarding the second UPNP control message to target second equipment;
receiving a response UPNP control message obtained by the target second equipment responding to the second UPNP control message, carrying out network address conversion on the response UPNP control message to obtain a first response UPNP control message, and sending the first response UPNP control message to the first HGU; and the first HGU is used for carrying out network address conversion on the first response UPNP control message to obtain a target response UPNP control message, and sending the target response UPNP control message to the first equipment so as to realize screen projection.
With reference to the second aspect, in a possible implementation manner, the performing network address translation on the response UPNP packet includes:
and converting the source address of the response UPNP message from the IP address and the port of the second equipment into the WAN IP and the port of the second HGU.
With reference to the second aspect, in a possible implementation manner, the performing network address translation on the first UPNP control packet includes:
and converting the destination address of the first UPNP control message from the WAN IP and the port of the second HGU into the WAN IP and the port of the target second equipment.
With reference to the second aspect, in a possible implementation manner, the performing network address translation on the response UPNP control packet includes:
and converting the source address of the response UPNP control message from the WAN IP and the port of the target second equipment into the WAN IP and the port of the second HGU.
To achieve the above object, a third aspect of the present invention provides a projection apparatus applied to a first HGU, the apparatus comprising:
a first module: the first device is used for receiving the UPNP message sent by the first device, performing network address conversion on the UPNP message to obtain a first UPNP message, and forwarding the first UPNP message to a second HGU through an OLT PON; the second HGU is used for authenticating the first UPNP message, if the first UPNP message passes the authentication, the first UPNP message is sent to second equipment, response UPNP message of the second equipment responding to the first UPNP message is received, network address conversion is carried out on the response UPNP message, a first response UPNP message is obtained, and the first response UPNP message is forwarded to the first HGU through the OLT PON; the second HGU is an HGU hung under the same OLT PON port with the first HGU, and the second equipment is hung under the second HGU;
a second module: the network address conversion module is used for authenticating the first response UPNP message, if the first response UPNP message passes the authentication, performing network address conversion on the first response UPNP message to obtain a second response UPNP message, and sending the second response UPNP message to the first equipment; the first equipment is used for generating a second equipment list which can be connected with the first equipment by utilizing the received second response UPNP message and displaying the second equipment list on a page, so that a user can select and receive target second equipment which is projected by the first equipment;
a third module: the device comprises a first device, a target HGU and a second device, wherein the target HGU is used for receiving a UPNP control message generated when the first device initiates screen projection, the UPNP control message comprises the target second device selected by a user, the network address conversion is carried out on the UPNP control message to obtain a first UPNP control message, and the first UPNP control message is forwarded to the target HGU hanging the target second device through a PON OLT; the target HGU is used for carrying out network address conversion on the first UPNP control message to obtain a second UPNP control message, sending the second UPNP control message to the target second equipment, receiving a response UPNP control message obtained by responding to the second UPNP control message from the target second equipment, carrying out network address conversion on the response UPNP control message to obtain a first response UPNP control message, and sending the first response UPNP control message to the first HGU;
a fourth module: and the network address conversion module is used for carrying out network address conversion on the first response UPNP control message to obtain a target response UPNP control message, and sending the target response UPNP control message to the first equipment so as to realize screen projection.
In order to achieve the above object, a fourth aspect of the present invention provides a screen projection apparatus applied to a second HGU, the apparatus comprising:
an authentication module: the device comprises a first HGU, a second HGU, a first device, a second device and a third HGU, wherein the first HGU is used for authenticating a first UPNP message, the first UPNP message is obtained by the network address conversion of the received UPNP message by the first HGU, the UPNP message is sent by the first device hung under the first HGU, the first UPNP message is forwarded and received by an OLT PON, and the first HGU is an HGU hung under the same OLT PON port with the second HGU;
a sending module: the first UPNP message is sent to a second device hung under the second HGU if the authentication is passed; the second device is used for responding to the first UPNP message, obtaining a response UPNP message and sending the response UPNP message to a second HGU;
a receiving and sending module: the first HGU is used for receiving the response UPNP message, carrying out network address conversion on the response UPNP message to obtain a first response UPNP message and sending the first response UPNP message to the first HGU; the first HGU is used for authenticating the first response UPNP message, if the authentication is passed, network address conversion is carried out on the first response UPNP message to obtain a second response UPNP message, the second response UPNP message is sent to the first equipment, the first equipment is used for generating a second equipment list which can be connected with the first equipment by using the received second response UPNP message and displaying the second equipment list on a page so that a user can select and receive target second equipment which is subjected to screen projection by the first equipment, the first HGU is used for receiving a UPNP control message generated when the screen projection is initiated by the first equipment after the user selects the target second equipment, network address conversion is carried out on the UPNP control message to obtain a first UPNP control message, and the first UPNP control message is forwarded to the target HGU through the OLT; the target HGU is an HGU of a second device with a target hanging down;
the conversion and forwarding module: if the target HGU is the target HGU, the network address conversion is carried out on the first UPNP control message to obtain a second UPNP control message, and the second UPNP control message is forwarded to target second equipment;
a receiving and forwarding module: the network address conversion module is used for receiving a response UPNP control message obtained by the target second equipment responding to the second UPNP control message, carrying out network address conversion on the response UPNP control message to obtain a first response UPNP control message, and sending the first response UPNP control message to the first HGU; and the first HGU is used for carrying out network address conversion on the first response UPNP control message to obtain a target response UPNP control message, and sending the target response UPNP control message to the first equipment so as to realize screen projection.
To achieve the above object, a third aspect of the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the aforementioned method.
To achieve the above object, a fourth aspect of the present invention provides a computer device comprising a memory and a processor, the memory storing a computer program, the computer program, when executed by the processor, causing the processor to perform the steps of the aforementioned method.
The embodiment of the invention has the following beneficial effects:
1) The information interaction between the first HGU and the target HGU is realized by carrying out network address conversion on the UPNP control message and the response UPNP control message, and finally, the cross-HGU screen projection between the first device and the target second device can be realized.
2) The information interaction between the first HGU and the second HGU is realized by carrying out network address conversion on the UPNP message and the response UPNP message, the target HGU and the target second equipment are determined from the second HGU, the UPNP message is prevented from being exposed in an external network, the safety of the first equipment is improved, the effectiveness determined by the target HGU and the target second equipment is improved, in addition, the safety of the information interaction between the first HGU and the second HGU is ensured by authenticating the UPNP message.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Wherein:
FIG. 1 is a schematic flow chart illustrating a screen projection method according to an embodiment of the present invention;
fig. 2 is a block diagram illustrating a screen projecting apparatus for applying a screen projecting method to a first HGU according to an embodiment of the present invention;
fig. 3 is a block diagram illustrating a screen projecting apparatus for applying a screen projecting method to a second HGU according to an embodiment of the present invention;
fig. 4 is a block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to solve the problem of screen projection between different HGU underhung devices, the invention provides a UPNP PROXY module at the HGU side, and the screen projection between the different HGU underhung devices is realized by adopting a UPNP PROXY DLNA mode. It should be noted that the present invention is more suitable for the situation that different HGUs in the same virtual domain of the FTTR are all hung on the same PON port of the OLT. When the initiating screen projection equipment and the receiving screen projection equipment are under the same HGU, screen projection is realized according to the existing UPNP DLNA mode, and when the initiating screen projection equipment and the receiving screen projection equipment are not under the same HGU, screen projection is realized by adopting UPNP PROXY DLNA.
The invention provides a screen projection method, which comprises a discovery phase and a control phase, wherein the discovery phase refers to that a screen projection device searches for connectable screen projection receiving devices hung under other HGUs in an FTTR domain, and the control phase refers to that a screen projection device and a screen projection receiving device perform screen projection.
Referring to fig. 1, fig. 1 is a schematic flowchart of a screen projection method according to an embodiment of the present invention, and as shown in fig. 1, the method is as follows.
First, the communication flow of the discovery phase is introduced:
and step S101, the first HGU receives the UPNP message sent by the first equipment, carries out network address conversion on the UPNP message to obtain a first UPNP message, and forwards the first UPNP message to the second HGU through the OLT PON.
The first HGU is an HGU for hanging a first device, the first device is a device for initiating screen projection, such as a mobile phone, and the second HGU is an HGU hung under the same OLT PON port with the first HGU.
A first device, which is hung down on a LAN side or a WIFI side of a first HGU, initiates a UPNP request, and the first HGU receives a UPNP message, where the first device, which is hung down on the first HGU, allocates an internal IP, that is, an IP address and a port of the first device, and since a destination address of the UPNP message is unknown at this time, in this embodiment, the Destination Address (DA) of the UPNP message adopts a multicast address and a port, and a Source Address (SA) is the IP address and the port of the first device. Because the IP address of the first device is an internal IP and cannot be exposed outside the first HGU, the UPNP PROXY module of the first HGU converts the SA of the UPNP packet from the IP address and port of the first device to the WAN IP and port of the first HGU through NAT (network address translation) for implementing mapping translation between the internal IP + port and the external IP + port, obtains the first UPNP packet, and forwards the first UPNP packet to the second HGU in the FTTR domain in the format of the UPNP PROXY packet. It should be noted that different HGUs are hung under the same OLT PON port and are respectively assigned with different WAN IPs and ports. In addition, in order to ensure that the UPNP PROXY message can be forwarded between HGU WANs under the same PON port, the OLT needs to turn on the P2P function of the PON.
It should be noted that, in the embodiment of the present invention, the first HGU is to send the first UPNP message to the second HGU in the FTTR domain, but in a normal situation, when the first HGU broadcasts the first UPNP message, the first UPNP message may be forwarded to other HGUs except for the FTTR domain, but this may cause the first device to be exposed in the external network, and may cause a potential safety hazard and interfere with the HGUs outside the FTTR domain, for example, a mobile phone may search for a television device in a home and may search for a television device of another person, so to avoid this, in this embodiment, the OLT sets an ACL, controls the first UPNP message not to enter the external network through the uplink port, and only exposes the first device in a virtual domain of the FTTR and may not be exposed in the external network, so that the first UPNP message is forwarded to the second HGU in the FTTR domain.
And step S102, the second HGU authenticates the first UPNP message, if the first UPNP message passes the authentication, the first UPNP message is sent to the second equipment, the second equipment responds to the first UPNP message to obtain a response UPNP message, and the response UPNP message is sent to the second HGU.
When the first UPNP packet reaches the second HGU, the second HGU authenticates the first UPNP packet, specifically, to ensure the security of the first UPNP packet, authentication information is added to the first UPNP packet, and specifically, when the HGU in the FTTR comes on line, the OLT may configure authentication information for the HGU, where the authentication information includes a domain name and a password, and when the first HGU forwards the first UPNP packet, the first UPNP packet is made to carry the authentication information of the first HGU. When the first HGU forwards the first UPNP message to the second HGU, the second HGU checks whether the domain name and the password of the first UPNP message are correct, if so, the authentication is passed, and if not, the authentication is not passed. And if the authentication is passed, the second HGU receives the first UPNP message and sends the first UPNP message to the second device hung under the second HGU.
And if the second equipment responds to the first UPNP message, obtaining a response UPNP message, wherein DA of the response UPNP message is WAN IP and a port of the first HGU, SA of the response UPNP message is an IP address and a port of the second equipment, and if the second equipment responds to the first UPNP message, the second equipment sends the response UPNP message to the second HGU.
Step S103, the second HGU receives the response UPNP message, carries out network address conversion on the response UPNP message to obtain a first response UPNP message, and sends the first response UPNP message to the first HGU.
Similarly, since the IP address of the second device is an internal IP and cannot be exposed outside the second HGU, the UPNP PROXY module of the second HGU converts the SA responding to the UPNP packet from the IP address and port of the second device to the WAN IP and port of the second HGU through NAT (network address translation), obtains a first responding UPNP packet, and forwards the first responding UPNP packet to the first hgpon u through the second layer of the OLT.
And step S104, the first HGU authenticates the first response UPNP message, if the first response UPNP message passes the authentication, the first response UPNP message is subjected to network address conversion to obtain a second response UPNP message, the second response UPNP message is sent to the first equipment, and the first equipment is used for generating a second equipment list which can be connected with the first equipment by using the received second response UPNP message and displaying the second equipment list on a page so that a user can select and receive a target second equipment which is projected by the first equipment.
In order to further improve the security, after receiving the first response UPNP message, the UPNP PROXY module of the first HGU checks the domain name and the password of the first response UPNP message to authenticate the first response UPNP message, and if the authentication is passed, the DA of the first response UPNP message is converted from the WAN IP and the port of the first HGU to the IP address and the port of the first device through the NAT to obtain a second response UPNP message, and the second response UPNP message is sent to the first device, the first device generates a second device list connectable to the first device by using the received second response UPNP message and displays the second device list on a page, and a user can select a target second device by operating on the first device.
After the target second device is determined, the first device may perform screen projection on the target second device, and the steps of the control stage are specifically described as follows:
step S105, the first HGU receives a UPNP control message generated when the first device initiates screen projection, carries out network address conversion on the UPNP control message to obtain a first UPNP control message, and forwards the first UPNP control message to a target HGU hanging the target second device through the OLT PON.
And the target HGU is an HGU of the second equipment hanging the target.
When the UPNP control message reaches the first HGU, the UPNP PROXY module of the first HGU converts the SA of the UPNP control message from the IP address and the port of the first device to the WAN IP and the port of the first HGU through NAT (network address translation) to obtain the first UPNP control message, and forwards the first UPNP control message to the target HGU through the second layer of the OLT PON.
And step S106, the target HGU carries out network address conversion on the first UPNP control message to obtain a second UPNP control message, and the second UPNP control message is forwarded to the target second equipment.
And if the second HGU is the target HGU, the DA of the first UPNP control message is converted into the IP address and the port of the target second equipment from the WAN IP and the port of the second HGU through the NAT to obtain a second UPNP control message, and the second UPNP control message is forwarded to the target second equipment which is hung down. In a possible implementation manner, in order to further ensure the security of the target HGU, after the first UPNP control packet reaches the UPNP PROXY module of the target HGU, the UPNP PROXY module first checks the domain name and the password of the first UPNP control packet, authenticates the first UPNP control packet, and after the authentication is passed, performs subsequent operations such as network address conversion on the first UPNP control packet.
Step S107, the target HGU receives a response UPNP control message obtained by the target second equipment responding to the second UPNP control message, carries out network address conversion on the response UPNP control message to obtain a first response UPNP control message, and sends the first response UPNP control message to the first HGU.
And the target second equipment responds to the second UPNP control message to obtain a response UPNP control message, wherein DA of the response UPNP control message is WAN IP and a port of the first HGU, SA of the response UPNP control message is an IP address and a port of the target second equipment, and the response UPNP control message is sent to the target HGU. And the UPNP PROXY module of the target HGU converts the SA responding to the UPNP control message from the IP address and the port of the target second equipment to the WAN IP and the port of the target HGU through NAT (network address translation) to obtain a first response UPNP control message, and forwards the first response UPNP control message to the first HGU through the second layer of the OLT PON.
And step S108, the first HGU carries out network address conversion on the first response UPNP control message to obtain a target response UPNP control message, and sends the target response UPNP control message to the first equipment so as to realize screen projection.
And the first HGU converts the DA of the first response UPNP control message from the WAN IP and the port of the first HGU into the IP address and the port of the first equipment through the NAT to obtain a target response UPNP control message, and sends the target response UPNP control message to the first equipment, so that screen projection can be realized. In a possible implementation manner, in order to further ensure the security of the first HGU, after the first response UPNP control packet reaches the UPNP PROXY module of the first HGU, the UPNP PROXY module checks the domain name and the password of the first response UPNP control packet to authenticate the first response UPNP control packet, and after the authentication is passed, the subsequent operations such as network address conversion and the like on the first response UPNP control packet are executed.
Based on the method, the information interaction between the first HGU and the second HGU is realized by carrying out network address conversion on the UPNP message and the response UPNP message, and the target HGU and the target second equipment are determined from the second HGU, so that the UPNP message is prevented from being exposed in an external network, the safety of the first equipment is improved, and the effectiveness of the determination of the target HGU and the target second equipment is improved. And the information interaction between the first HGU and the target HGU is realized by carrying out network address conversion on the UPNP control message and the response UPNP control message, and finally, the cross-HGU screen projection between the first equipment and the target second equipment can be realized. In addition, subsequent operation is executed after the UPNP message is authenticated, the safety of information interaction is improved, and the effectiveness of screen projection is ensured.
In order to better implement the method, the embodiment of the present invention provides a screen projecting apparatus applied to a first HGU and a screen projecting apparatus applied to a second HGU.
Referring to fig. 2, fig. 2 is a block diagram illustrating a projection apparatus applied to a first HGU, wherein the apparatus 20 includes:
the first module 201: the device is used for receiving the UPNP message sent by the first equipment, performing network address conversion on the UPNP message to obtain a first UPNP message, and forwarding the first UPNP message to a second HGU through an OLT PON; the second HGU is used for authenticating the first UPNP message, if the first UPNP message passes the authentication, the first UPNP message is sent to second equipment, response UPNP messages of the second equipment responding to the first UPNP message are received, network address conversion is carried out on the response UPNP messages, first response UPNP messages are obtained, and the first response UPNP messages are forwarded to the first HGU through the OLT PON; the second HGU is an HGU hung under the same OLT PON port as the first HGU, and the second device is a device hung under the second HGU.
The second module 202: the network address conversion module is used for authenticating the first response UPNP message, if the first response UPNP message passes the authentication, performing network address conversion on the first response UPNP message to obtain a second response UPNP message, and sending the second response UPNP message to the first equipment; the first device is used for generating a second device list which can be connected with the first device by utilizing the received second response UPNP message and displaying the second device list on a page, so that a user can select and receive a target second device which is projected by the first device.
The third module 203: the UPNP control message comprises a target second device selected by a user, the network address conversion is carried out on the UPNP control message to obtain a first UPNP control message, and the first UPNP control message is forwarded to a target HGU (hybrid head-mounted unit) hanging the target second device under through an OLT (optical line terminal) PON (passive optical network); the target HGU is used for carrying out network address conversion on the first UPNP control message to obtain a second UPNP control message, sending the second UPNP control message to the target second equipment, receiving a response UPNP control message obtained by the target second equipment responding to the second UPNP control message, carrying out network address conversion on the response UPNP control message to obtain a first response UPNP control message, and sending the first response UPNP control message to the first HGU.
The fourth module 204: and the network address conversion module is used for carrying out network address conversion on the first response UPNP control message to obtain a target response UPNP control message, and sending the target response UPNP control message to the first equipment so as to realize screen projection.
In a possible design, the second module 202 is specifically configured to: and converting the destination address of the first response UPNP message from the WAN IP and the port of the first HGU into the IP address and the port of the first equipment.
In a possible design, the second module 203 is specifically configured to: and converting the source address of the UPNP control message from the IP address and the port of the first equipment into the WAN IP and the port of the first HGU.
In a possible design, the second module 204 is specifically configured to: and converting the destination address of the first response UPNP control message from the WAN IP and the port of the first HGU into the IP address and the port of the first equipment.
Referring to fig. 3, fig. 3 is a block diagram of a screen projection apparatus applied to a second HGU, and the apparatus 30 includes:
the authentication module 301: the device comprises a first HGU, a second HGU, a first device connected with the first HGU, a second device connected with the second HGU and a third device connected with the second device, wherein the first device is used for carrying out network address conversion on the received UPNP message, the UPNP message is obtained by the first HGU after carrying out network address conversion on the UPNP message, the UPNP message is sent by the first device connected with the second HGU, the first UPNP message is forwarded and received by an OLT PON, and the first HGU and the second HGU are connected with the same OLT PON port.
The sending module 302: the first UPNP message is sent to a second device hung under the second HGU if the authentication is passed; and the second equipment is used for responding to the first UPNP message, obtaining a response UPNP message and sending the response UPNP message to the second HGU.
The receiving and sending module 303: the first HGU is used for receiving the response UPNP message, carrying out network address conversion on the response UPNP message to obtain a first response UPNP message and sending the first response UPNP message to the first HGU; the first HGU is used for authenticating the first response UPNP message, if the authentication is passed, network address conversion is carried out on the first response UPNP message to obtain a second response UPNP message, the second response UPNP message is sent to the first equipment, the first equipment is used for generating a second equipment list which can be connected with the first equipment by using the received second response UPNP message and displaying the second equipment list on a page so that a user can select and receive target second equipment which is subjected to screen projection by the first equipment, the first HGU is used for receiving a UPNP control message generated when the screen projection is initiated by the first equipment after the user selects the target second equipment, network address conversion is carried out on the UPNP control message to obtain a first UPNP control message, and the first UPNP control message is forwarded to the target HGU through the OLT; and the target HGU is an HGU of the second equipment with the target hanging down.
The conversion and forwarding module 304: and if the target HGU is detected, the network address conversion is carried out on the first UPNP control message to obtain a second UPNP control message, and the second UPNP control message is forwarded to the target second equipment.
The receiving and forwarding module 305: the device is used for receiving a response UPNP control message obtained by the target second equipment responding to a second UPNP control message, carrying out network address conversion on the response UPNP control message to obtain a first response UPNP control message, and sending the first response UPNP control message to the first HGU; and the first HGU is used for carrying out network address conversion on the first response UPNP control message to obtain a target response UPNP control message, and sending the target response UPNP control message to the first equipment so as to realize screen projection.
In a possible design, the receiving and sending module 303 is specifically configured to: and converting the source address of the response UPNP message from the IP address and the port of the second equipment into the WAN IP and the port of the second HGU.
In a possible design, the conversion forwarding module 304 is specifically configured to: and converting the destination address of the first UPNP control message from the WAN IP and the port of the second HGU into the WAN IP and the port of the target second equipment.
In a possible design, the receiving and forwarding module 305 is specifically configured to: and converting the source address of the response UPNP control message from the WAN IP and the port of the target second equipment into the WAN IP and the port of the second HGU.
Based on the device, information interaction between the first HGU and the second HGU is realized by carrying out network address conversion on the UPNP message and the response UPNP message, and the target HGU and the target second equipment are determined from the second HGU, so that the UPNP message is prevented from being exposed in an external network, the safety of the first equipment is improved, and the effectiveness determined by the target HGU and the target second equipment is improved. The information interaction between the first HGU and the target HGU is realized by carrying out network address conversion on the UPNP control message and the response UPNP control message, and finally, the cross-HGU screen projection between the first device and the target second device can be realized. In addition, subsequent operation is executed after the UPNP message is authenticated, the safety of information interaction is improved, and the effectiveness of screen projection is ensured.
FIG. 4 is a diagram illustrating an internal structure of a computer device in one embodiment. The computer device may specifically be a terminal, and may also be a server. As shown in fig. 4, the computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program which, when executed by the processor, causes the processor to carry out all the steps of the above method. The internal memory may also have stored therein a computer program that, when executed by the processor, causes the processor to perform all of the steps of the above-described method. Those skilled in the art will appreciate that the architecture shown in fig. 4 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In an embodiment, a computer device is proposed, comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the individual steps of the aforementioned method.
In an embodiment, a computer-readable storage medium is proposed, in which a computer program is stored which, when being executed by a processor, causes the processor to carry out the individual steps of the aforementioned method.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by a computer program, which may be stored in a non-volatile computer readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, and these are all within the scope of protection of the present application. Therefore, the protection scope of the present patent application shall be subject to the appended claims.

Claims (10)

1. A screen projection method is applied to a first HGU, wherein the first HGU is an HGU for hanging down a first device, and the first device is a device for initiating screen projection, and the method comprises the following steps:
receiving a UPNP message sent by the first equipment, carrying out network address conversion on the UPNP message to obtain a first UPNP message, and forwarding the first UPNP message to a second HGU through an OLT PON; the second HGU is used for authenticating the first UPNP message, if the first UPNP message passes the authentication, the first UPNP message is sent to second equipment, response UPNP messages of the second equipment responding to the first UPNP message are received, network address conversion is carried out on the response UPNP messages, first response UPNP messages are obtained, and the first response UPNP messages are forwarded to the first HGU through the OLT PON; the second HGU is an HGU hung under the same OLT PON port with the first HGU, and the second equipment is hung under the second HGU;
authenticating the first response UPNP message, if the first response UPNP message passes the authentication, performing network address conversion on the first response UPNP message to obtain a second response UPNP message, and sending the second response UPNP message to the first equipment; the first equipment is used for generating a second equipment list which can be connected with the first equipment by utilizing the received second response UPNP message and displaying the second equipment list on a page, so that a user can select and receive target second equipment which is projected by the first equipment;
receiving a UPNP control message generated when the first equipment initiates screen projection, wherein the UPNP control message comprises the target second equipment selected by a user, carrying out network address conversion on the UPNP control message to obtain a first UPNP control message, and forwarding the first UPNP control message to a target HGU (hybrid head management unit) hanging the target second equipment through an OLT (optical line terminal) PON (passive optical network); the target HGU is used for carrying out network address conversion on the first UPNP control message to obtain a second UPNP control message, sending the second UPNP control message to the target second equipment, receiving a response UPNP control message obtained by responding to the second UPNP control message from the target second equipment, carrying out network address conversion on the response UPNP control message to obtain a first response UPNP control message, and sending the first response UPNP control message to the first HGU;
and performing network address conversion on the first response UPNP control message to obtain a target response UPNP control message, and sending the target response UPNP control message to the first equipment to realize screen projection.
2. The method according to claim 1, wherein said performing network address translation on said first response UPNP packet comprises:
and converting the destination address of the first response UPNP message from the WAN IP and the port of the first HGU into the IP address and the port of the first equipment.
3. The method of claim 1, wherein the performing network address translation on the UPNP control packet comprises:
and converting the source address of the UPNP control message from the IP address and the port of the first equipment into the WAN IP and the port of the first HGU.
4. The method according to claim 1, wherein the performing network address translation on the first response UPNP control message comprises:
and converting the destination address of the first response UPNP control message from the WAN IP and the port of the first HGU into the IP address and the port of the first equipment.
5. A screen-casting method is applied to a second HGU, the second HGU is an HGU which is hung under the same OLT PON port with a first HGU, the first HGU is an HGU which is hung under first equipment, and the first equipment is equipment which initiates screen casting, and the method comprises the following steps:
authenticating a first UPNP message, wherein the first UPNP message is obtained by a first HGU after network address conversion is carried out on the received UPNP message, the UPNP message is sent by first equipment hung under the first HGU, the first UPNP message is forwarded and received by an OLT PON, and the first HGU and a second HGU are hung under the same OLT PON port;
if the authentication is passed, the first UPNP message is sent to second equipment hung under the second HGU; the second device is used for responding to the first UPNP message, obtaining a response UPNP message and sending the response UPNP message to a second HGU;
receiving the response UPNP message, performing network address conversion on the response UPNP message to obtain a first response UPNP message, and sending the first response UPNP message to the first HGU; the first HGU is used for authenticating the first response UPNP message, if the authentication is passed, network address conversion is carried out on the first response UPNP message to obtain a second response UPNP message, the second response UPNP message is sent to the first equipment, the first equipment is used for generating a second equipment list which can be connected with the first equipment by using the received second response UPNP message and displaying the second equipment list on a page so that a user can select and receive target second equipment which is subjected to screen projection by the first equipment, the first HGU is used for receiving a UPNP control message generated when the screen projection is initiated by the first equipment after the user selects the target second equipment, network address conversion is carried out on the UPNP control message to obtain a first UPNP control message, and the first UPNP control message is forwarded to the target HGU through the OLT; the target HGU is an HGU of a second device with a target hanging down;
if the target HGU is the target HGU, performing network address conversion on the first UPNP control message to obtain a second UPNP control message, and forwarding the second UPNP control message to target second equipment;
receiving a response UPNP control message obtained by the target second equipment responding to the second UPNP control message, carrying out network address conversion on the response UPNP control message to obtain a first response UPNP control message, and sending the first response UPNP control message to the first HGU; and the first HGU is used for carrying out network address conversion on the first response UPNP control message to obtain a target response UPNP control message, and sending the target response UPNP control message to the first equipment so as to realize screen projection.
6. The method according to claim 5, wherein the performing network address translation on the response UPNP packet comprises:
and converting the source address of the response UPNP message from the IP address and the port of the second equipment into the WAN IP and the port of the second HGU.
7. The method of claim 5, wherein the performing network address translation on the first UPNP control packet comprises:
and converting the destination address of the first UPNP control message from the WAN IP and the port of the second HGU into the WAN IP and the port of the target second equipment.
8. The method according to claim 5, wherein the performing network address translation on the response UPNP control packet comprises:
and converting the source address of the response UPNP control message from the WAN IP and the port of the target second equipment into the WAN IP and the port of the second HGU.
9. A screen projection device applied to a first HGU, the device comprising:
a first module: the device is used for receiving the UPNP message sent by the first equipment, performing network address conversion on the UPNP message to obtain a first UPNP message, and forwarding the first UPNP message to a second HGU through an OLT PON; the second HGU is used for authenticating the first UPNP message, if the first UPNP message passes the authentication, the first UPNP message is sent to second equipment, response UPNP messages of the second equipment responding to the first UPNP message are received, network address conversion is carried out on the response UPNP messages, first response UPNP messages are obtained, and the first response UPNP messages are forwarded to the first HGU through the OLT PON; the second HGU is an HGU hung under the same OLT PON port with the first HGU, and the second equipment is hung under the second HGU;
a second module: the network address conversion module is used for authenticating the first response UPNP message, if the first response UPNP message passes the authentication, performing network address conversion on the first response UPNP message to obtain a second response UPNP message, and sending the second response UPNP message to the first equipment; the first equipment is used for generating a second equipment list which can be connected with the first equipment by utilizing the received second response UPNP message and displaying the second equipment list on a page, so that a user can select and receive target second equipment which is projected by the first equipment;
a third module: the device comprises a first device, a target HGU and a second device, wherein the target HGU is used for receiving a UPNP control message generated when the first device initiates screen projection, the UPNP control message comprises the target second device selected by a user, the network address conversion is carried out on the UPNP control message to obtain a first UPNP control message, and the first UPNP control message is forwarded to the target HGU hanging the target second device through a PON OLT; the target HGU is used for carrying out network address conversion on the first UPNP control message to obtain a second UPNP control message, sending the second UPNP control message to the target second equipment, receiving a response UPNP control message obtained by responding to the second UPNP control message from the target second equipment, carrying out network address conversion on the response UPNP control message to obtain a first response UPNP control message, and sending the first response UPNP control message to the first HGU;
a fourth module: and the network address conversion module is used for carrying out network address conversion on the first response UPNP control message to obtain a target response UPNP control message, and sending the target response UPNP control message to the first equipment so as to realize screen projection.
10. A screen projection apparatus applied to a second HGU, the apparatus comprising:
an authentication module: the device comprises a first HGU, a second HGU, a first device, a second device and a third HGU, wherein the first HGU is used for authenticating a first UPNP message, the first UPNP message is obtained by the network address conversion of the received UPNP message by the first HGU, the UPNP message is sent by the first device hung under the first HGU, the first UPNP message is forwarded and received by an OLT PON, and the first HGU is an HGU hung under the same OLT PON port with the second HGU;
a sending module: the first UPNP message is sent to a second device hung under the second HGU if the authentication is passed; the second device is used for responding to the first UPNP message, obtaining a response UPNP message and sending the response UPNP message to a second HGU;
a receiving and sending module: the first HGU is used for receiving the response UPNP message, carrying out network address conversion on the response UPNP message to obtain a first response UPNP message and sending the first response UPNP message to the first HGU; the first HGU is used for authenticating the first response UPNP message, if the authentication is passed, network address conversion is carried out on the first response UPNP message to obtain a second response UPNP message, the second response UPNP message is sent to the first equipment, the first equipment is used for generating a second equipment list which can be connected with the first equipment by using the received second response UPNP message and displaying the second equipment list on a page so that a user can select and receive target second equipment which is subjected to screen projection by the first equipment, the first HGU is used for receiving a UPNP control message generated when the screen projection is initiated by the first equipment after the user selects the target second equipment, network address conversion is carried out on the UPNP control message to obtain a first UPNP control message, and the first UPNP control message is forwarded to the target HGU through the OLT; the target HGU is an HGU of a second device with a target hanging down;
the conversion forwarding module: if the target HGU is the target HGU, the network address conversion is carried out on the first UPNP control message to obtain a second UPNP control message, and the second UPNP control message is forwarded to target second equipment;
a receiving and forwarding module: the device is used for receiving a response UPNP control message obtained by the target second equipment responding to a second UPNP control message, carrying out network address conversion on the response UPNP control message to obtain a first response UPNP control message, and sending the first response UPNP control message to the first HGU; and the first HGU is used for carrying out network address conversion on the first response UPNP control message to obtain a target response UPNP control message, and sending the target response UPNP control message to the first equipment so as to realize screen projection.
CN202211679730.XA 2022-12-27 2022-12-27 Screen projection method and device Active CN115665084B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211679730.XA CN115665084B (en) 2022-12-27 2022-12-27 Screen projection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211679730.XA CN115665084B (en) 2022-12-27 2022-12-27 Screen projection method and device

Publications (2)

Publication Number Publication Date
CN115665084A true CN115665084A (en) 2023-01-31
CN115665084B CN115665084B (en) 2023-04-07

Family

ID=85022824

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211679730.XA Active CN115665084B (en) 2022-12-27 2022-12-27 Screen projection method and device

Country Status (1)

Country Link
CN (1) CN115665084B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20050058942A (en) * 2003-12-13 2005-06-17 엘지전자 주식회사 Wireless visual system based universal plug and play protocol and control method thereof
JP2010239746A (en) * 2009-03-31 2010-10-21 Softbank Bb Corp Remote device, and power supply control method
WO2012113460A1 (en) * 2011-02-25 2012-08-30 Ennova Research S.R.L. Method and system for combining more than one content data to a single resulting media and making this resulting media available to a content directory service (upnp) or digital media server (dlna)
US20150006742A1 (en) * 2013-07-01 2015-01-01 Echostar Technologies L.L.C. Live non-av content over a dlna network
CN108184174A (en) * 2017-12-29 2018-06-19 武汉长光科技有限公司 A kind of method of self-defined OAM under EPON system
CN110086782A (en) * 2019-03-29 2019-08-02 岭博科技(北京)有限公司 The method and electronic equipment of a kind of hotel's Internet of Things intelligent control system and intelligent control device
US20200193854A1 (en) * 2018-12-18 2020-06-18 Cantab Tecnología S. de R.L. de C.V. Virtual reality training method for developing soft skills
CN111427527A (en) * 2020-03-20 2020-07-17 海信视像科技股份有限公司 Screen projection method, device, equipment and computer readable storage medium
CN114401429A (en) * 2022-01-14 2022-04-26 烽火通信科技股份有限公司 Remote screen projection method and electronic equipment
CN114885193A (en) * 2022-03-30 2022-08-09 海信视像科技股份有限公司 Display device, terminal device and screen projection method

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20050058942A (en) * 2003-12-13 2005-06-17 엘지전자 주식회사 Wireless visual system based universal plug and play protocol and control method thereof
JP2010239746A (en) * 2009-03-31 2010-10-21 Softbank Bb Corp Remote device, and power supply control method
WO2012113460A1 (en) * 2011-02-25 2012-08-30 Ennova Research S.R.L. Method and system for combining more than one content data to a single resulting media and making this resulting media available to a content directory service (upnp) or digital media server (dlna)
US20150006742A1 (en) * 2013-07-01 2015-01-01 Echostar Technologies L.L.C. Live non-av content over a dlna network
CN108184174A (en) * 2017-12-29 2018-06-19 武汉长光科技有限公司 A kind of method of self-defined OAM under EPON system
US20200193854A1 (en) * 2018-12-18 2020-06-18 Cantab Tecnología S. de R.L. de C.V. Virtual reality training method for developing soft skills
CN110086782A (en) * 2019-03-29 2019-08-02 岭博科技(北京)有限公司 The method and electronic equipment of a kind of hotel's Internet of Things intelligent control system and intelligent control device
CN111427527A (en) * 2020-03-20 2020-07-17 海信视像科技股份有限公司 Screen projection method, device, equipment and computer readable storage medium
CN114401429A (en) * 2022-01-14 2022-04-26 烽火通信科技股份有限公司 Remote screen projection method and electronic equipment
CN114885193A (en) * 2022-03-30 2022-08-09 海信视像科技股份有限公司 Display device, terminal device and screen projection method

Also Published As

Publication number Publication date
CN115665084B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
US11165604B2 (en) Method and system used by terminal to connect to virtual private network, and related device
CN110800331A (en) Network verification method, related equipment and system
CN109688100B (en) NAT (network Address translation) penetration method, device, equipment and storage medium
US8806608B2 (en) Authentication server and method for controlling mobile communication terminal access to virtual private network
US20120311660A1 (en) SYSTEM AND METHOD FOR MANAGING IPv6 ADDRESS AND ACCESS POLICY
US8555347B2 (en) Dynamic host configuration protocol (DHCP) authentication using challenge handshake authentication protocol (CHAP) challenge
WO2022247751A1 (en) Method, system and apparatus for remotely accessing application, device, and storage medium
US11265244B2 (en) Data transmission method, PNF SDN controller, VNF SDN controller, and data transmission system
JP2003289340A (en) Identifier inquiry method, communication terminal and network system
KR20110060895A (en) A method and a gateway for providing multiple internet access
CN113518348A (en) Service processing method, device, system and storage medium
CN110769482B (en) Method and device for network connection of wireless equipment and wireless router equipment
CN112242996A (en) Intelligent gateway control method and device and readable storage medium
CN112039905A (en) Network communication method and device based on reverse connection, electronic equipment and medium
CN112492004B (en) Method, device, system and storage medium for establishing local communication link
CN101572645A (en) Method for establishing tunnel and device thereof
JP4028421B2 (en) Voice communication gate device address management method, management device, and program
CN115665084B (en) Screen projection method and device
CN114884771B (en) Identity network construction method, device and system based on zero trust concept
JP4965499B2 (en) Authentication system, authentication device, communication setting device, and authentication method
CN115278373B (en) Internet television networking method and system
WO2013034100A2 (en) Communications system and method for terminals based on different network protocols
CN113938293A (en) VPN network sharing method, storage medium and terminal device
CN113765916B (en) IPTV multicast control method, system, computer equipment and storage medium
JP7276960B2 (en) Relay device, relay method and relay program

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