Peer-to-peer network penetration method, system, electronic device and storage medium

By acquiring network environment information of worker nodes and edge nodes, and using a matching algorithm to select the most suitable edge node for worker nodes to perform network penetration, the problem of high failure rate of point-to-point network penetration is solved, and a higher penetration success rate is achieved.

CN116319664BActive Publication Date: 2025-12-05SHENZHEN COOCAA NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310228719.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-28
Publication Date
2025-12-05
Estimated Expiration
2043-02-28

AI Technical Summary

Technical Problem

Existing peer-to-peer network traversal methods have a certain failure rate, especially in NAT network environments, where devices cannot effectively traverse the public network.

Method used

By acquiring network environment information of worker nodes and edge nodes, a matching algorithm is used to match the most suitable edge nodes for worker nodes to perform network penetration, including matching edge nodes with the same public IP address, the same gateway, or the same primary gateway, and performing network environment detection to improve the success rate.

Benefits of technology

It improves the success rate of point-to-point network traversal and solves the network traversal problem in NAT network environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116319664B_ABST
    Figure CN116319664B_ABST
Patent Text Reader

Abstract

The application discloses a point-to-point network penetration method and system, electronic equipment and a storage medium. The method comprises the following steps: acquiring network environment information of a working node and an edge node; according to the network environment information of the working node and the network environment information of the edge node, a matching algorithm is used to match the corresponding edge node for the working node, so that the working node completes network penetration based on the matched edge node. The scheme provided by the application can improve the network penetration success rate.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of network communication, and in particular to a point-to-point network penetration method and system, an electronic device and a storage medium. BACKGROUND

[0002] Whether it is the current popular blockchain, or the BT, and eMule technologies and products in previous years, the P2P technology (Peer to peer, point-to-point communication) is the most basic technology supporting the network connection level.

[0003] In the P2P technology, due to the limited number of IPv4 addresses, most networked devices do not have public network IP and need to use NAT for network address translation before connecting to the public network for network communication, thus giving birth to related technologies of NAT (Network Address Translators) network penetration. Since there are four types of NAT, the penetrability of different combinations is different, so the network penetration has a certain failure rate. SUMMARY

[0004] To solve the technical problem of a certain failure rate in the existing point-to-point network penetration, the embodiments of the present application provide a point-to-point network penetration method, system, electronic device and storage medium.

[0005] The technical solution of the embodiments of the present application is as follows:

[0006] The embodiments of the present application provide a point-to-point network penetration method applied to a server, and the method comprises: obtaining network environment information of a worker node and an edge node; using a matching algorithm to match a corresponding edge node for the worker node according to the network environment information of the worker node and the network environment information of the edge node, so that the worker node completes network penetration based on the matched edge node.

[0007] In an embodiment, the matching algorithm used to match the corresponding edge node for the worker node comprises: matching an edge node with a public network IP consistent with the worker node for the worker node.

[0008] In an embodiment, the matching algorithm used to match the corresponding edge node for the worker node comprises: matching an edge node with a gateway same as the gateway of the worker node for the worker node.

[0009] In an embodiment, the matching algorithm used to match the corresponding edge node for the worker node comprises: among all the edge nodes with the same gateway as the worker node, matching an edge node with a first gateway same as the first gateway of the worker node for the worker node.

[0010] In an embodiment, the matching algorithm is used to match the corresponding edge node for the working node, comprising: weighting and summing the offline state, past connectivity rate, network type of the edge node same as the gateway of the first level, and matching the edge node with the maximum sum value for the working node.

[0011] In an embodiment, the method is applied to the working node, comprising: performing network environment detection when network penetration is needed, and reporting the detection result to the server; determining the edge node matched by the server, and completing network penetration based on the matched edge node.

[0012] In an embodiment, the method is applied to the edge node, comprising: performing network environment detection when the network state of the self changes or under a timing strategy, and reporting the detection result to the server; completing network penetration of the working node based on the matching result of the working node by the server.

[0013] The embodiment of the application further provides a point-to-point network penetration system, which comprises a server, an edge node and a working node: the server is used to acquire network environment information of the working node and the edge node; the working node is matched with the corresponding edge node by using a matching algorithm according to the network environment information of the working node and the network environment information of the edge node, so that the working node completes network penetration based on the matched edge node; the edge node is used to perform network environment detection when the network state of the self changes or under a timing strategy, and report the detection result to the server; and the working node is used to perform network environment detection when network penetration is needed, and report the detection result to the server.

[0014] In an embodiment, the server is further used to match the edge node same as the gateway of the working node for the working node.

[0015] In an embodiment, the server is further used to match the edge node same as the gateway of the working node for the working node.

[0016] In an embodiment, the server is further used to match the edge node same as the gateway of the working node for the working node.

[0017] In an embodiment, the server is further used to match the edge node same as the gateway of the working node for the working node.

[0018] The embodiment of the present application further provides an electronic device, comprising a processor and a memory for storing a computer program capable of running on the processor; wherein the processor is used to run the computer program, and the steps of any method described above are executed.

[0019] The embodiment of the present application further provides a storage medium, wherein the storage medium stores a computer program, and the computer program is executed by a processor to realize the steps of any method described above.

[0020] The point-to-point network penetration method, system, electronic device and storage medium provided by the embodiment of the present application obtain network environment information of a working node and an edge node; according to the network environment information of the working node and the network environment information of the edge node, a matching algorithm is used to match the working node with a corresponding edge node, so that the working node completes network penetration based on the matched edge node. The scheme provided by the present application can improve the network penetration success rate. BRIEF DESCRIPTION OF DRAWINGS

[0021] Figure 1 The flowchart of the point-to-point network penetration method of the embodiment of the present application is shown in the figure.

[0022] Figure 2 The structure diagram of the point-to-point network penetration method application system of the embodiment of the present application is shown in the figure.

[0023] Figure 3 The working flowchart of the point-to-point network penetration method of the embodiment of the present application is shown in the figure.

[0024] Figure 4 The internal structure diagram of the computer device of the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0025] The present application will be further described in detail below with reference to the accompanying drawings and embodiments.

[0026] The embodiment of the present application provides a point-to-point network penetration method applied to a server side, as shown in the figure, the method comprises the following steps. Figure 1

[0027] Step 101: Obtain network environment information of a working node and an edge node.

[0028] Step 102: According to the network environment information of the working node and the network environment information of the edge node, a matching algorithm is used to match the working node with a corresponding edge node, so that the working node completes network penetration based on the matched edge node.

[0029] Specifically, referring to the figure, the embodiment method can be applied to a server side as shown in the figure. Figure 2 Figure 2 ​​The system structure shown in the embodiment. That is, a STUN (Session Traversal Utilities for NAT) server connects a NAT node through a network, and the NAT node connects a PC and other devices through a STUN client.

[0030] NAT session traversal application STUN is a network protocol defined by RFC, which is used to detect whether there is a NAT device in a network, and to obtain the IP address and port number allocated by a NAT device to two communication endpoints. Then a P2P link that can traverse the NAT is established between the two communication endpoints, and P2P communication is realized. The existing STUN server is built on the public network, and can solve the network penetration on the public network; but in a local area network environment, if the STUN of the public network is used, and the loopback of the NAT of the local area network is not opened, and the firewall policy also affects the network penetration of such devices.

[0031] The method of the embodiment can improve the success rate of point-to-point network penetration between devices.

[0032] Specifically, the edge node in the embodiment works in a large-screen device, and a STUN / TURN (Traversal Using Relay NAT) service that meets the standards of RFC 5389 and RFC 5766 is run in the edge node. For example Figure 2 the STUN client in the embodiment.

[0033] The working node refers to each device and service that needs to perform network penetration communication. For example Figure 2 the PC end in the embodiment.

[0034] The working node and the edge node in the embodiment are configured with a gateway detection service, and can detect the network in which the node is located, so as to make good network environment detection for subsequent edge node matching.

[0035] The server in the embodiment is configured with a node matching service. The node matching service is used to match the most suitable edge node for the working node based on the network environment information obtained by the working node through gateway detection, so that the working node uses the matched edge node to complete network penetration.

[0036] In an embodiment, the matching algorithm is used to match the corresponding edge node for the working node, and the matching algorithm includes the following steps.

[0037] The edge node that is matched for the working node is consistent with the public IP of the working node.

[0038] In an embodiment, the matching algorithm is used to match the corresponding edge node for the worker node, including:

[0039] The edge node same as the worker node gateway is matched for the worker node.

[0040] In an embodiment, the matching algorithm is used to match the corresponding edge node for the worker node, including:

[0041] Among all the edge nodes same as the worker node gateway, the edge node same as the primary gateway is matched for the worker node.

[0042] In an embodiment, the matching algorithm is used to match the corresponding edge node for the worker node, including:

[0043] The offline state, past connectivity rate, network type of the edge node same as the primary gateway are weighted and summed, and the edge node with the maximum sum value is matched for the worker node.

[0044] Specifically, referring to Figure 3 , the matching algorithm in the embodiment can be specifically:

[0045] Step 1: Match the edge node same as the public IP of the worker node;

[0046] Step 2: Match the edge node same as the gateway of the worker node;

[0047] Step 3: Sort the edge node matched in Step 2, and the primary gateway of the edge node is the high priority of the same gateway.

[0048] Step 4: Weight and sum the offline state, past connectivity rate, network type (WIFI, wired) of the edge node, and finally sort the list of Step 3, and the list is the matched edge node list returned to the worker node.

[0049] The embodiment of the application provides another point-to-point network penetration method, applied to a worker node, and the method includes:

[0050] When network penetration is needed, network environment detection is performed, and the detection result is reported to a server;

[0051] The edge node matched by the server is determined, and network penetration is completed based on the matched edge node.

[0052] In the embodiment, the worker node performs detection when network penetration is needed, and reports the result to a node matching service, and the service returns the optimal edge node.

[0053] The embodiment of the present application provides another point-to-point network penetration method, which is applied to an edge node, and the method comprises the following steps:

[0054] When a self-network state changes or under a timing strategy, network environment detection is performed, and a detection result is reported to a server;

[0055] Based on a matching result of the server to a working node, network penetration of the working node is completed.

[0056] In the embodiment, the edge node completes detection and reports a result to a node matching service when a self-network state changes or under a timing strategy.

[0057] The point-to-point network penetration method provided by the embodiment of the present application acquires network environment information of a working node and an edge node; according to the network environment information of the working node and the network environment information of the edge node, a matching algorithm is used to match the working node with a corresponding edge node, so that the working node completes network penetration based on the matched edge node. The scheme provided by the present application can improve network penetration success rate.

[0058] In order to realize the method of the embodiment of the present application, the embodiment of the present application further provides a point-to-point network penetration system, which comprises a server, an edge node and a working node:

[0059] The server is used to acquire network environment information of a working node and an edge node; according to the network environment information of the working node and the network environment information of the edge node, a matching algorithm is used to match the working node with a corresponding edge node, so that the working node completes network penetration based on the matched edge node;

[0060] The edge node is used to perform network environment detection when a self-network state changes or under a timing strategy, and report a detection result to a server;

[0061] The working node is used to perform network environment detection when network penetration is needed, and report a detection result to a server.

[0062] In an embodiment, the server is further used to match the working node with an edge node which is consistent with a public network IP of the working node.

[0063] In an embodiment, the server is further used to match the working node with an edge node which is same as a gateway of the working node.

[0064] In an embodiment, the server is further used to match the working node with an edge node which is same as a first-level gateway in all edge nodes which are same as the gateway of the working node.

[0065] In an embodiment, the server is further configured to: sum, as weights, an offline state, a past connectivity rate, and a network type of the edge node same as the primary gateway, and match the working node with the edge node having a maximum sum value.

[0066] It should be noted that the above system provided by the above embodiments is executed, and only the division of the above program modules is exemplified. In actual application, the above processing can be completed by different program modules according to needs, that is, the internal structure of the terminal is divided into different program modules to complete all or part of the above processing. In addition, the above system and the above method embodiments provided by the above embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be described here.

[0067] In order to implement the method of the embodiment of the application, the embodiment of the application further provides a computer program product. The computer program product includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium. The processor executes the computer instructions, so that the computer device executes the steps of the above method.

[0068] Based on the hardware implementation of the above program modules, and in order to implement the method of the embodiment of the application, the embodiment of the application further provides an electronic device (computer device). Specifically, in one embodiment, the computer device can be a terminal, and its internal structure diagram can be as shown in Figure 4 The computer device includes a processor A01, a network interface A02, a display screen A04, an input device A05, and a storage (not shown in the figure) connected through a system bus. The processor A01 of the computer device is configured to provide computing and control capabilities. The storage of the computer device includes an internal memory A03 and a non-volatile storage medium A06. The non-volatile storage medium A06 stores an operating system B01 and a computer program B02. The internal memory A03 provides an environment for the operating system B01 and the computer program B02 in the non-volatile storage medium A06. The network interface A02 of the computer device is configured to communicate with external terminals through network connection. The computer program is executed by the processor A01 to implement the method of any one of the above embodiments. The display screen A04 of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device A05 of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.

[0069] Those skilled in the art can understand that Figure 4The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. A specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0070] The device provided by the embodiment of the present application comprises a processor, a memory, and a program stored in the memory and executable on the processor. The processor implements the method of any one of the above embodiments when executing the program.

[0071] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code.

[0072] The present application is described with reference to flowcharts and / or block diagrams of the method, device (system), and computer program product according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices generate a device implemented in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that carries out the function specified in one or more flows and / or blocks.

[0073] These computer program instructions can also be stored in a computer-readable memory that can direct the computer or other programmable data processing devices to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including instruction apparatus, which implements the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that carries out the function specified in one or more flows and / or blocks.

[0074] These computer program instructions can also be loaded into a computer or other programmable data processing device, so that a series of operation steps are performed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide a process for implementing the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1steps of a function specified in one or more blocks.

[0075] In one typical arrangement, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0076] Memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) and / or cache memory, non-volatile memory, such as read-only memory (ROM), EPROM, and / or flash memory, etc. Memory is an example of computer readable media.

[0077] Computer readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile discs (DVDs) or other optical storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. According to the definition herein, computer readable media does not include transitory media, such as modulated data signals and carrier waves.

[0078] It can be understood that the memory of the embodiments of the present application can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a ferromagnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM). The magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM) used as an external cache. By way of example but not limitation, many forms of RAM can be used, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), sync link dynamic random access memory (SLDRAM), and direct rambus random access memory (DRRAM).The memory described in the embodiments of the present application is intended to include, but not be limited to, the memory of these and any other suitable type of memory.

[0079] It should also be noted that the terms "comprising", "comprises", "including", "includes" or any other variation thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises a... " does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.

[0080] The above only describes the embodiments of the present application and is not intended to limit the present application. The present application can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the scope of claims of the present application.

Claims

1. A method of point-to-point network penetration, the method comprising: Applied to the server side, the method comprises: Obtaining network environment information of the working node and the edge node; According to the network environment information of the working node and the network environment information of the edge node, the matching algorithm is used to match the corresponding edge node for the working node, so that the working node completes network penetration based on the matched edge node; Wherein, the matching algorithm comprises: Step 1: matching all edge nodes with the same public IP as the working node; Step 2: matching edge nodes with the same gateway as the working node; Step 3: sorting the edge nodes matched in step 2, and the first gateway of the edge node is the same gateway with high priority; Step 4: weight sum of offline state, past connectivity rate and network type of edge node, and finally sort the list of step 3, which is the matching edge node list returned to the working node; The working node is used for network environment detection when network penetration is needed, and the detection result is reported to the server side; determine the edge node matched by the server side, and complete the network penetration of the working node based on the matched edge node; The edge node is used for network environment detection when the network state changes or under the timing strategy, and the detection result is reported to the server side; based on the matching result of the server side to the working node, the network penetration of the working node is completed.

2. The method of claim 1, wherein, The matching algorithm is used to match the corresponding edge node for the working node, which comprises: Matching the edge node with the same public IP as the working node for the working node.

3. The method of claim 2, wherein, The matching algorithm is used to match the corresponding edge node for the working node, which comprises: Matching the edge node with the same gateway as the working node for the working node.

4. The method of claim 3, wherein, The matching algorithm is used to match the corresponding edge node for the working node, which comprises: Among all the edge nodes with the same gateway as the working node, the edge node with the same first gateway as the working node is matched for the working node.

5. The method of claim 4, wherein, The matching algorithm is used to match the corresponding edge node for the working node, which comprises: The offline state, past connectivity rate and network type of the edge node with the same first gateway are weighted and summed, and the edge node with the maximum sum value is matched for the working node.

6. A method of penetrating a point-to-point network, characterized by, Applied to the working node, the method comprises: When network penetration is needed, network environment detection is performed, and the detection result is reported to the server side; Determine the edge node matched by the server side, and complete the network penetration based on the matched edge node; Wherein, the server side is used to execute the method as claimed in any one of claims 1-5.

7. A method of penetrating a point-to-point network, characterized by, Applied to the edge node, the method comprises: When the network state changes or under the timing strategy, network environment detection is performed, and the detection result is reported to the server side; Based on the matching result of the server side to the working node, the network penetration of the working node is completed; Wherein, the server side is used to execute the method as claimed in any one of claims 1-5.

8. A point-to-point network penetration system, characterized by, The system comprises a server, an edge node and a working node: The server is configured to acquire network environment information of the worker node and the edge node, match the worker node with a corresponding edge node by using a matching algorithm according to the network environment information of the worker node and the network environment information of the edge node, and enable the worker node to complete network penetration based on the matched edge node. The edge node is configured to perform network environment detection when a network state of the edge node changes or according to a timing strategy, and report a detection result to the server. The worker node is configured to perform network environment detection when network penetration is required, and report a detection result to the server. The matching algorithm comprises the following steps: Step 1: matching all edge nodes with the same public IP as the worker node; Step 2: matching edge nodes with the same gateway as the worker node; Step 3: sorting the edge nodes matched in step 2, and the high priority of the first gateway of the edge node is the same gateway; Step 4: performing weighted summation on the offline state, past connectivity rate and network type of the edge node, and then sorting the list of step 3, and the list is the matched edge node list returned to the worker node.

9. An electronic device, comprising: The computer program is executed by the processor, and the steps of the method in any one of claims 1 to 7 are implemented. The computer program is executed by the processor, and the steps of the method in any one of claims 1 to 7 are implemented. ​ 10. A storage medium having stored therein a computer program, characterized in that ​

Citation Information

Patent Citations

  • Method and system for penetrating NAT to establish overlay network in P2P network

    CN101741914A