CN117354316A - Relay connection method, device, equipment and storage medium based on P2P network - Google Patents
Relay connection method, device, equipment and storage medium based on P2P network Download PDFInfo
- Publication number
- CN117354316A CN117354316A CN202311106697.6A CN202311106697A CN117354316A CN 117354316 A CN117354316 A CN 117354316A CN 202311106697 A CN202311106697 A CN 202311106697A CN 117354316 A CN117354316 A CN 117354316A
- Authority
- CN
- China
- Prior art keywords
- relay
- peer
- relay server
- network
- connection
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 47
- 238000011156 evaluation Methods 0.000 claims description 8
- 238000004590 computer program Methods 0.000 claims description 5
- 238000004891 communication Methods 0.000 abstract description 27
- 238000005457 optimization Methods 0.000 abstract description 6
- 238000012360 testing method Methods 0.000 description 9
- 238000005516 engineering process Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 238000001514 detection method Methods 0.000 description 3
- 239000003999 initiator Substances 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000035515 penetration Effects 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 238000013468 resource allocation Methods 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 238000013519 translation Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/46—Interconnection of networks
- H04L12/4604—LAN interconnection over a backbone network, e.g. Internet, Frame Relay
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/16—Flow control; Congestion control in connection oriented networks, e.g. frame relay
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application relates to the technical field of communication, and provides a relay connection method, a device, equipment and a storage medium based on a P2P network, wherein the method comprises the following steps: receiving a relay service request sent by a peer, wherein the relay service request carries relay service quality information and identification information of the peer; identifying a network location of the peer based on the identification information of the peer; determining a first target relay server based on the network location and relay quality of service information; and sending the connection information of the first target relay server to the peer, wherein the peer establishes a relay link with the first target relay server based on the connection information. The method and the device realize control and optimization of relay connection by establishing the controller in the P2P network, thereby improving the resource utilization rate of the relay server, fully utilizing the bandwidth of the physical link, reducing the flow detour and improving the connection performance between peers using the relay link for communication.
Description
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a relay connection method, apparatus, device, and storage medium based on a P2P network.
Background
At present, most research directions and technical directions focus on the coordination and optimization aspects of a bearing network, edge computing and cloud computing, and an end computing power network facing a broadband access network is used as a typical application scene with high computing idle rate and uneven network resource allocation, so that the research investment in the industry is less, and related technical solutions are lacked. Especially, when constructing the network connection layer of the end computing power network, the existing P2P (Peer-to-Peer) connection technology is generally based, but the combination of the technology and the bottom layer network is poor, and the problem of unreasonable resource allocation exists.
In the broadband access network, the IPv4 network has complex network address translation (Network Address Translation, NAT) configuration, and the IPv6 network has the limitation of a status firewall, so that the direct intercommunication of nodes is a reasonable solution through technologies such as NAT penetration, firewall penetration and the like. However, in practice, the network environment of the node is very complex, and the above technology cannot guarantee that the peers can directly access each other, so that the relay server is still required to provide a relay link to implement the connection between the peers. A distributed hash table (Distributed Hash Table, DHT) is commonly used in the current P2P network to retrieve nodes capable of providing relay services, and the distributed hash table abstracts a layer of overlay network above an unrerley network, but the abstract network does not have a real topological relation between nodes, and is difficult to perceive network positions of a relay server and a peer, so that the problems of detour and resource mismatch exist in the process of selecting the relay server.
Disclosure of Invention
The application provides a relay connection method, a device, equipment and a storage medium based on a P2P network, which are used for solving the problems of detour and resource mismatch in the process of selecting a relay server, and realizing control and optimization of relay connection by establishing a controller in the P2P network, so that the resource utilization rate of the relay server is improved, and the connection performance between peers communicating by using the relay link is improved while the bandwidth of a physical link is fully utilized and the detour of flow is reduced.
The application provides a relay connection method based on a P2P network, which comprises the following steps:
receiving a relay service request sent by a peer, wherein the relay service request carries relay service quality information and identification information of the peer;
identifying a network location of the peer based on the identification information of the peer;
determining a first target relay server based on the network location and the relay quality of service information;
and sending the connection information of the first target relay server to the peer, wherein the peer establishes a relay link with the first target relay server based on the connection information.
In one embodiment, the determining the first target relay server based on the network location and the relay quality of service information includes:
determining a distance between the peer and each relay server based on the network location;
based on the distance and the relay service quality information, evaluating each relay server to obtain an evaluation result;
and determining the first target relay server based on the evaluation result.
In one embodiment, before the receiving the relay service request sent by the peer, the method further includes:
receiving a registration request sent by a second target relay server;
transmitting a first connection request to a plurality of the peers based on the registration request, wherein the plurality of the peers are connected with the second target relay server based on the first connection request;
acquiring a first number of peers successfully connected with the second target relay server;
and if the first number is greater than or equal to a first threshold, adding the second target relay server into a relay server list.
In one embodiment, after the obtaining the first number of peers successfully connected with the second target relay server, the method further includes:
and if the first number is smaller than the first threshold value, determining that the second target relay server fails to register.
In one embodiment, before the receiving the relay service request sent by the peer, the method further includes:
sending a second connection request to a plurality of the peers, wherein the plurality of the peers are connected with each relay server in the relay server list based on the second connection request;
obtaining a second number of the peers for which the connection of each relay server is successful;
and sending a first failure notification to the second number of third target relay servers smaller than a second threshold, and removing the third target relay servers from the relay server list.
In one embodiment, after the sending the connection information of the first target relay server to the peer, the method further includes:
receiving a second failure notification of the relay link sent by the peer;
based on the second failure notification, sending the removing information of the relay link to the peer and the first target relay server, and determining a fourth target relay server;
and sending the connection information of the fourth target relay server to the peer, wherein the peer establishes a relay link with the fourth target relay server based on the connection information of the fourth target relay server.
In one embodiment, the identifying the network location of the peer based on the identification information of the peer includes:
acquiring a topological structure of a point-to-point P2P network;
identifying a network location of the peer based on the identification information of the peer and the topology;
or, obtaining a topology table of the peer;
based on the identification information of the peer and the topology table, a network location of the peer is identified.
The application provides a relay connection device based on a P2P network, which comprises:
the receiving module is used for receiving a relay service request sent by a peer, wherein the relay service request carries relay service quality information and identification information of the peer;
an identification module for identifying a network location of the peer based on the identification information of the peer;
a determining module, configured to determine a first target relay server based on the network location and the relay quality of service information;
and the relay connection module is used for sending the connection information of the first target relay server to the peer, wherein the peer establishes a relay link with the first target relay server based on the connection information.
The application also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the relay connection method based on the P2P network when executing the program.
The present application also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a P2P network-based relay connection method as described in any of the above.
The relay connection method, the device, the equipment and the storage medium based on the P2P network, which are provided by the application, are used for receiving a relay service request sent by a peer, wherein the relay service request carries relay service quality information and identification information of the peer; identifying a network location of the peer based on the identification information of the peer; determining a first target relay server based on the network location and relay quality of service information; and sending the connection information of the first target relay server to the peer, wherein the peer establishes a relay link with the first target relay server based on the connection information. The method and the device realize control and optimization of relay connection by establishing the controller in the P2P network, thereby improving the resource utilization rate of the relay server, fully utilizing the bandwidth of the physical link, reducing the flow detour and improving the connection performance between peers using the relay link for communication.
Drawings
For a clearer description of the present application or of the prior art, the drawings that are used in the description of the embodiments or of the prior art will be briefly described, it being apparent that the drawings in the description below are some embodiments of the present application, and that other drawings may be obtained from these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a relay connection method based on a P2P network provided in the present application;
fig. 2 is a schematic structural diagram of a relay connection device based on a P2P network provided in the present application;
fig. 3 is a schematic structural diagram of an electronic device provided in the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the present application more apparent, the technical solutions in the present application will be clearly and completely described below with reference to the drawings in the present application, and it is apparent that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The relay connection method, apparatus, device and storage medium based on the P2P network of the present application are described below with reference to fig. 1 to 3.
Specifically, the present application provides a relay connection method based on a P2P network, and referring to fig. 1, fig. 1 is a schematic flow chart of the relay connection method based on the P2P network provided in the present application.
The relay connection method based on the P2P network provided by the embodiment of the application comprises the following steps:
step 100, receiving a relay service request sent by a peer, wherein the relay service request carries relay service quality information and identification information of the peer;
it should be noted that, according to the present application, based on the technical idea of SDN (Software-defined network), a controller entity is introduced into the P2P network to manage the real-time state of the relay server, and at the same time, maintain the topological relationship between the relay server and each peer. When a direct link cannot be established between the peers, the peers will request a relay service from the controller, which is responsible for calculating and screening the relay servers and instructing the peers to connect with the optimal relay server designated by the controller.
The present application includes three functional logic entities: a peer, a relay server and a controller, wherein a peer (peer) refers to an entity or individual acting as a node in a P2P network; the relay server is a server which plays a role in forwarding data traffic in network communication; the controller can directly communicate with each peer and the relay server through the P2P network, and is responsible for controlling and managing the relay service and the relay link, and the relay server is responsible for executing communication relay among the peers.
When a P2P initiator peer cannot be connected to a target peer through a direct link, the initiator peer sends a relay service request to a controller, wherein the relay service request carries relay service quality information and identification information of the peer, and the identification information of the peer comprises identification information of the peer of both communication parties; the relay quality of service information may be relay QoS (Quality of Service ) information, including the following information:
bandwidth requirements: indicating the bandwidth requirements of the trunking. For example, the bandwidth requirement may be a fixed value or may be a range or priority level to better match the available relay servers.
Delay requirement: requirements for relay service delay are described. For example, depending on the needs of the application scenario, lower latency is required to implement real-time or interactive applications.
Reliability requirements: indicating the need for reliability of the data transmission. For example, certain applications may have higher requirements for data integrity and reliability, and thus it is desirable to ensure that relay services can provide services with low packet loss rates without losing data.
Other requirements are: other quality of service related requirements such as jitter, throughput, priority, etc. are included.
By providing relay service QoS information, the requesting peer can inform the controller of its desire for relay service, while the controller can select an optimal relay server to meet the demand of the requesting peer according to the QoS information and ensure that an appropriate quality of service is provided.
Step 200, identifying the network location of the peer based on the identification information of the peer;
after the controller obtains the identification information of the peers of both communication parties, the network location of the peer is identified based on the identification information. Specifically, a topology structure of a point-to-point P2P network is obtained; based on the identification information of the peer and the topology, the network location of the peer is identified. For example, the controller may determine that there is a direct connection between the nodes based on the topology, and after it obtains the identification information of the peer, it may identify on which node the peer is located, i.e. the network location of the peer may be obtained.
Or, obtaining a topology table of the peer; based on the identification information of the peer and the topology table, the network location of the peer is identified. For example, the controller may maintain a registry or topology table of peers to record identification information and network location of each peer. When the controller receives the identification information of the peer, the network location of the peer may be queried in a registry or topology table.
Alternatively, if the identification information of the peer is an IP address, the controller may identify the network location of the peer through the IP address based on the fact that the peer typically interacts with the network through the IP address.
Step 300, determining a first target relay server based on the network position and the relay service quality information;
the controller determines a first target relay server based on the network location of the peer and the relay quality of service information. Specifically, determining a distance between the peer and each relay server based on the network location; based on the distance and the relay service quality information, evaluating each relay server to obtain an evaluation result; based on the evaluation result, a first target relay server is determined.
For example, based on the network location of the peer, a correlation index of the distance or network path between the peer and each relay server is calculated, and the relay servers that are closer in distance or reachable through a shorter path may reduce the effects of delay and network congestion, so the scoring of such relay servers is high. Meanwhile, relay service quality information such as bandwidth, throughput, delay, reliability, packet loss rate, resource load, service availability and the like is combined, each relay server is evaluated to determine a comprehensive score of each relay server, and then the relay server with the highest comprehensive score is used as a first target relay server, namely the optimal relay server.
And step 400, sending the connection information of the first target relay server to the peer, wherein the peer establishes a relay link with the first target relay server based on the connection information.
After determining the first target relay server, the controller sends the connection information of the first target relay server to the peer, and then the peer establishes a relay link with the first target relay server based on the connection information. For example, after the controller screens out the optimal relay server, the controller sends connection information such as identification information (e.g. server ID, name, hash value, etc.), address information (e.g. IP address or other network identifier), port information (e.g. communication port monitored by the relay server) and the like of the optimal relay server to the peer of the two communicating parties, so as to instruct the peer of the two communicating parties to establish a relay link with the optimal relay server. After the relay link is established, the communicating peers communicate through the relay server and the relay link.
According to the relay connection method based on the P2P network, a relay service request sent by a peer is received, wherein the relay service request carries relay service quality information and identification information of the peer; identifying a network location of the peer based on the identification information of the peer; determining a first target relay server based on the network location and relay quality of service information; and sending the connection information of the first target relay server to the peer, wherein the peer establishes a relay link with the first target relay server based on the connection information. The method and the device realize control and optimization of relay connection by establishing the controller in the P2P network, thereby improving the resource utilization rate of the relay server, fully utilizing the bandwidth of the physical link, reducing the flow detour and improving the connection performance between peers using the relay link for communication.
Based on the above embodiment, before the receiving the relay service request sent by the peer, the method further includes:
step 110, receiving a registration request sent by a second target relay server;
step 120, based on the registration request, sending a first connection request to a plurality of the peers, wherein the plurality of the peers are connected with the second target relay server based on the first connection request;
step 130, obtaining a first number of the peers successfully connected with the second target relay server;
and 140, if the first number is greater than or equal to a first threshold, adding the second target relay server into a relay server list.
The relay server needs to pass a certain authentication procedure to become an effective node in the network. For example, a relay server may initiate a registration request to a controller, which may communicate the registration request to a plurality of peers to test connectivity of the relay server. The specific flow is as follows:
(1) The second target relay server sends a registration request to the controller, wherein the registration request comprises identity information, basic characteristic parameters and the like of the second target relay server; the second target relay server refers to a relay server that currently needs to be authenticated as a valid node of the network.
(2) After receiving the registration request, the controller communicates the registration request to the plurality of peers, i.e., sends a first connection request to the plurality of peers.
(3) After receiving the first connection request, the peer point tests the second target relay server, namely connects with the second target relay server to judge whether the second target relay server can normally communicate with other peer points.
(4) According to the test result, a first number of peers successfully connected with the second target relay server is obtained, if the first number is larger than or equal to a first threshold value, the second target relay server can be communicated with most of the peers, the stability and the usability of the network can be ensured, and the second target relay server can be added into a relay server list. It will be appreciated that the role of the relay server is to assist in data transfer, to provide connectivity services and to increase the capacity and coverage of the network, if the relay server can be identified as being connectable by a plurality of peers, it is illustrated that it has the basic requirements required by the network nodes, and the task of data transfer between the nodes can be efficiently completed.
(5) If the first number is less than the first threshold, a determination is made that the second target relay server failed registration. That is, if most peers report that the second target relay server is not communicable, it is indicated that the second target relay server may have various problems, such as unstable connection, easy interruption, low data transmission efficiency, etc., which may cause instability and failure of the network, and even affect the normal operation of the entire network, and thus, it is necessary to reject the registration request of the second target relay server.
In the embodiment of the application, the registration mechanism of the relay server can improve the reliability and the security of the distributed network, and ensure that the relay server added into the network can work normally and cannot cause negative influence on the network. Meanwhile, the registration mechanism can also effectively reduce network congestion and improve data transmission efficiency, and provides more stable and efficient network service for users.
Based on the above embodiment, before the receiving the relay service request sent by the peer, the method further includes:
step 150, sending a second connection request to a plurality of the peers, wherein the plurality of the peers are connected with each relay server in the relay server list based on the second connection request;
step 160, obtaining a second number of the peers successfully connected to each relay server;
step 170, sending a first failure notification to the second number of third target relay servers smaller than a second threshold, and removing the third target relay servers from the relay server list.
It should be noted that the dial testing mechanism of the relay server is an important means for ensuring the stability and reliability of the network. The controller periodically instructs a plurality of peers to dial and test the relay server, and through the dial and test feedback result of the relay server, whether the relay server has a fault or is unavailable can be timely found, so that a relay server list can be timely updated, and the normal operation of the network is ensured. The specific flow is as follows:
(1) The controller periodically sends a second connection request to the plurality of peers to dial and test the relay server;
(2) The plurality of peers connect with each relay server in the relay server list based on the second connection request;
(3) The controller obtains the second number of successfully connected peers of each relay server based on the connection condition of each relay server, such as a pulling feedback result;
(4) And sending the first failure notification to a second number of third target relay servers smaller than the second threshold, and removing the third target relay servers from the relay server list. That is, if most peers report that the third target relay server is not communicable, it is indicated that various problems may exist in the third target relay server, and at this time, the third target relay server needs to be removed from the relay server list, and by removing the failed relay server, invalid network resources can be avoided, allocation of the network resources is optimized, and operation efficiency of the network is improved.
According to the embodiment of the application, whether the relay server has a fault or is unavailable can be found in time through the dial testing mechanism and the dial testing feedback result of the peer, and the influence on the network caused by the failure of the relay server is reduced. Meanwhile, by detecting and processing the failure relay server, the connectivity and stability of the network can be ensured, and the reliability and performance of the network can be improved.
Based on the above embodiment, after the sending the connection information of the first target relay server to the peer, the method further includes:
step 310, receiving a second failure notification of the relay link sent by the peer;
step 320, based on the second failure notification, sending the removal information of the relay link to the peer and the first target relay server, and determining a fourth target relay server;
and step 330, transmitting the connection information of the fourth target relay server to the peer, wherein the peer establishes a relay link with the fourth target relay server based on the connection information of the fourth target relay server.
It should be noted that, the failure detection mechanism of the relay server is a mechanism for monitoring the status of the relay link and handling the failure situation in time. When at least one of the two communication peer-to-peer parties detects a relay link failure, a relay server failure notification is sent to the controller to instruct the controller to reselect an appropriate relay server for communication.
Specifically, in the failure detection mechanism, when one of the two communication peer-bodies detects that the relay link fails, a second failure notification of the relay link is immediately sent to the controller, and the notification includes relevant information of the failed link, such as a failed relay server identifier, and the like. After receiving the second failure notification, the controller sends the removal information of the relay link to the peer and the first target relay server, and then reselects the appropriate relay server based on a reselection mechanism of the relay server, so as to ensure the continuity and stability of communication.
The reselection mechanism of the relay server refers to that after the controller receives the relay service failure notification (such as the second failure notification of the relay link), the state information of the peer of the two communication parties and the original relay server is updated, and the appropriate relay server is reselected to establish a new relay connection. The specific process is as follows:
(1) Receiving a relay service failure notification: the controller receives the relay service failure notification sent by the peers of the two communication parties.
(2) Removing the failed relay link state information: according to the failure information in the failure notification, the controller removes the state information of the peer of the two communication parties and the original relay server related to the failure relay link from the record, and ensures that the failure information is not used for subsequent relay service selection any more.
(3) Reselecting the appropriate relay server: the controller reselects the appropriate relay server based on the currently available relay server list and the needs of both the communication, wherein the selection process may be based on various policies such as load balancing, geographic location, etc.
(4) Establishing a new relay connection: after selecting a proper relay server, the controller sends new relay server information to the peers of the two communication parties and assists the two parties to establish new relay connection so that the two communication parties can communicate through the new relay connection.
According to the embodiment of the application, the failure notification is timely sent through the failure detection mechanism of the relay server, so that the relay server can be switched to an available relay server quickly when the relay link fails, and the reliability and the stability of communication are improved. On the other hand, the state information is updated through a reselection mechanism of the relay server, a proper relay server is reselected, a new relay connection is established, and the like, so that communication can be recovered in time after a relay link fails, and the selection of the relay service is optimized according to the current network condition and requirements.
Fig. 2 is a schematic structural diagram of a relay connection device based on a P2P network provided in the present application, and referring to fig. 2, an embodiment of the present application provides a relay connection device based on a P2P network, which includes a receiving module 201, an identifying module 202, a determining module 203, and a relay connection module 204.
A receiving module 201, configured to receive a relay service request sent by a peer, where the relay service request carries relay service quality information and identification information of the peer;
an identification module 202 for identifying a network location of the peer based on the identification information of the peer;
a determining module 203, configured to determine a first target relay server based on the network location and the relay service quality information;
and a relay connection module 204, configured to send connection information of the first target relay server to the peer, where the peer establishes a relay link with the first target relay server based on the connection information.
The relay connection device based on the P2P network, provided by the embodiment of the application, receives a relay service request sent by a peer, wherein the relay service request carries relay service quality information and identification information of the peer; identifying a network location of the peer based on the identification information of the peer; determining a first target relay server based on the network location and relay quality of service information; and sending the connection information of the first target relay server to the peer, wherein the peer establishes a relay link with the first target relay server based on the connection information. The method and the device realize control and optimization of relay connection by establishing the controller in the P2P network, thereby improving the resource utilization rate of the relay server, fully utilizing the bandwidth of the physical link, reducing the flow detour and improving the connection performance between peers using the relay link for communication.
In one embodiment, the determining module 203 is specifically configured to:
determining a distance between the peer and each relay server based on the network location;
based on the distance and the relay service quality information, evaluating each relay server to obtain an evaluation result;
and determining the first target relay server based on the evaluation result.
In one embodiment, the receiving module 201 is further configured to:
receiving a registration request sent by a second target relay server;
transmitting a first connection request to a plurality of the peers based on the registration request, wherein the plurality of the peers are connected with the second target relay server based on the first connection request;
acquiring a first number of peers successfully connected with the second target relay server;
and if the first number is greater than or equal to a first threshold, adding the second target relay server into a relay server list.
In one embodiment, the receiving module 201 is further configured to:
and if the first number is smaller than the first threshold value, determining that the second target relay server fails to register.
In one embodiment, the receiving module 201 is further configured to:
sending a second connection request to a plurality of the peers, wherein the plurality of the peers are connected with each relay server in the relay server list based on the second connection request;
obtaining a second number of the peers for which the connection of each relay server is successful;
and sending a first failure notification to the second number of third target relay servers smaller than a second threshold, and removing the third target relay servers from the relay server list.
In one embodiment, the relay connection module 204 is further configured to:
receiving a second failure notification of the relay link sent by the peer;
based on the second failure notification, sending the removing information of the relay link to the peer and the first target relay server, and determining a fourth target relay server;
and sending the connection information of the fourth target relay server to the peer, wherein the peer establishes a relay link with the fourth target relay server based on the connection information of the fourth target relay server.
In one embodiment, the identification module 201 is specifically configured to:
acquiring a topological structure of a point-to-point P2P network;
identifying a network location of the peer based on the identification information of the peer and the topology;
or, obtaining a topology table of the peer;
based on the identification information of the peer and the topology table, a network location of the peer is identified.
Fig. 3 illustrates a physical schematic diagram of an electronic device, as shown in fig. 3, where the electronic device may include: processor 310, communication interface 320, memory 330 and communication bus 340, wherein processor 310, communication interface 320 and memory 330 communicate with each other via communication bus 340. The processor 310 may invoke logic instructions in the memory 330 to perform a P2P network based relay connection method comprising:
receiving a relay service request sent by a peer, wherein the relay service request carries relay service quality information and identification information of the peer;
identifying a network location of the peer based on the identification information of the peer;
determining a first target relay server based on the network location and the relay quality of service information;
and sending the connection information of the first target relay server to the peer, wherein the peer establishes a relay link with the first target relay server based on the connection information.
Further, the logic instructions in the memory 330 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-only memory (ROM), a random access memory (RAM, randomAccessMemory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present application also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the P2P network-based relay connection method provided by the above methods, the method comprising:
receiving a relay service request sent by a peer, wherein the relay service request carries relay service quality information and identification information of the peer;
identifying a network location of the peer based on the identification information of the peer;
determining a first target relay server based on the network location and the relay quality of service information;
and sending the connection information of the first target relay server to the peer, wherein the peer establishes a relay link with the first target relay server based on the connection information.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the corresponding technical solutions.
Claims (10)
1. A relay connection method based on a P2P network, comprising:
receiving a relay service request sent by a peer, wherein the relay service request carries relay service quality information and identification information of the peer;
identifying a network location of the peer based on the identification information of the peer;
determining a first target relay server based on the network location and the relay quality of service information;
and sending the connection information of the first target relay server to the peer, wherein the peer establishes a relay link with the first target relay server based on the connection information.
2. The P2P network-based relay connection method of claim 1, wherein said determining a first target relay server based on said network location and said relay quality of service information comprises:
determining a distance between the peer and each relay server based on the network location;
based on the distance and the relay service quality information, evaluating each relay server to obtain an evaluation result;
and determining the first target relay server based on the evaluation result.
3. The P2P network-based relay connection method according to claim 1, further comprising, before the receiving peer sends the relay service request:
receiving a registration request sent by a second target relay server;
transmitting a first connection request to a plurality of the peers based on the registration request, wherein the plurality of the peers are connected with the second target relay server based on the first connection request;
acquiring a first number of peers successfully connected with the second target relay server;
and if the first number is greater than or equal to a first threshold, adding the second target relay server into a relay server list.
4. The P2P network based relay connection method of claim 3, further comprising, after said obtaining the first number of peers successfully connected to the second target relay server:
and if the first number is smaller than the first threshold value, determining that the second target relay server fails to register.
5. The P2P network-based relay connection method according to claim 3, further comprising, before the receiving peer sends the relay service request:
sending a second connection request to a plurality of the peers, wherein the plurality of the peers are connected with each relay server in the relay server list based on the second connection request;
obtaining a second number of the peers for which the connection of each relay server is successful;
and sending a first failure notification to the second number of third target relay servers smaller than a second threshold, and removing the third target relay servers from the relay server list.
6. The P2P network-based relay connection method according to claim 1, further comprising, after said transmitting the connection information of the first target relay server to the peer:
receiving a second failure notification of the relay link sent by the peer;
based on the second failure notification, sending the removing information of the relay link to the peer and the first target relay server, and determining a fourth target relay server;
and sending the connection information of the fourth target relay server to the peer, wherein the peer establishes a relay link with the fourth target relay server based on the connection information of the fourth target relay server.
7. The P2P network-based relay connection method according to claim 1, wherein the identifying the network location of the peer based on the identification information of the peer comprises:
acquiring a topological structure of a point-to-point P2P network;
identifying a network location of the peer based on the identification information of the peer and the topology;
or, obtaining a topology table of the peer;
based on the identification information of the peer and the topology table, a network location of the peer is identified.
8. A relay connection device based on a P2P network, comprising:
the receiving module is used for receiving a relay service request sent by a peer, wherein the relay service request carries relay service quality information and identification information of the peer;
an identification module for identifying a network location of the peer based on the identification information of the peer;
a determining module, configured to determine a first target relay server based on the network location and the relay quality of service information;
and the relay connection module is used for sending the connection information of the first target relay server to the peer, wherein the peer establishes a relay link with the first target relay server based on the connection information.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the P2P network-based relay connection method according to any one of claims 1 to 7 when executing the program.
10. A non-transitory computer readable storage medium, having stored thereon a computer program, which when executed by a processor, implements the P2P network-based relay connection method according to any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311106697.6A CN117354316A (en) | 2023-08-30 | 2023-08-30 | Relay connection method, device, equipment and storage medium based on P2P network |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311106697.6A CN117354316A (en) | 2023-08-30 | 2023-08-30 | Relay connection method, device, equipment and storage medium based on P2P network |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117354316A true CN117354316A (en) | 2024-01-05 |
Family
ID=89356425
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311106697.6A Pending CN117354316A (en) | 2023-08-30 | 2023-08-30 | Relay connection method, device, equipment and storage medium based on P2P network |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117354316A (en) |
-
2023
- 2023-08-30 CN CN202311106697.6A patent/CN117354316A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111373774B (en) | Method and apparatus for traffic routing and path optimization for peer-to-peer communications | |
CN107637037B (en) | System and method for virtual interfaces and advanced intelligent routing in a global virtual network | |
US10097645B2 (en) | Method and apparatus of performing peer-to-peer communication establishment and connection change-over | |
EP2058980B1 (en) | A method, system and device for establishing a peer to peer connection in a p2p network | |
US20100205481A1 (en) | Method and Apparatus for Detecting and Handling Peer Faults in Peer-to-Peer Network | |
WO2011110118A2 (en) | Fault detection method and system | |
US7561587B2 (en) | Method and system for providing layer-4 switching technologies | |
WO2013040970A1 (en) | Relay node selecting method and device | |
EP3817308A1 (en) | Method, device and system for responding to request and applied to bt system | |
CN102404155A (en) | Method and device for diagnosing network faults | |
EP4165904A1 (en) | Access traffic management | |
CN117692444A (en) | Wide area network broadcast audio synchronization method and device | |
CN117354316A (en) | Relay connection method, device, equipment and storage medium based on P2P network | |
EP2122906B1 (en) | Discovery of disconnected components in a distributed communication network | |
CN110932970B (en) | Processing method and device of Transmission Control Protocol (TCP) session | |
WO2022254246A1 (en) | Method to prioritize and offload mobile edge cloud traffic in 5g | |
CN112311613A (en) | Link detection method and device | |
CN113595760B (en) | System fault processing method and device | |
US12074785B2 (en) | Logical link redundant paths | |
US11936543B1 (en) | Link health determination | |
Zhang et al. | Research on multi-path network balancing method for cloud computing | |
WO2024212573A1 (en) | Communication connection method and apparatus, electronic device, system, and readable storage medium | |
WO2018141392A1 (en) | Firewall support for multipath connections | |
CN109639800B (en) | TCP connection processing method, device, equipment and storage medium | |
WO2024196708A1 (en) | Mitigation of missing session data for routing session |
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 |