[go: up one dir, main page]

CN116209095A - A network connection method and device - Google Patents

A network connection method and device Download PDF

Info

Publication number
CN116209095A
CN116209095A CN202310118255.7A CN202310118255A CN116209095A CN 116209095 A CN116209095 A CN 116209095A CN 202310118255 A CN202310118255 A CN 202310118255A CN 116209095 A CN116209095 A CN 116209095A
Authority
CN
China
Prior art keywords
target
address
target terminal
network
terminal device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310118255.7A
Other languages
Chinese (zh)
Inventor
尹屾
霍兴宇
史诗
胡琦
蔡露露
李雨笛
解觯
李博
严希音
付莉
武亚龙
屈洋
冯杏
李姗烨
王双
王森森
仲思睿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN202310118255.7A priority Critical patent/CN116209095A/en
Publication of CN116209095A publication Critical patent/CN116209095A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/08Access security
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/26Network addressing or numbering for mobility support

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a network connection method and device, relates to the field of communication, and solves the problem of difficult virtual private network connection. The network connection method comprises the following steps: receiving a connection request sent by target terminal equipment, wherein the connection request comprises a physical address of the target terminal equipment, and the target terminal equipment accesses a network through wireless access equipment; verifying whether the target terminal equipment has the authority of connecting with the target private network according to the physical address of the target terminal equipment to obtain a verification result; if the verification result shows that the target terminal equipment has the authority of connecting with the target private network, the first IP address is taken out from an address pool of the target private network, and the first IP address is sent to the target terminal equipment; the first IP address is for the target terminal device to connect to the target private network.

Description

一种网络连接方法和装置A network connection method and device

技术领域technical field

本发明涉及通信领域,尤其涉及一种网络连接方法和装置。The invention relates to the communication field, in particular to a network connection method and device.

背景技术Background technique

随着计算机技术的发展,虚拟专用网络已经得到了广泛应用。With the development of computer technology, virtual private network has been widely used.

但由于虚拟专用网络要求接入的终端设备以固定IP地址(InternetProtocolAddress)接入,因此出现了终端设备不易接入虚拟专用网络的问题。以有线方式进行网络接入的终端设备,能够以固定IP地址接入虚拟专用网络,但是有线线路铺设受制于建设成本和铺设条件,不易推广。以无线方式进行网络接入的终端设备,往往被随机动态分配IP地址,不能满足虚拟专用网络的接入条件。However, since the virtual private network requires the connected terminal device to access with a fixed IP address (Internet Protocol Address), there is a problem that the terminal device is not easy to access the virtual private network. Terminal equipment that accesses the network in a wired manner can access the virtual private network with a fixed IP address, but the laying of wired lines is subject to construction costs and laying conditions, and it is not easy to promote. Terminal equipment that accesses the network in a wireless manner is often assigned an IP address randomly and dynamically, which cannot meet the access conditions of a virtual private network.

因此,如何更容易地接入虚拟专用网络,成为亟待解决的技术问题。Therefore, how to access the virtual private network more easily has become a technical problem to be solved urgently.

发明内容Contents of the invention

本发明提供了一种网络连接方法和装置,用于解决终端设备如何接入虚拟专用网络的问题。The invention provides a network connection method and device, which are used to solve the problem of how terminal equipment accesses a virtual private network.

为达到上述目的,本发明采用如下技术方案:To achieve the above object, the present invention adopts the following technical solutions:

第一方面,本发明提供了一种网络连接方法,应用于服务器,包括:接收到目标终端设备发送的连接请求,连接请求包含目标终端设备的物理地址,目标终端设备通过无线接入设备接入网络;根据目标终端设备的物理地址,验证目标终端设备是否具有连接目标专用网络的权限,得到验证结果;若验证结果为目标终端设备具有连接目标专用网络的权限,从目标专用网络的地址池中取出第一IP地址,并将第一IP地址发送给目标终端设备;第一IP地址用于目标终端设备连接到目标专用网络。In the first aspect, the present invention provides a network connection method applied to a server, including: receiving a connection request sent by a target terminal device, where the connection request includes the physical address of the target terminal device, and the target terminal device accesses the network through a wireless access device network; according to the physical address of the target terminal device, verify whether the target terminal device has the authority to connect to the target private network, and obtain the verification result; if the verification result is that the target terminal device has the Taking out the first IP address and sending the first IP address to the target terminal device; the first IP address is used for the target terminal device to connect to the target private network.

可选的,服务器与用户数据库连接,用户数据库中包含具有连接目标专用网络的权限的终端设备的物理地址;根据目标终端设备的物理地址,验证目标终端设备是否具有连接目标专用网络的权限,得到验证结果,包括:查询目标终端设备的物理地址是否存在于用户数据库;若目标终端设备的物理地址存在于用户数据库,得到目标终端设备具有连接目标专用网络的权限的验证结果。Optionally, the server is connected to the user database, and the user database contains the physical address of the terminal device with the authority to connect to the target private network; according to the physical address of the target terminal device, verify whether the target terminal device has the authority to connect to the target private network, and obtain The verification result includes: querying whether the physical address of the target terminal device exists in the user database; if the physical address of the target terminal device exists in the user database, obtain the verification result that the target terminal device has the authority to connect to the target private network.

可选的,用户数据库中还包含用户验证信息,验证目标终端设备是否具有连接目标专用网络的权限,还包括:若目标终端设备的物理地址不存在于用户数据库,则向目标终端设备推送用户验证信息验证界面;接收目标终端设备发送的目标终端设备的用户验证信息,并验证目标终端设备的用户验证信息是否存在于用户数据库;Optionally, the user database also includes user verification information to verify whether the target terminal device has the authority to connect to the target private network, and also includes: if the physical address of the target terminal device does not exist in the user database, push the user verification information to the target terminal device Information verification interface; receiving the user verification information of the target terminal device sent by the target terminal device, and verifying whether the user verification information of the target terminal device exists in the user database;

若目标终端设备的用户验证信息存在于用户数据库,得到目标终端设备具有连接目标专用网络的权限的验证结果。If the user verification information of the target terminal device exists in the user database, a verification result is obtained that the target terminal device has the authority to connect to the target private network.

可选的,网络连接方法还包括:若目标终端设备的物理地址不存在于用户数据库,且得到目标终端设备具有连接目标专用网络的权限的验证结果,则将目标终端设备的物理地址保存至用户数据库中。Optionally, the network connection method also includes: if the physical address of the target terminal device does not exist in the user database, and the verification result that the target terminal device has the authority to connect to the target private network is obtained, then saving the physical address of the target terminal device to the user in the database.

可选的,用户数据库中还包含具有连接目标专用网络的权限的终端设备对应的网络标识,网络标识指向终端设备具有连接权限的目标专用网络;从目标专用网络的地址池中取出第一IP地址之前,网络连接方法还包括:根据用户数据库中目标终端设备对应的网络标识,确定目标终端设备具有连接权限的目标专用网络。Optionally, the user database also includes the network identifier corresponding to the terminal device with the authority to connect to the target private network, and the network identifier points to the target private network with which the terminal device has connection authority; the first IP address is taken out from the address pool of the target private network Previously, the network connection method further includes: according to the network identifier corresponding to the target terminal device in the user database, determining the target private network to which the target terminal device has connection authority.

可选的,将第一IP地址发送给目标终端设备之后,网络连接方法还包括:将第一IP地址确定为目标专用网络的地址池中不可被分配的IP地址;当目标终端设备停止使用第一IP地址时,将第一IP地址确定为目标专用网络的地址池中可被分配的IP地址。Optionally, after sending the first IP address to the target terminal device, the network connection method further includes: determining the first IP address as an IP address that cannot be allocated in the address pool of the target private network; When there is an IP address, determine the first IP address as an IP address that can be allocated in the address pool of the target private network.

本申请提供的网络连接方法,服务器可接收目标终端设备通过无线接入设备发送的连接请求,并对目标终端设备进行连接权限的验证,目标终端设备通过权限验证便可被分配目标专用网络地址池的第一IP地址。在无线传输动态分配地址的前提下,满足目标专用网络需要可信IP地址的需求。动态分配IP地址还能够更好地利用IP地址资源,以较少的IP地址满足目标专用网络动态的接入需求。In the network connection method provided by this application, the server can receive the connection request sent by the target terminal device through the wireless access device, and verify the connection authority of the target terminal device, and the target terminal device can be assigned the target private network address pool after passing the authority verification of the first IP address. On the premise of dynamically assigning addresses for wireless transmission, it meets the needs of trusted IP addresses for the target private network. Dynamic allocation of IP addresses can also make better use of IP address resources, and meet the dynamic access requirements of the target private network with fewer IP addresses.

相近技术中,由于终端设备接入虚拟专用网络需要使用可信IP地址,并且这些可信IP地址通常不会改变,而无线连接的方式通常是对终端设备随机动态分配IP地址,因此无线连接通常无法满足接入虚拟专用网络的要求。通过本申请提供的网络连接方法,可以在动态分配地址的基础上,当服务器对目标终端设备进行权限验证后,给目标终端设备分配目标专用网络地址池中的第一IP地址,即目标专用网络的可信IP地址。当目标终端设备通过无线接入设备,采用无线方式接入网络时,可以解决终端设备被无线连接动态分配IP地址,和目标专用网络只能通过可信IP地址接入之间的矛盾。In similar technologies, because terminal devices need to use trusted IP addresses to access the virtual private network, and these trusted IP addresses usually do not change, and the way of wireless connection is usually to randomly and dynamically assign IP addresses to terminal devices, so wireless connections usually The requirement to access a virtual private network cannot be met. Through the network connection method provided by this application, on the basis of dynamically assigning addresses, after the server verifies the authority of the target terminal device, the target terminal device can be assigned the first IP address in the target private network address pool, that is, the target private network trusted IP address. When the target terminal device accesses the network wirelessly through the wireless access device, it can solve the contradiction between the terminal device being dynamically assigned an IP address by the wireless connection and the target private network can only be accessed through a trusted IP address.

相比相近技术要求通过有线连接的方式才能接入目标专用网络相比,本申请提供的网络连接方法,可使得以无线方式进行网络接入的终端设备,也能够接入目标专用网络,从而不需要在所有连接场地铺设物理线路,不受限于物理线路的铺设条件和现有光缆资源,使目标终端设备在任何有网络的地方,都能通过架设无线接入设备接入目标专用网络。Compared with similar technologies that require a wired connection to access the target private network, the network connection method provided by this application can enable terminal equipment that accesses the network wirelessly to also access the target private network, thereby avoiding It is necessary to lay physical lines at all connection sites, regardless of the laying conditions of physical lines and existing optical cable resources, so that target terminal devices can access the target private network by setting up wireless access devices wherever there is a network.

当目标终端设备的物理地址不存在与用户数据库时,服务器还会对目标终端设备进行第二次权限验证。当目标终端设备通过第二次权限验证时,目标终端设备的物理地址会被保存在用户数据库中,那么,目标终端设备下次连接目标专用网络时就不需要再通过输入用户验证信息进行权限验证。对用户来说,不需要验证即能接入目标专用网络,减少了操作流程,提高了用户体验。When the physical address of the target terminal device does not exist in the user database, the server will also perform a second authority verification on the target terminal device. When the target terminal device passes the second permission verification, the physical address of the target terminal device will be saved in the user database, then, the next time the target terminal device connects to the target private network, it does not need to enter the user verification information for permission verification . For users, they can access the target private network without verification, which reduces the operation process and improves user experience.

除此之外,本申请还能确定目标终端设备对应的目标专用网络,从而本申请提供的网络连接方法还面向多个专用网络。In addition, the present application can also determine the target private network corresponding to the target terminal device, so the network connection method provided by the present application is also oriented to multiple private networks.

第二方面,本发明提供了一种网络连接方法,应用于目标终端设备,包括:与无线接入设备建立连接;通过无线接入设备,广播发送连接请求,以使得服务器接收并验证目标终端设备是否具有连接目标专用网络的权限,连接请求中包含目标终端设备的物理地址;若目标终端设备具有连接目标专用网络的权限,则接收到服务器发送的第一IP地址;第一IP地址为从目标专用网络的地址池中取出的地址;以第一IP地址为IP地址,连接到目标专用网络。In a second aspect, the present invention provides a network connection method applied to a target terminal device, including: establishing a connection with a wireless access device; broadcasting a connection request through the wireless access device, so that the server receives and verifies the target terminal device Whether you have the right to connect to the target private network, the connection request contains the physical address of the target terminal device; if the target terminal device has the right to connect to the target private network, you will receive the first IP address sent by the server; the first IP address is the slave target The address taken from the address pool of the private network; use the first IP address as the IP address to connect to the target private network.

可选的,服务器与用户数据库连接,用户数据库中包含具有连接目标专用网络权限的终端设备的物理地址;若目标终端设备的物理地址存在于用户数据库中,则目标终端设备具有连接目标专用网络的权限。Optionally, the server is connected to the user database, and the user database contains the physical address of the terminal device with the permission to connect to the target private network; if the physical address of the target terminal device exists in the user database, then the target terminal device has the permission to connect to the target private network. permission.

可选的,用户数据库中还包含具有连接目标专用网络权限的终端设备的用户验证信息;若目标终端设备的物理地址不存在于用户数据库中,在接收到服务器发送的第一IP地址前,网络连接方法还包括:接收到服务器推送的用户验证信息验证界面;接收到输入的目标终端设备的用户验证信息,并将目标终端设备的用户验证信息发送给服务器;若目标终端设备的用户验证信息存在于用户数据库中,则目标终端设备通过验证,目标终端设备具有连接目标专用网络的权限。Optionally, the user database also includes user verification information of a terminal device with the authority to connect to the target dedicated network; if the physical address of the target terminal device does not exist in the user database, before receiving the first IP address sent by the server, the network The connection method also includes: receiving the user verification information verification interface pushed by the server; receiving the input user verification information of the target terminal device, and sending the user verification information of the target terminal device to the server; if the user verification information of the target terminal device exists In the user database, the target terminal device has passed the verification, and the target terminal device has the authority to connect to the target private network.

可选的,网络连接方法还包括:停止使用第一IP地址,与目标专用网络断开连接。Optionally, the network connection method further includes: stopping using the first IP address, and disconnecting from the target private network.

本申请提供的网络连接方法,将与网络建立隧道的设备和与专用网络建立连接的设备解耦,目标终端设备可使用第一IP地址通过与网络建立隧道的无线接入设备接入专用网络。对于用户来说,本申请提供的网络连接方法只需要接入无线接入设备即可接入目标专用网络,不需要进行与目标专用网络相关的参数配置,只有第一次连接时可能需要输入用户验证信息,在之后都可以通过连接无线接入设备后直接与目标专用网络连接,省略了繁琐的参数配置和连接操作,接入目标专用网络更简便快捷,提高了用户体验。The network connection method provided in this application decouples the device establishing a tunnel with the network and the device establishing a connection with the private network, and the target terminal device can use the first IP address to access the private network through the wireless access device establishing a tunnel with the network. For users, the network connection method provided by this application only needs to access the wireless access device to access the target private network, and does not need to configure parameters related to the target private network. After verifying the information, you can directly connect to the target private network after connecting the wireless access device, omitting cumbersome parameter configuration and connection operations, making it easier and faster to access the target private network, and improving user experience.

第三方面,本发明提供了一种网络连接装置,包括:In a third aspect, the present invention provides a network connection device, including:

请求接收模块,用于接收到目标终端设备发送的连接请求,连接请求包含目标终端设备的物理地址,目标终端设备通过无线接入设备接入网络。The request receiving module is configured to receive the connection request sent by the target terminal device, the connection request includes the physical address of the target terminal device, and the target terminal device accesses the network through the wireless access device.

信息验证模块,用于根据所述目标终端设备的物理地址,验证目标终端设备是否具有连接目标专用网络的权限,得到验证结果。The information verification module is used to verify whether the target terminal device has the authority to connect to the target dedicated network according to the physical address of the target terminal device, and obtain a verification result.

地址分配模块,用于当验证结果为目标终端设备具有连接目标专用网络的权限时,从目标专用网络的地址池中取出第一IP地址,并将第一IP地址发送给目标终端设备。第一IP地址用于目标终端设备连接到目标专用网络。The address assignment module is configured to take out the first IP address from the address pool of the target private network and send the first IP address to the target terminal device when the verification result is that the target terminal device has the authority to connect to the target private network. The first IP address is used for the target terminal device to connect to the target private network.

第四方面,本发明提供了一种网络连接装置,包括:In a fourth aspect, the present invention provides a network connection device, including:

信号连接模块,用于与无线接入设备建立连接。The signal connection module is used to establish a connection with the wireless access device.

数据发送模块,用于通过无线接入设备,广播发送连接请求,以使得服务器接收并验证目标终端设备是否具有连接目标专用网络的权限,连接请求中包含目标终端设备的物理地址。The data sending module is used to broadcast and send a connection request through the wireless access device, so that the server receives and verifies whether the target terminal device has the right to connect to the target dedicated network, and the connection request includes the physical address of the target terminal device.

数据接收模块,用于当目标终端设备具有连接目标专用网络的权限时,则接收到服务器发送的第一IP地址;第一IP地址为从目标专用网络的地址池中取出的地址。The data receiving module is used to receive the first IP address sent by the server when the target terminal device has the authority to connect to the target private network; the first IP address is an address taken from the address pool of the target private network.

信号连接模块,还用于以第一IP地址为IP地址,连接到目标专用网络。The signal connection module is also used to connect to the target private network using the first IP address as the IP address.

本申请中第三方面到第四方面及其各种实现方式的具体描述,可以参考第一方面到第二方面及其各种实现方式中的详细描述;并且,第三方面到第四方面及其各种实现方式的有益效果,可以参考第一方面到第二方面及其各种实现方式中的有益效果分析,此处不再赘述。For the specific description of the third aspect to the fourth aspect and its various implementation modes in this application, you can refer to the detailed descriptions in the first aspect to the second aspect and its various implementation modes; and, the third aspect to the fourth aspect and For the beneficial effects of various implementations thereof, reference may be made to the analysis of the beneficial effects in the first aspect to the second aspect and various implementations thereof, and will not be repeated here.

本申请的这些方面或其他方面在以下的描述中会更加简明易懂。These or other aspects of the present application will be more clearly understood in the following description.

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained based on these drawings without creative effort.

图1为本申请实施例中的网络连接方法的系统架构示意图;FIG. 1 is a schematic diagram of a system architecture of a network connection method in an embodiment of the present application;

图2为本申请实施例中服务器101和终端设备102基本物理结构包含的计算装置的结构示意图;FIG. 2 is a schematic structural diagram of a computing device included in the basic physical structure of the server 101 and the terminal device 102 in the embodiment of the present application;

图3为本申请实施例中的服务器一侧,网络连接方法的流程示意图;FIG. 3 is a schematic flowchart of a network connection method on the server side in an embodiment of the present application;

图4为本申请实施例中的验证目标终端设备102是否具有连接目标专用网络的权限,得到验证结果的流程示意图;FIG. 4 is a schematic flow diagram of verifying whether the target terminal device 102 has the authority to connect to the target private network and obtaining the verification result in the embodiment of the present application;

图5为本申请实施例中的目标终端设备一侧,网络连接方法的流程示意图;FIG. 5 is a schematic flowchart of a network connection method on the target terminal device side in an embodiment of the present application;

图6为本申请实施例中的一种网络连接装置的结构示意图;FIG. 6 is a schematic structural diagram of a network connection device in an embodiment of the present application;

图7为本申请实施例中的另一种网络连接装置的结构示意图。FIG. 7 is a schematic structural diagram of another network connection device in an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本发明的描述中,除非另有说明,“多个”的含义是两个或两个以上。The terms "first" and "second" are used for descriptive purposes only, and cannot be interpreted as indicating or implying relative importance or implicitly specifying the quantity of indicated technical features. Thus, a feature defined as "first" and "second" may explicitly or implicitly include one or more of these features. In the description of the present invention, unless otherwise specified, "plurality" means two or more.

本申请实施例提供一种网络连接方法及装置,该网络连接方法可适用于如图1所示的系统架构。该系统架构包括服务器101、目标终端设备102和无线接入设备103。服务器101与网络连接,或被包含在网络中。目标终端设备102与无线接入设备103连接,并通过无线接入设备103接入网络,进而与服务器101通信。Embodiments of the present application provide a network connection method and device, and the network connection method is applicable to the system architecture shown in FIG. 1 . The system architecture includes a server 101 , a target terminal device 102 and a wireless access device 103 . The server 101 is connected to or included in the network. The target terminal device 102 is connected to the wireless access device 103 , accesses the network through the wireless access device 103 , and then communicates with the server 101 .

具体的,目标终端设备102可通过有线连接或者无线连接的方式,与无线接入设备103连接。Specifically, the target terminal device 102 may be connected to the wireless access device 103 through a wired connection or a wireless connection.

需要说明的是,本申请对系统架构中服务器101、目标终端设备102和无线接入设备103的数量不进行限定,本申请在图1中以一个服务器101、一个目标终端设备102和一个无线接入设备103为例进行说明。It should be noted that this application does not limit the number of servers 101, target terminal devices 102 and wireless access devices 103 in the system architecture. This application uses a server 101, a target terminal device 102 and a wireless access device The input device 103 is taken as an example for description.

在一种可能的实施例中,服务器101可接收到目标终端设备102发送的连接请求。服务器101还能基于该连接请求验证目标终端设备102是否具有连接目标专用网络的权限,并得出验证结果。进一步地,若目标终端设备102具有连接目标专用网络的权限,服务器会向目标终端设备102发送第一IP地址,第一IP地址是从目标专用网络的地址池中取出的。In a possible embodiment, the server 101 may receive the connection request sent by the target terminal device 102 . The server 101 can also verify whether the target terminal device 102 has the right to connect to the target private network based on the connection request, and obtain a verification result. Further, if the target terminal device 102 has the right to connect to the target private network, the server will send the first IP address to the target terminal device 102, and the first IP address is taken from the address pool of the target private network.

可选的,服务器101可将发送给目标终端设备102的第一IP地址,确定为目标专用网络的地址池中的不可被分配的IP地址。服务器101还能在目标终端设备102停止使用第一IP地址时,将该第一IP地址,确定为目标专用网络的地址池中可被分配的IP地址。Optionally, the server 101 may determine the first IP address sent to the target terminal device 102 as an unallocated IP address in the address pool of the target private network. The server 101 can also determine the first IP address as an IP address that can be allocated in the address pool of the target private network when the target terminal device 102 stops using the first IP address.

目标终端设备102可通过无线接入设备103向服务器101广播发送连接请求,该连接请求包含目标终端设备102的物理地址(MediaAccessContro lAddress,MAC地址)。若目标终端设备102具有连接目标专用网络的权限,目标终端设备102会接收到服务器101发送的第一IP地址,并以第一IP地址为IP地址,连接到目标专用网络。The target terminal device 102 may broadcast a connection request to the server 101 through the wireless access device 103, where the connection request includes the physical address (MediaAccessControlAddress, MAC address) of the target terminal device 102. If the target terminal device 102 has the right to connect to the target private network, the target terminal device 102 will receive the first IP address sent by the server 101, and use the first IP address as the IP address to connect to the target private network.

无线接入设备103可根据L2TP协议(Layer2TunnelingProtocol,第二层隧道协议),与网络中核心网的边缘路由器建立连接,以传输目标终端设备102发送的所有数据。The wireless access device 103 can establish a connection with the edge router of the core network in the network according to the L2TP protocol (Layer2Tunneling Protocol, Layer 2 Tunneling Protocol), so as to transmit all the data sent by the target terminal device 102 .

在一种可能的实施例中,本申请实施例中网络连接方法的系统架构还包含用户数据库104,用户数据库104与服务器101连接。In a possible embodiment, the system architecture of the network connection method in the embodiment of the present application further includes a user database 104 , and the user database 104 is connected to the server 101 .

用户数据库104中的数据可被服务器101获取。The data in the user database 104 can be retrieved by the server 101 .

可选的,用户数据库104中包含具有连接目标专用网络的权限的终端设备的物理地址。用户数据库104中终端设备的物理地址,可被用于服务器101验证目标终端设备102是否具有连接目标专用网络的权限。Optionally, the user database 104 includes physical addresses of terminal devices that have the authority to connect to the target private network. The physical address of the terminal device in the user database 104 can be used by the server 101 to verify whether the target terminal device 102 has the authority to connect to the target private network.

可选的,用户数据库104中还包含具有连接目标专用网络的权限的终端设备的用户验证信息,该用户验证信息可被用于服务器101验证目标终端设备102是否具有连接目标专用网络的权限。Optionally, the user database 104 also includes user verification information of a terminal device having the right to connect to the target private network, and the user verification information can be used by the server 101 to verify whether the target terminal device 102 has the right to connect to the target private network.

可选的,目标专用网络可以是一个,也可以是多个,目标专用网络包含在网络中。用户数据库104中还包含具有连接目标专用网络的权限的终端设备对应的网络标识。该网络标识指向终端设备具有连接权限的目标专用网络,该网络标识可用于服务器101在从目标专用网络的地址池中取出第一IP地址前,确定目标终端设备102具有连接权限的目标专用网络。Optionally, there may be one or more target dedicated networks, and the target dedicated network is included in the network. The user database 104 also includes network identifiers corresponding to terminal devices that have permission to connect to the target private network. The network identifier points to the target private network to which the terminal device has connection permission, and the network identifier can be used by the server 101 to determine the target private network to which the target terminal device 102 has connection permission before taking the first IP address from the address pool of the target private network.

在一种可能的实施例中,服务器101包含用户数据库104。In a possible embodiment, the server 101 includes a user database 104 .

本申请实施例中的服务器101可以是机架式服务器、刀片服务器、塔式服务器或机柜式服务器等设备,搭建方式可以是单一集成式、集群式或分布式,本申请实施例中对此不做限制。The server 101 in the embodiment of the present application may be a rack server, a blade server, a tower server or a cabinet server, etc., and the construction method may be single integrated, clustered or distributed, which is not mentioned in the embodiment of the present application. Do limit.

本申请实施例中的终端设备102可以是手机、台式电脑、平板电脑、笔记本电脑、手持计算机、可穿戴电子设备、手持计算机、超级移动个人计算机(Ultra-mobilePersonalComputer,UMPC)、上网本等电子设备,本申请实施例对此不做任何限制。The terminal device 102 in the embodiment of the present application may be a mobile phone, a desktop computer, a tablet computer, a notebook computer, a handheld computer, a wearable electronic device, a handheld computer, an ultra-mobile personal computer (Ultra-mobile Personal Computer, UMPC), an electronic device such as a netbook, The embodiments of this application do not impose any limitation on this.

无线接入设备103可以为无线路由器、4G/5G无线接入设备等无线连接设备,本申请实施例对此不做任何限制。The wireless access device 103 may be a wireless connection device such as a wireless router or a 4G/5G wireless access device, which is not limited in this embodiment of the present application.

服务器101和终端设备102基本物理结构类似,都包括图2所示计算装置所包括的元件。下面以图2所示的计算装置为例,介绍服务器101和终端设备102的物理结构。The basic physical structures of the server 101 and the terminal device 102 are similar, and both include elements included in the computing device shown in FIG. 2 . The following uses the computing device shown in FIG. 2 as an example to introduce the physical structures of the server 101 and the terminal device 102 .

如图2所示,计算装置可以包括处理器201,存储器202、通信接口203、总线204。处理器201,存储器202以及通信接口203之间可以通过总线204连接。As shown in FIG. 2 , the computing device may include a processor 201 , a memory 202 , a communication interface 203 , and a bus 204 . The processor 201 , the memory 202 and the communication interface 203 may be connected through a bus 204 .

处理器201是计算装置的控制中心,可以是一个处理器,也可以是多个处理元件的统称。例如,处理器201可以是一个通用中央处理单元(centralprocessingunit,CPU),也可以是其他通用处理器等。其中,通用处理器可以是微处理器或者是任何常规的处理器等。The processor 201 is the control center of the computing device, and may be one processor, or a general term for multiple processing elements. For example, the processor 201 may be a general-purpose central processing unit (central processing unit, CPU), or other general-purpose processors. Wherein, the general-purpose processor may be a microprocessor or any conventional processor.

作为一种实施例,处理器201可以包括一个或多个CPU,例如图2中所示的CPU0和CPU1。As an embodiment, the processor 201 may include one or more CPUs, such as CPU0 and CPU1 shown in FIG. 2 .

存储器202可以是只读存储器(read-onlymemory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(randomaccessm emory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electricallyerasableprogrammableread-onl ymemory,EEPROM)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。The memory 202 may be a read-only memory (read-only memory, ROM) or other types of static storage devices that can store static information and instructions, a random access memory (random access memory, RAM) or other types of dynamic storage devices that can store information and instructions. The storage device can also be an electrically erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM), a magnetic disk storage medium or other magnetic storage devices, or can be used to carry or store desired program codes in the form of instructions or data structures and any other medium that can be accessed by a computer, but is not limited to.

一种可能的实现方式中,存储器202可以独立于处理器201存在,存储器202可以通过总线204与处理器201相连接,用于存储指令或者程序代码。处理器201调用并执行存储器202中存储的指令或程序代码时,能够实现本申请实施例提供的模型部署方法。In a possible implementation manner, the memory 202 may exist independently of the processor 201, and the memory 202 may be connected to the processor 201 through the bus 204, and is used for storing instructions or program codes. When the processor 201 invokes and executes the instructions or program codes stored in the memory 202, the model deployment method provided by the embodiment of the present application can be implemented.

在本申请实施例中,对于服务器101和终端设备102而言,存储器202中存储的软件程序不同,实现的功能不同。关于各设备所执行的功能将结合下面的流程图进行描述。In this embodiment of the present application, for the server 101 and the terminal device 102, the software programs stored in the memory 202 are different, and the functions realized are different. The functions performed by each device will be described in conjunction with the flow chart below.

另一种可能的实现方式中,存储器202也可以和处理器201集成在一起。In another possible implementation manner, the memory 202 may also be integrated with the processor 201 .

通信接口203,用于计算装置与其他设备通过通信网络连接,所述通信网络可以是以太网,无线接入网(radioaccessnetwork,RAN),无线局域网(wirelesslocalareanetworks,WLAN)等。通信接口203可以包括用于接收数据的接收单元,以及用于发送数据的发送单元。The communication interface 203 is used for connecting the computing device with other devices through a communication network, and the communication network may be Ethernet, radio access network (radio access network, RAN), wireless local area network (wireless local area network, WLAN) and so on. The communication interface 203 may include a receiving unit for receiving data, and a sending unit for sending data.

总线204,可以是工业标准体系结构(IndustryStandardArchitectur e,ISA)总线、外部设备互连(PeripheralComponentInterconnect,PCI)总线或扩展工业标准体系结构(ExtendedIndustryStandardArchitecture,EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。为便于表示,图2中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The bus 204 may be an Industry Standard Architecture (Industry Standard Architecture, ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (Extended Industry Standard Architecture, EISA) bus, etc. The bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only one thick line is used in FIG. 2 , but it does not mean that there is only one bus or one type of bus.

需要指出的是,图2中示出的结构并不构成对该计算装置的限定,除图2所示部件之外,该计算装置可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。It should be pointed out that the structure shown in FIG. 2 does not constitute a limitation to the computing device. In addition to the components shown in FIG. 2, the computing device may include more or less components than shown in the illustration, or combine some components, or a different arrangement of components.

如图3所示,本申请提供的一种网络连接方法,应用于服务器,例如应用于如图1中示出的服务器,该方法可以包括如下S301至S303。As shown in FIG. 3 , a network connection method provided by the present application is applied to a server, such as the server shown in FIG. 1 , and the method may include the following steps S301 to S303.

S301:接收到目标终端设备发送的连接请求,连接请求包含目标终端设备的物理地址,目标终端设备通过无线接入设备接入网络。S301: Receive a connection request sent by a target terminal device, where the connection request includes a physical address of the target terminal device, and the target terminal device accesses a network through a wireless access device.

目标终端设备可以通过无线接入设备接入网络。当无线接入设备第一次接入网络时,会被网络分配一个固定IP地址。从而,无线接入设备能作为目标终端设备的网关,使目标终端设备也接入网络。The target terminal device can access the network through the wireless access device. When the wireless access device accesses the network for the first time, it will be assigned a fixed IP address by the network. Therefore, the wireless access device can serve as a gateway for the target terminal device, enabling the target terminal device to also access the network.

在一种可能的实施方式中,目标终端设备可使用基于RJ45接口(RegisteredJack45)的连接器或连接线,与无线接入设备连接。In a possible implementation manner, the target terminal device may use a connector or connection line based on an RJ45 interface (Registered Jack45) to connect to the wireless access device.

在另一种可能的实施方式中,目标终端设备通过无线接入设备发送的WI FI信号,与无线接入设备连接。In another possible implementation manner, the target terminal device is connected to the wireless access device through a WI FI signal sent by the wireless access device.

示例的,目标终端设备通过有线连接或无线连接,接入无线接入设备,无线接入设备再通过无线连接的方式与网络建立连接,进而向服务器发送连接请求。进一步地,服务器可接收到目标终端设备接入网络后发送的连接请求,该连接请求中包含目标终端设备的物理地址,即MAC地址。For example, the target terminal device accesses the wireless access device through a wired connection or a wireless connection, and the wireless access device establishes a connection with the network through a wireless connection, and then sends a connection request to the server. Further, the server may receive a connection request sent by the target terminal device after accessing the network, and the connection request includes the physical address of the target terminal device, that is, the MAC address.

S302:根据目标终端设备的物理地址,验证目标终端设备是否具有连接目标专用网络的权限,得到验证结果。S302: According to the physical address of the target terminal device, verify whether the target terminal device has the right to connect to the target private network, and obtain a verification result.

S303:若验证结果为目标终端设备具有连接目标专用网络的权限,从目标专用网络的地址池中取出第一IP地址,并将第一IP地址发送给目标终端设备。第一IP地址用于使目标终端设备连接到目标专用网络。S303: If the verification result is that the target terminal device has the authority to connect to the target private network, take the first IP address from the address pool of the target private network, and send the first IP address to the target terminal device. The first IP address is used to connect the target terminal device to the target private network.

一般,连接虚拟专用网络需要验证连接端的源地址,即通常连接端使用固定可信的IP地址才能接入虚拟专用网络。Generally, connecting to a virtual private network needs to verify the source address of the connecting end, that is, usually the connecting end uses a fixed and trusted IP address to access the virtual private network.

在本申请中,目标专用网络即是上述虚拟专用网络,而连接端的源地址即是请求连接目标专用网络的目标终端设备的IP地址。目标终端设备此时还没有IP地址,需要服务器的分配。In this application, the target private network is the aforementioned virtual private network, and the source address of the connection end is the IP address of the target terminal device requesting to connect to the target private network. The target terminal device does not have an IP address at this time, and needs to be assigned by the server.

当服务器验证得到的验证结果为目标终端设备具有连接目标专用网络的权限,服务器从目标专用网络的地址池中取出第一IP地址,并发送给目标终端设备。其中,由于第一IP地址为目标专用网络地址池中的地址,即为目标专用网络的可信IP地址,因此目标终端设备能够以第一IP地址,通过目标专用网络对源地址的验证,连接到目标专用网络。When the verification result obtained by the server verification is that the target terminal device has the authority to connect to the target private network, the server fetches the first IP address from the address pool of the target private network, and sends it to the target terminal device. Wherein, since the first IP address is an address in the address pool of the target private network, that is, a trusted IP address of the target private network, the target terminal device can use the first IP address to connect to to the target private network.

由上述实施例可知,本申请提供的网络连接方法,服务器接收到目标终端设备发送的连接请求,并验证目标终端设备是否有接入目标专用网络的权限。若目标终端设备具有连接目标专用网络的权限,服务器发送的第一IP地址可使目标终端设备连接到目标专用网络。It can be seen from the above embodiments that in the network connection method provided by the present application, the server receives the connection request sent by the target terminal device, and verifies whether the target terminal device has the right to access the target private network. If the target terminal device has the right to connect to the target private network, the first IP address sent by the server can enable the target terminal device to connect to the target private network.

相近技术中,由于终端设备接入虚拟专用网络需要使用可信IP地址,并且这些可信IP地址通常不会改变,而无线连接的方式通常是对终端设备随机动态分配IP地址,因此无线连接通常无法满足接入虚拟专用网络的要求。通过本申请提供的网络连接方法,可以在动态分配地址的基础上,当服务器对目标终端设备进行权限验证后,给目标终端设备分配目标专用网络地址池中的第一IP地址,即目标专用网络的可信IP地址。当目标终端设备通过无线接入设备,采用无线方式接入网络时,可以解决终端设备被无线连接动态分配IP地址,和目标专用网络只能通过可信IP地址接入之间的矛盾。In similar technologies, because terminal devices need to use trusted IP addresses to access the virtual private network, and these trusted IP addresses usually do not change, and the way of wireless connection is usually to randomly and dynamically assign IP addresses to terminal devices, so wireless connections usually The requirement to access a virtual private network cannot be met. Through the network connection method provided by this application, on the basis of dynamically assigning addresses, after the server verifies the authority of the target terminal device, the target terminal device can be assigned the first IP address in the target private network address pool, that is, the target private network trusted IP address. When the target terminal device accesses the network wirelessly through the wireless access device, it can solve the contradiction between the terminal device being dynamically assigned an IP address by the wireless connection and the target private network can only be accessed through a trusted IP address.

相比相近技术要求通过有线连接的方式才能接入目标专用网络相比,本申请提供的网络连接方法,可使得以无线方式进行网络接入的终端设备,也能够接入目标专用网络,从而不需要在所有连接场地铺设物理线路,不受限于物理线路的铺设条件和现有光缆资源,使目标终端设备在任何有网络的地方,都能通过架设无线接入设备接入目标专用网络。Compared with similar technologies that require a wired connection to access the target private network, the network connection method provided by this application can enable terminal equipment that accesses the network wirelessly to also access the target private network, thereby avoiding It is necessary to lay physical lines at all connection sites, regardless of the laying conditions of physical lines and existing optical cable resources, so that target terminal devices can access the target private network by setting up wireless access devices wherever there is a network.

在一种可能的实施例中,服务器与用户数据库连接,用户数据库中包含具有连接目标专用网络的权限的终端设备的物理地址。如图4所示,根据目标终端设备的物理地址,验证目标终端设备是否具有连接目标专用网络的权限,得到验证结果,可包括S3021至S3022:In a possible embodiment, the server is connected to the user database, and the user database contains the physical addresses of the terminal devices that have the authority to connect to the target private network. As shown in Figure 4, according to the physical address of the target terminal device, verify whether the target terminal device has the authority to connect to the target private network, and obtain the verification result, which may include S3021 to S3022:

S3021:查询目标终端设备的物理地址是否存在于用户数据库。S3021: Query whether the physical address of the target terminal device exists in the user database.

S3022:若目标终端设备的物理地址存在于用户数据库,得到目标终端设备具有连接目标专用网络的权限的验证结果。S3022: If the physical address of the target terminal device exists in the user database, obtain a verification result that the target terminal device has the authority to connect to the target private network.

由于终端设备的物理地址为终端设备的区别性标识,因此可以用来验证终端设备是否具有目标专用网络的权限。Since the physical address of the terminal device is a distinguishing identifier of the terminal device, it can be used to verify whether the terminal device has the authority of the target private network.

示例的,目标终端设备的物理地址为“CC-85-E2-00-6A-E2”,则再用户数据库中查询是否存在“CC-85-E2-00-6A-E2”。若“CC-85-E2-00-6A-E2”存在,则目标终端设备具有连接目标专用网络的权限。For example, if the physical address of the target terminal device is "CC-85-E2-00-6A-E2", then query whether "CC-85-E2-00-6A-E2" exists in the user database. If "CC-85-E2-00-6A-E2" exists, the target terminal device has the authority to connect to the target private network.

由上述实施例可知,当目标终端设备的物理地址存在于用户数据库,目标终端设备仅需发送包含自身物理地址的连接请求,即触发服务器对目标终端设备进行验证。对于用户而言,当目标终端设备的物理地址存在于用户数据库时,且目标终端设备通过无线接入设接入网络时,本申请提供的网络连接方法,可做到“即接即连”,也就是,只要目标终端设备接入无线接入设备,即可接入目标专用网络。与相近技术相比,本申请提供的网络连接方法既进行了对目标终端设备的验证,又省去了用户每次手动进行验证的繁琐操作,方便用户接入目标专用网络,提高了用户体验。It can be seen from the above embodiments that when the physical address of the target terminal device exists in the user database, the target terminal device only needs to send a connection request including its own physical address, which triggers the server to verify the target terminal device. For the user, when the physical address of the target terminal device exists in the user database, and the target terminal device accesses the network through a wireless access device, the network connection method provided by this application can achieve "instant connection". That is, as long as the target terminal device accesses the wireless access device, it can access the target private network. Compared with similar technologies, the network connection method provided by this application not only verifies the target terminal device, but also saves the cumbersome operation of manually verifying each time for the user, which facilitates the user to access the target private network and improves user experience.

在一种可能的实施例中,用户数据库中还包含具有连接目标专用网络的终端设备的用户验证信息。验证目标终端设备是否具有连接目标专用网络的权限,还包括S3023至S3025:In a possible embodiment, the user database further includes user verification information of terminal devices connected to the target private network. Verify whether the target terminal device has the authority to connect to the target private network, also including S3023 to S3025:

S3023:若目标终端设备的物理地址不存在于用户数据库,则向目标终端设备推送用户验证信息验证界面。S3023: If the physical address of the target terminal device does not exist in the user database, push a user verification information verification interface to the target terminal device.

如果目标终端设备的物理地址不存在于用户数据库,那么目标终端设备可能是没有连接目标专用网络权限的终端设备,或者目标终端设备是具有连接目标专用网络权限的终端设备,但目标终端设备的物理地址尚未储存到用户数据库中。因此,可通过进一步的验证,来判断目标终端设备是否具有连接目标专用网络的权限。If the physical address of the target terminal device does not exist in the user database, then the target terminal device may be a terminal device without permission to connect to the target private network, or the target terminal device may be a terminal device with permission to connect to the target private network, but the physical address of the target terminal device The address has not been stored in the user database. Therefore, further verification can be used to determine whether the target terminal device has the right to connect to the target private network.

S3024:接收目标终端设备发送的目标终端设备的用户验证信息,并验证目标终端设备的用户验证信息是否存在于用户数据库。S3024: Receive the user verification information of the target terminal device sent by the target terminal device, and verify whether the user verification information of the target terminal device exists in the user database.

示例的,若目标终端设备的物理地址不存在于用户数据库,服务器向目标终端设备推送一个用户验证信息界面,用户验证信息界面中包含输入框,用户可以在输入框中输入的内容包括用户验证信息。服务器接收到目标终端设备在输入框中获得的用户验证信息,并与用户数据库中的目标终端设备的用户验证信息进行对比。For example, if the physical address of the target terminal device does not exist in the user database, the server pushes a user verification information interface to the target terminal device. The user verification information interface contains an input box, and the content that the user can enter in the input box includes user verification information . The server receives the user verification information obtained by the target terminal device in the input box, and compares it with the user verification information of the target terminal device in the user database.

在一种可能的实施例中,用户验证信息为用户名和密码。除此之外,用户验证信息还可以是其他信息,比如验证码,本申请实施例中以用户名和密码作为用户验证信息仅作为一种示例,并不对本申请作构成实际限定。In a possible embodiment, the user authentication information is a user name and a password. In addition, the user verification information may also be other information, such as a verification code. In the embodiment of the present application, the user name and password are used as the user verification information only as an example, and do not constitute an actual limitation to the present application.

S3025:若目标终端设备的用户验证信息存在于用户数据库,得到目标终端设备具有连接目标专用网络的权限的验证结果。S3025: If the user verification information of the target terminal device exists in the user database, obtain a verification result that the target terminal device has the authority to connect to the target private network.

由上述实施例中可知,本申请提供的网络连接方法,在目标终端设备的物理地址不存在于用户数据库时,还能通过用户验证信息,对目标终端设备是否具有连接目标专用网络做进一步的验证。As can be seen from the above-mentioned embodiments, the network connection method provided by the present application can further verify whether the target terminal device has a dedicated network for connection to the target terminal device through user verification information when the physical address of the target terminal device does not exist in the user database. .

在一种可能的实施例中,若目标终端设备的物理地址不存在于用户数据库,且得到目标终端设备具有连接目标专用网络的权限的验证结果,则将目标终端设备的物理地址保存至用户数据库中。In a possible embodiment, if the physical address of the target terminal device does not exist in the user database, and the verification result that the target terminal device has the authority to connect to the target private network is obtained, then the physical address of the target terminal device is saved in the user database middle.

可见,当目标终端设备的物理地址不存在于用户数据库,且通过用户验证信息的验证,目标终端设备具有连接目标专用网络的权限时,用户数据库会保存目标终端设备的物理地址。这样,目标终端设备在下一次发送连接请求后,不需要再一次通过用户验证信息进行验证,就可被服务器直接确定为具有连接目标专用网络权限的终端设备。对用户来说,只有第一次接入目标专用网络时需要输入用户验证信息,第二次及之后就不需要再进行操作,可达到上述接入无线连接设备,即可连接目标专用网络的效果,提高了用户体验。It can be seen that when the physical address of the target terminal device does not exist in the user database, and the target terminal device has the authority to connect to the target private network through the verification of the user authentication information, the user database will store the physical address of the target terminal device. In this way, after the target terminal device sends a connection request next time, it can be directly determined by the server as a terminal device with the right to connect to the target dedicated network without being authenticated by the user verification information again. For the user, only the user verification information needs to be entered when accessing the target private network for the first time, and no further operation is required for the second time and thereafter, which can achieve the above-mentioned effect of connecting to the target private network by accessing the wireless connection device , improving the user experience.

在一种可能的实施例中,用户数据库中还包含具有连接目标专用网络的权限的终端设备对应的网络标识,网络标识指向终端设备具有连接权限的目标专用网络。从目标专用网络的地址池中取出第一IP地址之前,网络连接方法还包括:根据用户数据库中目标终端设备对应的网络标识,确定目标终端设备具有连接权限的目标专用网络。In a possible embodiment, the user database further includes a network identifier corresponding to a terminal device having permission to connect to the target private network, and the network identifier points to the target private network to which the terminal device has connection permission. Before taking out the first IP address from the address pool of the target private network, the network connection method further includes: determining the target private network to which the target terminal device has connection authority according to the network identifier corresponding to the target terminal device in the user database.

示例的,目标终端设备具有连接目标专用网络的权限,在用户数据库中,目标终端设备对应的网络标识指向专用网络A。那么,服务器将专用网络A确定为目标终端设备的目标专用网络。进一步地,服务器会从网络A的地址池中取出第一IP地址,并将第一IP地址发送给目标终端设备。For example, the target terminal device has the right to connect to the target private network, and in the user database, the network identifier corresponding to the target terminal device points to the private network A. Then, the server determines private network A as the target private network of the target terminal device. Further, the server will take out the first IP address from the address pool of network A, and send the first IP address to the target terminal device.

由上述实施例可知,本申请提供的网络连接方法,在验证目标终端设备具有连接目标专用网络的权限后,进一步确定目标终端设备对应的目标专用网络具体为哪个专用网络。并且,通过给目标终端设备分配相应目标专用网络的地址池中的IP地址,使目标终端设备接入相应的目标专用网络。这样,本申请提供的网络连接方法可面向多个专用网络,并且只需要一个用于验证终端设备权限的服务器。It can be seen from the above embodiments that, in the network connection method provided by the present application, after verifying that the target terminal device has the authority to connect to the target private network, it further determines which private network the target private network corresponds to. And, by allocating the IP address in the address pool of the corresponding target private network to the target terminal device, the target terminal device is made to access the corresponding target private network. In this way, the network connection method provided by the present application can be oriented to multiple private networks, and only one server for verifying the authority of the terminal device is needed.

在一种可能的实施例中,将第一IP地址发送给目标终端设备后,网络连接方法还包括:将第一IP地址确定为目标专用网络的地址池中不可被分配的IP地址。当目标终端设备停止使用第一IP地址时,将第一IP地址确定为目标专用网络的地址池中可被分配的IP地址。In a possible embodiment, after sending the first IP address to the target terminal device, the network connection method further includes: determining the first IP address as an unallocated IP address in the address pool of the target private network. When the target terminal device stops using the first IP address, determine the first IP address as an IP address that can be allocated in the address pool of the target private network.

应理解,IP地址是有限的,且同一时间,一个IP地址只能被一个网络设备使用。而通过无线连接接入网络的终端设备流动性大,一般无线接入网络的终端设备以动态分配的方式获得IP地址,即需要接入网络的时候才会被分配IP地址。It should be understood that IP addresses are limited, and at the same time, one IP address can only be used by one network device. However, terminal devices that access the network through wireless connections have high mobility. Generally, terminal devices that access the network obtain IP addresses in a dynamic manner, that is, they are assigned IP addresses only when they need to access the network.

服务器在将第一IP地址分配给目标终端设备后,第一IP地址就不可再被其他终端设备使用,那么服务器会将第一IP地址确定为目标专用网络的地址池中不可被分配的IP地址。当目标终端设备停止使用第一IP地址,那么第一IP地址就可再被其他终端设备使用,服务器就会将第一IP地址确定为可被分配的IP地址。After the server assigns the first IP address to the target terminal device, the first IP address can no longer be used by other terminal devices, then the server will determine the first IP address as an IP address that cannot be allocated in the address pool of the target private network . When the target terminal device stops using the first IP address, the first IP address can be used by other terminal devices again, and the server will determine the first IP address as an IP address that can be allocated.

可见,本申请通过上述方式动态分配IP地址,既使目标终端设备可接入目标专用网络,还使目标专用网络地址池中的地址按需分配,不被一个终端设备长期占用。这样,较少的IP地址就能满足目标专用网络动态变化的连接需求。It can be seen that the present application dynamically allocates IP addresses through the above method, even if the target terminal device can access the target private network, the address in the target private network address pool is allocated on demand, and will not be occupied by a terminal device for a long time. In this way, fewer IP addresses can meet the dynamically changing connection requirements of the target private network.

由上述实施例可知,本申请提供的网络连接方法,服务器可接收目标终端设备通过无线接入设备发送的连接请求,并对目标终端设备进行连接权限的验证,目标终端设备通过权限验证便可被分配目标专用网络地址池的第一IP地址。在无线传输动态分配地址的前提下,满足目标专用网络需要可信IP地址的需求。动态分配IP地址还能够更好地利用IP地址资源,以较少的IP地址满足目标专用网络动态的接入需求。It can be seen from the above embodiments that in the network connection method provided by this application, the server can receive the connection request sent by the target terminal device through the wireless access device, and verify the connection authority of the target terminal device. Allocate the first IP address of the target private network address pool. On the premise of dynamically assigning addresses for wireless transmission, it meets the needs of trusted IP addresses for the target private network. Dynamic allocation of IP addresses can also make better use of IP address resources, and meet the dynamic access requirements of the target private network with fewer IP addresses.

当目标终端设备的物理地址不存在与用户数据库时,服务器还会对目标终端设备进行第二次权限验证。当目标终端设备通过第二次权限验证时,目标终端设备的物理地址会被保存在用户数据库中,那么,目标终端设备下次连接目标专用网络时就不需要再通过输入用户验证信息进行权限验证。对用户来说,不需要验证即能接入目标专用网络,减少了操作流程,提高了用户体验。When the physical address of the target terminal device does not exist in the user database, the server will also perform a second authority verification on the target terminal device. When the target terminal device passes the second permission verification, the physical address of the target terminal device will be saved in the user database, then, the next time the target terminal device connects to the target private network, it does not need to enter the user verification information for permission verification . For users, they can access the target private network without verification, which reduces the operation process and improves user experience.

除此之外,本申请还能确定目标终端设备对应的目标专用网络,从而本申请提供的网络连接方法还面向多个专用网络。In addition, the present application can also determine the target private network corresponding to the target terminal device, so the network connection method provided by the present application is also oriented to multiple private networks.

如图5所示,本申请提供的一种网络连接方法,应用于目标终端设备,例如应用于如图1中示出的目标终端设备102,该方法可以包括如下S501至S504。As shown in FIG. 5 , a network connection method provided by the present application is applied to a target terminal device, such as the target terminal device 102 shown in FIG. 1 , and the method may include the following steps S501 to S504.

S501:与无线接入设备建立连接。S501: Establish a connection with a wireless access device.

S502:通过无线接入设备,广播发送连接请求,以使得服务器接收并验证目标终端设备是否具有连接目标专用网络的权限,连接请求中包含目标终端设备的物理地址。S502: Broadcast and send a connection request through the wireless access device, so that the server receives and verifies whether the target terminal device has the right to connect to the target private network, and the connection request includes the physical address of the target terminal device.

由于此时目标终端设备还未被分配IP地址,因此只能以0.0.0.0作为IP地址进行通信。但是由于使用0.0.0.0不能进行正常通信,并且目标终端设备也没有能给它分配IP地址的服务器的地址,因此目标终端设备会通过无线接入设备,向网络中广播发送连接请求,且该连接请求中包含目标终端设备的物理地址。Since the target terminal device has not been assigned an IP address at this time, it can only use 0.0.0.0 as the IP address for communication. However, because 0.0.0.0 cannot be used for normal communication, and the target terminal device does not have the address of a server that can assign an IP address to it, the target terminal device will broadcast a connection request to the network through the wireless access device, and the connection The request contains the physical address of the target end device.

在一种可能的实施方式中,无线接入设备和网络中的核心网的边缘路由器基于L2TP协议(第二层隧道协议)建立连接。In a possible implementation manner, the wireless access device establishes a connection with the edge router of the core network in the network based on the L2TP protocol (Layer 2 Tunneling Protocol).

应理解,数据在进行传输时,会根据源IP地址和目的IP地址进行寻找传输路径。寻找到传输路径后,数据帧携带的源物理地址指向目标终端设备,目的物理地址指向网关,即无线接入设备。而后,数据帧会根据每一跳中传输路由器和接受收路由器的变化而变化。因此,最终目的IP地址接收到的数据帧并不携带源IP地址指向的目标终端设备的物理地址,而是上一个网络传输设备的物理地址。It should be understood that when data is being transmitted, a transmission path will be searched according to the source IP address and the destination IP address. After finding the transmission path, the source physical address carried by the data frame points to the target terminal device, and the destination physical address points to the gateway, that is, the wireless access device. Then, the data frame will change according to the change of the transmitting router and the receiving router in each hop. Therefore, the data frame received by the final destination IP address does not carry the physical address of the target terminal device pointed to by the source IP address, but the physical address of the previous network transmission device.

而L2TP协议可建立点对点的隧道传输,将原数据作为荷载数据,再加封L2TP报文头和PPP报文头。加封的L2TP报文头和PPP报文头用于指示数据的传输,从而传输时不改变荷载数据携带的源物理地址。The L2TP protocol can establish a point-to-point tunnel transmission, use the original data as the payload data, and then seal the L2TP message header and the PPP message header. The encapsulated L2TP message header and PPP message header are used to indicate data transmission, so that the source physical address carried by the payload data will not be changed during transmission.

这样,从无线接入设备传入的数据就能够携带目标终端设备的物理地址,相比直接发送目标终端设备的物理地址更为安全可靠。In this way, the data transmitted from the wireless access device can carry the physical address of the target terminal device, which is safer and more reliable than directly sending the physical address of the target terminal device.

S503:若目标终端设备具有连接目标专用网络的权限,则接收到服务器发送的第一IP地址,第一IP地址为从目标专用网络的地址池中取出的地址。S503: If the target terminal device has the authority to connect to the target private network, receive a first IP address sent by the server, where the first IP address is an address taken from an address pool of the target private network.

S504:以第一IP地址为IP地址,连接到目标专用网络。S504: Connect to the target private network by using the first IP address as the IP address.

比如,目标终端设备具有连接目标专用网络的权限,目标终端设备可接收到服务器从目标专用网络的地址池中取出的第一IP地址“116.179.33.144”。目标终端设备应答服务器接受该地址,并使用第一IP地址“116.179.33.144”为IP地址,连接目标专用网络。For example, the target terminal device has the authority to connect to the target private network, and the target terminal device may receive the first IP address "116.179.33.144" taken out by the server from the address pool of the target private network. The target terminal device responds to the server accepting the address, and uses the first IP address "116.179.33.144" as the IP address to connect to the target private network.

由上述实施例可知,本申请提供的网络连接方法,目标终端设备通过无线接入设备连接到网络后,只需发送携带硬件地址的连接请求,通过验证即可得到第一IP地址,并连接到目标专用网络。It can be seen from the above-mentioned embodiments that in the network connection method provided by this application, after the target terminal device is connected to the network through the wireless access device, it only needs to send a connection request carrying a hardware address, and the first IP address can be obtained through verification, and connected to Target private network.

目标终端设备以无线连接的方式,使其不受到有线线路的铺设问题,在任何有网络的场合都可以通过无线接入设备接入目标专用网络。The target terminal device is connected wirelessly, so that it is not subject to the problem of laying wired lines, and can access the target private network through the wireless access device in any occasion where there is a network.

除此之外,本申请将建立隧道的设备和最终访问目标专用网络的设备解耦,使用无线接入设备建立隧道的,而最终标终端设备获得目标专用网络地址池中IP地址,并连接目标专用网络。通过这样的方式,接入目标专用网络时,只有无线接入设备需要配置与目标专用网络连接对应的参数,而目标终端设备只需要连接无线接入设备,不需要进行复杂的配置,简化了用户接入目标专用网络的操作。In addition, this application decouples the device that establishes the tunnel from the device that finally accesses the target private network, uses the wireless access device to establish the tunnel, and the final target terminal device obtains the IP address in the target private network address pool and connects to the target private network. In this way, when accessing the target private network, only the wireless access device needs to configure the parameters corresponding to the target private network connection, while the target terminal device only needs to connect to the wireless access device without complex configuration, which simplifies user The operation of accessing the target's private network.

在一种可能的实施例中,服务器与用户数据库连接,用户数据库中包含具有连接目标专用网络权限的终端设备的物理地址。若目标终端设备的物理地址存在于用户数据库中,则目标终端设备具有连接目标专用网络的权限。In a possible embodiment, the server is connected to the user database, and the user database contains the physical addresses of the terminal devices that have the authority to connect to the private network of the target. If the physical address of the target terminal device exists in the user database, then the target terminal device has the right to connect to the target private network.

在一种可能的实施例中,用户数据库中还包含具有连接目标专用网络权限的终端设备的用户验证信息。若目标终端设备的物理地址不存在于用户数据库中,在接收到服务器发送的第一IP地址前,网络连接方法还包括:接收到服务器推送的用户验证信息验证界面。接收到输入的目标终端设备的用户验证信息,并将目标终端设备的用户验证信息发送给服务器。若目标终端设备的用户验证信息存在于用户数据库中,则目标终端设备通过验证,目标终端设备具有连接目标专用网络的权限。In a possible embodiment, the user database further includes user verification information of terminal devices that have the authority to connect to the target dedicated network. If the physical address of the target terminal device does not exist in the user database, before receiving the first IP address sent by the server, the network connection method further includes: receiving a user verification information verification interface pushed by the server. The input user verification information of the target terminal device is received, and the user verification information of the target terminal device is sent to the server. If the user verification information of the target terminal device exists in the user database, the target terminal device has passed the verification, and the target terminal device has the authority to connect to the target private network.

由上述实施例可知,本申请对目标终端设备提供两次连接权限的验证。当目标终端设备的物理地址存在于用户数据库中,目标终端设备即有权限接入。当目标终端设备的物理地址不存在于用户数据库中,还能通过服务器推送的验证信息验证界面,进一步进行连接权限的验证。第一次验证可使物理地址存在于用户数据库中的终端设备快捷方便地连接到目标专用网络,第二次验证可使物理地址不存在于用户数据库中的终端设备通过验证连接到目标专用网络。It can be seen from the foregoing embodiments that the present application provides two verifications of the connection authority to the target terminal device. When the physical address of the target terminal device exists in the user database, the target terminal device has the right to access. When the physical address of the target terminal device does not exist in the user database, the verification information verification interface pushed by the server can be used to further verify the connection authority. The first verification enables terminal devices whose physical addresses exist in the user database to quickly and conveniently connect to the target private network, and the second verification allows terminal devices whose physical addresses do not exist in the user database to pass verification and connect to the target private network.

在一种可能的实施例中,使用目标网络地址池中的地址可在网络中根据策略路由,连接到目标专用网络。In a possible embodiment, the addresses in the address pool of the target network can be used to connect to the target private network according to policy routing in the network.

传统的路由表转发只能通过数据的目标地址做决策提供路由,而策略路由可以根据源地址、目的地址、源端口、目的端口、协议等特征来做决策提供路由,灵活性好。当目标专用网络的路由表复杂,或者有目标专用网络有多个出入口时,需要对不同的服务、应用和终端设备的访问进行控制,更适合使用策略路由。Traditional routing table forwarding can only make decisions and provide routes based on the destination address of the data, while policy routing can make decisions and provide routes based on characteristics such as source address, destination address, source port, destination port, and protocol, which is flexible. When the routing table of the target private network is complex, or there are multiple entrances and exits of the target private network, it is necessary to control the access of different services, applications, and terminal devices, and it is more suitable to use policy routing.

例如,目标专用网络有两个数据出入口,目的端口A和目的端口B,要求目标终端设备必须通过目的端口A访问目标专用网络。从而,目标终端设备寻找访问目标专用网络的路由路径时,会获得对应的路由路径A,目标终端设备通过路由路径A与目标专用网络的目的端口A连接。For example, the target private network has two data entrances and exits, destination port A and destination port B, and it is required that the target terminal device must access the target private network through destination port A. Therefore, when the target terminal device searches for a routing path to access the target private network, it will obtain a corresponding routing path A, and the target terminal device is connected to the destination port A of the target private network through the routing path A.

当然,策略路由还有其他的配置方法,比如根据负载平衡配置目标终端设备和目标专用网络之间的路由路径,本申请实施例中以目的端口来做决策提供路由仅为示例,并不对本申请构成实际限定。Of course, there are other configuration methods for policy routing, such as configuring the routing path between the target terminal device and the target private network according to load balancing. In the embodiment of this application, the destination port is used to make decisions and provide routes. constitute a practical limit.

在一种可能的实施例中,网络连接方法还包括:停止使用第一IP地址,与目标专用网络断开连接。In a possible embodiment, the network connection method further includes: stopping using the first IP address, and disconnecting from the target private network.

动态的地址分配方式有多种,比如分配的IP地址有使用时长,到期未续租会被收回使用权限。或者,断开连接即会被收回分配的IP地址。There are many ways of dynamic address allocation. For example, the allocated IP address has a usage time, and the usage right will be revoked if the lease is not renewed upon expiration. Alternatively, the assigned IP address will be reclaimed upon disconnection.

例如,当目标终端设备对第一IP地址的使用到期,目标终端设备就不再具有第一IP地址的使用权限,与目标专用网络的连接就会断开,而第一IP地址会被服务器收回。For example, when the use of the first IP address by the target terminal device expires, the target terminal device no longer has the right to use the first IP address, the connection with the target private network will be disconnected, and the first IP address will be deleted by the server. take back.

由上述实施例可知,本申请提供的网络连接方法,将与网络建立隧道的设备和与专用网络建立连接的设备解耦,目标终端设备可使用第一IP地址通过与网络建立隧道的无线接入设备接入专用网络。对于用户来说,本申请提供的网络连接方法只需要接入无线接入设备即可接入目标专用网络,不需要进行与目标专用网络相关的参数配置,只有第一次连接时可能需要输入用户验证信息,在之后都可以通过连接无线接入设备后直接与目标专用网络连接,省略了繁琐的参数配置和连接操作,接入目标专用网络更简便快捷,提高了用户体验。It can be seen from the above-mentioned embodiments that the network connection method provided by the present application decouples the device that establishes a tunnel with the network and the device that establishes a connection with a private network, and the target terminal device can use the first IP address to establish a tunnel with the network. The device is connected to the private network. For users, the network connection method provided by this application only needs to access the wireless access device to access the target private network, and does not need to configure parameters related to the target private network. After verifying the information, you can directly connect to the target private network after connecting the wireless access device, omitting cumbersome parameter configuration and connection operations, making it easier and faster to access the target private network, and improving user experience.

如图6所示,在一些实施例中,本申请提供的一种网络连接装置,可以包括:As shown in FIG. 6, in some embodiments, a network connection device provided by the present application may include:

请求接收模块601,用于接收到目标终端设备发送的连接请求,连接请求包含目标终端设备的物理地址,目标终端设备通过无线接入设备接入网络。The request receiving module 601 is configured to receive a connection request sent by a target terminal device, the connection request includes the physical address of the target terminal device, and the target terminal device accesses the network through a wireless access device.

信息验证模块602,用于根据目标终端设备的物理地址,验证目标终端设备是否具有连接目标专用网络的权限,得到验证结果。The information verification module 602 is configured to verify whether the target terminal device has the authority to connect to the target private network according to the physical address of the target terminal device, and obtain a verification result.

地址分配模块603,用于当验证结果为目标终端设备具有连接目标专用网络的权限时,从目标专用网络的地址池中取出第一IP地址,并将第一IP地址发送给目标终端设备,第一IP地址用于目标终端设备连接到目标专用网络。The address allocation module 603 is configured to take out the first IP address from the address pool of the target private network when the verification result is that the target terminal device has the authority to connect to the target private network, and send the first IP address to the target terminal device, the second An IP address for the target terminal device to connect to the target private network.

在一种可能的实施例中,服务器与用户数据库连接,用户数据库中包含具有连接目标专用网络的权限的终端设备的物理地址。信息验证模块602,具体用于:查询目标终端设备的物理地址是否存在于用户数据库;若目标终端设备的物理地址存在于用户数据库,得到目标终端设备具有连接目标专用网络的权限的验证结果。In a possible embodiment, the server is connected to the user database, and the user database contains the physical addresses of the terminal devices that have the authority to connect to the target private network. The information verification module 602 is specifically used to: query whether the physical address of the target terminal device exists in the user database; if the physical address of the target terminal device exists in the user database, obtain the verification result that the target terminal device has the authority to connect to the target private network.

在一种可能的实施例中,用户数据库中还包含用户验证信息,信息验证模块602,还用于:若目标终端设备的物理地址不存在于用户数据库,则向目标终端设备推送用户验证信息验证界面。接收目标终端设备发送的目标终端设备的用户验证信息,并验证目标终端设备的用户验证信息是否存在于用户数据库。若目标终端设备的用户验证信息存在于用户数据库,得到目标终端设备具有连接目标专用网络的权限的验证结果。In a possible embodiment, the user database also includes user verification information, and the information verification module 602 is also configured to: if the physical address of the target terminal device does not exist in the user database, push the user verification information verification information to the target terminal device. interface. Receive the user verification information of the target terminal device sent by the target terminal device, and verify whether the user verification information of the target terminal device exists in the user database. If the user verification information of the target terminal device exists in the user database, a verification result is obtained that the target terminal device has the authority to connect to the target private network.

在一种可能的实施例中,信息验证模块602,还用于:若目标终端设备的物理地址不存在于用户数据库,且得到目标终端设备具有连接目标专用网络的权限的验证结果,则将目标终端设备的物理地址保存至用户数据库中。In a possible embodiment, the information verification module 602 is further configured to: if the physical address of the target terminal device does not exist in the user database, and the verification result that the target terminal device has the authority to connect to the target private network is obtained, then the target terminal device The physical address of the terminal device is stored in the user database.

在一种可能的实施例中,用户数据库中还包含具有连接目标专用网络的权限的终端设备对应的网络标识,网络标识指向终端设备具有连接权限的目标专用网络。地址分配模块603,还用于:从目标专用网络的地址池中取出第一IP地址之前,根据用户数据库中目标终端设备对应的网络标识,确定目标终端设备具有连接权限的目标专用网络。In a possible embodiment, the user database further includes a network identifier corresponding to a terminal device having permission to connect to the target private network, and the network identifier points to the target private network to which the terminal device has connection permission. The address assignment module 603 is further configured to: before taking out the first IP address from the address pool of the target private network, determine the target private network to which the target terminal device has connection authority according to the network identifier corresponding to the target terminal device in the user database.

在一种可能的实施例中,地址分配模块603,还用于:发送第一IP地址给目标终端设备后,将第一IP地址确定为目标专用网络的地址池中不可被分配的IP地址。当目标终端设备停止使用第一IP地址时,将第一IP地址确定为目标专用网络的地址池中可被分配的IP地址。In a possible embodiment, the address allocation module 603 is further configured to: after sending the first IP address to the target terminal device, determine the first IP address as an IP address that cannot be allocated in the address pool of the target private network. When the target terminal device stops using the first IP address, determine the first IP address as an IP address that can be allocated in the address pool of the target private network.

如图7所示,在一些实施例中,本申请提供的一种网络连接装置,可以包括:As shown in FIG. 7, in some embodiments, a network connection device provided by the present application may include:

信号连接模块701,用于与无线接入设备建立连接。A signal connection module 701, configured to establish a connection with a wireless access device.

数据发送模块702,用于通过无线接入设备,广播发送连接请求,以使得服务器接收并验证目标终端设备是否具有连接目标专用网络的权限,连接请求中包含目标终端设备的物理地址。The data sending module 702 is configured to broadcast and send a connection request through the wireless access device, so that the server receives and verifies whether the target terminal device has permission to connect to the target private network, and the connection request includes the physical address of the target terminal device.

数据接收模块703,用于当目标终端设备具有连接目标专用网络的权限时,则接收到服务器发送的第一IP地址,第一IP地址为从目标专用网络的地址池中取出的地址。The data receiving module 703 is configured to receive the first IP address sent by the server when the target terminal device has the authority to connect to the target private network, and the first IP address is an address taken from the address pool of the target private network.

信号连接模块701,还用于以第一IP地址为IP地址,连接到目标专用网络。The signal connection module 701 is further configured to use the first IP address as the IP address to connect to the target private network.

在一种可能的实施例中,服务器与用户数据库连接,用户数据库中包含具有连接目标专用网络权限的终端设备的物理地址。若目标终端设备的物理地址存在于用户数据库中,则目标终端设备具有连接目标专用网络的权限。In a possible embodiment, the server is connected to the user database, and the user database contains the physical addresses of the terminal devices that have the authority to connect to the private network of the target. If the physical address of the target terminal device exists in the user database, then the target terminal device has the right to connect to the target private network.

在一种可能的实施例中,用户数据库中还包含具有连接目标专用网络权限的终端设备的用户验证信息。若目标终端设备的物理地址不存在于用户数据库中,在接收到服务器发送的第一IP地址前,数据接收模块703,还用于:接收到服务器推送的用户验证信息验证界面。接收到输入的目标终端设备的用户验证信息,并将目标终端设备的用户验证信息发送给服务器。若目标终端设备的用户验证信息存在于用户数据库中,则目标终端设备通过验证,目标终端设备具有连接目标专用网络的权限。In a possible embodiment, the user database further includes user verification information of terminal devices that have the authority to connect to the target dedicated network. If the physical address of the target terminal device does not exist in the user database, before receiving the first IP address sent by the server, the data receiving module 703 is further configured to: receive the user verification information verification interface pushed by the server. The input user verification information of the target terminal device is received, and the user verification information of the target terminal device is sent to the server. If the user verification information of the target terminal device exists in the user database, the target terminal device has passed the verification, and the target terminal device has the authority to connect to the target private network.

在一种可能的实施例中,信号连接模块701,还用于:停止使用第一IP地址,与目标专用网络断开连接。In a possible embodiment, the signal connection module 701 is further configured to: stop using the first IP address, and disconnect from the target private network.

本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质上存储程序或指令,程序或指令被处理器执行时实现上述方法实施例中的各个步骤。The embodiment of the present application also provides a computer-readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, each step in the foregoing method embodiment is implemented.

其中,计算机可读存储介质,例如可以是但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘。随机存取存储器(RandomAccessMemory,RAM)、只读存储器(Read-OnlyMemory,ROM)、可擦式可编程只读存储器(ErasablePr ogrammableReadOnlyMemory,EPROM)、寄存器、硬盘、光纤、便携式紧凑磁盘只读存储器(CompactDiscRead-OnlyMemory,CD-ROM)、光存储器件、磁存储器件、或者上述的人以合适的组合、或者本领域数值的任何其他形式的可读存储介质。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于特定用途集成电路(Appl icationSpecificIntegratedCircuit,ASIC)中。在本申请实施例中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。Wherein, the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk. Random Access Memory (Random Access Memory, RAM), Read-Only Memory (Read-Only Memory, ROM), Erasable Programmable Read-Only Memory (ErasableProgrammableReadOnlyMemory, EPROM), Registers, Hard Disk, Optical Fiber, Portable Compact Disk Read-Only Memory (CompactDiscRead -OnlyMemory, CD-ROM), optical storage device, magnetic storage device, or any other form of readable storage medium in an appropriate combination of the above, or values in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may be located in an application specific integrated circuit (Application Specific Integrated Circuit, ASIC). In the embodiments of the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, and the program may be used by or in combination with an instruction execution system, device or device.

本申请的实施例提供一种计算机程序产品,该计算机程序产品被存储在非易失的存储介质中,该计算机程序产品被至少一个处理器执行以实现上述方法实施例所示的各个步骤。The embodiments of the present application provide a computer program product, the computer program product is stored in a non-volatile storage medium, and the computer program product is executed by at least one processor to implement the steps shown in the foregoing method embodiments.

在上述实施例中,可以全部或部分地通过软件、物理、固件或者其任意组合来实现。当使用软件程序实现时,可以全部或部分地以计算机程序产品的形式来实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在可读存储介质中,或者从一个可读存储介质向另一个可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或者数据中心通过有线(例如同轴电缆、光纤、数字用户线(DigitalSubscriberLine,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带),光介质(例如,DVD)、或者半导体介质(例如固态硬盘(SolidStateDisk,SSD))等。In the above embodiments, all or part of the implementation may be implemented by software, physics, firmware or any combination thereof. When implemented using a software program, it may 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 the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a readable storage medium or transmitted from one readable storage medium to another readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server or a data center via a wired ( Such as coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (such as infrared, wireless, microwave, etc.) to another website site, computer, server or data center. The readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media. The available medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, DVD), or a semiconductor medium (for example, a solid state disk (SolidStateDisk, SSD)) and the like.

通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能单元的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元完成,即将装置的内部结构划分成不同的功能单元,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above-mentioned functional units is used as an example for illustration. In practical applications, the above-mentioned functions can be allocated according to needs Completed by different functional units, that is, the internal structure of the device is divided into different functional units to complete all or part of the functions described above. For the specific working process of the above-described system, device, and unit, reference may be made to the corresponding process in the foregoing method embodiments, and details are not repeated here.

由于本申请的实施例中的设备、可读存储介质、计算机程序产品可以应用于上述方法,因此,其所能获得的技术效果也可参考上述方法实施例,本申请的实施例在此不再赘述。Since the devices, readable storage media, and computer program products in the embodiments of the present application can be applied to the above-mentioned methods, the technical effects that can be obtained can also refer to the above-mentioned method embodiments, and the embodiments of the present application are not repeated here. repeat.

需要说明的是,上述各单元可以为单独设立的处理器,也可以集成在控制器的某一个处理器中实现,此外,也可以以程序代码的形式存储于控制器的存储器中,由控制器的某一个处理器调用并执行以上各单元的功能。这里所述的处理器可以是一个中央处理器(CentralProcessingUnit,CPU),或者是特定集成电路(ApplicationSpecificIntegratedCircuit,ASIC),或者是被配置成实施本申请实施例的一个或多个集成电路。It should be noted that each of the above units can be implemented as a separate processor, or can be integrated into a certain processor of the controller. In addition, it can also be stored in the memory of the controller in the form of program code. One of the processors calls and executes the functions of the above units. The processor mentioned here may be a central processing unit (Central Processing Unit, CPU), or a specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that, in various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the order of execution, and the execution order of the processes should be determined by their functions and internal logic, and should not be used in the embodiments of the present application. The implementation process constitutes any limitation.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子物理、或者计算机软件和电子物理的结合来实现。这些功能究竟以物理还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic physics, or a combination of computer software and electronic physics. Whether these functions are implemented in a physical or software manner depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统、设备和方法,可以通过其它的方式实现。例如,以上所描述的设备实施例仅仅是示意性的,例如,单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合、直接耦合或通信连接可以是通过接口实现的,其接口连接可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated. to another system, or some features may be ignored, or not implemented. In another point, the mutual coupling, direct coupling or communication connection shown or discussed may be realized through an interface, and the interface connection may be in an electrical, mechanical or other form.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.

以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above is only a specific implementation of the application, but the scope of protection of the application is not limited thereto. Anyone familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the application. Should be covered within the protection scope of this application. Therefore, the protection scope of the present application should be determined by the protection scope of the claims.

Claims (12)

1. A network connection method, applied to a server, comprising:
receiving a connection request sent by target terminal equipment, wherein the connection request comprises a physical address of the target terminal equipment, and the target terminal equipment accesses a network through wireless access equipment;
Verifying whether the target terminal equipment has the authority of connecting with a target private network according to the physical address of the target terminal equipment to obtain a verification result;
if the verification result is that the target terminal equipment has the authority of connecting the target private network, a first IP address is taken out from an address pool of the target private network, and the first IP address is sent to the target terminal equipment; the first IP address is used for the target terminal device to connect to the target private network.
2. The network connection method according to claim 1, wherein the server is connected to a user database containing physical addresses of terminal devices having rights to connect to the target private network; and verifying whether the target terminal equipment has the right to connect with the target private network according to the physical address of the target terminal equipment to obtain a verification result, wherein the verification result comprises the following steps:
inquiring whether the physical address of the target terminal equipment exists in the user database;
and if the physical address of the target terminal equipment exists in the user database, obtaining a verification result that the target terminal equipment has the authority to connect with the target private network.
3. The network connection method according to claim 2, wherein the user database further contains user authentication information, and the authentication of whether the target terminal device has the right to connect to the target private network, further comprises:
if the physical address of the target terminal equipment does not exist in the user database, pushing a user verification information verification interface to the target terminal equipment;
receiving user authentication information of the target terminal equipment sent by the target terminal equipment And verifying whether user verification information of the target terminal device exists in the user database;
and if the user authentication information of the target terminal equipment exists in the user database, obtaining an authentication result that the target terminal equipment has the authority to connect the target private network.
4. A network connection method according to claim 3, characterized in that the method further comprises:
if the physical address of the target terminal equipment does not exist in the user database and a verification result that the target terminal equipment has the authority to connect with the target private network is obtained, the physical address of the target terminal equipment is stored in the user database.
5. The network connection method according to any one of claims 2 to 4, wherein the user database further contains a network identifier corresponding to the terminal device having the authority to connect to the target private network, the network identifier pointing to the target private network to which the terminal device has the authority to connect; before the first IP address is fetched from the address pool of the target private network, the method further includes:
and determining the target special network with the connection authority of the target terminal equipment according to the network identifier corresponding to the target terminal equipment in the user database.
6. The network connection method according to claim 1, wherein after the first IP address is sent to the target terminal device, further comprising:
determining the first IP address as a I P address in the address pool of the target private network that cannot be allocated;
when the target terminal device stops using the first IP address, the first IP address is determined as an IP address which can be allocated in an address pool of the target special network.
7. A network connection method, applied to a target terminal device, comprising:
Establishing a connection with a wireless access device;
broadcasting and sending a connection request through the wireless access equipment so that a server receives and verifies whether the target terminal equipment has the authority of connecting with a target special network, wherein the connection request comprises the physical address of the target terminal equipment;
if the target terminal equipment has the authority of connecting the target private network, a first IP address sent by the server is received; the first IP address is an address taken out of an address pool of the target private network;
and connecting to the target private network by taking the first IP address as an IP address.
8. The network connection method according to claim 7, wherein the server is connected to a user database containing physical addresses of terminal devices having rights to connect to the target private network; and if the physical address of the target terminal equipment exists in the user database, the target terminal equipment has the authority of connecting the target special network.
9. The network connection method according to claim 8, wherein the user database further contains user authentication information of the terminal device having authority to connect to the target private network; if the physical address of the target terminal device does not exist in the user database, before receiving the first IP address sent by the server, the method further includes:
Receiving a user verification information verification interface pushed by the server;
receiving input user authentication information of the target terminal equipment, and sending the user authentication information of the target terminal equipment to the server; if the user verification information of the target terminal equipment exists in the user database, the target terminal equipment passes verification, and the target terminal equipment has the authority of connecting the target private network.
10. The network connection method as recited in claim 7, wherein the method further comprises:
and stopping using the first IP address, and disconnecting from the target special network.
11. A network connection device, comprising:
a request receiving module, configured to receive a connection request sent by a target terminal device, where the connection request includes a physical address of the target terminal device, and the target terminal device accesses a network through a wireless access device;
the information verification module is used for verifying whether the target terminal equipment has the authority of connecting the target special network according to the physical address of the target terminal equipment to obtain a verification result;
The address allocation module is used for taking out a first IP address from an address pool of the target special network and sending the first IP address to the target terminal equipment when the verification result shows that the target terminal equipment has the authority of connecting the target special network; the first IP address is used for the target terminal device to connect to the target private network.
12. A network connection device, comprising:
the signal connection module is used for establishing connection with the wireless access equipment;
the data sending module is used for broadcasting and sending a connection request through the wireless access equipment so that a server receives and verifies whether target terminal equipment has the authority of connecting a target special network or not, wherein the connection request comprises a physical address of the target terminal equipment;
the data receiving module is used for receiving a first IP address sent by the server when the target terminal equipment has the authority of connecting the target private network; the first IP address is an address taken out of an address pool of the target private network;
the signal connection module is further configured to connect to the target private network with the first IP address as an IP address.
CN202310118255.7A 2023-02-01 2023-02-01 A network connection method and device Pending CN116209095A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310118255.7A CN116209095A (en) 2023-02-01 2023-02-01 A network connection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310118255.7A CN116209095A (en) 2023-02-01 2023-02-01 A network connection method and device

Publications (1)

Publication Number Publication Date
CN116209095A true CN116209095A (en) 2023-06-02

Family

ID=86510768

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310118255.7A Pending CN116209095A (en) 2023-02-01 2023-02-01 A network connection method and device

Country Status (1)

Country Link
CN (1) CN116209095A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013020267A1 (en) * 2011-08-08 2013-02-14 华为数字技术有限公司 Ip address allocation method, system and device
US20160044494A1 (en) * 2014-08-06 2016-02-11 Kt Corporation Determining network connection structure of target area
CN107659934A (en) * 2017-10-19 2018-02-02 上海斐讯数据通信技术有限公司 A kind of control method and wireless network access device of wireless network connection
CN108322366A (en) * 2017-01-17 2018-07-24 阿里巴巴集团控股有限公司 Access the methods, devices and systems of network
CN111711714A (en) * 2020-06-17 2020-09-25 厦门亿联网络技术股份有限公司 IP address query method, device, server, control equipment and medium
CN114710302A (en) * 2020-12-17 2022-07-05 北京首信科技股份有限公司 Internet access control method and control device thereof

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013020267A1 (en) * 2011-08-08 2013-02-14 华为数字技术有限公司 Ip address allocation method, system and device
US20160044494A1 (en) * 2014-08-06 2016-02-11 Kt Corporation Determining network connection structure of target area
CN108322366A (en) * 2017-01-17 2018-07-24 阿里巴巴集团控股有限公司 Access the methods, devices and systems of network
CN107659934A (en) * 2017-10-19 2018-02-02 上海斐讯数据通信技术有限公司 A kind of control method and wireless network access device of wireless network connection
CN111711714A (en) * 2020-06-17 2020-09-25 厦门亿联网络技术股份有限公司 IP address query method, device, server, control equipment and medium
CN114710302A (en) * 2020-12-17 2022-07-05 北京首信科技股份有限公司 Internet access control method and control device thereof

Similar Documents

Publication Publication Date Title
CN109245984B (en) A message transmission method, an information processing method and related equipment
CN109315004B (en) PDU type setting method and related entity
KR102388195B1 (en) BRAS system-based message packaging method and device
WO2021057889A1 (en) Data processing method and apparatus, electronic device, and storage medium
US8737388B2 (en) Method, apparatus and system for processing packets
US9832136B1 (en) Streaming software to multiple virtual machines in different subnets
CN104993993B (en) A kind of message processing method, equipment and system
CN114143283B (en) Tunnel self-adaptive configuration method and device, central terminal equipment and communication system
CN110691110B (en) Communication method, device, system, terminal, equipment and medium
CN110392066A (en) A method and device for accessing services
WO2022257763A1 (en) Routing method and apparatus, device, and storage medium
CN113498110B (en) Service message transmission method and related equipment
CN116996908A (en) Fusion management method, device, equipment and medium of master-slave gateway and wireless AP
WO2023221708A1 (en) Pdn dialing method, system and apparatus, multi-pdn dialing configuration method, system and apparatus, and device and storage medium
CN112019492A (en) Access control method, device and storage medium
CN115412549A (en) Information configuration method and device and request processing method and device
CN118487936A (en) A virtual-real interconnection method, device, equipment and storage medium
CN116209095A (en) A network connection method and device
CN116566764A (en) A configuration method and device for accessing a virtual private network
CN116233655B (en) Business processing method, device and storage medium
CN116156497B (en) Gateway authentication method, device and storage medium
CN115664920B (en) Network communication management method, device and equipment of cloud platform and storage medium
CN115632992A (en) Data transmission method and device, computer equipment and storage medium
CN204498144U (en) A kind of Virtual network operator multiple exit based on Campus Network selects equipment
CN112714202B (en) Equipment configuration method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination