WO2020238523A1 - Gateway configuration method, system, computer storage medium and electronic device - Google Patents

Gateway configuration method, system, computer storage medium and electronic device Download PDF

Info

Publication number
WO2020238523A1
WO2020238523A1 PCT/CN2020/087146 CN2020087146W WO2020238523A1 WO 2020238523 A1 WO2020238523 A1 WO 2020238523A1 CN 2020087146 W CN2020087146 W CN 2020087146W WO 2020238523 A1 WO2020238523 A1 WO 2020238523A1
Authority
WO
WIPO (PCT)
Prior art keywords
gateway
parameters
parameter
address
target
Prior art date
Application number
PCT/CN2020/087146
Other languages
French (fr)
Chinese (zh)
Inventor
林英想
庄严
Original Assignee
深圳云里物里科技股份有限公司
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 深圳云里物里科技股份有限公司 filed Critical 深圳云里物里科技股份有限公司
Publication of WO2020238523A1 publication Critical patent/WO2020238523A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/02Standardisation; Integration
    • H04L41/0246Exchanging or transporting network management information using the Internet; Embedding network management web servers in network elements; Web-services-based protocols
    • H04L41/0253Exchanging or transporting network management information using the Internet; Embedding network management web servers in network elements; Web-services-based protocols using browsers or web-pages for accessing management information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/02Standardisation; Integration
    • H04L41/0246Exchanging or transporting network management information using the Internet; Embedding network management web servers in network elements; Web-services-based protocols
    • H04L41/0266Exchanging or transporting network management information using the Internet; Embedding network management web servers in network elements; Web-services-based protocols using meta-data, objects or commands for formatting management information, e.g. using eXtensible markup language [XML]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/10Mapping addresses of different types
    • H04L61/103Mapping addresses of different types across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]

Definitions

  • the specific process of ARP scanning can be as follows: firstly sending a corresponding ARP scanning request to each IP address in the target IP address range, and then receiving host information returned by all hosts according to the ARP scanning request, and then according to the gateway device.
  • the MAC address feature of, filters the host information to obtain the gateway information.
  • the URL parameter represents the address of the server.
  • the parameter value in all gateways is the same, because there is only one server address in general.
  • the parameters related to the gateway cannot be the same.
  • the parameters can be divided into two categories, one is the parameters that differ due to different IP addresses, and the other is the parameters that differ due to different MAC addresses, such as static IP addresses. , Ssid parameter, clientID parameter and topic parameter.
  • the judgment module is used to judge whether the same target class parameter exists in all the original gateway parameters; if so, mark the same target class parameter as the parameter to be modified;

Abstract

Disclosed by the present application is a gateway configuration method, which comprises: acquiring gateway information of all gateway devices in a target IP address segment, the gateway information comprising the mapping between the MAC addresses and IP addresses of the gateway devices; sending a parameter acquisition instruction to all of the gateway devices according to the mapping so as to acquire original gateway parameters of all of the gateway devices; when a modification instruction is received, modifying all of the original gateway parameters according to the modification instruction to obtain new gateway parameters; and sending each of the new gateway parameters to a corresponding gateway device in order for the gateway device to complete a parameter configuration operation according to the new gateway parameter. The present method may configure gateway parameters in batches and improve the efficiency of gateway configuration. Further disclosed by the present application is a gateway configuration system, a computer-readable storage medium and an electronic device, which have the beneficial effects described above.

Description

一种网关配置方法、系统、计算机存储介质及电子设备Gateway configuration method, system, computer storage medium and electronic equipment 技术领域Technical field
本发明涉及计算机技术领域,特别涉及一种网关配置方法、系统、一种计算机可读存储介质及一种电子设备。The present invention relates to the field of computer technology, in particular to a gateway configuration method and system, a computer-readable storage medium and an electronic device.
背景技术Background technique
网关(Gateway)设备又称网间连接器、协议转换器,是多个网络间提供数据转换服务的计算机系统或设备。可以说网关设备就是不同网之间的连接器,就是数据要从一个网到另外一个网时要经过“协商”的设备。Gateway (Gateway) equipment, also known as network connector, protocol converter, is a computer system or device that provides data conversion services between multiple networks. It can be said that a gateway device is a connector between different networks, which is a device that undergoes "negotiation" when data is to be transferred from one network to another.
相关技术中,配置网关需要经过如下步骤:使用手机或者手提笔记本连接所述网关发射的WiFi热点,在浏览器中输入其IP地址后访问所述网关的网页配置页面后才能进行配置。但是,当网关的数量非常多的时候,不断地重复上面所述步骤是非常烦躁且耗时的时候。In related technologies, the configuration of the gateway requires the following steps: use a mobile phone or laptop to connect to the WiFi hotspot transmitted by the gateway, enter its IP address in a browser, and access the web configuration page of the gateway before configuration. However, when the number of gateways is very large, it is very annoying and time-consuming to repeatedly repeat the above steps.
因此,如何批量配置网关参数,提高网关配置效率是本领域技术人员目前需要解决的技术问题。Therefore, how to configure gateway parameters in batches to improve the efficiency of gateway configuration is a technical problem that needs to be solved by those skilled in the art.
发明内容Summary of the invention
本申请的目的是提供一种网关配置方法、系统、一种计算机可读存储介质及一种电子设备,能够批量配置网关参数,提高网关配置效率。The purpose of this application is to provide a gateway configuration method and system, a computer-readable storage medium, and an electronic device that can configure gateway parameters in batches and improve the efficiency of gateway configuration.
为解决上述技术问题,本申请提供一种网关配置方法,该网关配置方法包括:In order to solve the above technical problems, this application provides a gateway configuration method. The gateway configuration method includes:
获取目标IP地址段内所有网关设备的网关信息;其中,所述网关信息包括所述网关设备的MAC地址与IP地址的映射关系;Acquiring gateway information of all gateway devices in the target IP address segment; wherein the gateway information includes the mapping relationship between the MAC address and the IP address of the gateway device;
根据所述映射关系向所有所述网关设备发送参数获取指令,以便获取所有所述网关设备的原网关参数;Sending a parameter acquisition instruction to all the gateway devices according to the mapping relationship, so as to acquire the original gateway parameters of all the gateway devices;
当接收到修改指令时,根据所述修改指令修改所有所述原网关参数得到新网关参数;When a modification instruction is received, modify all the original gateway parameters according to the modification instruction to obtain new gateway parameters;
将每一所述新网关参数发送至对应的网关设备,以便所述网关设备根据所述新网关参数完成参数配置操作。Send each of the new gateway parameters to the corresponding gateway device, so that the gateway device completes the parameter configuration operation according to the new gateway parameters.
可选的,所述获取目标IP地址段内所有网关设备的网关信息包括:Optionally, the acquiring gateway information of all gateway devices in the target IP address segment includes:
向所述目标IP地址段内的每一IP地址发送对应的HTTP扫描请求;Sending a corresponding HTTP scan request to each IP address in the target IP address segment;
接收所有所述网关设备根据所述HTTP扫描请求返回的网关信息。Receiving all gateway information returned by the gateway device according to the HTTP scanning request.
可选的,所述获取目标IP地址段内所有网关设备的网关信息包括:Optionally, the acquiring gateway information of all gateway devices in the target IP address segment includes:
向所述目标IP地址段内的每一IP地址发送对应的ARP扫描请求;Sending a corresponding ARP scanning request to each IP address in the target IP address range;
接收所有主机根据所述ARP扫描请求返回的主机信息;Receiving host information returned by all hosts according to the ARP scanning request;
根据所述网关设备的MAC地址特征对所述主机信息进行过滤得到所述网关信息。Filter the host information according to the MAC address feature of the gateway device to obtain the gateway information.
可选的,所述网关信息还包括:网关设备型号和网关固件版本;Optionally, the gateway information further includes: gateway device model and gateway firmware version;
相应的,将每一所述新网关参数发送至对应的网关设备包括:Correspondingly, sending each of the new gateway parameters to the corresponding gateway device includes:
根据所述网关设备型号和所述网关固件版本创建相应的目标HTTP请求格式;Create a corresponding target HTTP request format according to the gateway device model and the gateway firmware version;
为每一所述网关设备构建包含所述新网关参数的目标HTTP请求格式的参数修改请求;Constructing a parameter modification request in a target HTTP request format including the new gateway parameters for each of the gateway devices;
将每一所述参数修改请求发送至对应的网关设备。Send each parameter modification request to the corresponding gateway device.
可选的,在获取所有所述网关设备的原网关参数之后,还包括:Optionally, after acquiring the original gateway parameters of all the gateway devices, it further includes:
判断所有所述原网关参数中是否存在相同的目标类参数;Determine whether the same target class parameter exists in all the original gateway parameters;
若是,则将所述相同的目标类参数标记为待修改类参数;If yes, mark the same target class parameter as the class parameter to be modified;
相应的,在将每一所述新网关参数发送至对应的网关设备之前,还包括:Correspondingly, before sending each of the new gateway parameters to the corresponding gateway device, the method further includes:
对所有所述待修改类参数执行修改操作得到新的目标类参数,以使所有所述新网关参数中的目标类参数或新的目标类参数均不相同。Perform a modification operation on all the parameters of the class to be modified to obtain new target class parameters, so that the target class parameters or the new target class parameters in all the new gateway parameters are different.
可选的,所述目标类参数包括静态IP地址、ssid参数、clientID参数和topic参数中的任一类参数或任几类参数的组合。Optionally, the target class parameters include any type of parameters or a combination of any number of types of parameters among static IP address, ssid parameter, clientID parameter, and topic parameter.
可选的,在获取所有所述网关设备的原网关参数之后,还包括:Optionally, after acquiring the original gateway parameters of all the gateway devices, it further includes:
设置每一所述网关设备的MAC地址的修改权限,以便禁止用户修改所述MAC地址。Set the modification authority of the MAC address of each gateway device so as to prohibit the user from modifying the MAC address.
本申请还提供了一种网关配置系统,该网关配置系统包括:This application also provides a gateway configuration system, which includes:
扫描模块,用于获取目标IP地址段内所有网关设备的网关信息;其中,所述网关信息包括所述网关设备的MAC地址与IP地址的映射关系;The scanning module is used to obtain gateway information of all gateway devices in the target IP address segment; wherein the gateway information includes the mapping relationship between the MAC address and the IP address of the gateway device;
参数获取模块,用于根据所述映射关系向所有所述网关设备发送参数获取指令,以便获取所有所述网关设备的原网关参数;The parameter acquisition module is configured to send a parameter acquisition instruction to all the gateway devices according to the mapping relationship, so as to acquire the original gateway parameters of all the gateway devices;
批量配置模块,用于当接收到修改指令时,根据所述修改指令修改所有所述原网关参数得到新网关参数;还用于将每一所述新网关参数发送至对应的网关设备,以便所述网关设备根据所述新网关参数完成参数配置操作。The batch configuration module is used to modify all the original gateway parameters according to the modification instruction to obtain new gateway parameters when a modification instruction is received; it is also used to send each of the new gateway parameters to the corresponding gateway device for all The gateway device completes the parameter configuration operation according to the new gateway parameter.
本申请还提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序执行时实现上述网关配置方法执行的步骤。The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed, the steps performed by the foregoing gateway configuration method are implemented.
本申请还提供了一种电子设备,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器调用所述存储器中的计算机程序时实现上述网关配置方法执行的步骤。The present application also provides an electronic device including a memory and a processor, the memory is stored with a computer program, and when the processor invokes the computer program in the memory, the steps performed by the above gateway configuration method are implemented.
本申请提供了一种网关配置方法,包括获取目标IP地址段内所有网关设备的网关信息;其中,所述网关信息包括所述网关设备的MAC地址与IP地址的映射关系;根据所述映射关系向所有所述网关设备发送参数获取指令,以便获取所有所述网关设备的原网关参数;当接收到修改指令时,根据所述修改指令修改所有所述原网关参数得到新网关参数;将每一所述新网关参数发送至对应的网关设备,以便所述网关设备根据所述新网关参数完成参数配置操作。This application provides a gateway configuration method, including obtaining gateway information of all gateway devices in the target IP address segment; wherein the gateway information includes the mapping relationship between the MAC address and IP address of the gateway device; according to the mapping relationship Send a parameter acquisition instruction to all the gateway devices so as to acquire the original gateway parameters of all the gateway devices; when a modification instruction is received, modify all the original gateway parameters according to the modification instruction to obtain new gateway parameters; The new gateway parameter is sent to the corresponding gateway device, so that the gateway device completes the parameter configuration operation according to the new gateway parameter.
本申请首先获取目标IP地址段内所有网关设备的MAC地址与IP地址的映射关系,基于该映射关系获取每一网关设备的原网关参数,对原网关管参数进行批量修改得到新网关参数。通过将新网关参数发送至对应的网关参数,每一网关设备可以根据新网关参数完成参数配置操作。在上述网关配置过程中可以实现对于批量网关参数的集中获取与修改,能够批量配置网关参数,提高网关配置效率。本申请同时还提供了一种网关配置系统、一种计算机可读存储介质和一种电子设备,具有上述有益效果,在此不再赘述。This application first obtains the mapping relationship between the MAC addresses and IP addresses of all gateway devices in the target IP address segment, obtains the original gateway parameters of each gateway device based on the mapping relationship, and batches the original gateway management parameters to obtain new gateway parameters. By sending the new gateway parameters to the corresponding gateway parameters, each gateway device can complete the parameter configuration operation according to the new gateway parameters. In the above-mentioned gateway configuration process, centralized acquisition and modification of batch gateway parameters can be realized, gateway parameters can be configured in batches, and gateway configuration efficiency can be improved. This application also provides a gateway configuration system, a computer-readable storage medium, and an electronic device, which have the above-mentioned beneficial effects, and will not be repeated here.
附图说明Description of the drawings
为了更清楚地说明本申请实施例,下面将对实施例中所需要使用的附图做简单的介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例, 对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present application more clearly, the following will briefly introduce the drawings needed in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. As far as personnel are concerned, they can obtain other drawings based on these drawings without creative work.
图1为本申请实施例所提供的一种网关配置方法的流程图;FIG. 1 is a flowchart of a gateway configuration method provided by an embodiment of the application;
图2为本实施例提供的网关信息获取方式的流程图;FIG. 2 is a flowchart of the gateway information acquisition method provided by this embodiment;
图3为本申请实施例提供的获取原网关参数的方法的流程图;FIG. 3 is a flowchart of a method for obtaining original gateway parameters provided by an embodiment of the application;
图4为本申请实施例提供的网关参数批量配置方法的流程图;4 is a flowchart of a method for batch configuration of gateway parameters provided by an embodiment of the application;
图5为本申请实施例所提供的一种网关配置系统的结构示意图。FIG. 5 is a schematic structural diagram of a gateway configuration system provided by an embodiment of the application.
具体实施方式Detailed ways
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments It is a part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
下面请参见图1,图1为本申请实施例所提供的一种网关配置方法的流程图。Please refer to Fig. 1 below, which is a flowchart of a gateway configuration method provided by an embodiment of the application.
具体步骤可以包括:Specific steps can include:
S101:获取目标IP地址段内所有网关设备的网关信息;S101: Obtain gateway information of all gateway devices in the target IP address segment;
其中,本实施例的网关配置方法可以基于计算机实现,本实施例能够实现批量配置网关的先决条件可以包括以下几点:(1)执行本实施例所描述的网关配置方法的计算机和需要被配置的网关设备处于同一个网段的局域网;(2)每个网关设备都有内置的HTTP服务器,能处理批量配置程序请求过来的HTTP请求;具体的,HTTP请求可以包括扫描请求、原始参数获取请求和配置参数请求。Among them, the gateway configuration method of this embodiment can be implemented on a computer. The prerequisites for this embodiment to configure gateways in batches may include the following points: (1) The computer that executes the gateway configuration method described in this embodiment and needs to be configured The gateway devices are in the same network segment of the local area network; (2) Each gateway device has a built-in HTTP server that can process HTTP requests from the batch configuration program; specifically, HTTP requests can include scan requests and original parameter acquisition requests And configuration parameter request.
本步骤的目的在于扫描出处于目标IP地址段内所有网关设备的网关信息,作为一种可行的实施方式,可以扫描出同一局域网内的所有网关设备。本步骤提到的所述网关信息可以包括所述网关设备的MAC地址与IP地址的映射关系。The purpose of this step is to scan out the gateway information of all gateway devices in the target IP address segment. As a feasible implementation manner, all gateway devices in the same local area network can be scanned. The gateway information mentioned in this step may include the mapping relationship between the MAC address and the IP address of the gateway device.
本实施例可以通过发送HTTP请求或发送ARP请求的方式获取网关设备的MAC地址与IP地址的映射关系,当然还可以根据实际应用场景灵活选择获取网关信息的其他方式,在此不进行具体的限定。In this embodiment, the mapping relationship between the MAC address and the IP address of the gateway device can be obtained by sending an HTTP request or sending an ARP request. Of course, other methods of obtaining gateway information can be flexibly selected according to actual application scenarios, and no specific limitation is made here. .
S102:根据所述映射关系向所有所述网关设备发送参数获取指令,以便获取所有所述网关设备的原网关参数;S102: Send a parameter acquisition instruction to all the gateway devices according to the mapping relationship, so as to acquire the original gateway parameters of all the gateway devices;
其中,本步骤建立在已经获得网关设备的MAC地址与IP地址的映射关系基础上,根据该映射关系向网关设备发送参数获取指令可以获取网关设备中已存在的原网关参数,原网关参数可以包括静态IP地址、ssid参数、clientID参数、MAC地址和topic参数等信息。Among them, this step is established on the basis of obtaining the mapping relationship between the MAC address of the gateway device and the IP address, and sending a parameter acquisition instruction to the gateway device according to the mapping relationship can obtain the original gateway parameters that already exist in the gateway device. The original gateway parameters may include Information such as static IP address, ssid parameter, clientID parameter, MAC address and topic parameter.
作为一种可行的实施方式,当存在多个网关设备返回原网关参数后,可以构建关于所有网关设备的原网关参数列表。网关设备存在特定的参数需要与其他所有网关均不相同,因此可以在原网关参数列表中判断特定类型的参数是否存在重复的现象,若存在可以进行调整。进一步的,由于MAC地址在每一个网关中都不能一样,因此在获得MAC地址后,可以对MAC地址执行权限修改操作,以便限制用户只能修改处了MAC地址之外的信息。As a feasible implementation manner, when multiple gateway devices return original gateway parameters, a list of original gateway parameters for all gateway devices can be constructed. The gateway device has specific parameters that need to be different from all other gateways. Therefore, it can be judged in the original gateway parameter list whether there are duplicates of specific types of parameters, and adjustments can be made if they exist. Further, since the MAC address cannot be the same in each gateway, after obtaining the MAC address, the permission modification operation can be performed on the MAC address, so as to restrict the user to only modify the information other than the MAC address.
具体的,网关设备可以按照JSON数据格式返回参数列表,此处为了方便描述,仅仅列举出几个参数,但是不限于这个几个参数,原网关参数的格式如下内容:Specifically, the gateway device can return the parameter list according to the JSON data format. For the convenience of description, only a few parameters are listed here, but not limited to these few parameters. The format of the original gateway parameters is as follows:
Figure PCTCN2020087146-appb-000001
Figure PCTCN2020087146-appb-000001
S103:当接收到修改指令时,根据所述修改指令修改所有所述原网关参数得到新网关参数;S103: When a modification instruction is received, modify all the original gateway parameters according to the modification instruction to obtain new gateway parameters;
其中,在获得了多个网关设备的原网关参数后,可以接收上层应用或用户发送的修改指令,修改指令可以包括每一网关设备对应的原网关参数中特 定类型参数的目标值,即将原网关参数中的初始值修改为目标值,最终得到新网关参数。Among them, after obtaining the original gateway parameters of multiple gateway devices, a modification instruction sent by an upper application or user can be received. The modification instruction may include the target value of a specific type of parameter in the original gateway parameter corresponding to each gateway device, that is, the original gateway The initial value in the parameters is modified to the target value, and the new gateway parameters are finally obtained.
作为一种可行的实施方式,在根据修改指令修改原网关参数的过程中,可以检测特定类型的参数,如静态IP地址,是否存在重复的现象,若存在可以基于特定的规则将相关参数配置为不同的参数,例如当网关设备A和B的静态IP地址均为192.168.0.0时,可以将其中一个网关设备的静态IP地址加1,即得到分别为192.168.0.0和192.168.0.1的静态IP地址。通过上述操作能够防止参数冲突带来的负面影响。As a feasible implementation, in the process of modifying the original gateway parameters according to the modification instruction, it is possible to detect whether specific types of parameters, such as static IP addresses, are duplicated, and if they exist, they can be configured based on specific rules as Different parameters, for example, when the static IP addresses of gateway devices A and B are both 192.168.0.0, you can add 1 to the static IP address of one of the gateway devices to get static IP addresses of 192.168.0.0 and 192.168.0.1 respectively . The above operations can prevent the negative impact caused by parameter conflicts.
S104:将每一所述新网关参数发送至对应的网关设备,以便所述网关设备根据所述新网关参数完成参数配置操作。S104: Send each of the new gateway parameters to the corresponding gateway device, so that the gateway device completes the parameter configuration operation according to the new gateway parameters.
其中,在得到新网关参数之后,本步骤将每一新网关参数发送至对应的网关设备,以便网关设备依据新网关参数进行相应的参数修改操作,完成对于多个网关设备的批量配置。Among them, after the new gateway parameters are obtained, this step sends each new gateway parameter to the corresponding gateway device, so that the gateway device can perform corresponding parameter modification operations according to the new gateway parameters to complete batch configuration of multiple gateway devices.
本实施例首先获取目标IP地址段内所有网关设备的MAC地址与IP地址的映射关系,基于该映射关系获取每一网关设备的原网关参数,对原网关管参数进行批量修改得到新网关参数。通过将新网关参数发送至对应的网关参数,每一网关设备可以根据新网关参数完成参数配置操作。在上述网关配置过程中可以实现对于批量网关参数的集中获取与修改,能够批量配置网关参数,提高网关配置效率。This embodiment first obtains the mapping relationship between the MAC addresses and IP addresses of all gateway devices in the target IP address segment, obtains the original gateway parameters of each gateway device based on the mapping relationship, and batches the original gateway management parameters to obtain new gateway parameters. By sending the new gateway parameters to the corresponding gateway parameters, each gateway device can complete the parameter configuration operation according to the new gateway parameters. In the foregoing gateway configuration process, centralized acquisition and modification of batch gateway parameters can be realized, gateway parameters can be configured in batches, and gateway configuration efficiency can be improved.
作为对于图1对应的实施例的进一步补充,101获取目标IP地址段内所有网关设备的网关信息的操作可以具体包括HTTP扫描方式和ARP扫描方式。作为实现HTTP扫描方式或ARP扫描方式的先决条件,当网关设备的部署环境在有多级路由器或者多个VLAN组成的多网段的大局域网时,网段之间可以相互访问可以支持HTTP方式扫描,但是ARP方式不支持跨网段扫描。每一网关内置的HTTP服务器能处理HTTP扫描请求,也就是当批量配置程序发送URL为http://{IP}:{Port}/checknetwork的HTTPGET请求后,网关将返回网关的当前MAC地址,IP地址,网关型号和固件版本号。每一网关内置的HTTP服务器能处理HTTP获取原始参数的请求,也就是当批量配置程序发送URL为http://{IP}:{Port}/checkparam的HTTPGET请求后,网 关内置的HTTP服务器将返回网关的原始参数。每一网关内置的HTTP服务器能处理HTTP配置参数的请求,也就是当批量配置程序发送URL为http://{IP}:{Port}/setparam?Parameter1=Value1&&Parameter2=Value2的HTTPGET请求后,网关内置的HTTP服务器将配置网关的参数并返回配置结果。As a further supplement to the embodiment corresponding to FIG. 1, the operation of 101 obtaining gateway information of all gateway devices in the target IP address segment may specifically include an HTTP scanning mode and an ARP scanning mode. As a prerequisite for implementing HTTP scanning or ARP scanning, when the deployment environment of the gateway device is in a large local area network with multi-level routers or multiple network segments composed of multiple VLANs, the network segments can access each other and can support HTTP scanning , But the ARP method does not support scanning across network segments. The built-in HTTP server of each gateway can handle HTTP scanning requests, that is, when the batch configuration program sends an HTTPGET request with URL http://{IP}:{Port}/checknetwork, the gateway will return the current MAC address and IP of the gateway Address, gateway model and firmware version number. The built-in HTTP server of each gateway can process HTTP requests to obtain the original parameters, that is, when the batch configuration program sends an HTTP GET request with URL http://{IP}:{Port}/checkparam, the built-in HTTP server of the gateway will return The original parameters of the gateway. The built-in HTTP server of each gateway can process HTTP configuration parameter requests, that is, when the batch configuration program sends the URL as http://{IP}:{Port}/setparam? After the HTTP GET request of Parameter1=Value1&&Parameter2=Value2, the HTTP server built in the gateway will configure the parameters of the gateway and return the configuration result.
HTTP扫描的具体过程可以为:首先向所述目标IP地址段内的每一IP地址发送对应的HTTP扫描请求,然后接收所有所述网关设备根据所述HTTP扫描请求返回的网关信息。The specific process of HTTP scanning may be: first sending a corresponding HTTP scanning request to each IP address in the target IP address segment, and then receiving gateway information returned by all the gateway devices according to the HTTP scanning request.
ARP扫描的具体过程可以为:首先向所述目标IP地址段内的每一IP地址发送对应的ARP扫描请求,其次接收所有主机根据所述ARP扫描请求返回的主机信息,然后根据所述网关设备的MAC地址特征对所述主机信息进行过滤得到所述网关信息。The specific process of ARP scanning can be as follows: firstly sending a corresponding ARP scanning request to each IP address in the target IP address range, and then receiving host information returned by all hosts according to the ARP scanning request, and then according to the gateway device The MAC address feature of, filters the host information to obtain the gateway information.
在上述两种扫描方式中,HTTP扫描方式能够向每一网关设备发送HTTP扫描请求,而ARP扫描方式无法只对网关设备发送ARP扫描请求,而是向目标IP地址段内所有主机发送ARP扫描请求。因此ARP扫描方式可以获得所有主机的信息,然后再执行过滤操作得到网关设备的网关信息。作为一种可行的实施方式,网关设备的MAC地址相对于一般主机的MAC地址具有特定的地址特征,例如网关设备的MAC地址的前N位为特定的数字。Among the above two scanning methods, the HTTP scanning method can send HTTP scanning requests to each gateway device, while the ARP scanning method cannot only send ARP scanning requests to gateway devices, but sends ARP scanning requests to all hosts in the target IP address range. . Therefore, the ARP scanning method can obtain the information of all hosts, and then perform the filtering operation to obtain the gateway information of the gateway device. As a feasible implementation manner, the MAC address of the gateway device has a specific address feature relative to the MAC address of a general host. For example, the first N bits of the MAC address of the gateway device are specific numbers.
请参见图2,图2为本实施例提供的网关信息获取方式的流程图;Please refer to FIG. 2, which is a flowchart of a gateway information acquisition method provided by this embodiment;
S201、输入需要扫描的IP地址段范围;S201. Input the range of the IP address segment to be scanned;
S202、选择ARP扫描方式或HTTP扫描方式;S202. Select ARP scanning mode or HTTP scanning mode;
若选择HTTP扫描方式进入S20211,若选择ARP扫描方式进入20221:If you select HTTP scan mode, enter S20211, if you select ARP scan mode, enter 20221:
S20211、输入HTTP请求的BasicAuth的密码;S20211. Enter the BasicAuth password of the HTTP request;
S20212、自定义HTTP请求扫描;S20212, custom HTTP request scanning;
其中,自定义HTTP请求扫描过程可以为:根据输入的IP地址段范围,为该IP地址段范围内的所有IP都分别生成一个扫描的HTTP请求。例如,其URL为http://{IP}:{Port}/checknetwork的HTTPGET请求。The custom HTTP request scanning process may be: according to the input IP address range, a scanned HTTP request is generated for all IPs in the IP address range. For example, the HTTP GET request whose URL is http://{IP}:{Port}/checknetwork.
S20213、网关内置的HTTP服务器验证密钥成功后返回网关的型号、固件版本号、MAC地址和IP地址。S20213, the gateway's built-in HTTP server verifies the key successfully and returns the gateway's model, firmware version number, MAC address and IP address.
其中,若IP地址的网关存在,其HTTP服务器收到HTTP扫描请求后,将返回网关的型号,固件版本号,MAC地址,IP地址,如果批量配置程序没有收到网关的回复,就说明该IP地址的网关不存在。Among them, if the gateway with the IP address exists, its HTTP server will return the model, firmware version number, MAC address, and IP address of the gateway after receiving the HTTP scan request. If the batch configuration program does not receive a reply from the gateway, it will indicate the IP The gateway of the address does not exist.
S20214、获得IP地址段内网关对应的MAC地址和IP地址的映射表,并结束流程。S20214. Obtain a MAC address and IP address mapping table corresponding to the gateway in the IP address segment, and end the process.
S20221、选择合适的网卡适配器;S20221, select the appropriate network card adapter;
S20222、根据输入的IP地址段范围,向各个IP地址发送ARP请求扫描;S20222. Send an ARP request scan to each IP address according to the input IP address range;
S20223、扫描出所有在局域网内的主机的MAC地址和IP地址的映射表;S20223: Scan out the mapping table of MAC addresses and IP addresses of all hosts in the LAN;
其中,该主机可以包括网关,也可能是电脑、手机等其他设备。Among them, the host may include a gateway, or may be other devices such as a computer or a mobile phone.
S20224、根据网关的MAC地址特征来过滤出要配置的目标网关;S20224: Filter out the target gateway to be configured according to the MAC address characteristics of the gateway;
S20225、得到IP地址段内网关对应的MAC地址和IP地址的映射表,并结束流程。S20225: Obtain the mapping table of the MAC address and the IP address corresponding to the gateway in the IP address segment, and end the process.
作为对于图1对应的实施例的进一步补充,网关信息还可以包括网关设备型号和网关固件版本。进一步的,当网关信息包括网关设备型号和网关固件版本时,S104中将每一所述新网关参数发送至对应的网关设备的操作可以包括以下步骤:As a further supplement to the embodiment corresponding to FIG. 1, the gateway information may also include the gateway device model and the gateway firmware version. Further, when the gateway information includes the gateway device model and the gateway firmware version, the operation of sending each of the new gateway parameters to the corresponding gateway device in S104 may include the following steps:
步骤1:根据所述网关设备型号和所述网关固件版本创建相应的目标HTTP请求格式;Step 1: Create a corresponding target HTTP request format according to the gateway device model and the gateway firmware version;
步骤2:为每一所述网关设备构建包含所述新网关参数的目标HTTP请求格式的参数修改请求;Step 2: Construct a parameter modification request in a target HTTP request format including the parameters of the new gateway for each of the gateway devices;
步骤3:将每一所述参数修改请求发送至对应的网关设备。Step 3: Send each parameter modification request to the corresponding gateway device.
网关设备往往会因为需要升级的原因(比如需要增加参数的设定),导致不同型号和不同固件版本的网关支持的HTTP请求格式不一样,比如用高版本固件的HTTP请求格式给低版本固件请求设置参数时,低版本的固件有可能无法识别高版本的HTTP请求格式。上述过程提供了HTTP请求格式的构建方法,在知道网关设备型号和所述网关固件版本后,创建适应网关当前固件版本的请求格式,实现网关固件版本之间的升级迭代。Gateway devices often need to upgrade due to reasons (such as the need to increase parameter settings), resulting in different models and different firmware versions of the gateway supports different HTTP request formats, such as using the HTTP request format of the higher version of the firmware to request the lower version of the firmware When setting the parameters, the lower version of the firmware may not recognize the higher version of the HTTP request format. The above process provides a method for constructing the HTTP request format. After the gateway device model and the gateway firmware version are known, a request format that adapts to the current firmware version of the gateway is created to realize the upgrade iteration between the gateway firmware versions.
作为对于图1对应的实施例的进一步补充,在获取所有所述网关设备的原网关参数之后,还包括以下操作:判断所有所述原网关参数中是否存在相同的目标类参数;若是,则将所述相同的目标类参数标记为待修改类参数。进一步的,还可以在将每一所述新网关参数发送至对应的网关设备之前,对所有所述待修改类参数执行修改操作得到新的目标类参数,以使所有所述新网关参数中的目标类参数或新的目标类参数均不相同。上述目标类参数包括静态IP地址、ssid参数、clientID参数和topic参数中的任一类参数或任几类参数的组合。As a further supplement to the embodiment corresponding to FIG. 1, after acquiring the original gateway parameters of all the gateway devices, the following operation is also included: judging whether the same target class parameter exists in all the original gateway parameters; if so, The same target class parameter is marked as a class parameter to be modified. Further, before sending each of the new gateway parameters to the corresponding gateway device, a modification operation may be performed on all the parameters to be modified to obtain a new target class parameter, so that all of the new gateway parameters Neither the target class parameter nor the new target class parameter are the same. The above-mentioned target class parameters include any type of parameters or a combination of any of several types of parameters among static IP address, ssid parameter, clientID parameter, and topic parameter.
在网关参数中大部分的参数在每个网关都是一样的,比如URL参数,URL参数表示的是服务器的地址,在所有的网关的参数值都是一样的,因为一般情况只有一个服务器地址。但是,与网关相关的参数是不能一样,在这里参数可以分为两大类,一类为因IP地址不同而不同的参数,另一类为因MAC地址不同而不同的参数,例如静态IP地址、ssid参数、clientID参数和topic参数。Most of the parameters in the gateway parameters are the same in each gateway, such as URL parameters. The URL parameter represents the address of the server. The parameter value in all gateways is the same, because there is only one server address in general. However, the parameters related to the gateway cannot be the same. Here, the parameters can be divided into two categories, one is the parameters that differ due to different IP addresses, and the other is the parameters that differ due to different MAC addresses, such as static IP addresses. , Ssid parameter, clientID parameter and topic parameter.
其中,静态IP地址,即static_IP参数,在设置网关的静态IP地址时,如果每一个网关的静态IP地址都是一样将会无法正常通讯。ssid参数,表示的是网关发射出来的wifi热点名称,如果一样就不能区分这个wifi热点是哪个网关的了。clientID参数,表示的是网关的客户端唯一标识符,用于MQTT通信协议中,clientID也是不能一样的,如果有相同clientID的网关连接入同一个服务器,会把另一个相同clientID网关从服务器踢下线。topic参数,表示的网关发布消息的主题,同样是用于MQTT通信协议中的,如果主题一样,服务器就无法区分消息是来自哪个网关的了。也就是说,上述提到的目标类参数为任意两个网关设备的参数中不能完全一致的参数。Among them, the static IP address is the static_IP parameter. When setting the static IP address of the gateway, if the static IP address of each gateway is the same, normal communication will not be possible. The ssid parameter indicates the name of the wifi hotspot transmitted by the gateway. If the same, it will not be able to distinguish which gateway the wifi hotspot belongs to. The clientID parameter represents the unique identifier of the gateway's client. It is used in the MQTT communication protocol. The clientID cannot be the same. If a gateway with the same clientID connects to the same server, another gateway with the same clientID will be kicked off the server. line. The topic parameter indicates the topic of the message published by the gateway, which is also used in the MQTT communication protocol. If the topic is the same, the server cannot distinguish which gateway the message comes from. In other words, the above-mentioned target class parameters are parameters that cannot be completely consistent among the parameters of any two gateway devices.
下面通过在实际应用中的实施例说明上述实施例描述的获取原网关参数和网关参数批量配置的流程。The following describes the process of obtaining the original gateway parameters and the batch configuration of the gateway parameters described in the foregoing embodiments through an embodiment in a practical application.
请参见图3,图3为本申请实施例提供的获取原网关参数的方法的流程图,获取原网关参数的方法可以包括以下步骤Please refer to FIG. 3. FIG. 3 is a flowchart of a method for obtaining original gateway parameters according to an embodiment of the application. The method for obtaining original gateway parameters may include the following steps
S301、输入HTTP请求的BasicAuth(基本认证)的密码;S301. Input the BasicAuth (basic authentication) password of the HTTP request;
S302、向网关设备发送获取原始参数的HTTP请求;S302: Send an HTTP request for obtaining original parameters to the gateway device;
其中,原始参数即上述提到的原网关参数。例如,HTTP请求可以为URL为http://{IP}:{Port}/checkparam的HTTP生成的请求;Among them, the original parameters are the original gateway parameters mentioned above. For example, the HTTP request can be a request generated by HTTP with the URL http://{IP}:{Port}/checkparam;
S303、网关内置的HTTP服务器在收到HTTP请求后,将返回网关的原始参数列表;S303. After receiving the HTTP request, the HTTP server built into the gateway will return the original parameter list of the gateway;
S304、判断参数是否在每个网关里面都不能相同;若是则进入S3041,若否,则进入S3042;S304. Judge whether the parameters cannot be the same in each gateway; if yes, go to S3041, if not, go to S3042;
S3041、直接将参数呈现给用户;S3041, directly present the parameters to the user;
S3042、判断该参数是根据MAC地址不一样还是根据静态IP地址不一样;S3042, judge whether the parameter is different based on the MAC address or the static IP address;
S30421、根据静态IP地址不一样时(原因是在同一个局域网内的IP地址是不能相同的,这样区分是为了防止IP地址冲突),直接使用花括号将该静态IP地址包含起来,这样做是为了提醒用户,比如{192.168.0.2}。S30421. When the static IP addresses are different (the reason is that the IP addresses in the same LAN cannot be the same, this distinction is to prevent IP address conflicts), directly use curly braces to enclose the static IP address. This is To remind users, such as {192.168.0.2}.
S30422、根据MAC地址不一样时,将MAC地址捕捉出来,以特殊字符呈现给用户,以提醒用户不要修改该特殊字符,大写MAC地址的参数字符用{MAC}显示,小写mac地址字符用{mac}显示给用户。MAC地址这类参数在每个网关都是不能一样,参数值是包含MAC地址的字符的,即MAC地址在世界都是独一无二的,所以使用MAC地址可以区分每个网关的参数,例如,网关发射出来的WiFi的名称是不能一样,命名格式为“GW-XXXXXXXXX”,其中XXXXXXXXX字符为网关的MAC地址。比如可将“GW-XXXXXXXXX”参数转成“GW-{MAC}”,以此限制用户只能修改“{MAC}”特殊字符之外的字符。S30422. When the MAC address is different, the MAC address is captured and presented to the user as a special character to remind the user not to modify the special character. The uppercase MAC address parameter character is displayed with {MAC}, and the lowercase mac address character is {mac } Show to users. Parameters such as MAC address cannot be the same in each gateway. The parameter value contains the characters of the MAC address, that is, the MAC address is unique in the world, so the use of the MAC address can distinguish the parameters of each gateway, for example, the gateway transmits The name of the WiFi that comes out cannot be the same, the naming format is "GW-XXXXXXXXX", where XXXXXXXXX characters are the MAC address of the gateway. For example, the "GW-XXXXXXXXX" parameter can be converted to "GW-{MAC}" to restrict the user to only modify characters other than the "{MAC}" special characters.
下面请参见图4,图4为本申请实施例提供的网关参数批量配置方法的流程图,该网关参数批量配置方法可以包括以下步骤:Please refer to FIG. 4 below. FIG. 4 is a flowchart of a method for batch configuration of gateway parameters according to an embodiment of the application. The method for batch configuration of gateway parameters may include the following steps:
S401、在原始参数的基础上修改目标参数;S401: Modify the target parameter on the basis of the original parameter;
其中,该原始参数即原网关参数。Among them, the original parameter is the original gateway parameter.
S402、选择要配置的网关设备;S402. Select the gateway device to be configured;
S403、输入HTTP请求的BasicAuth的密码;S403. Input the BasicAuth password of the HTTP request;
S404、为已选中的网关创建HTTP请求:S404. Create an HTTP request for the selected gateway:
S4041、根据获得的网关型号、固件版本创建不同的HTTP请求格式,以便实现网关固件版本之间的升级迭代。S4041. Create different HTTP request formats according to the obtained gateway model and firmware version, so as to implement upgrade iterations between gateway firmware versions.
S4042、依次判断每一类参数是否在每个网关里面都不能相同;如果该参数可以相同,就直接生成,不用处理;如果参数不可以相同,进入S40422;S4042, in turn, determine whether each type of parameter cannot be the same in each gateway; if the parameter can be the same, it is directly generated without processing; if the parameter cannot be the same, enter S40422;
其中,本步骤是对网关参数中每一类参数依次进行判断,依次判断每一类参数是否在每个网关里面都不能相同。Among them, this step is to judge each type of parameter in the gateway parameters in turn, and judge whether each type of parameter is different in each gateway.
S40422、判断该类参数为MAC地址还是静态IP地址;S40422. Judge whether this type of parameter is a MAC address or a static IP address;
S404221、若为静态IP地址,将被花括号包含的IP地址(即待修改类参数)提取出来,以该IP地址为基准累加1,保证不同的网关设置的静态IP地址是不一样的,否则会引起IP地址冲突。S404221. If it is a static IP address, extract the IP address contained in the curly brackets (that is, the parameter to be modified), and add 1 based on the IP address to ensure that the static IP addresses set by different gateways are different, otherwise Will cause IP address conflict.
S404222、若为MAC地址,将含有{mac}或者{MAC}特殊字符的参数捕捉出来,将这些特殊字符替换成对应网关实际的MAC地址,如:{MAC}特殊字符的参数替换成对应网关真实大写的MAC地址字符,{mac}特殊字符转换成对应网关真实小写的mac地址。S404222. If it is a MAC address, capture the parameters containing {mac} or {MAC} special characters, and replace these special characters with the actual MAC address of the corresponding gateway. For example, replace the parameter with the special characters of {MAC} with the real gateway. Uppercase MAC address characters, {mac} special characters are converted to the real lowercase mac address of the corresponding gateway.
S405、在创建好HTTP配置参数请求(例如,其URL为http://{IP}:{Port}/setparam?Parameter1=Value1&&Parameter2=Value2的HTTPGET请求)后,将创建好的HTTP请求放入线程池,限制最多同时请求的数量,防止网络拥挤;S405. After creating the HTTP configuration parameter request (for example, the HTTP GET request whose URL is http://{IP}:{Port}/setparam?Parameter1=Value1&&Parameter2=Value2), put the created HTTP request into the thread pool , Limit the maximum number of simultaneous requests to prevent network congestion;
S406、网关内置的HTTP服务器接收到请求后将返回参数配置的结果。S406: After receiving the request, the HTTP server built in the gateway returns the result of parameter configuration.
请参见图5,图5为本申请实施例所提供的一种网关配置系统的结构示意图;Please refer to FIG. 5, which is a schematic structural diagram of a gateway configuration system provided by an embodiment of the application;
该系统可以包括:The system can include:
扫描模块100,用于获取目标IP地址段内所有网关设备的网关信息;其中,所述网关信息包括所述网关设备的MAC地址与IP地址的映射关系;The scanning module 100 is configured to obtain gateway information of all gateway devices in the target IP address segment; wherein the gateway information includes the mapping relationship between the MAC address and the IP address of the gateway device;
参数获取模块200,用于根据所述映射关系向所有所述网关设备发送参数获取指令,以便获取所有所述网关设备的原网关参数;The parameter acquisition module 200 is configured to send a parameter acquisition instruction to all the gateway devices according to the mapping relationship, so as to acquire the original gateway parameters of all the gateway devices;
批量配置模块300,用于当接收到修改指令时,根据所述修改指令修改所有所述原网关参数得到新网关参数;还用于将每一所述新网关参数发送至对应的网关设备,以便所述网关设备根据所述新网关参数完成参数配置操作。The batch configuration module 300 is configured to modify all the original gateway parameters according to the modification instruction to obtain new gateway parameters when a modification instruction is received; it is also configured to send each of the new gateway parameters to the corresponding gateway device so that The gateway device completes the parameter configuration operation according to the new gateway parameter.
其中,本实施例前提将网关设备部署在同一个局域网下,运行网关配置系统的电脑、手机等终端设备也在同一个局域网下,批量配置程序通过ARP (Address Resolution Protocol地址解析协议)或者HTTP(Hypertext Transfer Protocol超文本传输协议)扫描出整个局域网下的网关的IP地址和MAC地址的映射关系,然后通过IP地址向某个网关发送HTTP请求以获取网关的原始参数,用户修改参数后,再将修改后的参数通过一定地规则向需要配置的网关分发配置的HTTP请求,网关的HTTP服务器将返回配置的结果,至此就完成了批量配置。Among them, this embodiment assumes that the gateway device is deployed under the same local area network, and the terminal devices such as computers and mobile phones running the gateway configuration system are also under the same local area network. The batch configuration program passes ARP (Address Resolution Protocol) or HTTP ( Hypertext Transfer Protocol) scans the mapping relationship between the IP address and MAC address of the gateway under the entire LAN, and then sends an HTTP request to a certain gateway through the IP address to obtain the original parameters of the gateway. After the user modifies the parameters, The modified parameters distribute the configured HTTP request to the gateway that needs to be configured through certain rules, and the HTTP server of the gateway will return the configuration result, and the batch configuration is completed.
本实施例首先获取目标IP地址段内所有网关设备的MAC地址与IP地址的映射关系,基于该映射关系获取每一网关设备的原网关参数,对原网关管参数进行批量修改得到新网关参数。通过将新网关参数发送至对应的网关参数,每一网关设备可以根据新网关参数完成参数配置操作。在上述网关配置过程中可以实现对于批量网关参数的集中获取与修改,能够批量配置网关参数,提高网关配置效率。This embodiment first obtains the mapping relationship between the MAC addresses and IP addresses of all gateway devices in the target IP address segment, obtains the original gateway parameters of each gateway device based on the mapping relationship, and batches the original gateway management parameters to obtain new gateway parameters. By sending the new gateway parameters to the corresponding gateway parameters, each gateway device can complete the parameter configuration operation according to the new gateway parameters. In the above-mentioned gateway configuration process, centralized acquisition and modification of batch gateway parameters can be realized, gateway parameters can be configured in batches, and gateway configuration efficiency can be improved.
进一步的,扫描模块100包括:Further, the scanning module 100 includes:
第一请求发送单元,用于向所述目标IP地址段内的每一IP地址发送对应的HTTP扫描请求;The first request sending unit is configured to send a corresponding HTTP scanning request to each IP address in the target IP address range;
第一信息接收单元,用于接收所有所述网关设备根据所述HTTP扫描请求返回的网关信息。The first information receiving unit is configured to receive all gateway information returned by the gateway device according to the HTTP scanning request.
进一步的,扫描模块100包括:Further, the scanning module 100 includes:
第二请求发送单元,用于向所述目标IP地址段内的每一IP地址发送对应的ARP扫描请求;The second request sending unit is configured to send a corresponding ARP scanning request to each IP address in the target IP address range;
第二信息接收单元,用于接收所有主机根据所述ARP扫描请求返回的主机信息;The second information receiving unit is configured to receive host information returned by all hosts according to the ARP scanning request;
过滤单元根据所述网关设备的MAC地址特征对所述主机信息进行过滤得到所述网关信息。The filtering unit filters the host information according to the MAC address feature of the gateway device to obtain the gateway information.
进一步的,所述网关信息还包括:网关设备型号和网关固件版本;Further, the gateway information further includes: gateway device model and gateway firmware version;
相应的,批量配置模块300包括:Correspondingly, the batch configuration module 300 includes:
格式创建单元,用于根据所述网关设备型号和所述网关固件版本创建相应的目标HTTP请求格式;A format creation unit, configured to create a corresponding target HTTP request format according to the gateway device model and the gateway firmware version;
请求构建单元,用于为每一所述网关设备构建包含所述新网关参数的目标HTTP请求格式的参数修改请求;A request construction unit, configured to construct a parameter modification request in the target HTTP request format including the new gateway parameters for each of the gateway devices;
请求发送单元,用于将每一所述参数修改请求发送至对应的网关设备。The request sending unit is configured to send each parameter modification request to the corresponding gateway device.
进一步的,还包括:Further, it also includes:
判断模块,用于判断所有所述原网关参数中是否存在相同的目标类参数;若是,则将所述相同的目标类参数标记为待修改类参数;The judgment module is used to judge whether the same target class parameter exists in all the original gateway parameters; if so, mark the same target class parameter as the parameter to be modified;
相应的,还包括:Correspondingly, it also includes:
参数修改模块,用于对所有所述待修改类参数执行修改操作得到新的目标类参数,以使所有所述新网关参数中的目标类参数或新的目标类参数均不相同。The parameter modification module is configured to perform a modification operation on all the parameters to be modified to obtain new target parameters, so that the target parameters or the new target parameters in all the new gateway parameters are different.
进一步的,所述目标类参数包括静态IP地址、ssid参数、clientID参数和topic参数中的任一类参数或任几类参数的组合。Further, the target class parameters include any type of parameters or a combination of any number of types of parameters among static IP address, ssid parameter, clientID parameter, and topic parameter.
进一步的,还包括:Further, it also includes:
权限设置模块,用于设置每一所述网关设备的MAC地址的修改权限,以便禁止用户修改所述MAC地址。The authority setting module is used to set the modification authority of the MAC address of each gateway device so as to prohibit the user from modifying the MAC address.
上述实施例可以批量区分网关相关的参数,不会把网关相关的参数配置成同一个参数,防止了参数冲突带来的负面影响。自定义格式的HTTP扫描方式,其HTTP扫描结果返回网关型号,版本号,可以实现版本之间的更新迭代。扫描结果直接是我们的目标网关,而不是其他不相关的主机,省去过滤的麻烦。若采用HTTP扫描方式,其HTTP扫描结果返回网关型号,版本号,可以实现版本之间的更新迭代。扫描结果直接是网关,而不是其他不相关的主机省去过滤的麻烦。The foregoing embodiment can distinguish gateway-related parameters in batches, and does not configure gateway-related parameters as the same parameter, thereby preventing negative effects caused by parameter conflicts. Custom format HTTP scanning method, the HTTP scanning result returns the gateway model and version number, which can realize the update iteration between versions. The scan result is directly our target gateway, not other unrelated hosts, saving the trouble of filtering. If the HTTP scanning method is adopted, the HTTP scanning result returns the gateway model and version number, which can realize the update iteration between versions. The scan result is directly the gateway, rather than other unrelated hosts, saving you the trouble of filtering.
由于系统部分的实施例与方法部分的实施例相互对应,因此系统部分的实施例请参见方法部分的实施例的描述,这里暂不赘述。Since the embodiment of the system part corresponds to the embodiment of the method part, for the embodiment of the system part, please refer to the description of the embodiment of the method part, which will not be repeated here.
本申请还提供了一种计算机可读存储介质,其上存有计算机程序,该计算机程序被执行时可以实现上述实施例所提供的步骤。该存储介质可以包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed, the steps provided in the foregoing embodiments can be implemented. The storage medium may include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.
本申请还提供了一种电子设备,可以包括存储器和处理器,所述存储器中存有计算机程序,所述处理器调用所述存储器中的计算机程序时,可以实现上述实施例所提供的步骤。当然所述电子设备还可以包括各种网络接口, 电源等组件。在该电子设备中上述实施例的处理过程可以以批量配置的形式存在,批量配置程序可以分三个步骤模块来完成,扫描模块将负责扫描出同一局域网内的网关,给用户界面模块返回网关的MAC地址和IP地址的映射表。用户界面模块通过获取原始参数模块来得到网关的原始参数。用户通过用户界面模块修改步骤二得到的原始参数后,用户界面模块将修改过后的参数通过批量配置模块给需要配置的网关发送配置参数的HTTP请求,至此将完成批量配置。The present application also provides an electronic device, which may include a memory and a processor, the memory stores a computer program, and when the processor calls the computer program in the memory, the steps provided in the above-mentioned embodiments can be implemented. Of course, the electronic device may also include various network interfaces, power supplies and other components. In the electronic device, the processing process of the above-mentioned embodiment can be in the form of batch configuration. The batch configuration procedure can be completed in three steps. The scanning module will be responsible for scanning out the gateways in the same local area network and returning the gateway to the user interface module. MAC address and IP address mapping table. The user interface module obtains the original parameters of the gateway by obtaining the original parameter module. After the user modifies the original parameters obtained in step 2 through the user interface module, the user interface module sends the modified parameters to the gateways that need to be configured through the batch configuration module to send HTTP requests for configuration parameters, and the batch configuration is completed.
说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的系统而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以对本申请进行若干改进和修饰,这些改进和修饰也落入本申请权利要求的保护范围内。The various embodiments in the specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant information can be referred to the description of the method part. It should be pointed out that for those of ordinary skill in the art, without departing from the principles of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the protection scope of the claims of this application.
还需要说明的是,在本说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的状况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should also be noted that in this specification, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities or operations. There is any such actual relationship or sequence between operations. Moreover, the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device that includes a series of elements includes not only those elements, but also includes Other elements of, or also include elements inherent to this process, method, article or equipment. Under the condition of no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other same elements in the process, method, article or equipment including the element.

Claims (10)

  1. 一种网关配置方法,其特征在于,包括:A gateway configuration method is characterized in that it includes:
    获取目标IP地址段内所有网关设备的网关信息;其中,所述网关信息包括所述网关设备的MAC地址与IP地址的映射关系;Acquiring gateway information of all gateway devices in the target IP address segment; wherein the gateway information includes the mapping relationship between the MAC address and the IP address of the gateway device;
    根据所述映射关系向所有所述网关设备发送参数获取指令,以便获取所有所述网关设备的原网关参数;Sending a parameter acquisition instruction to all the gateway devices according to the mapping relationship, so as to acquire the original gateway parameters of all the gateway devices;
    当接收到修改指令时,根据所述修改指令修改所有所述原网关参数得到新网关参数;When a modification instruction is received, modify all the original gateway parameters according to the modification instruction to obtain new gateway parameters;
    将每一所述新网关参数发送至对应的网关设备,以便所述网关设备根据所述新网关参数完成参数配置操作。Send each of the new gateway parameters to the corresponding gateway device, so that the gateway device completes the parameter configuration operation according to the new gateway parameters.
  2. 根据权利要求1所述网关配置方法,其特征在于,所述获取目标IP地址段内所有网关设备的网关信息包括:The gateway configuration method according to claim 1, wherein said acquiring gateway information of all gateway devices in the target IP address segment comprises:
    向所述目标IP地址段内的每一IP地址发送对应的HTTP扫描请求;Sending a corresponding HTTP scan request to each IP address in the target IP address segment;
    接收所有所述网关设备根据所述HTTP扫描请求返回的网关信息。Receiving all gateway information returned by the gateway device according to the HTTP scanning request.
  3. 根据权利要求1所述网关配置方法,其特征在于,所述获取目标IP地址段内所有网关设备的网关信息包括:The gateway configuration method according to claim 1, wherein said acquiring gateway information of all gateway devices in the target IP address segment comprises:
    向所述目标IP地址段内的每一IP地址发送对应的ARP扫描请求;Sending a corresponding ARP scanning request to each IP address in the target IP address range;
    接收所有主机根据所述ARP扫描请求返回的主机信息;Receiving host information returned by all hosts according to the ARP scanning request;
    根据所述网关设备的MAC地址特征对所述主机信息进行过滤得到所述网关信息。Filtering the host information according to the MAC address feature of the gateway device to obtain the gateway information.
  4. 根据权利要求1所述网关配置方法,其特征在于,所述网关信息还包括:网关设备型号和网关固件版本;The gateway configuration method according to claim 1, wherein the gateway information further comprises: gateway device model and gateway firmware version;
    相应的,将每一所述新网关参数发送至对应的网关设备包括:Correspondingly, sending each of the new gateway parameters to the corresponding gateway device includes:
    根据所述网关设备型号和所述网关固件版本创建相应的目标HTTP请求格式;Create a corresponding target HTTP request format according to the gateway device model and the gateway firmware version;
    为每一所述网关设备构建包含所述新网关参数的目标HTTP请求格式的参数修改请求;Constructing a parameter modification request in a target HTTP request format including the new gateway parameters for each of the gateway devices;
    将每一所述参数修改请求发送至对应的网关设备。Send each parameter modification request to the corresponding gateway device.
  5. 根据权利要求1至4任一项所述网关配置方法,其特征在于,在获取所有所述网关设备的原网关参数之后,还包括:The gateway configuration method according to any one of claims 1 to 4, characterized in that, after acquiring the original gateway parameters of all the gateway devices, it further comprises:
    判断所有所述原网关参数中是否存在相同的目标类参数;Judging whether the same target class parameter exists in all the original gateway parameters;
    若是,则将所述相同的目标类参数标记为待修改类参数;If yes, mark the same target class parameter as the class parameter to be modified;
    相应的,在将每一所述新网关参数发送至对应的网关设备之前,还包括:Correspondingly, before sending each of the new gateway parameters to the corresponding gateway device, it further includes:
    对所有所述待修改类参数执行修改操作得到新的目标类参数,以使所有所述新网关参数中的目标类参数或新的目标类参数均不相同。Perform a modification operation on all the parameters of the class to be modified to obtain new target class parameters, so that the target class parameters or the new target class parameters in all the new gateway parameters are different.
  6. 根据权利要求5所述网关配置方法,其特征在于,所述目标类参数包括静态IP地址、ssid参数、clientID参数和topic参数中的任一类参数或任几类参数的组合。The gateway configuration method according to claim 5, wherein the target type parameters include any type of parameters or a combination of any of several types of parameters among static IP address, ssid parameter, clientID parameter and topic parameter.
  7. 根据权利要求1所述网关配置方法,其特征在于,在获取所有所述网关设备的原网关参数之后,还包括:The gateway configuration method according to claim 1, wherein after obtaining all the original gateway parameters of the gateway device, the method further comprises:
    设置每一所述网关设备的MAC地址的修改权限,以便禁止用户修改所述MAC地址。Set the modification authority of the MAC address of each gateway device so as to prohibit the user from modifying the MAC address.
  8. 一种网关配置系统,其特征在于,包括:A gateway configuration system is characterized in that it comprises:
    扫描模块,用于获取目标IP地址段内所有网关设备的网关信息;其中,所述网关信息包括所述网关设备的MAC地址与IP地址的映射关系;A scanning module, configured to obtain gateway information of all gateway devices in the target IP address segment; wherein the gateway information includes the mapping relationship between the MAC address and the IP address of the gateway device;
    参数获取模块,用于根据所述映射关系向所有所述网关设备发送参数获取指令,以便获取所有所述网关设备的原网关参数;The parameter acquisition module is configured to send a parameter acquisition instruction to all the gateway devices according to the mapping relationship, so as to acquire the original gateway parameters of all the gateway devices;
    批量配置模块,用于当接收到修改指令时,根据所述修改指令修改所有所述原网关参数得到新网关参数;还用于将每一所述新网关参数发送至对应的网关设备,以便所述网关设备根据所述新网关参数完成参数配置操作。The batch configuration module is used to modify all the original gateway parameters according to the modification instruction to obtain new gateway parameters when a modification instruction is received; it is also used to send each of the new gateway parameters to the corresponding gateway device for all The gateway device completes the parameter configuration operation according to the new gateway parameter.
  9. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述网关配置方法的步骤。A computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the gateway configuration method according to any one of claims 1 to 7 is implemented step.
  10. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises:
    存储器,用于存储计算机程序;Memory, used to store computer programs;
    处理器,用于执行所述计算机程序时实现如权利要求1至7任一项所述网关配置方法的步骤。The processor is configured to implement the steps of the gateway configuration method according to any one of claims 1 to 7 when executing the computer program.
PCT/CN2020/087146 2019-05-24 2020-04-27 Gateway configuration method, system, computer storage medium and electronic device WO2020238523A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910440399.8 2019-05-24
CN201910440399.8A CN110113218A (en) 2019-05-24 2019-05-24 A kind of gateway configuration method, system, computer storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
WO2020238523A1 true WO2020238523A1 (en) 2020-12-03

Family

ID=67492189

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/087146 WO2020238523A1 (en) 2019-05-24 2020-04-27 Gateway configuration method, system, computer storage medium and electronic device

Country Status (2)

Country Link
CN (1) CN110113218A (en)
WO (1) WO2020238523A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110113218A (en) * 2019-05-24 2019-08-09 深圳云里物里科技股份有限公司 A kind of gateway configuration method, system, computer storage medium and electronic equipment
CN111736877A (en) * 2020-03-31 2020-10-02 紫光云技术有限公司 Method for upgrading Agent of cloud database
CN114422481B (en) * 2021-12-13 2024-03-15 科华数据股份有限公司 Network equipment management method and related device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101621406A (en) * 2009-07-28 2010-01-06 中兴通讯股份有限公司 Method for configuring domestic gateways in batch, configuring equipment and domestic gateways
CN106301959A (en) * 2016-10-10 2017-01-04 烽火通信科技股份有限公司 Gateway batch upgrading method based on WINDOWS and LINUX platform and system
CN106375129A (en) * 2016-09-21 2017-02-01 深圳市欧瑞博电子有限公司 Method and device for upgrading home gateway
CN107979497A (en) * 2017-12-26 2018-05-01 北京搜狐新媒体信息技术有限公司 A kind of method of automatic configuration and device
CN109218103A (en) * 2018-09-26 2019-01-15 京信通信系统(中国)有限公司 Gateway upgrade method, gateway and Network Management Equipment
CN110113218A (en) * 2019-05-24 2019-08-09 深圳云里物里科技股份有限公司 A kind of gateway configuration method, system, computer storage medium and electronic equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101521658A (en) * 2008-02-29 2009-09-02 上海博达数据通信有限公司 Realizing method for Ethernet ARP scanning which is applied in broadband router
CN102082685A (en) * 2009-11-30 2011-06-01 三星电子(中国)研发中心 Network configured method and system of embedded device
CN102710439B (en) * 2012-05-29 2014-07-16 南京邮电大学 Obtaining method of user terminal parameter information
CN104506567B (en) * 2014-11-19 2017-09-29 北京天地互连信息技术有限公司 Data exchange method for gateway and server of Internet of things
US11689414B2 (en) * 2017-11-10 2023-06-27 International Business Machines Corporation Accessing gateway management console

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101621406A (en) * 2009-07-28 2010-01-06 中兴通讯股份有限公司 Method for configuring domestic gateways in batch, configuring equipment and domestic gateways
CN106375129A (en) * 2016-09-21 2017-02-01 深圳市欧瑞博电子有限公司 Method and device for upgrading home gateway
CN106301959A (en) * 2016-10-10 2017-01-04 烽火通信科技股份有限公司 Gateway batch upgrading method based on WINDOWS and LINUX platform and system
CN107979497A (en) * 2017-12-26 2018-05-01 北京搜狐新媒体信息技术有限公司 A kind of method of automatic configuration and device
CN109218103A (en) * 2018-09-26 2019-01-15 京信通信系统(中国)有限公司 Gateway upgrade method, gateway and Network Management Equipment
CN110113218A (en) * 2019-05-24 2019-08-09 深圳云里物里科技股份有限公司 A kind of gateway configuration method, system, computer storage medium and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ANONYMOUS: "Open Mobile Alliance OMA-TS-GwMO-Vl_0-20110729-D (Management Objects and Generic Alerts that are needed to provide the DM Gateway functionality, as defined in [DMDICT])", 29 July 2011 (2011-07-29), pages 1 - 51, XP009524867, Retrieved from the Internet <URL:http://member.openmobilealliance.org/ftp/public_documents/DM/DM-GWMO/Permanent_documents> *

Also Published As

Publication number Publication date
CN110113218A (en) 2019-08-09

Similar Documents

Publication Publication Date Title
WO2020238523A1 (en) Gateway configuration method, system, computer storage medium and electronic device
US10869196B2 (en) Internet access authentication method and client, and computer storage medium
US9363285B2 (en) Communication system, network for qualification screening/setting, communication device, and network connection method
US7827252B2 (en) Network device management
CN104753697B (en) A kind of method, equipment and system controlling the automatic beginning of the network equipment
US9189636B2 (en) Office machine security policy
US10162577B2 (en) Image processing apparatus and method and non-transitory computer readable medium
US9973399B2 (en) IPV6 address tracing method, apparatus, and system
US10892965B2 (en) Data network management
JP2009110261A (en) Network management apparatus, network management method, and program for carrying out network management method
CN103812900A (en) Data synchronization method, device and system
WO2020088170A1 (en) Domain name system configuration method and related apparatus
EP2814217B1 (en) Access control method for wifi device and wifi device thereof
CN113098722A (en) Multi-network card management method, device and computer readable storage medium
JP7052481B2 (en) Network system, setting information operation method and program
US20200252796A1 (en) Access point ap authentication method, system, and related device
JP2009193326A (en) Authentication system, authentication method and server
CN110278558B (en) Message interaction method and WLAN system
JP2010147837A (en) Ip phone device, ip phone system, and setting confirmation method
CN110505075B (en) Device management method and related device
CN113132218A (en) Home gateway access method, device, system processor and storage medium
CN110753135A (en) IP address configuration method, configuration equipment and storage medium
US9467932B2 (en) Access control method for WiFi device and WiFi device
JP2007053485A (en) System for controlling network equipment
US11750762B2 (en) Information processing apparatus, information processing system, and non-transitory computer readable medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20813630

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20813630

Country of ref document: EP

Kind code of ref document: A1