Network communication method and device, communication equipment and storage medium
By deploying VPN functions in independent communication devices and building VPN tunnels using cellular network modules and communication interfaces, the convenience and maintenance cost of installing client software in terminal devices in existing VPN technology is solved, and convenient and efficient use of VPN functions is achieved.
Patent Information
- Application Number
- CN202411860163.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-03-07
AI Technical Summary
The existing VPN technology requires the installation of client software on the user terminal, which reduces convenience. Moreover, due to the wide variety of terminal devices, the development and maintenance of VPN client software is relatively high.
Deploy VPN functions in independent communication devices, and realize the construction and data transmission of VPN tunnels through cellular network modules and communication interfaces, avoid installing VPN client software in terminal devices.
It improves the convenience of using VPN functions, reduces the development and maintenance costs of VPN functions, and ensures that VPN functions are plug-and-play.
Smart Images

Figure CN119583205A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network communications, and in particular to a network communication method, device, communication equipment and storage medium. Background Art
[0002] VPN (Virtual Private Network) is a virtual private network. Specifically, the basic principle of VPN technology is to use tunnel technology to establish an encrypted tunnel in the public network and transmit network data through the tunnel. This technology solves the cost of renting cross-provincial and cross-sea dedicated lines between two remote networks, reduces operating costs, and performs identity authentication before initiating the establishment of the tunnel, encrypts data packets during tunnel transmission, and fully guarantees the security of network access.
[0003] In the related art, in order to realize VPN communication, it is usually necessary to install and deploy VPN client software in the user terminal. However, the installation of VPN client software reduces the convenience of using VPN functions; and there are many types of user terminals, and VPN client software needs to be adapted and maintained separately for each user terminal, which also increases the development and maintenance costs of VPN client software. Summary of the invention
[0004] The purpose of the present invention is to provide a network communication method, apparatus, communication equipment and storage medium, which can deploy VPN functions in independent communication equipment, avoid installing VPN client software in terminal equipment, and ensure that the VPN function is plug-and-play, thereby improving ease of use.
[0005] In order to solve the above technical problems, the present invention provides a network communication method, which is applied to a communication device, wherein the communication device includes a cellular network module and a communication interface, and the method includes:
[0006] When it is determined that the terminal device is accessed through the communication interface, a firmware initialization operation is performed, and a network registration dialing operation is performed through the cellular network module to connect to the cellular network;
[0007] Performing an address allocation operation on the terminal device and establishing a network connection with the terminal device;
[0008] Receiving authentication information sent by the terminal device, and performing a verification operation on the authentication information;
[0009] When it is determined that the authentication information passes the verification, a VPN tunnel is established with the server through the cellular network, and the business data between the terminal device and the server is transmitted through the VPN tunnel.
[0010] Optionally, the constructing a VPN tunnel with the server through the cellular network includes:
[0011] Based on the cellular network and the national encryption algorithm, a tunnel establishment process is performed with the server to build a national encryption VPN tunnel with the server.
[0012] Optionally, the communication interface includes a network interface and / or a USB interface.
[0013] Optionally, the performing a verification operation on the authentication information includes:
[0014] Obtaining preset certificate information, and sending the certificate information and the authentication information to the server through the cellular network, so that the server simultaneously verifies the certificate information and the authentication information, and the server returns a virtual IP address and a resource address when determining that both the certificate information and the authentication information pass the verification;
[0015] When the virtual IP address and the resource address are received, it is determined that the authentication information has passed the verification, and a configuration operation is performed on a preset virtual network card using the virtual IP address, and the resource address is added to a routing table.
[0016] Optionally, the transmitting the service data between the terminal device and the server through the VPN tunnel includes:
[0017] receiving a first network data packet sent by the terminal device, and determining whether a destination address of the first network data packet is the same as a resource address in the routing table;
[0018] If they are the same, forwarding the first network data packet to the preset virtual network card, modifying the source address of the first network data packet to the virtual IP address in the preset virtual network card, encrypting the first network data packet according to the VPN tunnel parameters, and obtaining a first encrypted data packet;
[0019] The first encrypted data packet is sent to the server through the VPN tunnel.
[0020] Optionally, it also includes:
[0021] Receiving a second encrypted data packet returned by the server through the VPN tunnel;
[0022] Decrypting the second encrypted data packet according to the VPN tunnel parameters to obtain a second network data packet, and modifying the destination address of the second network data packet to the intranet IP address of the terminal device;
[0023] The second network data packet with the target address modified is sent to the terminal device.
[0024] Optionally, the receiving authentication information sent by the terminal device includes:
[0025] receiving an authentication request sent by the terminal device, and returning a preset network page to the terminal device; wherein the preset network page is used to input the authentication information;
[0026] Receive authentication information sent by the terminal device.
[0027] The present invention also provides a network communication device, which is applied to a communication device, wherein the communication device includes a cellular network module and a communication interface, and the device includes:
[0028] An initialization module, configured to execute a firmware initialization operation when it is determined that the terminal device is accessed through the communication interface, and to execute a network registration dialing operation through the cellular network module to connect to the cellular network;
[0029] An address allocation module, used to perform an address allocation operation on the terminal device and establish a network connection with the terminal device;
[0030] An authentication module, used to receive the authentication information sent by the terminal device and perform a verification operation on the authentication information;
[0031] The VPN communication module is used to build a VPN tunnel with the server through the cellular network when it is determined that the authentication information has passed the verification, and transmit the business data between the terminal device and the server through the VPN tunnel.
[0032] The present invention also provides a communication device, comprising: a processor, a memory, a communication interface, and a cellular network module;
[0033] Memory for storing computer programs;
[0034] A processor, configured to implement the network communication method as described above when executing the computer program;
[0035] The communication interface is used to connect to the terminal device;
[0036] The cellular network module is used to connect to a cellular network.
[0037] Optionally, the communication interface includes a network interface and / or a USB interface.
[0038] The present invention also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are loaded and executed by a processor, the network communication method as described above is implemented.
[0039] The present invention provides a network communication method, which is applied to a communication device, wherein the communication device comprises a cellular network module and a communication interface, and the method comprises: when it is determined that a terminal device is accessed through the communication interface, executing a firmware initialization operation, and executing a network registration dialing operation through the cellular network module to connect to a cellular network; performing an address allocation operation on the terminal device and establishing a network connection with the terminal device; receiving authentication information sent by the terminal device, and performing a verification operation on the authentication information; when it is determined that the authentication information passes the verification, constructing a VPN tunnel with a server through the cellular network, and transmitting business data between the terminal device and the server through the VPN tunnel.
[0040] It can be seen that the present invention can set a cellular network module and a communication interface in an independent communication device, and can provide the communication device with VPN tunnel construction capability and VPN communication capability. Specifically, when it is determined that the terminal device is accessed through the communication interface, a firmware initialization operation can be performed, and a network registration dialing operation can be performed through the cellular network module to connect to the cellular network. Subsequently, an address allocation operation can be performed on the terminal device to establish a network connection with the terminal device. Subsequently, the authentication information sent by the terminal device can be received, and a verification operation can be performed on the authentication information to verify the identity of the terminal device. Finally, when it is determined that the authentication information passes the verification, a VPN tunnel is constructed with the server through the cellular network, and business data between the terminal device and the server is transmitted through the VPN tunnel. In other words, the VPN function can be deployed in an independent communication device, which can not only avoid installing VPN client software in the terminal device, but also ensure that the VPN function is plug-and-play, thereby improving the convenience of using the VPN function and reducing costs. The present invention also provides a network communication device, a communication device and a computer-readable storage medium, which have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0042] Figure 1 A flowchart of a network communication method provided by an embodiment of the present invention;
[0043] Figure 2 A flowchart of another network communication method provided by an embodiment of the present invention;
[0044] Figure 3 A structural block diagram of a network communication device provided by an embodiment of the present invention;
[0045] Figure 4 A structural block diagram of a communication device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] VPN (Virtual Private Network) is a virtual private network. Specifically, the basic principle of VPN technology is to use tunnel technology to establish an encrypted tunnel in the public network and transmit network data through the tunnel. This technology solves the cost of renting cross-provincial and cross-sea dedicated lines between two remote networks, reduces operating costs, and performs identity authentication before initiating the establishment of the tunnel, encrypts data packets during tunnel transmission, and fully guarantees the security of network access.
[0048] In the related art, in order to realize VPN communication, it is usually necessary to install and deploy VPN client software in the user terminal. However, the installation of VPN client software reduces the convenience of using VPN functions; and there are many types of user terminals, such as personal computers, mobile devices, servers, IoT devices (such as industrial control equipment, access control equipment), etc. At the same time, the operating systems running on different user terminals may also be different, which leads to the need for VPN client software to be individually adapted and maintained for each user terminal, thereby increasing the development and maintenance costs of VPN client software.
[0049] In view of this, in order to solve the technical problem of how to improve the convenience of using VPN function, the present invention can provide a communication device and a network communication method, in which a cellular network module and a communication interface can be added to the communication device, and the communication device can be endowed with VPN tunnel building function and VPN communication function. In this way, the VPN function can be deployed in an independent communication device, which can avoid installing VPN client software in the terminal device, and at the same time ensure that the VPN function is plug-and-play, thereby improving the convenience of use.
[0050] For easier understanding, please refer to Figure 1 , Figure 1A flowchart of a network communication method provided by an embodiment of the present invention. The method is applied to a communication device, and the communication device may further include a cellular network module and a communication interface. The cellular network module may provide cellular network access capability, and may be composed of a baseband, an antenna, a SIM card slot, etc., and may specifically be a 3G module, a 4G module, a 5G module, etc. The communication interface may provide terminal device access capability, and may specifically be a network interface (RJ45 interface), a USB interface, or both a network interface and a USB interface. The method may include:
[0051] S101. When it is determined that the terminal device is accessed through the communication interface, a firmware initialization operation is performed, and a network registration dialing operation is performed through the cellular network module to connect to a cellular network.
[0052] In this embodiment, the communication device can access the terminal device through its own communication interface, communicate with the terminal device through the network, and provide VPN services for the terminal device. When determining to access the terminal device, the communication device can trigger power-on startup and perform firmware initialization operations. Among them, the communication device firmware can include an embedded operating system, a DHCP service program, a module dialing program, an SSLVPN client program, and device certificate information. Among them, the embedded operating system is used to provide a basic operating system environment. The DHCP service program (Dynamic Host Configuration Protocol) can be used by the communication device to assign an intranet IP address to the terminal device. The module dialing program is used to perform PPPoE dialing (Point-to-Point Protocol Over Ethernet). The SSL VPN client program (Secure Socket Layer) and the device certificate information are both used to provide VPN functions. It is worth noting that in this embodiment, the SSLVPN client program can be deployed in the communication device, and the communication device provides VPN services for the terminal device without setting the client program in the terminal device. In this way, in this embodiment, only the adaptation and maintenance of the SSLVPN client program in the communication device need to be considered, thereby effectively reducing the development and maintenance costs of the client program.
[0053] Furthermore, when the communication device completes the firmware initialization operation, it can perform a network registration dial-up operation through its own cellular network module to connect to the cellular network. This embodiment does not limit the specific process of the network registration dial-up operation, which may include, for example, SIM card authentication, available base station selection, optimal network signal selection, sending a registration request to the network, obtaining an assigned public IP address, etc.
[0054] S102: Perform an address allocation operation on the terminal device and establish a network connection with the terminal device.
[0055] In this step, when the communication device completes the network registration dial-up operation, it can perform an address allocation operation for the terminal device and establish a network connection with the terminal device. Specifically, the communication device can allocate an intranet IP address and a gateway IP address to the terminal device based on the above-mentioned DHCP service program. Among them, the gateway IP address is the intranet IP address of the communication device itself, that is, the communication device can be regarded as a gateway device of the intranet where the terminal device is located.
[0056] S103: Receive authentication information sent by the terminal device, and perform a verification operation on the authentication information.
[0057] In this step, in order to protect the data security of the server and ensure that only authenticated terminal devices are allowed to access the server through the VPN tunnel, the communication device also needs to separately receive the authentication information sent by the terminal device and perform a verification operation on the authentication information. For the convenience of the user, the terminal device can initiate an authentication request to the communication device. Subsequently, when the communication device receives the authentication request, it can return a preset network page to the terminal device. Subsequently, the terminal device can output the preset network page so that the user can enter the authentication information through the preset network page. Finally, the terminal device can send the input authentication information to the communication device.
[0058] Based on this, the receiving the authentication information sent by the terminal device may include:
[0059] Step 11: receiving an authentication request sent by the terminal device, and returning a preset network page to the terminal device; wherein the preset network page is used to input the authentication information;
[0060] Step 12: Receive the authentication information sent by the terminal device.
[0061] Furthermore, this embodiment does not limit the specific process of the above-mentioned verification operation, which can be set according to actual application requirements. For example, to ensure the reliability of verification, the communication device can send the authentication information together with its own certificate information to the server, so that the server can verify both the authentication information and the certificate information, that is, verify the user identity and the communication device identity at the same time. If it is determined that the authentication information and the certificate information pass the verification, the server can return the virtual IP address and resource address required for VPN communication to the communication device. Furthermore, when the communication device receives the virtual IP address and the resource address, it can determine that the authentication information passes the verification.
[0062] Furthermore, when the communication device receives the virtual IP address and resource address, it can use the virtual IP address to perform configuration operations on the preset virtual network card and add the resource address to the routing table. The preset virtual network card is subsequently used to provide VPN services, and the routing table is used to forward network data packets that need to be sent by the VPN tunnel to the preset virtual network card.
[0063] Based on this, performing a verification operation on the authentication information may include:
[0064] Step 21: Obtain preset certificate information, and send the certificate information and the authentication information to the server through the cellular network, so that the server can verify the certificate information and the authentication information at the same time, and return the virtual IP address and resource address when the server determines that the certificate information and the authentication information have passed the verification.
[0065] Step 22: When the virtual IP address and the resource address are received, it is determined that the authentication information has passed the verification, and the virtual IP address is used to perform a configuration operation on the preset virtual network card, and the resource address is added to the routing table.
[0066] S104: When it is determined that the authentication information passes the verification, a VPN tunnel is established with the server through the cellular network, and business data between the terminal device and the server is transmitted through the VPN tunnel.
[0067] When it is determined that the authentication information has passed the verification, the communication device can establish a VPN tunnel with the server through the cellular network to transmit business data between the terminal device and the server through the VPN tunnel.
[0068] It should be noted that this embodiment does not limit the construction process of the VPN tunnel, and reference may be made to the relevant technologies of SSLVPN. In order to improve the security and controllability of the VPN tunnel, a tunnel establishment process may be performed with the server based on the national secret algorithm to build a national secret VPN tunnel with the server. Among them, common national secret algorithms may include SM2, SM3, and SM4.
[0069] Based on this, the construction of a VPN tunnel with the server through the cellular network may include:
[0070] Step 31: Execute a tunnel establishment process with the server based on the cellular network and the national encryption algorithm to build a national encryption VPN tunnel with the server.
[0071] The following will introduce the process of a communication device transmitting a network data packet from a terminal device to a server. Based on this, the transmission of service data between the terminal device and the server through the VPN tunnel may include:
[0072] Step 41: Receive a first network data packet sent by the terminal device, and determine whether the destination address of the first network data packet is the same as the resource address in the routing table. If yes, proceed to step 42; if no, proceed to step 44.
[0073] In this step, when the communication device receives the first network data packet sent by the terminal device, it needs to determine whether the first network data packet needs to be sent from the VPN tunnel. Specifically, the communication device can determine whether the target address of the first network data packet is the same as the recorded resource address in the routing table. If they are the same, it can be determined that the first network data packet needs to be sent through the VPN tunnel, and then the first network data packet can be forwarded to the preset virtual network card. If they are different, the first network data packet can be sent directly through the cellular network.
[0074] Step 42: If they are the same, forward the first network data packet to the preset virtual network card, modify the source address of the first network data packet to the virtual IP address in the preset virtual network card, encrypt the first network data packet according to the VPN tunnel parameters, and obtain a first encrypted data packet.
[0075] In this step, since the communication device provides VPN services for the terminal device in this embodiment, that is, the communication device replaces the terminal device to perform VPN communication with the server, it is necessary to modify the source address of the first network data packet from the intranet IP address of the terminal device to the virtual IP address issued by the server, so as to modify the source device of the first network data packet to point to the preset virtual network card. Subsequently, the communication device also needs to encrypt the first network data packet according to the VPN tunnel parameters to obtain the first encrypted data packet to be sent.
[0076] Step 43: Send the first encrypted data packet to the server through the VPN tunnel.
[0077] Step 44: If different, sending the first encrypted data packet through the cellular network.
[0078] The following will introduce the process of the communication device transmitting the network data packet from the server to the terminal device. Based on this, the method may also include:
[0079] Step 51: Receive a second encrypted data packet returned by the server through the VPN tunnel.
[0080] Step 52: Decrypt the second encrypted data packet according to the VPN tunnel parameters to obtain a second network data packet, and modify the destination address of the second network data packet to the intranet IP address of the terminal device.
[0081] In this step, the communication device first needs to decrypt the second network data packet according to the VPN tunnel parameters to obtain the second network data packet in plain text. In addition, as mentioned above, since the source device of the first network data packet has been modified to point to the virtual network card in the communication device, the destination device corresponding to the second network data packet returned by the server is also the virtual network card in the communication device. To ensure that the terminal device can recognize the second network data packet, the communication device also needs to modify the destination address of the second network data packet to the intranet IP address of the terminal device.
[0082] Step 53: Send the second network data packet with the modified target address to the terminal device.
[0083] Based on the above embodiments, the present invention can set a cellular network module and a communication interface in an independent communication device, and can provide the communication device with VPN tunnel construction capability and VPN communication capability. Specifically, when it is determined that the terminal device is accessed through the communication interface, a firmware initialization operation can be performed, and a network registration dial-up operation can be performed through the cellular network module to connect to the cellular network. Subsequently, an address allocation operation can be performed on the terminal device to establish a network connection with the terminal device. Subsequently, the authentication information sent by the terminal device can be received, and a verification operation can be performed on the authentication information to verify the identity of the terminal device. Finally, when it is determined that the authentication information passes the verification, a VPN tunnel is constructed with the server through the cellular network, and the business data between the terminal device and the server is transmitted through the VPN tunnel. In other words, the VPN communication task can be transferred from the terminal device to the communication device, which can not only avoid the installation of VPN client software in the terminal device, but also ensure that the VPN function is plug-and-play, thereby reducing the user's usage cost and maintenance cost.
[0084] Based on the above embodiment, the above network communication method is fully introduced below based on specific examples. Figure 2 , Figure 2 This is a flow chart of another network communication method provided by an embodiment of the present invention. The method specifically includes:
[0085] 1. Register user authentication information on the VPN server, issue device certificate information, and burn the device certificate information, module networking dial-up program, and SSL client program into the 4G module firmware.
[0086] 2. After the 4G module is connected to the terminal device through the USB port or RJ45 network port, insert the SIM card into the 4G module slot. Power on the 4G module, load and run the firmware after the module starts, start the DHCP service and allocate network configuration parameters to the terminal device. The module communicates with the SIM card, identifies and authenticates the validity and legitimacy of the SIM card. The module connects to the operator network to register and obtain the assigned network IP address, and sets the Internet access parameters. The module starts the module's built-in VPN client.
[0087] The startup process of the 4G module is as follows:
[0088]
[0089] 3. The server is initialized, a TCP listening port is created, a virtual network card is created, and the IP address of the virtual network card is set. The VPN client in the 4G module initiates a TCP link, and the server accepts the link. The user of the terminal device can access the identity authentication page provided by the 4G module and manually enter the module PIN code. The client software in the module obtains the identification PIN code, and uses the device certificate and the PIN code to initiate login authentication, and the server verifies the authentication. The authentication is sent by the server to the client through the client virtual IP address and VPN resources; the client creates a virtual network card, sets the IP address of the virtual network card, and the client writes the VPN resources into the routing table in the operating system in the 4G module; the client initiates a tunnel establishment request, the server receives the tunnel establishment request, and the tunnel establishment is completed.
[0090] The tunnel establishment process is as follows:
[0091]
[0092] 4. When the user directly accesses the service address in the VPN resource list on the terminal device connected to the 4G module, the terminal device forwards the data packet to the 4G module according to the gateway address. The 4G module will forward the data packet of the terminal device accessing the resource to the client virtual network card according to the pre-written routing table. The client intercepts the IP data packet on the virtual network card, and the client encrypts the legal IP data packet after screening and filtering the VPN resource list and forwards it to the server; the server reads the data packet from the tunnel, decrypts it and sends it to the virtual network card; the data packet on the virtual network card is sent to the user service, and the user service gives a response packet; the server intercepts the IP data packet of the virtual network card, finds the corresponding client link information according to the IP address in the IP header, and encrypts the IP data packet and forwards it to the client; the client reads the encrypted packet from the tunnel and decrypts it, and writes the data packet to the virtual network card; the virtual network card returns the response data packet to the gateway address, and the 4G module forwards the response packet to the terminal device, and the user receives the response IP data packet for accessing the resource service.
[0093] The tunnel encryption transmission workflow is as follows:
[0094] Terminal equipment Client (4G module) Server Terminal device access resource address According to the gateway assigned by DHCP, the data packets accessing resources are forwarded to the gateway address Receive data packets from terminal devices and forward them to the virtual network card according to the system routing table and the destination address of the data packets. The client intercepts the IP data packets on the virtual network card and filters the data packets belonging to VPN resources. The client encrypts the data packet and sends it to the server through the tunnel The server reads the encrypted data packet from the tunnel, decrypts it, and writes it to the virtual network card The server intercepts IP data packets on the virtual network card The server parses the destination IP of the data packet, finds the corresponding client tunnel based on the destination IP, encrypts the data packet and sends it to the client through the tunnel The client reads the encrypted packet from the tunnel, decrypts it, and writes the packet to the virtual network card The virtual network card returns the response packet to the gateway address Received the response packet from the resource
[0095] The network communication device, communication equipment, computer-readable storage medium, and computer program product provided by the present invention are introduced below. The network communication device, communication equipment, computer-readable storage medium, and computer program product described below can be compared with the network communication method described above.
[0096] Please refer to Figure 3 , Figure 3 This is a structural block diagram of a network communication device provided by an embodiment of the present invention. The device is applied to a communication device, the communication device includes a cellular network module and a communication interface, and the device includes:
[0097] The initialization module 301 is used to perform a firmware initialization operation when it is determined that the terminal device is accessed through the communication interface, and perform a network registration dialing operation through the cellular network module to connect to the cellular network;
[0098] An address allocation module 302, configured to perform an address allocation operation on the terminal device and establish a network connection with the terminal device;
[0099] The authentication module 303 is used to receive the authentication information sent by the terminal device and perform a verification operation on the authentication information;
[0100] The VPN communication module 304 is used to build a VPN tunnel with the server through the cellular network when it is determined that the authentication information has passed the verification, and transmit the business data between the terminal device and the server through the VPN tunnel.
[0101] Optionally, the VPN communication module 304 may include:
[0102] The VPN tunnel establishment submodule is used to execute the tunnel establishment process with the server based on the cellular network and the national encryption algorithm to build a national encryption VPN tunnel with the server.
[0103] Optionally, the authentication module 303 may include:
[0104] A sending submodule, used for obtaining preset certificate information, and sending the certificate information and the authentication information to the server through the cellular network, so that the server can verify the certificate information and the authentication information at the same time, and the server can return the virtual IP address and the resource address when it is determined that the certificate information and the authentication information are both verified;
[0105] The receiving submodule is used to determine whether the authentication information has passed the verification when receiving the virtual IP address and the resource address, and to perform configuration operations on the preset virtual network card using the virtual IP address, and to add the resource address to the routing table.
[0106] Optionally, the VPN communication module 304 may include:
[0107] a data packet receiving submodule, configured to receive a first network data packet sent by the terminal device, and determine whether a target address of the first network data packet is the same as a resource address in the routing table;
[0108] an encryption submodule, configured to forward the first network data packet to the preset virtual network card if the two are the same, and modify the source address of the first network data packet to the virtual IP address in the preset virtual network card, encrypt the first network data packet according to the VPN tunnel parameters, and obtain a first encrypted data packet;
[0109] The first VPN communication submodule is used to send the first encrypted data packet to the server through the VPN tunnel.
[0110] Optionally, the VPN communication module 304 may further include:
[0111] A second VPN communication submodule, used to receive a second encrypted data packet returned by the server through the VPN tunnel;
[0112] a decryption submodule, configured to decrypt the second encrypted data packet according to the VPN tunnel parameters to obtain a second network data packet, and modify the destination address of the second network data packet to the intranet IP address of the terminal device;
[0113] The data packet sending submodule is used to send the second network data packet with the target address modified to the terminal device.
[0114] Optionally, the authentication module 303 may include:
[0115] A page return submodule, used to receive the authentication request sent by the terminal device, and return a preset network page to the terminal device; wherein the preset network page is used to input the authentication information;
[0116] The authentication information receiving submodule is used to receive the authentication information sent by the terminal device.
[0117] Please refer to Figure 4 , Figure 4This is a structural block diagram of a communication device provided in an embodiment of the present invention. The embodiment of the present invention provides a communication device 10, including a processor 11, a memory 12, a communication interface 14, and a cellular network module 15; wherein the memory 12 is used to store a computer program; the processor 11 is used to execute the network communication method provided in the aforementioned embodiment when executing the computer program; the communication interface 14 is used to connect to a terminal device, and may include a network interface and / or a USB interface; the cellular network module 15 is used to connect to a cellular network.
[0118] For the specific process of the above-mentioned network communication method, reference may be made to the corresponding contents provided in the aforementioned embodiments, which will not be repeated here.
[0119] Furthermore, the memory 12 as a carrier for storing resources may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the storage method may be temporary storage or permanent storage.
[0120] In addition, the communication device 10 also includes a power supply 13 and a communication bus 16. The power supply 13 is used to provide working voltage for each hardware device on the communication device 10. It can be a built-in power supply (such as a battery), or the terminal device can be used as a power supply. The communication bus 16 can be a PCIe bus (Peripheral Component Interconnect express, a high-speed serial computer expansion bus standard).
[0121] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, wherein the computer program / instruction implements the network communication method described in the above embodiment when executed by a processor.
[0122] Since the embodiments of the computer program product part correspond to the embodiments of the network communication method part, please refer to the description of the embodiments of the network communication method part for the embodiments of the computer program product part, and will not be repeated here.
[0123] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the network communication method described in the above embodiment is implemented.
[0124] Since the embodiments of the computer-readable storage medium part correspond to the embodiments of the network communication method part, please refer to the description of the embodiments of the network communication method part for the embodiments of the storage medium part, which will not be repeated here.
[0125] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0126] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0127] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0128] The above is a detailed introduction to a network communication method, device, communication equipment and storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, the present invention can also be improved and modified, and these improvements and modifications also fall within the scope of protection of the present invention.
Claims
1. A network communication method, characterized in that: Applied to a communication device, the communication device comprising a cellular network module and a communication interface, the method comprising: When it is determined that the terminal device is accessed through the communication interface, a firmware initialization operation is performed, and a network registration dialing operation is performed through the cellular network module to connect to the cellular network; Performing an address allocation operation on the terminal device and establishing a network connection with the terminal device; Receiving authentication information sent by the terminal device, and performing a verification operation on the authentication information; When it is determined that the authentication information passes the verification, a VPN tunnel is established with the server through the cellular network, and the business data between the terminal device and the server is transmitted through the VPN tunnel.
2. The network communication method according to claim 1, characterized in that: The step of establishing a VPN tunnel with the server through the cellular network includes: Based on the cellular network and the national encryption algorithm, a tunnel establishment process is performed with the server to build a national encryption VPN tunnel with the server.
3. The network communication method according to claim 1, characterized in that: The communication interface includes a network interface and / or a USB interface.
4. The network communication method according to any one of claims 1 to 3, characterized in that: The performing a verification operation on the authentication information includes: Obtaining preset certificate information, and sending the certificate information and the authentication information to the server through the cellular network, so that the server simultaneously verifies the certificate information and the authentication information, and the server returns a virtual IP address and a resource address when determining that both the certificate information and the authentication information pass the verification; When the virtual IP address and the resource address are received, it is determined that the authentication information has passed the verification, and a configuration operation is performed on a preset virtual network card using the virtual IP address, and the resource address is added to a routing table.
5. The network communication method according to claim 4, characterized in that: The transmitting of the service data between the terminal device and the server through the VPN tunnel includes: receiving a first network data packet sent by the terminal device, and determining whether a destination address of the first network data packet is the same as a resource address in the routing table; If they are the same, forwarding the first network data packet to the preset virtual network card, modifying the source address of the first network data packet to the virtual IP address in the preset virtual network card, encrypting the first network data packet according to the VPN tunnel parameters, and obtaining a first encrypted data packet; The first encrypted data packet is sent to the server through the VPN tunnel.
6. The network communication method according to claim 5, characterized in that: Also includes: Receiving a second encrypted data packet returned by the server through the VPN tunnel; Decrypting the second encrypted data packet according to the VPN tunnel parameters to obtain a second network data packet, and modifying the destination address of the second network data packet to the intranet IP address of the terminal device; The second network data packet with the target address modified is sent to the terminal device.
7. The network communication method according to claim 4, characterized in that: The receiving authentication information sent by the terminal device includes: receiving an authentication request sent by the terminal device, and returning a preset network page to the terminal device; wherein the preset network page is used to input the authentication information; Receive authentication information sent by the terminal device.
8. A network communication device, characterized in that: Applied to a communication device, the communication device comprises a cellular network module and a communication interface, and the device comprises: An initialization module, configured to execute a firmware initialization operation when it is determined that the terminal device is accessed through the communication interface, and to execute a network registration dialing operation through the cellular network module to connect to the cellular network; An address allocation module, used to perform an address allocation operation on the terminal device and establish a network connection with the terminal device; An authentication module, used to receive the authentication information sent by the terminal device and perform a verification operation on the authentication information; The VPN communication module is used to build a VPN tunnel with the server through the cellular network when it is determined that the authentication information has passed the verification, and transmit the business data between the terminal device and the server through the VPN tunnel.
9. A communication device, characterized in that: include: A communication interface for connecting to a terminal device; A cellular network module, used for connecting to a cellular network; Memory for storing computer programs; A processor, configured to implement the network communication method according to any one of claims 1 to 7 when executing the computer program.
10. The communication device according to claim 9, characterized in that The communication interface includes a network interface and / or a USB interface.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are loaded and executed by a processor, the network communication method according to any one of claims 1 to 7 is implemented.