Application access method, cloud proxy component, node proxy component, device and medium
View Patent ↗An application access method includes: acquiring a node discovery result; in response to the node discovery result indicating that no node is discovered, performing a user datagram protocol (UDP) hole punching operation between a local area network where a newly registered edge node is located and a current existing local area network to obtain an intercommunication relationship between the local area networks, and updating a global routing table based on the intercommunication relationship; in response to the node discovery result indicating that a node is successfully discovered, associating node information of the newly registered edge node with target local area network information to update the global routing table; and issuing the global routing table to a node proxy component in each edge node, so that the node proxy component in each edge node forwards an application access flow based on the global routing table to realize application access.
1 . An application access method, applied to a cloud proxy component, wherein the application access method comprises:
acquiring a node discovery result, wherein a current cluster comprises edge nodes, a newly registered edge node is an edge node newly registered to the current cluster, the newly registered edge node and an edge node that are located in a same local area network are capable to access each other, the newly registered edge node and an edge node that are not located in the same local area network are unable to be directly connected; the node discovery result is a node discovery result obtained by a node proxy component in the newly registered edge node to perform node discovery on each edge node in the current cluster, to determine whether there is a node located in the same local area network as the newly registered edge node;
in response to the node discovery result indicating that no node located in the same local area network as the newly registered edge node is discovered, performing a user datagram protocol (UDP) hole punching operation between a local area network where the newly registered edge node is located and a current existing local area network to obtain an intercommunication relationship between local area networks, and updating a global routing table based on the intercommunication relationship;
in response to the node discovery result indicating that a node located in the same local area network as the newly registered edge node is successfully discovered, associating node information of the newly registered edge node with target local area network information to update the global routing table, wherein the target local area network information is local area network information of a local area network where a successfully discovered node is located; and
issuing the global routing table to a node proxy component in each edge node of the edge nodes in the current cluster, so that the node proxy component in each edge node forwards an application access flow based on the global routing table to realize application access;
wherein before acquiring the node discovery result, the application access method further comprises: issuing a cluster node list to the node proxy component in the newly registered edge node, so that the node proxy component in the newly registered edge node performs node discovery on each edge node in the current cluster based on the cluster node list, to obtain the node discovery result.
2 . The application access method according to claim 1 , further comprising:
acquiring the node information of the newly registered edge node sent by the node proxy component in the newly registered edge node; and
adding the node information to the cluster node list.
3 . The application access method according to claim 2 , wherein the node information comprises a service discovery port of the node proxy component in the newly registered edge node; and the node proxy component in the newly registered edge node accesses each edge node in the current cluster based on a service discovery port of the node proxy component of each edge node in the cluster node list.
4 . The application access method according to claim 3 , wherein the node information further comprises a unique identifier of a node.
5 . The application access method according to claim 1 , wherein in response to the node discovery result indicating that no node located in the same local area network as the newly registered edge node is discovered, the application access method further comprises:
acquiring a public network network address translation (NAT) gateway address of the local area network where the newly registered edge node is located; and
creating local area network information of the local area network where the newly registered edge node is located based on the public network NAT gateway address and the node information of the newly registered edge node.
6 . The application access method according to claim 1 , wherein in response to the node proxy component in each edge node of the edge nodes in the current cluster determining based on the global routing table that a local area network where a local node is located and a local area network where a destination node is located are of the same local area network, the application access flow is directly forwarded to a node proxy component in the destination node, so that the node proxy component in the destination node forwards the application access flow to a destination application; and
in response to the node proxy component in each edge node of the edge nodes in the current cluster determining based on the global routing table that an intercommunication relationship between the local area network where the local node is located and the local area network where the destination node is located is capable of intercommunication through UDP hole punching, the application access flow is forwarded to the node proxy component in the destination node through a NAT gateway of the local area network where the destination node is located, so that the node proxy component in the destination node forwards the application access flow to the destination application.
7 . The application access method according to claim 1 , further comprising:
maintaining a long link with the node proxy component in each edge node of the edge nodes in the current cluster.
8 . The application access method according to claim 7 , further comprising:
acquiring an application access flow sent by a target node proxy component based on the long link, and forwarding the application access flow sent by the target node proxy component to a node proxy component in a destination node, so that the node proxy component in the destination node forwards the application access flow sent by the target node proxy component to a destination application;
wherein the target node proxy component is a node proxy component that determines based on the global routing table that the intercommunication relationship between a local area network where a local node is located and a local area network where the destination node is located is uncapable of intercommunication through UDP hole punching.
9 . The application access method according to claim 1 , further comprising:
monitoring addition/deletion information of each edge node of the edge nodes in the current cluster and updating the global routing table of each edge node; and
issuing an updated global routing table of each edge node to the node proxy component in each edge node.
10 . The application access method according to claim 1 , wherein the global routing table comprises local area network information of each local area network in a cluster and the intercommunication relationship between the local area networks, and the local area network information of each local area network in the cluster comprises each node information in each local area network in the cluster.
11 . A non-transitory computer-readable storage medium, configured to store a computer program therein, wherein the computer program, when being executed by a processor, implementing the application access method according to claim 1 .
12 . An application access method, applied to a node proxy component, wherein the application access method comprises:
during node registration of a local node, performing node discovery on each edge node in a current cluster to obtain a node discovery result, to determine whether there is a node located in a same local area network as a newly registered edge node; wherein the current cluster comprises edge nodes, the newly registered edge node is an edge node newly registered to the current cluster, the newly registered edge node and an edge node that are located in the same local area network are capable to access each other, the newly registered edge nodes and an edge node that are not located in the same local area network are unable to be directly connected;
sending the node discovery result to a cloud proxy component, so that the cloud proxy component updates a global routing table based on the node discovery result, wherein in response to the node discovery result indicating that no node located in the same local area network as the newly registered edge node is discovered, the cloud proxy component performs a user datagram protocol (UDP) hole punching operation between a local area network where a newly registered edge node is located and a current existing local area network to obtain an intercommunication relationship between local area networks, and updates the global routing table based on the intercommunication relationship; in response to the node discovery result indicating that a node located in the same local area network as the newly registered edge node is successfully discovered, the cloud proxy component associates node information of the newly registered edge node with target local area network information to update the global routing table, the target local area network information is local area network information of a local area network where a successfully discovered node is located; and
acquiring the global routing table issued by the cloud proxy component, and forwarding an application access flow based on the global routing table to realize application access;
wherein the acquiring the global routing table issued by the cloud proxy component, and forwarding the application access flow based on the global routing table to realize application access comprises: receiving an application access flow sent by a first local application to a second application; selecting an application forwarding mode based on the global routing table; and sending the application access flow sent by the first local application to the second application through the application forwarding mode.
13 . The application access method according to claim 12 , wherein the sending the application access flow sent by the first local application to the second application through the application forwarding mode comprises:
in response to a node where the second application is located and the first local application being on the same local area network, directly forwarding the application access flow sent by the first local application to a node proxy component where the second application is located, so that a node proxy component of the second application forwards the application access flow sent by the first local application to the second application.
14 . The application access method according to claim 12 , wherein the sending the application access flow sent by the first local application to the second application through the application forwarding mode comprises:
in response to a node where the second application is located and the first local application being not on the same local area network and two local area networks access each otherthrough UDP hole punching, forwarding the application access flow sent by the first local application to a node proxy component of the second application through a NAT gateway of the local area network where the second application is located, so that the node proxy component of the second application forwards the application access flow sent by the first local application to the second application.
15 . The application access method according to claim 12 , wherein the sending the application access flow sent by the first local application to the second application through the application forwarding mode comprises:
in response to a node where the second application is located and the first local application being not on the same local area network and two local area networks do not access each other through UDP hole punching, forwarding the application access flow sent by the first local application to the cloud proxy component, so that the cloud proxy component forwards the application access flow sent by the first local application to a node proxy component of the node where the second application is located, and a node proxy component of the second application sends the application access flow sent by the first local application to the second application.
16 . The application access method according to claim 12 , further comprising:
monitoring a configured local service discovery port, and directing a flow generated by the configured local service discovery port to a local node proxy component.
17 . The application access method according to claim 12 , further comprising:
connecting a public network Internet Protocol (IP) exposed by the cloud proxy component, and establishing a long link channel to the cloud proxy component; and
reporting local node information to the cloud proxy component.
18 . An electronic device, comprising a processor and a memory, wherein
the memory is configured to store a computer program; and
the processor is configured to, when executing the computer program, implement operations comprising:
acquiring a node discovery result, wherein a current cluster comprises edge nodes, a newly registered edge node is an edge node newly registered to the current cluster, the newly registered edge node and an edge node that are located in a same local area network are capable to access each other, the newly registered edge node and an edge node that are not located in the same local area network are unable to be directly connected; the node discovery result is a node discovery result obtained by a node proxy component in the newly registered edge node to perform node discovery on each edge node in the current cluster, to determine whether there is a node located in the same local area network as the newly registered edge node;
in response to the node discovery result indicating that no node located in the same local area network as the newly registered edge node is discovered, performing a user datagram protocol (UDP) hole punching operation between a local area network where the newly registered edge node is located and a current existing local area network to obtain an intercommunication relationship between local area networks, and updating a global routing table based on the intercommunication relationship;
in response to the node discovery result indicating that a node located in the same local area network as the newly registered edge node is successfully discovered, associating node information of the newly registered edge node with target local area network information to update the global routing table, wherein the target local area network information is local area network information of a local area network where a successfully discovered node is located; and
issuing the global routing table to a node proxy component in each edge node of the edge nodes in the current cluster, so that the node proxy component in each edge node forwards an application access flow based on the global routing table to realize application access;
wherein before the operation of acquiring the node discovery result, the operations further comprise: issuing a cluster node list to the node proxy component in the newly registered edge node, so that the node proxy component in the newly registered edge node performs node discovery on each edge node in the current cluster based on the cluster node list, to obtain the node discovery result.