CN111314477A - P2P communication method, system, home gateway, electronic device and storage medium - Google Patents

P2P communication method, system, home gateway, electronic device and storage medium Download PDF

Info

Publication number
CN111314477A
CN111314477A CN202010113319.0A CN202010113319A CN111314477A CN 111314477 A CN111314477 A CN 111314477A CN 202010113319 A CN202010113319 A CN 202010113319A CN 111314477 A CN111314477 A CN 111314477A
Authority
CN
China
Prior art keywords
node
home gateway
public network
communication
network address
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.)
Pending
Application number
CN202010113319.0A
Other languages
Chinese (zh)
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.)
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information 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 China Mobile Communications Group Co Ltd, China Mobile Hangzhou Information Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202010113319.0A priority Critical patent/CN111314477A/en
Publication of CN111314477A publication Critical patent/CN111314477A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • 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

Landscapes

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

Abstract

The invention relates to the field of communication, and discloses a P2P communication method, a system, a home gateway, electronic equipment and a storage medium. In the invention, the P2P communication method is applied to the home gateway, and comprises the following steps: receiving query request information of a first node requesting to connect a second node; inquiring the port number and the public network address of the second node according to the inquiry request information; the port numbers and public network addresses of the first node and the second node are pre-stored in the home gateway; and sending the queried port number and public network address of the second node to the first node so that the first node can establish a P2P communication connection with the second node. The scheme can improve the safety of the business data in P2P communication and improve the diversification of the business data.

Description

P2P communication method, system, home gateway, electronic device and storage medium
Technical Field
The present invention relates to the field of communications, and in particular, to a P2P communication method, system, home gateway, electronic device, and storage medium.
Background
The server is an important device in the network, however, once a large amount of service requests are sent to the server, the server is easily paralyzed, so that all users cannot obtain service responses. To address this issue, the P2P communication model, i.e., peer-to-peer or peer-to-peer communication, has emerged. In the P2P model, participants of the network, both service providers and resource acquirers, share a portion of the resources they own.
The inventor finds that some existing P2P communication modes are unidirectional communication, and information interaction between participants cannot be well realized; in addition, the existing P2P communication model is more suitable for business services, such as data transmission services in business are more closely coupled with server logic, and ordinary users cannot effectively control data transmission when performing P2P communication by using business software.
Disclosure of Invention
The invention aims to provide a P2P communication method, a system, a home gateway, an electronic device and a storage medium, so that the data security of P2P communication is higher, and the diversification of data services is realized.
In order to solve the above technical problem, an embodiment of the present invention provides a P2P communication method applied to a home gateway, including: receiving query request information of a first node requesting to connect a second node; inquiring the port number and the public network address of the second node according to the inquiry request information; the port numbers and public network addresses of the first node and the second node are pre-stored in the home gateway; and sending the queried port number and public network address of the second node to the first node so that the first node can establish a P2P communication connection with the second node.
The embodiment of the invention also provides a P2P communication method, which is applied to a first node and comprises the following steps: sending query request information for connecting a second node to the home gateway; receiving a port number and a public network address of a second node sent by a home gateway; the port numbers and public network addresses of the first node and the second node are pre-stored in the home gateway; and establishing P2P communication connection with the second node according to the port number and the public network address of the second node.
An embodiment of the present invention further provides a home gateway, including: the receiving module is used for receiving query request information of a first node requesting to connect a second node; the query module is used for querying the port number and the public network address of the second node according to the query request information; the port numbers and public network addresses of the first node and the second node are pre-stored in the home gateway; and the sending module is used for sending the inquired port number and public network address of the second node to the first node so that the first node can establish P2P communication connection with the second node.
An embodiment of the present invention further provides a P2P communication system, including: a first node, a second node and a home gateway in the P2P communication method as described above; the first node and the second node are both in communication connection with the home gateway.
An embodiment of the present invention further provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the volatile memory stores instructions executable by the at least one processor to enable the at least one processor to perform the above-described P2P communication method applied to the home gateway or the above-described P2P communication method applied to the first node.
An embodiment of the present invention also provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the above-described P2P communication method applied to a home gateway or the above-described P2P communication method applied to a first node.
Compared with the prior art, the embodiment of the invention has the advantages that the home gateway replaces a server in the prior art, and stores the public network addresses and the port numbers of the first node and the second node which pass through the authentication of the home gateway, so that the information related to the first node and the second node is prevented from being acquired by a third-party server, and the information safety of a user of the home gateway can be ensured. (ii) a And the home gateway sends the public network address and the port number of the second node to the first node according to the query request information sent by the first node, so that the first node and the second node can establish P2P communication connection. Different from the existing special service area with single service, the home gateway does not limit the type of data service, thereby realizing the diversification of the data service; the data of the first node and the second node are not forwarded through the server, so that the safety and confidentiality of data transmission can be realized; because the home gateway stores the public network addresses of the first node and the second node, the first node and the second node are exposed in the public network and are not blocked by the middleware any more, and therefore, the two-way communication can be realized.
In addition, before receiving the query request information that the first node requests to connect to the second node, the method further includes: authenticating the first node and the second node according to authentication request messages sent by the first node and the second node; after the first node and the second node are authenticated, the port numbers and the public network addresses of the first node and the second node which pass the authentication are stored. Therefore, the port numbers and the public network addresses of the first node and the second node, which can be obtained by the home gateway, are used for the subsequent P2P communication connection of the first node and the second node.
In addition, an authentication request message sent by the first node is generated according to a public network address and a port number of a home gateway which are configured in the first node in advance; and the authentication request message sent by the second node is generated according to the public network address and the port number of the home gateway which is pre-configured in the second node. Thereby, the first node and the second node can transmit the authentication request information to the home gateway.
In addition, after the authentication of the first node and the second node is completed, the method further comprises: storing the communication protocols of the first node and the second node which pass the authentication; before sending the port number and the public network address of the second node to the first node, the method further comprises the following steps: and feeding back the communication protocol of the second node to the first node so that the first node establishes the P2P communication connection with the second node according to the communication protocol of the second node. Therefore, the first node can establish P2P communication connection with the second node according to the communication protocol of the second node, and the success rate of establishing connection is improved.
Drawings
Fig. 1 is a schematic structural diagram of a P2P communication method in the prior art;
fig. 2 is a flowchart of a P2P communication method according to a first embodiment of the present invention;
fig. 3 is a topology diagram of a P2P communication method according to a first embodiment of the present invention;
fig. 4 is an interaction flowchart of a P2P communication method according to a first embodiment of the present invention;
fig. 5 is a flowchart of a P2P communication method according to a second embodiment of the present invention;
fig. 6 is a schematic structural diagram of a home gateway provided according to a third embodiment of the present invention;
fig. 7 is a schematic structural diagram of a P2P communication system according to a fourth embodiment of the present invention;
fig. 8 is a block diagram of an electronic apparatus provided in accordance with a fifth embodiment of the present invention.
Detailed Description
Fig. 1 shows a schematic structural diagram of a P2P communication method in the prior art, in order for a first node 104 to establish a P2P communication connection with a second node 105, a router 102 needs to be disposed at the first node 104, and a router 103 needs to be disposed at the second node 105, for mapping public network addresses and port numbers of the first node 104 and the second node 105 to a server 101, and then the server forwards the public network address and port number of the first node 104 to the second node 105, and forwards the public network address and port number of the second node 105 to the first node 104, thereby implementing the P2P communication connection between the first node 104 and the second node 105. An important core module in the P2P communication method is the server 103, however, the server in the prior art is tightly coupled with the business data transmission service, and if some applications only share files, the common user cannot effectively control data transmission when using business software to perform P2P communication.
In addition, when the first node side does not have a router, the communication is unidirectional, that is, the first node can access the data of the second node, but the second node cannot access the data of the first node, so that the user requirements cannot be well met.
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention will be described in detail with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that in various embodiments of the invention, numerous technical details are set forth in order to provide a better understanding of the present application. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments. The following embodiments are divided for convenience of description, and should not constitute any limitation to the specific implementation manner of the present invention, and the embodiments may be mutually incorporated and referred to without contradiction.
The first embodiment of the invention relates to a P2P communication method, which is applied to a home gateway and comprises the following steps: receiving query request information of a first node requesting to connect a second node; inquiring the port number and the public network address of the second node according to the inquiry request information; the port numbers and public network addresses of the first node and the second node are pre-stored in the home gateway; and sending the queried port number and public network address of the second node to the first node so that the first node can establish a P2P communication connection with the second node.
The following describes the implementation details of the P2P communication method of the present embodiment, and the following is only provided for the convenience of understanding and is not necessary for implementing the present embodiment.
A specific flow of the P2P communication method in this embodiment is shown in fig. 2, and specifically includes:
step 201, receiving query request information of a first node requesting to connect to a second node.
The first node sends query request information for requesting to connect the second node to the home gateway, and the home gateway receives the query request information. The first node and the second node can be devices such as a mobile phone, a computer, a telephone watch, a household robot, an electric cooker or a television.
Specifically, a certain application software is installed on the first node, or a certain website is logged in; and then sends query request information requesting connection to the second node to the home gateway through the application software or the web address.
In this embodiment, before receiving query request information that a first node requests to connect to a second node, the method further includes: authenticating the first node and the second node according to authentication request messages sent by the first node and the second node; after finishing the authentication of the first node and the second node, the home gateway stores the port numbers and the public network addresses of the first node and the second node which pass the authentication.
The first node can send a message to the home gateway only through authentication of the home gateway; similarly, the second node which the first node requests to connect to can be queried by the home gateway after passing the authentication of the home gateway. In other words, both the first node and the second node performing P2P communication connection must pass authentication of the home gateway to realize P2P communication by using the home gateway.
Specifically, the first node and the second node send authentication information to the home gateway, and the home gateway authenticates the first node and the second node according to the authentication request messages sent by the first node and the second node. After finishing the authentication of the first node and the second node, the home gateway acquires the port numbers and the public network addresses of the first node and the second node according to authentication request messages sent by the first node and the second node, and stores the port numbers and the public network addresses of the first node and the second node.
Further, the authentication request message sent by the first node is generated according to the public network address and the port number of the home gateway pre-configured in the first node; and the authentication request message sent by the second node is generated according to the public network address and the port number of the home gateway which is pre-configured in the second node.
The first node and the second node are configured with the public network address and the port number of the home gateway in advance, so that the first node and the second node can send an authentication request message to the home gateway according to the public network address and the port number of the home gateway.
Step 202, inquiring the port number and the public network address of the second node according to the inquiry request information; the port numbers and public network addresses of the first node and the second node are pre-stored in the home gateway.
The first node and the second node are devices authenticated by the home gateway, so that the home gateway stores port numbers and public network addresses of the first node and the second node. If the second node does not pass through the device of the home gateway, the home gateway cannot inquire the port number and the public network address of the second node.
In practical application, the first node can check the devices in the home gateway by logging in application software or a website, and select a device which wants to establish P2P communication, namely a target node; the first node sends query request information of the first node requesting to connect with a target node to the home gateway through application software or a website. And after receiving the query request information, the home gateway queries the public network address and the port number of the target node.
Step 203, sending the queried port number and public network address of the second node to the first node, so that the first node establishes P2P communication connection with the second node.
The home gateway sends the queried port number and public network address of the second node to the first node, after receiving the port number and the public network address of the second node, the first node is equivalent to the second node being exposed in the public network, and the first node is not blocked by middleware in the second node, that is, the first node can be directly connected with the second node and perform a series of data service operations, such as file transmission to the second node, data access to the second node, remote control of the second node, and the like.
In this embodiment, after the authentication of the first node and the second node is completed, the method further includes: storing the communication protocols of the first node and the second node which pass the authentication; before sending the port number and the public network address of the second node to the first node, the method further comprises the following steps: and feeding back the communication protocol of the second node to the first node so that the first node establishes the P2P communication connection with the second node according to the communication protocol of the second node.
To establish a P2P communication connection with a second node, a first node needs to know the communication protocol of the second node and establish a communication connection with the second node according to the communication protocol of the second node. Specifically, after finishing the authentication of the first node and the second node, the home gateway acquires the communication protocols of the first node and the second node according to the authentication request messages sent by the first node and the second node, and stores the communication protocols of the first node and the second node.
Specifically, the communication protocol includes UDP protocol and TCP protocol. In this embodiment, the communication protocol is a UDP protocol.
In summary, the home gateway sends the public network address and the port number of the second node to the first node, and feeds back the communication protocol of the second node to the first node, and the first node realizes the P2P communication connection with the second node according to the public network address, the port number and the communication protocol of the second node.
For ease of understanding, a topological diagram of P2P communication in this embodiment will be illustrated below.
Referring to fig. 3, each host is connected to the internet through a home gateway or a router, and P2P communication between hosts can be realized without using a server.
Specifically, fig. 4 is a schematic flowchart of a transmission protocol in the P2P communication method according to an embodiment of the present invention, and referring to fig. 4, the establishing, by the host a, a P2P communication connection with the host C includes:
firstly, the host a and the host C open port snooping, so that the host a and the host C can perceive an access request of other hosts to themselves.
Then, the host a connects to the home gateway a, including: the host A sends an authentication request message to the home gateway according to the pre-stored public network address and port number of the home gateway, and the host A can access the home gateway A after the home gateway passes the authentication of the host A. Similarly, the host C is connected to the home gateway a, and if the host C is not in the coverage area of the home gateway a, a communication connection can be established with the home gateway a through the router C.
Then, the home gateway a records the connection information of the host. When the host A and the host C pass the authentication of the home gateway A, the home gateway A records the public network address and the port number of the host A after being mapped by the home gateway ANAT, and the home gateway A records the public network address and the port number of the host C after being mapped by the router C NAT.
Then, the host a obtains the public network address and the port number of the host C, and specifically includes: the host A sends query request information for requesting to connect the host C to the home gateway A; the home gateway A queries the public network address and the port number of the host C and sends the public network address and the port number of the host C to the host A; and the host A establishes a UDP connection with the host C by using the public network address and the port number of the host C and carries out data transmission.
In the embodiment, the home gateway replaces a server in the prior art, so that the deployment of server resources is reduced; in addition, the home gateway replaces a server in the prior art, and public network addresses and port numbers of the first node and the second node which pass through the authentication of the home gateway are stored, so that the information related to the first node and the second node is prevented from being acquired by a third-party server, and the information safety of a user of the home gateway can be ensured.
In addition, the home gateway sends the public network address and the port number of the second node to the first node according to the query request information sent by the first node, so that the first node and the second node can establish P2P communication connection. Different from the existing special service area with single service, the home gateway does not limit the type of data service, thereby realizing the diversification of the data service; and the data of the first node and the second node are not forwarded through the server, so that the safety and confidentiality of data transmission can be realized.
Meanwhile, the home gateway stores the public network addresses of the first node and the second node, so that the first node and the second node are exposed in the public network and are not blocked by the middleware any more, and therefore bidirectional communication can be achieved.
As shown in fig. 5, a flow of a P2P communication method in a second embodiment of the present invention is applied to a first node, and specifically includes:
step 301, sending query request information for connecting the second node to the home gateway.
The first node transmits query request information for connecting the second node to the home gateway.
Step 302, receiving a port number and a public network address of a second node sent by a home gateway; the port numbers and public network addresses of the first node and the second node are pre-stored in the home gateway.
The first node receives a port number and a public network address of a second node sent by a home gateway; the port numbers and public network addresses of the first node and the second node are pre-stored in the home gateway.
And step 303, establishing a P2P communication connection with the second node according to the port number and the public network address of the second node.
And the first node establishes P2P communication connection with the second node according to the port number and the public network address of the second node.
It is to be understood that the second embodiment uses the first node as the execution main body, and the same or similar parts to the first embodiment are not described herein again.
The structure of the home gateway in the third embodiment of the present invention is shown in fig. 6, and specifically includes:
a receiving module 401, configured to receive query request information that a first node requests to connect to a second node; a query module 402, configured to query, according to the query request information, a port number and a public network address of the second node; the port numbers and public network addresses of the first node and the second node are pre-stored in the home gateway; a sending module 403, configured to send the queried port number and public network address of the second node to the first node, so that the first node establishes a P2P communication connection with the second node.
In this embodiment, the home gateway further includes an authentication module, configured to authenticate the first node and the second node according to authentication request messages sent by the first node and the second node before receiving query request information that the first node requests to connect to the second node; and the storage module is used for storing the port numbers and the public network addresses of the first node and the second node which pass the authentication after the authentication of the first node and the second node is completed.
In this embodiment, the home gateway further includes a configuration module, configured to configure a public network address and a port number of the home gateway to the first node and the second node in advance; the authentication request message sent by the first node is generated according to the public network address and the port number of the home gateway which is pre-configured in the first node; and the authentication request message sent by the second node is generated according to the public network address and the port number of the home gateway which is pre-configured in the second node.
In this embodiment, the storage module is further configured to store the communication protocols of the authenticated first node and the authenticated second node after the authentication module completes authentication of the first node and the second node; before the sending module sends the port number and the public network address of the second node to the first node, the sending module feeds back the communication protocol of the second node to the first node, so that the first node establishes P2P communication connection with the second node according to the communication protocol of the second node.
In this embodiment, the home gateway replaces a server in the prior art, and stores public network addresses and port numbers of the first node and the second node that pass authentication of the home gateway, thereby preventing information related to the first node and the second node from being acquired by a third-party server, and ensuring information security of a user of the home gateway.
In addition, the home gateway sends the public network address and the port number of the second node to the first node according to the query request information sent by the first node, so that the first node and the second node can establish P2P communication connection. Different from the existing special service area with single service, the home gateway does not limit the type of data service, thereby realizing the diversification of the data service; and the data of the first node and the second node are not forwarded through the server, so that the safety and confidentiality of data transmission can be realized.
Meanwhile, the home gateway stores the public network addresses of the first node and the second node, so that the first node and the second node are exposed in the public network and are not blocked by the middleware any more, and therefore bidirectional communication can be achieved.
The structure of the P2P communication system in the fourth embodiment of the present invention is shown in fig. 7.
In this embodiment, the P2P communication system 500 includes a first node 503, a second node 504, and a home gateway 501; wherein, the first node 503 and the second node 504 are both connected with the home gateway 501 in communication.
In this embodiment, the P2P communication system further includes a router 502, and the second node 504 establishes a communication connection with the home gateway 501 through the router 502.
In this embodiment, the home gateway 501 is provided with a built-in management module 511, which is used to store public network addresses and port numbers of the first node 503 and the second node 504 that establish communication connection with the home gateway 501.
In this embodiment, the home gateway integrated management module replaces a third-party server in the prior art, and the management module stores public network addresses and port numbers of the first node and the second node that pass through home gateway authentication, thereby preventing information related to the first node and the second node from being acquired by the third-party server, and ensuring information security of a user of the home gateway.
In addition, the home gateway sends the public network address and the port number of the second node to the first node through the management module according to the query request information sent by the first node, so that the first node and the second node can establish P2P communication connection. Different from the existing special service area with single service, the home gateway does not limit the type of data service, thereby realizing the diversification of the data service; and the data of the first node and the second node are not forwarded through the server, so that the safety and confidentiality of data transmission can be realized.
A fifth embodiment of the present invention relates to an electronic device, as shown in fig. 8, the server includes at least one processor 601; and a memory 602 communicatively coupled to the at least one processor 601; and a communication component 603 communicatively coupled to the terminal, the communication component 603 receiving and transmitting data under control of the processor 601; wherein the memory 602 stores instructions executable by the at least one processor 601 to implement the embodiments of the P2P communication method applied to the home gateway or the P2P communication method applied to the first node described above.
Specifically, the server includes: one or more processors 601 and a memory 602, one processor 601 being exemplified in fig. 8. The processor 601 and the memory 602 may be connected by a bus or other means, and fig. 8 illustrates the connection by the bus as an example. The memory 602, which is a computer-readable storage medium, may be used to store computer software programs, computer-executable programs, and modules. The processor 601 executes various functional applications and data processing of the device, i.e., implements the above-described embodiment of the P2P communication method applied to the home gateway or the P2P communication method applied to the first node, by executing the computer software program, instructions, and modules stored in the memory 602.
The memory 602 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store a list of options, etc. Further, the memory 602 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, the memory 602 may optionally include memory located remotely from the processor 601, which may be connected to an external device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more modules are stored in the memory 602, and when executed by the one or more processors 601, perform the P2P communication method applied to the home gateway or the P2P communication method applied to the first node in any of the above-described method embodiments.
The product can execute the method provided by the embodiment of the application, has corresponding functional modules and beneficial effects of the execution method, and can refer to the method provided by the embodiment of the application without detailed technical details in the embodiment.
Where the memory and processor are connected by a bus, the bus may comprise any number of interconnected buses and bridges, the buses connecting together one or more of the various circuits of the processor and the memory. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor is transmitted over a wireless medium via an antenna, which further receives the data and transmits the data to the processor.
The processor is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And the memory may be used to store data used by the processor in performing operations.
A sixth embodiment of the present invention relates to a computer-readable storage medium storing a computer program. The computer program, when executed by the processor, implements an embodiment of the P2P communication method applied to the home gateway or the P2P communication method applied to the first node as described above.
Those skilled in the art can understand that all or part of the steps in the method according to the above embodiments may be implemented by a program to instruct related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, etc.) or a processor (processor) to execute all or part of the steps in the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific embodiments for practicing the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.

Claims (10)

1. A P2P communication method is applied to a home gateway and comprises the following steps:
receiving query request information of a first node requesting to connect a second node;
inquiring the port number and the public network address of the second node according to the inquiry request information; the port numbers and public network addresses of the first node and the second node are pre-stored in the home gateway;
and sending the queried port number and public network address of the second node to the first node so that the first node establishes P2P communication connection with the second node.
2. The P2P communication method according to claim 1, wherein before the receiving inquiry request information that the first node requests to connect to the second node, further comprising:
authenticating the first node and the second node according to authentication request messages sent by the first node and the second node;
after the first node and the second node are authenticated, storing the authenticated port numbers and public network addresses of the first node and the second node.
3. The P2P communication method according to claim 2, wherein the authentication request message sent by the first node is generated according to a public network address and a port number of the home gateway pre-configured in the first node;
and the authentication request message sent by the second node is generated according to the public network address and the port number of the home gateway which are pre-configured in the second node.
4. The P2P communication method according to claim 2, further comprising, after the completion of the authentication of the first node and the second node:
storing the communication protocols of the first node and the second node which are authenticated;
before the sending the port number and the public network address of the second node to the first node, the method further includes:
and feeding back the communication protocol of the second node to the first node so that the first node establishes a P2P communication connection with the second node according to the communication protocol of the second node.
5. A P2P communication method, applied to a first node, comprising:
sending query request information for connecting a second node to the home gateway;
receiving the port number and the public network address of the second node sent by the home gateway; the port numbers and public network addresses of the first node and the second node are pre-stored in the home gateway;
and establishing P2P communication connection with the second node according to the port number and the public network address of the second node.
6. A home gateway, comprising:
the receiving module is used for receiving query request information of a first node requesting to connect a second node;
the query module is used for querying the port number and the public network address of the second node according to the query request information; the port numbers and public network addresses of the first node and the second node are pre-stored in the home gateway;
a sending module, configured to send the queried port number and public network address of the second node to the first node, so that the first node establishes P2P communication connection with the second node.
7. A P2P communication system, comprising: a first node, a second node and a home gateway as claimed in claim 6;
wherein the first node and the second node are both in communication connection with the home gateway.
8. The P2P communication system according to claim 7, wherein the P2P communication system further comprises a router through which the second node establishes a communication connection with the home gateway;
and the home gateway built-in management module is used for storing the public network address and the port number of the first node or the second node which establishes communication connection with the home gateway.
9. An electronic device, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the P2P communication method of any one of claims 1-4; or to perform the P2P communication method of claim 5.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the P2P communication method of any one of claims 1-4; alternatively, the P2P communication method of claim 5 is implemented.
CN202010113319.0A 2020-02-24 2020-02-24 P2P communication method, system, home gateway, electronic device and storage medium Pending CN111314477A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010113319.0A CN111314477A (en) 2020-02-24 2020-02-24 P2P communication method, system, home gateway, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010113319.0A CN111314477A (en) 2020-02-24 2020-02-24 P2P communication method, system, home gateway, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN111314477A true CN111314477A (en) 2020-06-19

Family

ID=71161857

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010113319.0A Pending CN111314477A (en) 2020-02-24 2020-02-24 P2P communication method, system, home gateway, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN111314477A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112202877A (en) * 2020-09-29 2021-01-08 中移(杭州)信息技术有限公司 Gateway linkage method, gateway, cloud server and user terminal

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101035270A (en) * 2007-04-19 2007-09-12 苏州鹞鹰数据技术有限公司 Peer-to-peer video monitoring method based on the Internet
CN102932955A (en) * 2012-11-09 2013-02-13 中山爱科数字科技股份有限公司 Digital household device fast point-to-point linking method
US20150215774A1 (en) * 2012-08-09 2015-07-30 Zte Corporation Method and Device for Processing and Managing an Establishment of X2 Connection
CN107222504A (en) * 2017-07-11 2017-09-29 深圳市斑点猫信息技术有限公司 A kind of P2P communication means and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101035270A (en) * 2007-04-19 2007-09-12 苏州鹞鹰数据技术有限公司 Peer-to-peer video monitoring method based on the Internet
US20150215774A1 (en) * 2012-08-09 2015-07-30 Zte Corporation Method and Device for Processing and Managing an Establishment of X2 Connection
CN102932955A (en) * 2012-11-09 2013-02-13 中山爱科数字科技股份有限公司 Digital household device fast point-to-point linking method
CN107222504A (en) * 2017-07-11 2017-09-29 深圳市斑点猫信息技术有限公司 A kind of P2P communication means and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112202877A (en) * 2020-09-29 2021-01-08 中移(杭州)信息技术有限公司 Gateway linkage method, gateway, cloud server and user terminal

Similar Documents

Publication Publication Date Title
KR102047197B1 (en) Discovering Wide Area Services for the Internet of Things
KR101877188B1 (en) Service layer interworking using mqtt protocol
CN104994073B (en) Mobile phone terminal, server and its account number and apparatus bound control execute method
CA2530343C (en) System for the internet connections, and server for routing connections to a client machine
CN105100052B (en) Server, mobile phone terminal and its account number and apparatus bound execution, control method
CN105376299B (en) Network communication method, equipment and network attached storage equipment
EP2908477B1 (en) Remote access method and device
US10819761B2 (en) Electronic device and method for controlling electronic device
US20170085392A1 (en) System, method and apparatus for data communication
CN106604119A (en) Network penetrating method and system of intelligent TV private cloud equipment
US20230291706A1 (en) Method for accessing network, media gateway, electronic device and storage medium
US20050111486A1 (en) Device and method for controlling network devices located within private networks
EP2693691B1 (en) Method and apparatus for initializing gateway in device management system
CN105657055A (en) Local area network equipment finding method and device oriented to WEB page
CN104581977A (en) WLAN user management method, device and system
CN111314477A (en) P2P communication method, system, home gateway, electronic device and storage medium
EP3127353B1 (en) Machine-to-machine domain proxy
CN101465783B (en) Connection method, device and connection network bridge for isomery household network appliances
CN109981725A (en) A kind of communication means across security domain, server and readable storage medium storing program for executing
KR101746226B1 (en) Method for exchanging information using smart grid in universal plug and play
WO2017091949A1 (en) Communication method, small cell base station, small cell base station controller, terminal and system
KR101231203B1 (en) System and method for network communicating between a communication device and information device
CN114640710A (en) Information subscription method and device
JP5708288B2 (en) Satellite communication method, control station and earth station
TW202125291A (en) Gateway device with built-in server module and communication system thereof

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200619