Network connection method and device, electronic equipment and storage medium
By selecting edge service nodes to establish alternative connections when the VPN is unstable, the problem of client request processing efficiency caused by VPN instability is solved and more efficient communication processing is achieved.
Patent Information
- Application Number
- CN202411134973.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-10-29
AI Technical Summary
The virtual private network (VPN) is unstable, causing normal communication between the client and the server, affecting the processing efficiency of client requests.
When the VPN between the client node and the source service node is unstable, the target edge service node is selected and a network connection is established to replace the connection between the VPN and the source service node, and the client request is forwarded through the edge service node for processing.
The network connection established through the edge service node avoids the interference of VPN instability on the communication between the client node and the source service node, ensuring the processing efficiency of client requests.
Smart Images

Figure CN118869779A_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of computer network technology, and specifically to a network connection method, device, electronic device, and storage medium. Background Art
[0002] A Virtual Private Network (VPN) is a network connection technology used to establish a secure, encrypted connection on a public network. Data can be transmitted between the client and the server through an encrypted channel established by VPN to avoid data leakage.
[0003] However, there is a certain degree of instability. This instability may be caused by a variety of factors, including network problems, VPN server problems, client software problems or configuration errors. VPN instability may cause the client and server to be unable to communicate normally, thereby affecting the processing efficiency of client requests. Summary of the invention
[0004] The embodiments of this specification provide a network connection method, device, electronic device, and storage medium, and the technical solutions are as follows:
[0005] In a first aspect, an embodiment of this specification provides a network connection method, which is applied to a client node, including:
[0006] In response to the virtual private network between the client node and the source service node being unstable, selecting a target edge node from at least one edge service node corresponding to the source service node;
[0007] Sending a connection establishment request to the target edge node to establish a network connection with the target edge node;
[0008] Based on the network connection, a client request is sent to the target edge node, so that the edge service node forwards the client request to the source service node for processing.
[0009] In a second aspect, an embodiment of the present specification provides a network connection device, applied to a client node, including:
[0010] A selection unit: in response to instability of a virtual private network between a client node and a source service node, selecting a target edge node from at least one edge service node corresponding to the source service node;
[0011] A connection establishment unit: sending a connection establishment request to the target edge node to establish a network connection with the target edge node;
[0012] A sending unit: based on the network connection, sends a client request to the target edge node, so that the edge service node forwards the client request to the source service node for processing.
[0013] In a third aspect, an embodiment of the present specification provides an electronic device, comprising a processor and a memory; the processor is connected to the memory; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the steps of the network connection method described in the first aspect of the above embodiment.
[0014] In a fourth aspect, an embodiment of this specification provides a computer storage medium, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the steps of the network connection method described in the first aspect of the above embodiment.
[0015] The beneficial effects brought by the technical solutions provided by some embodiments of this specification include at least:
[0016] When the virtual private network between the client node and the source service node is unstable, a network connection is established through the edge service node corresponding to the source service node, so that the network connection established by the edge service node can replace the virtual private network to establish a connection with the source service node, thereby avoiding the unstable virtual private network from interfering with the communication between the client node and the source service node, and ensuring the processing efficiency of the client request. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of this specification, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 It is a schematic diagram of a VPN-based communication system provided in an embodiment of this specification.
[0019] Figure 2 It is an architecture diagram of a network connection system provided in an embodiment of this specification.
[0020] Figure 3 It is a flowchart of a network connection method provided in an embodiment of this specification.
[0021] Figure 4a It is an interaction diagram for establishing a connection with an edge service node provided in an embodiment of this specification.
[0022] Figure 4b This is another interaction diagram for establishing a connection with an edge service node provided in an embodiment of this specification.
[0023] Figure 5 It is a block diagram of a network connection device provided in an embodiment of this specification.
[0024] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION
[0025] The technical solutions in the embodiments of this specification will be described clearly and completely below in conjunction with the drawings in the embodiments of this specification.
[0026] The terms "first", "second", etc. in the description and claims of this specification and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any variation thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.
[0027] The network connection method is described in detail below in conjunction with one or more embodiments.
[0028] A Virtual Private Network (VPN) is a network connection technology used to establish a secure, encrypted connection on a public network. Data can be transmitted between the client and the server through an encrypted channel established by VPN to avoid data leakage.
[0029] See also Figure 1 , Figure 1 A schematic diagram of a VPN-based communication system provided in an embodiment of this specification is shown. Figure 1 As shown, the communication system includes: a mobile phone 11, a VPN server 12, and a VPN channel 13.
[0030] The mobile phone 11 is a type of electronic device that can be used by the user. Of course, the electronic devices used by the user are not limited to this. For example, they can also include: tablet devices, laptops, PDAs (Personal Digital Assistants), wearable devices (such as smart glasses, smart watches, etc.), etc. This specification does not limit this. During operation, a client program of the communication system runs on the mobile phone 11, so that the mobile phone 11 is configured as a client of the communication system. The client program can generate a client request according to the user's instructions, and send the client request to the VPN server 12, so that the VPN server 12 processes the client request.
[0031] The VPN server 12 may be a physical server including an independent host, or the server 12 may be a virtual server hosted by a host cluster. A VPN channel is established between the VPN server 12 and the mobile phone 11. The VPN may define routing rules for communication between the VPN server 12 and the mobile phone 11, and the routing policy determines which data packets should be encrypted and sent through the VPN channel 12, and which data packets should be directly routed through the ordinary Internet.
[0032] The VPN server 12 runs a server program of the communication system, so that the VPN server 12 is configured as the server of the communication system. The server program can cooperate with the above-mentioned client, for example, it can receive a client request sent by the client, process the client request, and return the processing result to the client through the VPN channel.
[0033] The interaction between the mobile phone 11 and the VPN server 12 may include various types of wired or wireless interactions, which are not limited in this specification.
[0034] However, VPNs are somewhat unstable. This instability may be caused by a variety of factors, including network problems, VPN server problems, client software problems, or configuration errors. VPN instability may cause the client and server to be unable to communicate normally, which in turn affects the processing efficiency of client requests.
[0035] To solve this problem, this specification proposes a network connection method, device, electronic device, and storage medium.
[0036] Combine the following Figure 2 A detailed description of the architecture involved in this network connection method. Figure 2 , Figure 2 Schematic diagram of a network connection system provided by an embodiment of this specification is shown. Figure 2As shown, the system may include: a client node 21, a source service node 22, and edge service nodes 23-25.
[0037] Edge service nodes refer to physical or virtual servers and devices distributed at the edge of the network. They are deployed close to the terminal devices used by users to reduce data transmission delays and improve the response speed of network services. These nodes usually undertake data processing and storage tasks and can provide content distribution, caching, computing and network request processing services. The main purpose of edge service nodes is to deploy data processing and services closer to the client, which is in contrast to the traditional centralized data center model, in which all processing work is completed in a data center farther away from the user.
[0038] The client node 21 corresponds to the client deployed on the terminal device used by the user, the edge service nodes 23-24 are deployed near the terminal device, and the source service node 22 is deployed away from the terminal device. The source service node 22 and the edge service nodes 23-24 together constitute the service end. The source service node 22 can process the client request generated by the client node 21, and the edge service nodes 23-24 can forward the received client request to the source service node 22.
[0039] A VPN channel is established between the client node 21 and the source service node 22. According to the actual situation, the client node 21 can choose to send the client request to the source service node 22 for processing through the VPN channel, or can choose to send the client request to the source service node 22 for processing through any edge service node.
[0040] The above-mentioned network connection system, when the virtual private network between the client node and the source service node is unstable, establishes a network connection through an edge service node corresponding to the source service node, so that the network connection established by the edge service node can replace the virtual private network to establish a connection with the source service node, thereby avoiding the unstable virtual private network from interfering with the communication between the client node and the source service node, and ensuring the processing efficiency of the client request.
[0041] See also Figure 3 , Figure 3 A schematic diagram of a network connection method provided in an embodiment of this specification is shown. Figure 3 As shown, the network connection method is applied to a client node and may at least include the following steps:
[0042] Step 302: In response to the virtual private network between the client node and the source service node being unstable, select a target edge node from at least one edge service node corresponding to the source service node.
[0043] As mentioned before, Virtual Private Networks, or VPNs, are somewhat unstable. Users can predefine under what circumstances a VPN is considered unstable.
[0044] In one embodiment, it also includes: sending a connection establishment request to the source service node through the virtual private network between the client node and the source service node, and determining whether the virtual private network meets the preset conditions according to the response result of the source service node; wherein the preset conditions include at least one of the following: no response message returned by the source service node is received, and the first network delay of the virtual private network exceeds a preset threshold; when the virtual private network meets any of the preset conditions, determining that the virtual private network is unstable.
[0045] There are many situations for the response result, for example, it may include: receiving or not receiving the response message from the source service node, the time when the response message is received, etc.
[0046] Under normal circumstances, if the source service node receives the connection establishment request sent by the client node, it will return a response message to the client node. If the client node receives the response message, the VPN channel between the client node and the source service node can be determined to be established. If the client node does not receive the response message, it indicates that the VPN is unstable.
[0047] The first network delay may be the difference between the first time when the client node sends the connection establishment request and the second time when the client node receives the response message. If the first network delay exceeds a threshold value preset by the user, it indicates that the VPN is unstable.
[0048] In this embodiment, by sending a connection establishment request to the source service node, the client node can determine whether the VPN is stable based on the response result of the source service node, so as to select the transmission path of the client request, thereby avoiding the unstable VPN from interfering with the communication between the client node and the source service node, thereby ensuring the processing efficiency of the client request.
[0049] Of course, the preset conditions are not limited to the above two, and may also include, for example: the packet loss rate of client processing through VPN exceeds a certain threshold. This specification does not limit this.
[0050] Furthermore, the method further includes: determining a network card name of a network interface of the client node on the virtual private network, and determining whether the virtual private network is in an activated state according to the network card name.
[0051] A VPN channel can only be established when the VPN is activated. Specifically, the active network interfaces on the device can be scanned to determine whether the network card name contains "tun" or "tap" or "ppp". If it contains any of the above network card names, it indicates that the user terminal has turned on the VPN activation state.
[0052] Compared with the source service node, the edge service node is deployed closer to the user terminal, and the target edge node can be any edge service node of at least one edge service node corresponding to the source service node. The specific selection process will be described in detail later and will not be repeated here.
[0053] Step 304: Send a connection establishment request to the target edge node to establish a network connection with the target edge node.
[0054] It is worth noting that the connection request here is different from the connection request sent by the client node to the source service node. Although both types of connection requests are used to establish a connection, the former is specifically used to establish a network connection between the client node and the target edge node, while the latter is specifically used to establish a network connection between the client node and the source service node. Of course, the data contained in the two is not consistent.
[0055] The client node can send a connection request to the target edge node, and the target edge node can return a corresponding response message, thereby establishing a network connection, so that the client node can send the client request to the target edge node.
[0056] Step 306: Based on the network connection, send the client request to the target edge node, so that the edge service node forwards the client request to the source service node for processing.
[0057] When deploying the edge service node and the source service node, the IP address of the source service node is stored at the edge service node. According to the IP address, the edge service node can forward the client request to the source service node for processing.
[0058] Of course, the edge service node can also pre-process the client request, which helps to speed up the processing speed of the source service node for the client request, thereby improving the overall processing efficiency and reducing the load of the source service node.
[0059] In this embodiment, when the virtual private network between the client node and the source service node is unstable, a network connection is established through an edge service node corresponding to the source service node, so that the network connection established by the edge service node can replace the virtual private network to establish a connection with the source service node, thereby avoiding interference of the unstable virtual private network on the communication between the client node and the source service node, and ensuring the processing efficiency of the client request.
[0060] In one embodiment, when the preset condition includes that the first network delay of the virtual private network exceeds a preset threshold, it also includes: determining the second network delay of the network channel established between the client node and the source service node based on the network connection; sending the client request to the target edge node includes: when the first network delay is greater than the second network delay, sending the client request to the target edge node.
[0061] The first network delay can be used to characterize the stability of the VPN, and the second network delay can also be used to characterize the stability of the newly-built network connection and edge transparent transmission (hereinafter collectively referred to as the newly-built network channel).
[0062] After the network connection is established, the client node can send a delay measurement request to the source service node through the newly created network channel, so that the source service node returns a response message. The second network delay can be the difference between the third moment when the client node sends the delay measurement request and the fourth moment when the source service node returns the response message.
[0063] Since the VPN is unstable, but the newly created network channel is even more unstable, the stability of the VPN channel and the newly created network channel can be determined by comparing the first network delay and the second network delay, so as to select the network channel with better condition to transmit the client request.
[0064] In this embodiment, by comparing the first network delay and the second network delay, the stability of the VPN channel and the newly created network channel is compared, so that the network channel with better condition is selected to transmit the client request, thereby ensuring the processing efficiency of the client request.
[0065] In one embodiment, the selecting a target edge node from at least one edge service node corresponding to the source service node includes: determining description information of the at least one edge service node, and sending a connection establishment request to the at least one edge service node according to the determined description information; and determining the edge service node that first establishes a network connection as the target edge node.
[0066] As mentioned above, when the client node receives the response message returned by the edge service node, it can be regarded as the establishment of the network connection between the client node and the edge service node. The edge service node that first establishes the network connection is the sending node of the response message first received by the client node. Since the network connection between the target edge node and the client node is established the fastest, it means that the speed of sending the client request through this network connection will also be faster.
[0067] In this embodiment, the edge service node that first establishes a network connection is determined as the target edge node, so that the network connection established between the target edge node and the client node is the fastest one for transmitting client requests among multiple edge service nodes, thereby ensuring the processing efficiency of client requests.
[0068] Furthermore, the description information is an IP address; determining the description information of the at least one edge service node includes: obtaining a domain name corresponding to the edge service node, and sending the domain name to a domain name server, so that the domain name server resolves the domain name to obtain the IP address of the at least one edge service node; or, obtaining the IP address of the at least one edge service node from the source service node through a virtual private network between the client node and the source service node.
[0069] In one case, the IP address of the edge service node can be obtained by resolving the domain name, which can be stored in the client node. Figure 4a , Figure 4a An interactive diagram for establishing a connection with an edge service node provided in an embodiment of this specification is shown, such as Figure 4a As shown, the interaction diagram includes the following steps:
[0070] In step 402, the client node sends the domain name to the domain name server. The domain name server (DNS) is a server used to convert domain names into IP addresses. It converts domain names and the corresponding IP addresses. In step 404, the domain name server resolves the domain name and obtains the IP address of the edge service node. In step 406, the domain name server returns the IP address to the client node. In step 408, the client node sends a connection request to the edge service node. The client node can use the multiple IP addresses received as target addresses one by one and send connection requests to the target addresses. In step 410, the edge service node returns a response message to the client node.
[0071] In another case, the IP address of the edge service node is provided by the source service node. Figure 4b , Figure 4b Another interactive diagram for establishing a connection with an edge service node provided in an embodiment of this specification is shown, such as Figure 4b As shown, the interaction diagram includes the following steps:
[0072] Step 412, the source service node sends an IP address to the client node. Specifically, when the client node sends a connection request to the source service node to determine the stability of the VPN, the response message returned by the source service node may include the IP address of the edge service node; or, the client node may send an additional request to obtain the IP address through the established VPN channel so that the source service node returns the corresponding IP address. This specification does not limit this. Step 414, the client node sends a connection request to the edge service node. Step 416, the edge service node returns a response message to the client node.
[0073] In this case, since the IP address of the edge service node is provided by the source service node, the edge service node can be regarded as a secure node and can be transmitted without encrypting the client request, which simplifies the request processing process and improves the request processing efficiency.
[0074] Furthermore, the client node stores a routing policy corresponding to the virtual private network, and the routing policy records the edge-associated nodes associated with the virtual private network; and selecting the target edge node from at least one edge service node corresponding to the source service node includes: selecting the target edge node from the edge service nodes other than the edge-associated node in the at least one edge service node.
[0075] In actual situations, the transmission of a VPN channel may need to pass through edge service nodes. These edge service nodes associated with the VPN channel are edge-associated nodes, and the information of the edge-associated nodes is recorded in the routing policy stored in the client node.
[0076] The client node can determine which edge service nodes are edge associated nodes according to the routing policy, and thus select a target edge node from edge service nodes other than the edge associated nodes. Since VPN instability may be related to edge associated nodes, this method can further eliminate the interference of VPN instability on client request processing.
[0077] In one embodiment, the client request sent to the target edge node is encrypted.
[0078] As mentioned above, VPN channels are encrypted channels, and VPN routing policies can determine which data packets should be encrypted and sent through VPN channels, and which data packets should be routed directly through the ordinary Internet. Considering the security of data, data transmission through the target edge node also needs to be encrypted to ensure data security.
[0079] The specific encryption method may be common symmetric encryption or asymmetric encryption, and of course may be other encryption methods, which are not limited in this specification.
[0080] Furthermore, the encryption method requested by the client is key encryption; the key is a key pre-negotiated by the client node and the source service node and stored in the client node; or, the key is a temporary key received from the source service node after the client node establishes a connection with the source service node.
[0081] In one case, the client node stores a public key pre-negotiated with the source service node, and the source service node stores a private key corresponding to the public key. The client node can encrypt the client request according to the public key and send the encrypted client request to the target edge node. After receiving the encrypted client request forwarded by the target edge node, the source service node can decrypt the encrypted client request according to the private key and further process the decrypted client request.
[0082] In this case, the client request is encrypted in the form of asymmetric encryption, ensuring the security of the data.
[0083] In another case, after the client node establishes a connection with the source service node, the source service node can generate a temporary public-private key pair, which is time-limited, and the source service node can generate a new temporary public-private key pair every preset time period. The source service node can send a temporary public key in the temporary public-private key pair to the client node, so that the client node can encrypt the client request according to the temporary public key. The source service node can also decrypt the encrypted client request according to the temporary private key in the temporary public-private key pair. The source service node stores a pre-negotiated public key and private key, and also includes: obtaining a pre-negotiated public key from the source service node through a virtual private network between the client node and the source service node, and encrypting the client request according to the public key, so that the source service node decrypts the encrypted client request according to the private key.
[0084] In this case, the key used to encrypt the client request is temporarily generated and can be updated on time, which further improves data security.
[0085] See also Figure 5 , Figure 5 A block diagram of a network connection device provided in an embodiment of this specification. The device is applied to a client node, including:
[0086] A selection unit 502 is configured to select a target edge node from at least one edge service node corresponding to the source service node in response to instability of a virtual private network between the client node and the source service node;
[0087] A connection establishment unit 504, configured to send a connection establishment request to the target edge node to establish a network connection with the target edge node;
[0088] The sending unit 506 is configured to send the client request to the target edge node based on the network connection, so that the edge service node forwards the client request to the source service node for processing.
[0089] Optionally, also include:
[0090] The first determining unit 508 is used to send a connection establishment request to the source service node through the virtual private network between the client node and the source service node, and determine whether the virtual private network meets a preset condition according to a response result of the source service node; wherein the preset condition includes at least one of the following: no response message returned by the source service node is received, and the first network delay of the virtual private network exceeds a preset threshold;
[0091] The second determining unit 510 is configured to determine that the virtual private network is unstable if the virtual private network meets any of the preset conditions.
[0092] Optionally, when the preset condition includes that the first network delay of the virtual private network exceeds a preset threshold,
[0093] Also included is: a third determining unit 512, configured to determine a second network delay of a network channel established between the client node and the source service node based on the network connection;
[0094] The sending unit 506 is specifically configured to send the client request to the target edge node when the first network delay is greater than the second network delay.
[0095] Optionally, before sending the connection establishment request to the source service node, the method further includes:
[0096] The fourth determining unit 514 is configured to determine a network card name of a network interface of the client node on the virtual private network, and determine whether the virtual private network is in an activated state according to the network card name.
[0097] Optionally, the selection unit 502 is specifically configured to:
[0098] Determine description information of the at least one edge service node, and send a connection establishment request to the at least one edge service node according to the determined description information;
[0099] The edge service node that first establishes a network connection is determined as the target edge node.
[0100] Optionally, the description information is an IP address; the selection unit 502 is specifically configured to:
[0101] Obtaining a domain name corresponding to the edge service node, and sending the domain name to a domain name server, so that the domain name server resolves the domain name to obtain the IP address of the at least one edge service node; and / or,
[0102] The IP address of the at least one edge service node is obtained from the source service node through a virtual private network between the client node and the source service node.
[0103] Optionally, the client node stores a routing address list corresponding to the virtual private network, and the routing address list records edge-related nodes passed by the virtual private network;
[0104] The selecting unit 502 is specifically configured to select a target edge node from the edge service nodes other than the edge associated node in the at least one edge service node.
[0105] Optionally, the client request sent to the target edge node is encrypted.
[0106] Optionally, the encryption method requested by the client is key encryption;
[0107] The key is a key pre-negotiated between the client node and the source service node and stored in the client node; or,
[0108] The key is a temporary key received from the source service node after the client node establishes a connection with the source service node.
[0109] In this embodiment, when the virtual private network between the client node and the source service node is unstable, a network connection is established through an edge service node corresponding to the source service node, so that the network connection established by the edge service node can replace the virtual private network to establish a connection with the source service node, thereby avoiding interference of the unstable virtual private network on the communication between the client node and the source service node, and ensuring the processing efficiency of the client request.
[0110] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the network connection device embodiment, since it is basically similar to the network connection method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0111] See also Figure 6A schematic diagram of the structure of an electronic device provided in an embodiment of this specification is shown.
[0112] like Figure 6 As shown, the electronic device 600 may include: at least one processor 601 , at least one network interface 604 , a user interface 603 , a memory 605 , and at least one communication bus 602 .
[0113] The communication bus 602 may be used to realize the connection and communication among the above-mentioned components.
[0114] The user interface 603 may include buttons, and the optional user interface may also include a standard wired interface or a wireless interface.
[0115] The network interface 604 may include, but is not limited to, a Bluetooth module, an NFC module, a Wi-Fi module, etc.
[0116] Among them, the processor 601 may include one or more processing cores. The processor 601 uses various interfaces and lines to connect the various parts of the entire electronic device 600, and executes various functions and processes data of the electronic device 600 by running or executing instructions, programs, code sets or instruction sets stored in the memory 605, and calling data stored in the memory 605. Optionally, the processor 601 can be implemented in at least one hardware form of DSP, FPGA, and PLA. The processor 601 can integrate one or a combination of CPU, GPU, modem, etc. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to handle wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 601, and it can be implemented separately through a chip.
[0117] Among them, the memory 605 may include RAM or ROM. Optionally, the memory 605 includes a non-transient computer-readable medium. The memory 605 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 605 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above various method embodiments, etc. The memory 605 may also be at least one storage device located away from the aforementioned processor 601. The memory 605 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a network connection application. The processor 601 can be used to call the network connection application stored in the memory 605 and execute the network connection steps mentioned in the aforementioned embodiments.
[0118] The embodiment of the present specification also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a computer or a processor, the computer or the processor executes the above Figure 3 , Figure 4a , Figure 4b One or more steps in the illustrated embodiment. If the components of the electronic device described above are implemented in the form of software functional units and sold or used as independent products, they can be stored in the computer-readable storage medium.
[0119] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of this specification is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0120] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes. In the absence of conflict, the technical features in this embodiment and the implementation scheme can be combined arbitrarily.
[0121] The embodiments described above are merely preferred embodiments of this specification and are not intended to limit the scope of this specification. Without departing from the design spirit of this specification, various modifications and improvements made to the technical solutions of this specification by ordinary technicians in this field should fall within the scope of protection determined by the claims of this specification.
Claims
1. A network connection method, applied to a client node, comprising: In response to the virtual private network between the client node and the source service node being unstable, selecting a target edge node from at least one edge service node corresponding to the source service node; Sending a connection establishment request to the target edge node to establish a network connection with the target edge node; Based on the network connection, a client request is sent to the target edge node, so that the edge service node forwards the client request to the source service node for processing.
2. A network connection method according to claim 1, further comprising: Sending a connection request to the source service node through the virtual private network between the client node and the source service node, and determining whether the virtual private network meets a preset condition according to a response result of the source service node; wherein the preset condition includes at least one of the following: no response message returned by the source service node is received, and a first network delay of the virtual private network exceeds a preset threshold; When the virtual private network meets any of the preset conditions, it is determined that the virtual private network is unstable.
3. A network connection method according to claim 2, wherein the preset condition includes a first network delay of the virtual private network exceeding a preset threshold value, Also includes: Determine a second network delay of a network channel established between the client node and the source service node based on the network connection; The sending the client request to the target edge node includes: sending the client request to the target edge node when the first network delay is greater than the second network delay.
4. The network connection method according to claim 2, before sending the connection establishment request to the source service node, further comprising: Determine a network card name of a network interface of the client node on the virtual private network, and determine whether the virtual private network is in an activated state according to the network card name.
5. A network connection method according to claim 1, wherein the step of selecting a target edge node from at least one edge service node corresponding to the source service node comprises: Determine description information of the at least one edge service node, and send a connection establishment request to the at least one edge service node according to the determined description information; The edge service node that first establishes a network connection is determined as the target edge node.
6. A network connection method according to claim 5, wherein the description information is an IP address; The determining the description information of the at least one edge service node includes: Obtain a domain name corresponding to the edge service node, and send the domain name to a domain name server, so that the domain name server resolves the domain name to obtain an IP address of the at least one edge service node; or, The IP address of the at least one edge service node is obtained from the source service node through a virtual private network between the client node and the source service node.
7. A network connection method according to claim 1, wherein the client node stores a routing policy corresponding to the virtual private network, and the routing policy records an edge-associated node associated with the virtual private network; The selecting a target edge node from at least one edge service node corresponding to the source service node includes: A target edge node is selected from edge service nodes other than the edge associated node among the at least one edge service node.
8. According to a network connection method according to claim 1, the client request sent to the target edge node is encrypted.
9. A network connection method according to claim 8, wherein the encryption method requested by the client is key encryption; The key is a key pre-negotiated between the client node and the source service node and stored in the client node; or, The key is a temporary key received from the source service node after the client node establishes a connection with the source service node.
10. A network connection device, applied to a client node, comprising: A selection unit: in response to instability of a virtual private network between a client node and a source service node, selecting a target edge node from at least one edge service node corresponding to the source service node; A connection establishment unit: sending a connection establishment request to the target edge node to establish a network connection with the target edge node; A sending unit: based on the network connection, sends a client request to the target edge node, so that the edge service node forwards the client request to the source service node for processing.
11. The network connection device according to claim 10, further comprising: A first determining unit: sending a connection establishment request to the source service node through the virtual private network between the client node and the source service node, and determining whether the virtual private network meets a preset condition according to a response result of the source service node; wherein the preset condition includes at least one of the following: no response message returned by the source service node is received, and a first network delay of the virtual private network exceeds a preset threshold; A second determining unit is configured to determine that the virtual private network is unstable when the virtual private network meets any of the preset conditions.
12. A network connection device according to claim 11, wherein when the preset condition includes that the first network delay of the virtual private network exceeds a preset threshold, Also includes: A third determining unit: determining a second network delay of a network channel established between the client node and the source service node based on the network connection; The sending unit is specifically configured to send a client request to the target edge node when the first network delay is greater than the second network delay.
13. The network connection device according to claim 11, before sending the connection establishment request to the source service node, further comprising: A fourth determining unit: determining a network card name of a network interface of the client node on the virtual private network, and determining whether the virtual private network is in an activated state according to the network card name.
14. The network connection device according to claim 10, wherein the selection unit is specifically configured to: Determine description information of the at least one edge service node, and send a connection establishment request to the at least one edge service node according to the determined description information; The edge service node that first establishes a network connection is determined as the target edge node.
15. A network connection device according to claim 14, wherein the description information is an IP address; and the selection unit is specifically configured to: Obtaining a domain name corresponding to the edge service node, and sending the domain name to a domain name server, so that the domain name server resolves the domain name to obtain the IP address of the at least one edge service node; or, The IP address of the at least one edge service node is obtained from the source service node through a virtual private network between the client node and the source service node.
16. A network connection device according to claim 10, wherein the client node stores a routing address list corresponding to the virtual private network, and the routing address list records edge-related nodes passed by the virtual private network; The selection unit is specifically configured to select a target edge node from edge service nodes other than the edge associated node in the at least one edge service node.
17. The network connection device according to claim 10, wherein the client request sent to the target edge node is encrypted.
18. A network connection device according to claim 17, wherein the encryption method requested by the client is key encryption; The key is a key pre-negotiated between the client node and the source service node and stored in the client node; or, The key is a temporary key received from the source service node after the client node establishes a connection with the source service node.
19. An electronic device comprising a processor and a memory; The processor is connected to the memory; The memory is used to store executable program code; The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the method according to any one of claims 1 to 9.
20. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
