[go: up one dir, main page]

CN105282263A - Address configuration method and device and equipment - Google Patents

Address configuration method and device and equipment Download PDF

Info

Publication number
CN105282263A
CN105282263A CN201410293544.1A CN201410293544A CN105282263A CN 105282263 A CN105282263 A CN 105282263A CN 201410293544 A CN201410293544 A CN 201410293544A CN 105282263 A CN105282263 A CN 105282263A
Authority
CN
China
Prior art keywords
address
location information
conversion
conversion factor
mac address
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
CN201410293544.1A
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.)
SANYA ZHONGXING SOFTWARE Co Ltd
Original Assignee
SANYA ZHONGXING SOFTWARE 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 SANYA ZHONGXING SOFTWARE Co Ltd filed Critical SANYA ZHONGXING SOFTWARE Co Ltd
Priority to CN201410293544.1A priority Critical patent/CN105282263A/en
Priority to PCT/CN2014/091933 priority patent/WO2015196719A1/en
Publication of CN105282263A publication Critical patent/CN105282263A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明提供一种地址配置方法、装置和设备,其中方法包括:获取设备在网络中的位置信息,所述位置信息能唯一确定所述设备;将所述位置信息转换为位置信息参数;将所述位置信息参数换算成设备的IP地址和MAC地址;将所述IP和MAC地址自动分配给所述设备。本发明的方案可以解决设备IP和MAC地址不确定的问题和依赖外部服务器的风险,同时设备使用者无需访问其他设备,就可确定其他设备的IP和MAC地址,大大方便了设备间消息交互。

The present invention provides an address configuration method, device and equipment, wherein the method includes: acquiring location information of a device in a network, the location information can uniquely determine the device; converting the location information into location information parameters; The location information parameters are converted into the IP address and MAC address of the device; the IP and MAC addresses are automatically assigned to the device. The solution of the present invention can solve the problem of uncertain IP and MAC addresses of devices and the risk of relying on external servers. At the same time, device users can determine the IP and MAC addresses of other devices without accessing other devices, which greatly facilitates message interaction between devices.

Description

一种地址配置方法、装置和设备An address configuration method, device and equipment

技术领域technical field

本发明涉及数据通信领域,特别是指一种地址配置方法、装置和设备。The invention relates to the field of data communication, in particular to an address configuration method, device and equipment.

背景技术Background technique

在一个数据通信的网络系统中,系统中的各个设备之间需要进行数据收发,这种数据收发是在一个基于IP和MAC地址的网络中进行,所以就需要采用一种方式,来确定和设置系统中各个设备的IP地址和MAC地址。在通常的解决方案中,网络系统内部的IP地址分配,采用DHCP(动态主机配置协议)方式。In a data communication network system, data transmission and reception are required between various devices in the system. This data transmission and reception is carried out in a network based on IP and MAC addresses, so it is necessary to use a method to determine and set The IP address and MAC address of each device in the system. In a common solution, the IP address allocation within the network system adopts the DHCP (Dynamic Host Configuration Protocol) method.

DHCP为网络内的主机提供地址和配置参数,是基于客户端和服务器的模式,其DHCP工作原理和请求IP的过程如下:DHCP provides addresses and configuration parameters for hosts in the network. It is based on the mode of client and server. The working principle of DHCP and the process of requesting IP are as follows:

1.主机发送DHCP发现广播包,在网络上寻找DHCP服务器;1. The host sends a DHCP discovery broadcast packet to search for a DHCP server on the network;

2.DHCP服务器收到后,发送给主机一个单播包,包含IP地址、MAC地址、域名信息以及地址租期;2. After the DHCP server receives it, it sends a unicast packet to the host, including IP address, MAC address, domain name information and address lease period;

3.主机发送DHCP请求,正式向服务器请求分配已提供的IP地址;3. The host sends a DHCP request to formally request the server to assign the provided IP address;

4.DHCP服务器向主机发送DHCP确认,确认主机请求。4. The DHCP server sends a DHCP confirmation to the host to confirm the host's request.

DHCP服务器配置主机地址的优点在于降低了配置和部署设备时间,降低了发生配置错误的可能性,可集中化管理主机IP;然而正是这种使用方式,其也存在如下几点缺陷:The advantage of configuring the host address by the DHCP server is that it reduces the configuration and deployment time of the device, reduces the possibility of configuration errors, and can centrally manage the host IP; however, it is precisely this way of use, which also has the following disadvantages:

IP地址随机性:用户的IP地址是随机分配的,具有不确定性,用户访问主机难度较大;若主机的IP地址经常发生改变的话,也很难根据网络IP地址来执行网络管理策略;Randomness of IP address: The user's IP address is randomly assigned, which is uncertain, and it is difficult for the user to access the host; if the IP address of the host changes frequently, it is also difficult to implement network management strategies based on the network IP address;

访问权限变化:如果用户的访问权限是基于IP地址划分的,则访问权限随IP地址不同而变化。Changes in access rights: If the user's access rights are divided based on IP addresses, the access rights will vary with different IP addresses.

若网络中存在多个DHCP服务器,可能会产生IP地址的冲突If there are multiple DHCP servers in the network, IP address conflicts may occur

若网络中有非DHCP的主机,则DHCP服务器不能够发现;If there are non-DHCP hosts in the network, the DHCP server cannot find them;

由于IP地址分配依赖于外部的DHCP服务器的正常运行,一旦DHCP服务器运行异常,则会直接影响网络中设备的IP地址分配,进而影响到用户的业务。Since the IP address assignment depends on the normal operation of the external DHCP server, once the DHCP server is running abnormally, it will directly affect the IP address assignment of devices in the network, thereby affecting the services of users.

发明内容Contents of the invention

本发明要解决的技术问题是提供一种地址配置方法、装置和设备。通过根据设备的位置信息得到该设备的IP地址和MAC地址,不依赖于外部的DHCP服务器获取设备的IP地址和MAC地址,不存在随即性。也避免了可能导致的IP地址冲突和获取不到地址的问题。The technical problem to be solved by the present invention is to provide an address configuration method, device and equipment. By obtaining the IP address and MAC address of the device according to the location information of the device, it does not rely on an external DHCP server to obtain the IP address and MAC address of the device, and there is no randomness. It also avoids the possible IP address conflict and the problem of not being able to obtain the address.

为解决上述技术问题,本发明的实施例提供一种地址配置方法,包括:In order to solve the above technical problems, an embodiment of the present invention provides an address configuration method, including:

获取设备在网络中的位置信息,所述位置信息能唯一确定所述设备;Obtain the location information of the device in the network, the location information can uniquely identify the device;

将所述位置信息转换为位置信息参数;converting the location information into location information parameters;

将所述位置信息参数换算成设备的IP地址和MAC地址;Converting the location information parameter into an IP address and a MAC address of the device;

将所述IP和MAC地址自动分配给所述设备。The IP and MAC addresses are automatically assigned to the device.

其中,所述位置信息包括:Wherein, the location information includes:

设备所在网络中能确定其物理位置的一组位置数据,所述一组位置数据能唯一确定所述设备。A set of location data that can determine the physical location of the device in the network where the device is located, and the set of location data can uniquely identify the device.

其中,将所述位置信息转换为位置信息参数的步骤包括:Wherein, the step of converting the location information into location information parameters includes:

将所述一组位置数据,分别映射为一个位置信息参数,得到一组位置信息参数。The set of position data is mapped to a position information parameter respectively to obtain a set of position information parameters.

其中,将所述位置信息参数换算成设备的IP地址和MAC地址的步骤包括:Wherein, the step of converting the location information parameter into the IP address and the MAC address of the device includes:

将所述位置信息参数作为IP地址字段的换算因子,根据所述换算因子和每一个换算因子对应的IP地址换算算法,换算成设备的IP地址;以及Using the location information parameter as a conversion factor of the IP address field, and converting it into an IP address of the device according to the conversion factor and an IP address conversion algorithm corresponding to each conversion factor; and

将所述位置信息参数作为MAC地址字段的换算因子,根据所述换算因子和每一个换算因子对应的MAC地址换算算法,换算成设备的MAC地址。The location information parameter is used as the conversion factor of the MAC address field, and converted into the MAC address of the device according to the conversion factor and the MAC address conversion algorithm corresponding to each conversion factor.

其中,所述将所述位置信息参数作为IP地址字段的换算因子,根据所述换算因子和每一个换算因子对应的IP地址换算算法,换算成设备的IP地址的步骤包括:Wherein, the step of using the location information parameter as the conversion factor of the IP address field, and converting it into the IP address of the device according to the conversion factor and the IP address conversion algorithm corresponding to each conversion factor includes:

将所述位置信息参数划分为4个换算因子,每一个换算因子对应IP地址的一个字段,且每一个换算因子对应的一个IP地址换算算法;Dividing the location information parameter into 4 conversion factors, each conversion factor corresponds to a field of the IP address, and an IP address conversion algorithm corresponding to each conversion factor;

将每一个换算因子按照该换算因子对应的IP地址换算算法,转换为IP地址的一个字段;Convert each conversion factor into a field of the IP address according to the IP address conversion algorithm corresponding to the conversion factor;

将4个字段组合起来,得到设备的IP地址。Combine the 4 fields to get the IP address of the device.

其中,将4个字段组合起来,得到设备的IP地址后还包括:Among them, the four fields are combined to obtain the IP address of the device, including:

根据所述位置信息中的网络号来获得该IP地址的子网掩码。Obtain the subnet mask of the IP address according to the network number in the location information.

其中,将所述位置信息参数作为MAC地址字段的换算因子,根据所述换算因子和每一个换算因子对应的MAC地址换算算法,换算成设备的MAC地址的步骤包括:Wherein, using the position information parameter as a conversion factor of the MAC address field, according to the conversion factor and the MAC address conversion algorithm corresponding to each conversion factor, the step of converting to the MAC address of the device includes:

将所述位置信息参数划分为6个换算因子,每一个换算因子对应MAC地址的一个字段,且每一个换算因子对应的一个MAC地址换算算法;Divide the location information parameter into 6 conversion factors, each conversion factor corresponds to a field of the MAC address, and each conversion factor corresponds to a MAC address conversion algorithm;

将每一个换算因子按照该换算因子对应的MAC地址换算算法,转换为MAC地址的一个字段;Convert each conversion factor into a field of the MAC address according to the MAC address conversion algorithm corresponding to the conversion factor;

将6个字段组合起来,得到设备的MAC地址。Combine the 6 fields to get the MAC address of the device.

其中,将6个字段组合起来,得到设备的MAC地址的步骤包括:Among them, the steps of combining the 6 fields to obtain the MAC address of the device include:

将表示此设备的类型值作为MAC地址的前2个字段;Use the type value representing this device as the first 2 fields of the MAC address;

将后面四个字段每个字段数值设置为和IP地址的四个字段值一致,得到设备的MAC地址。Set the values of each of the following four fields to be consistent with the values of the four fields of the IP address to obtain the MAC address of the device.

本发明的实施例还提供一种地址配置装置,包括:Embodiments of the present invention also provide an address configuration device, including:

获取模块,用于获取设备在网络中的位置信息,所述位置信息能唯一确定所述设备;An acquisition module, configured to acquire location information of the device in the network, where the location information can uniquely identify the device;

转换模块,用于将所述位置信息转换为位置信息参数;A conversion module, configured to convert the location information into location information parameters;

处理模块,用于将所述位置信息参数换算成设备的IP地址和MAC地址;A processing module, configured to convert the location information parameter into an IP address and a MAC address of the device;

配置模块,用于将所述IP和MAC地址自动分配给所述设备。a configuration module, configured to automatically assign the IP and MAC addresses to the device.

其中,所述处理模块包括:Wherein, the processing module includes:

第一处理子模块,用于将所述位置信息参数作为IP地址字段的换算因子,根据所述换算因子和每一个换算因子对应的IP地址换算算法,换算成设备的IP地址;以及The first processing submodule is used to convert the position information parameter into the IP address of the device according to the conversion factor and the IP address conversion algorithm corresponding to each conversion factor as the conversion factor of the IP address field; and

第二处理子模块,用于将所述位置信息参数作为MAC地址字段的换算因子,根据所述换算因子和每一个换算因子对应的MAC地址换算算法,换算成设备的MAC地址。The second processing sub-module is configured to use the position information parameter as a conversion factor of the MAC address field, and convert it into the MAC address of the device according to the conversion factor and the MAC address conversion algorithm corresponding to each conversion factor.

其中,所述第一处理子模块包括:Wherein, the first processing submodule includes:

第一划分子模块,用于将所述位置信息参数划分为4个换算因子,每一个换算因子对应IP地址的一个字段,且每一个换算因子对应的一个IP地址换算算法;The first dividing sub-module is used to divide the position information parameter into 4 conversion factors, each conversion factor corresponds to a field of the IP address, and each conversion factor corresponds to an IP address conversion algorithm;

第一转换子模块,用于将每一个换算因子按照该换算因子对应的IP地址换算算法,转换为IP地址的一个字段;The first conversion submodule is used to convert each conversion factor into a field of the IP address according to the IP address conversion algorithm corresponding to the conversion factor;

第一组合子模块,用于将4个字段组合起来,得到设备的IP地址。The first combination sub-module is used to combine the four fields to obtain the IP address of the device.

其中,上述装置还包括:获得子模块,用于根据所述位置信息中的网络号来获得该IP地址的子网掩码。Wherein, the above-mentioned device further includes: an obtaining submodule, configured to obtain the subnet mask of the IP address according to the network number in the location information.

其中,所述第二处理子模块包括:Wherein, the second processing submodule includes:

第二划分子模块,用于将所述位置信息参数划分为6个换算因子,每一个换算因子对应MAC地址的一个字段,且每一个换算因子对应的一个MAC地址换算算法;The second dividing sub-module is used to divide the position information parameter into 6 conversion factors, each conversion factor corresponds to a field of the MAC address, and each conversion factor corresponds to a MAC address conversion algorithm;

第二转换子模块,用于将每一个换算因子按照该换算因子对应的MAC地址换算算法,转换为MAC地址的一个字段;The second conversion submodule is used to convert each conversion factor into a field of the MAC address according to the MAC address conversion algorithm corresponding to the conversion factor;

第二组合子模块,用于将6个字段组合起来,得到设备的MAC地址。The second combination sub-module is used to combine the 6 fields to obtain the MAC address of the device.

其中,所述第二组合子模块用于:将表示此设备的类型值作为MAC地址的前2个字段;将后面四个字段每个字段数值设置为和IP地址的四个字段值一致,得到设备的MAC地址。Wherein, the second combination submodule is used to: use the type value representing the device as the first 2 fields of the MAC address; set each field value of the following four fields to be consistent with the four field values of the IP address, and obtain MAC address of the device.

本发明的实施例还提供一种设备,包括处理器,所述处理器包括如上所述的地址配置装置。An embodiment of the present invention also provides a device, including a processor, where the processor includes the above-mentioned address configuration device.

其中,所述设备还包括接口,所述处理器将所述地址配置装置的所述处理模块得到的所述IP和MAC地址通过所述接口发送给网络中的交换机,并通过所述交换机与其它网络中的设备交换所述设备的IP地址和MAC地址。Wherein, the device further includes an interface, and the processor sends the IP and MAC addresses obtained by the processing module of the address configuration device to a switch in the network through the interface, and communicates with other Devices in the network exchange IP addresses and MAC addresses of the devices.

本发明的上述技术方案的有益效果如下:The beneficial effects of above-mentioned technical scheme of the present invention are as follows:

上述方案中,通过获取设备在网络中的位置信息,所述位置信息能唯一确定所述设备;将所述位置信息转换为位置信息参数;将所述位置信息参数换算成设备的IP地址和MAC地址;将所述IP和MAC地址自动分配给所述设备。本发明实施例采用的方法,不依赖于外部的DHCP服务器,获取到的IP和MAC地址确定,不存在随即性。也避免了可能导致的IP地址冲突和获取不到地址的问题。In the above scheme, by obtaining the location information of the device in the network, the location information can uniquely determine the device; convert the location information into location information parameters; convert the location information parameters into the IP address and MAC address of the device address; automatically assigning the IP and MAC address to the device. The method adopted in the embodiment of the present invention does not depend on an external DHCP server, and the acquired IP and MAC addresses are determined without randomness. It also avoids the possible IP address conflict and the problem of not being able to obtain the address.

附图说明Description of drawings

图1是根据本发明实施例给出的一种IP和MAC地址生成方法的流程示意图;Fig. 1 is a schematic flow diagram of a method for generating an IP and MAC address according to an embodiment of the present invention;

图2是根据本发明实施例给出的一种地址配置装置的结构示意图。Fig. 2 is a schematic structural diagram of an address configuration device according to an embodiment of the present invention.

图3是根据本发明实施例的单个局域网内多个设备配置IP和MAC地址的示意图;Fig. 3 is a schematic diagram of multiple devices configuring IP and MAC addresses in a single local area network according to an embodiment of the present invention;

图4是根据本发明实施例的多个局域网中多个设备配置IP和MAC地址示意图。Fig. 4 is a schematic diagram of configuring IP and MAC addresses for multiple devices in multiple local area networks according to an embodiment of the present invention.

具体实施方式detailed description

为使本发明要解决的技术问题、技术方案和优点更加清楚,下面将结合附图及具体实施例进行详细描述。In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, the following will describe in detail with reference to the drawings and specific embodiments.

如图1所示,本发明的实施例提供一种地址配置方法,包括:As shown in Figure 1, an embodiment of the present invention provides an address configuration method, including:

步骤11,获取设备在网络中的位置信息,所述位置信息能唯一确定所述设备;Step 11, obtaining the location information of the device in the network, the location information can uniquely identify the device;

步骤12,将所述位置信息转换为位置信息参数;Step 12, converting the location information into location information parameters;

步骤13,将所述位置信息参数换算成设备的IP地址和MAC地址;Step 13, converting the location information parameter into an IP address and a MAC address of the device;

步骤14,将所述IP和MAC地址自动分配给所述设备。Step 14, automatically assigning the IP and MAC address to the device.

本发明的该实施例通过获取设备在网络中的位置信息,所述位置信息能唯一确定所述设备;将所述位置信息转换为位置信息参数;将所述位置信息参数换算成设备的IP地址和MAC地址;将所述IP和MAC地址自动分配给所述设备。本发明实施例采用的方法,不依赖于外部的DHCP服务器,获取到的IP和MAC地址确定,不存在随即性。也避免了可能导致的IP地址冲突和获取不到地址的问题。This embodiment of the present invention obtains the location information of the device in the network, and the location information can uniquely determine the device; converts the location information into a location information parameter; converts the location information parameter into the IP address of the device and MAC address; automatically assigning said IP and MAC address to said device. The method adopted in the embodiment of the present invention does not depend on an external DHCP server, and the acquired IP and MAC addresses are determined without randomness. It also avoids the possible IP address conflict and the problem of not being able to obtain the address.

其中,本发明的一具体实施例中,包括上述步骤11-14的基础上,其中,所述位置信息具体可以通过配置文件、位置定位等多种方式获取;所述位置信息可以包括:设备所在网络中能确定其物理位置的一组位置数据,所述一组位置数据能唯一确定所述设备。当然,该位置信息并不局限于设备在网络中的物理位置信息,所有在网络中可表示设备位置的信息,都可作为该设备的位置信息。例如:对于分布式设备机框,可以分为局号、机架号、机框号、槽位号、CPU号;对于一个区域,例如可以分为省、市、区、路(街)、号;对于一个家庭,如存在多套住宅,可分为户、房间、房间内设备等。Wherein, in a specific embodiment of the present invention, on the basis of the above-mentioned steps 11-14, wherein, the location information can be obtained through various methods such as configuration files and location positioning; the location information can include: A set of location data within a network that identifies its physical location, the set of location data uniquely identifying the device. Of course, the location information is not limited to the physical location information of the device in the network, and all information that can represent the location of the device in the network can be used as the location information of the device. For example: for a distributed equipment frame, it can be divided into office number, rack number, frame number, slot number, and CPU number; for an area, it can be divided into province, city, district, road (street), number ; For a family, if there are multiple houses, they can be divided into households, rooms, and equipment in the rooms.

其中,本发明的另一具体实施例中,包括上述步骤11-14的基础上,上述步骤12具体可以包括:将所述一组位置数据,分别映射为一个位置信息参数,得到一组位置信息参数。具体的,为位置信息的每个字段给出一个编号值,例如,对于分布式设备机框,本身就有局号、机架号、机框号、槽位号、CPU号值,可以直接映射作为位置信息参数;而对于一个区域,例如A省B市C区D路(街)X号,就需要对每个省、市、区、路(街)、X号进行编号,映射出一组位置信息参数值;对于一个家庭,可映射为户号、房间号、设备号等数值。对于位置信息参数,其参数范围是连续的线性参数。对于位置信息参数,需要有一个固定参数来来表示此IP地址所在的局域网的编号,即网络号。此网络号可与位置信息参数复用来作为输入参数,网络号的作用主要是区分和隔离各个网络。Wherein, in another specific embodiment of the present invention, on the basis of the above-mentioned steps 11-14, the above-mentioned step 12 may specifically include: respectively mapping the set of location data into a location information parameter to obtain a set of location information parameter. Specifically, a number value is given for each field of the location information. For example, for a distributed equipment chassis, it has office number, rack number, chassis number, slot number, and CPU number values, which can be directly mapped As a location information parameter; and for an area, such as No. X, Road (Street) D, District C, City B, Province A, it is necessary to number each province, city, district, road (street), and No. X to map out a set of Location information parameter value; for a family, it can be mapped to values such as household number, room number, and device number. For the position information parameter, its parameter range is a continuous linear parameter. For the location information parameter, there needs to be a fixed parameter to indicate the number of the local area network where the IP address is located, that is, the network number. This network number can be multiplexed with the location information parameter as an input parameter, and the function of the network number is mainly to distinguish and isolate each network.

其中,本发明的另一具体实施例中,包括上述步骤11-14的基础上,上述步骤13具体可以包括:Wherein, in another specific embodiment of the present invention, on the basis of including the above steps 11-14, the above step 13 may specifically include:

步骤131,将所述位置信息参数作为IP地址字段的换算因子,根据所述换算因子和每一个换算因子对应的IP地址换算算法,换算成设备的IP地址;以及Step 131, using the location information parameter as the conversion factor of the IP address field, and converting it into the IP address of the device according to the conversion factor and the IP address conversion algorithm corresponding to each conversion factor; and

步骤132,将所述位置信息参数作为MAC地址字段的换算因子,根据所述换算因子和每一个换算因子对应的MAC地址换算算法,换算成设备的MAC地址。Step 132, using the location information parameter as a conversion factor of the MAC address field, and converting it into a MAC address of the device according to the conversion factor and a MAC address conversion algorithm corresponding to each conversion factor.

其中,步骤131包括:Wherein, step 131 includes:

步骤1311,将所述位置信息参数划分为4个换算因子,每一个换算因子对应IP地址的一个字段,且每一个换算因子对应的一个IP地址换算算法;Step 1311, divide the location information parameter into 4 conversion factors, each conversion factor corresponds to a field of the IP address, and each conversion factor corresponds to an IP address conversion algorithm;

步骤1312,将每一个换算因子按照该换算因子对应的IP地址换算算法,转换为IP地址的一个字段;Step 1312, converting each conversion factor into a field of the IP address according to the IP address conversion algorithm corresponding to the conversion factor;

步骤1313,将4个字段组合起来,得到设备的IP地址。Step 1313, combine the four fields to obtain the IP address of the device.

以IPv4为例,现有的IP地址为32位,每8位为一字段,32位的IP地址就由四字段数值组成。IP地址的四字段数值,每字段数值对应一个地址换算算法,以位置信息参数作为换算算法的输入参数,1个或多个输入参数作为此算法的换算因子,换算得到一段IP地址数值,IP地址的四字段数值组成一个32位的IP地址。显然,IP地址每段地址数值对应的地址换算算法是一个连续的线性算法,即根据输入参数的变换,通过换算算法得到的数值应该是连续的变动。Taking IPv4 as an example, the existing IP address is 32 bits, and every 8 bits is a field, and the 32-bit IP address is composed of four field values. The four-field value of the IP address, each field value corresponds to an address conversion algorithm, the location information parameter is used as the input parameter of the conversion algorithm, and one or more input parameters are used as the conversion factor of this algorithm, and a piece of IP address value is obtained after conversion, IP address The four-field values form a 32-bit IP address. Obviously, the address conversion algorithm corresponding to the value of each segment of the IP address is a continuous linear algorithm, that is, according to the transformation of the input parameters, the value obtained through the conversion algorithm should change continuously.

考虑到IPv4的第1段数值有效范围在十进制1到126,128到223范围内,第2、3、4段数值有效范围必须在十进制0到255之间。对于每个换算因子,即映射得到的位置信息参数,其值范围也在IPv4的四段数值范围内。同样换算因子经过换算算法得到的数值其范围也在IPv4的四段数值范围内。Considering that the valid range of the value of the first segment of IPv4 is within the range of 1 to 126 and 128 to 223 in decimal, the valid range of the values of segment 2, 3, and 4 must be between 0 and 255 in decimal. For each conversion factor, that is, the location information parameter obtained through mapping, its value range is also within the four-segment value range of IPv4. Similarly, the range of the value obtained by the conversion factor through the conversion algorithm is also within the four-stage value range of IPv4.

对于32位的IP地址可分为两个部分,前一部分为此IP地址的网络地址,后一部分为此IP地址的主机地址,网络地址和主机地址通过子网掩码来进行划分,例如对于IP地址A.B.C.D,子网掩码为255.255.255.0,其前三个字节A.B.C就为其网络地址,最后一个字节D就为其主机地址。For a 32-bit IP address, it can be divided into two parts. The former part is the network address of the IP address, and the latter part is the host address of the IP address. The network address and the host address are divided by the subnet mask, for example, for IP The address A.B.C.D, the subnet mask is 255.255.255.0, the first three bytes A.B.C are its network address, and the last byte D is its host address.

进一步的,上述步骤1313后还包括:Further, after the above step 1313, it also includes:

步骤1314,根据所述位置信息中的网络号来获得该IP地址的子网掩码。Step 1314, obtain the subnet mask of the IP address according to the network number in the location information.

本发明对于网络地址和主机地址的划分,也就是子网掩码的设定是根据位置信息中的网络号来确定,例如,设定一个家庭,其换算算法得到的IP地址为:户号.房间号.1.设备号,每个房间为一个局域网,其网络号和房间号可设置为相同,则其子网掩码就为255.255.0.0,户号和房间号就为其网络地址,1和设备号就为其主机地址,如果其每个房间有多个局域网,每个局域网的网络号作为输入参数,其换算算法得到的IP地址为户号.房间号.网络号.设备号,则其子网掩码为255.255.255.0。这里子网掩码根据其网络范围来设定。The present invention divides the network address and the host address, that is, the setting of the subnet mask is determined according to the network number in the location information. For example, if a family is set, the IP address obtained by its conversion algorithm is: account number. Room No. 1. Equipment No., each room is a local area network, its network No. and room No. can be set to be the same, then its subnet mask is 255.255.0.0, and the account No. and room No. are its network addresses, 1 and the device number are its host addresses. If each room has multiple LANs, the network number of each LAN is used as an input parameter, and the IP address obtained by the conversion algorithm is account number.room number.network number.equipment number, then Its subnet mask is 255.255.255.0. Here the subnet mask is set according to its network range.

其中,本发明的一具体实施例中,上述步骤132包括:Wherein, in a specific embodiment of the present invention, the above step 132 includes:

步骤1321,将所述位置信息参数划分为6个换算因子,每一个换算因子对应MAC地址的一个字段,且每一个换算因子对应的一个MAC地址换算算法;Step 1321, divide the location information parameter into 6 conversion factors, each conversion factor corresponds to a field of the MAC address, and each conversion factor corresponds to a MAC address conversion algorithm;

步骤1322,将每一个换算因子按照该换算因子对应的MAC地址换算算法,转换为MAC地址的一个字段;Step 1322, converting each conversion factor into a field of the MAC address according to the MAC address conversion algorithm corresponding to the conversion factor;

步骤1323,将6个字段组合起来,得到设备的MAC地址。Step 1323, combine the 6 fields to obtain the MAC address of the device.

其中,步骤1323包括:将表示此设备的类型值作为MAC地址的前2个字段,其中,第1个字段的最后一位数值不能为1;将后面四个字段每个字段数值设置为和IP地址的四个字段值一致,得到设备的MAC地址。Among them, step 1323 includes: using the type value representing the device as the first two fields of the MAC address, wherein the last digit of the first field cannot be 1; The four field values of the address are the same, and the MAC address of the device is obtained.

以当前的MAC地址为例,MAC地址为48位,分为六个字段,每个字段为一个字节,8位,以十六进制表示,对于MAC地址的6个字段,前两个字段在换算算法中表示此设备的类型值,其范围要求是第1个字段8位的最后一位数值不能为1,以排除此MAC生成为组播MAC地址,后面四个字段每个字段数值和IP地址四个字段值一致。Take the current MAC address as an example, the MAC address is 48 bits, divided into six fields, each field is a byte, 8 bits, expressed in hexadecimal, for the 6 fields of the MAC address, the first two fields In the conversion algorithm, it indicates the type value of this device. The range requirement is that the last digit of the 8-bit value in the first field cannot be 1, so as to exclude that this MAC is generated as a multicast MAC address. The value of each field in the last four fields and The values of the four fields of the IP address are consistent.

这里需要说明,本发明对位置信息参数作为输入参数换算得到IP地址和MAC地址的算法并不加限制,只要可以通过此算法得到本网络系统内IP地址和MAC地址值唯一,都在本发明所述之列。It needs to be explained here that the present invention does not limit the algorithm for obtaining the IP address and the MAC address by converting the location information parameter as an input parameter, as long as the IP address and the MAC address value in the network system can be obtained through this algorithm, it is all within the scope of the present invention. listed.

设定位置信息参数值在设备的网络系统内唯一,其作为输入参数通过换算得到的IP地址也在设备的网络系统内唯一,不会与本网络系统内其他设备的IP地址冲突。同样,对于MAC地址,也不会与本网络系统内的其他设备MAC地址冲突。The value of the set position information parameter is unique in the network system of the device, and the IP address obtained through conversion as an input parameter is also unique in the network system of the device, and will not conflict with the IP addresses of other devices in the network system. Similarly, the MAC address will not conflict with the MAC addresses of other devices in the network system.

本发明的上述实施例中,在进行IP地址和MAC地址转换过程中,例如,各个设备通过位置信息映射得到的位置信息参数为X、Y、Z、网络号、设备号,使用F1、F2、F3、F4来代表IP四段地址的四个换算算法,通过换算算法得到其IP地址为F1(X,Y).F2(Z).F3(网络号).F4(设备号),每个字段为十进制,其子网掩码用来区分不同的网络,即对应IP的四个字段为255.255.255.0;得到各个设备的MAC地址为00:01:F1(X,Y):F2(Z):F3(网络号):F4(设备号),每个字段为十六进制。In the above-mentioned embodiments of the present invention, in the process of converting IP address and MAC address, for example, the location information parameters obtained by each device through location information mapping are X, Y, Z, network number, and device number, using F1, F2, F3 and F4 represent the four conversion algorithms of the IP four-segment address. The IP address obtained through the conversion algorithm is F1(X,Y).F2(Z).F3(network number).F4(device number), each field It is in decimal, and its subnet mask is used to distinguish different networks, that is, the four fields corresponding to IP are 255.255.255.0; the MAC address of each device is obtained as 00:01:F1(X,Y):F2(Z): F3 (network number): F4 (device number), each field is hexadecimal.

采用本发明实施例提供的技术方案,设备的IP地址和MAC地址是设备在本地自动配置,无需通过外部DHCP服务器来分配,和现有技术比较而言,具有IP地址固定,网络通信不受DHCP服务器工作影响等优势。Adopting the technical solution provided by the embodiment of the present invention, the IP address and MAC address of the device are automatically configured locally by the device, and do not need to be allocated through an external DHCP server. Compared with the prior art, the IP address is fixed, and the network communication is not subject to DHCP. Advantages such as server work impact.

如图2所示,本发明的实施例还提供一种地址配置装置,包括:As shown in Figure 2, an embodiment of the present invention also provides an address configuration device, including:

获取模块201,用于获取设备在网络中的位置信息,所述位置信息能唯一确定所述设备;An acquisition module 201, configured to acquire location information of a device in the network, where the location information can uniquely identify the device;

转换模块202,用于将所述位置信息转换为位置信息参数;A conversion module 202, configured to convert the location information into location information parameters;

处理模块203,用于将所述位置信息参数换算成设备的IP地址和MAC地址;A processing module 203, configured to convert the location information parameter into an IP address and a MAC address of the device;

配置模块204,用于将所述IP和MAC地址自动分配给所述设备。The configuration module 204 is configured to automatically assign the IP and MAC address to the device.

本发明的该装置实施例同样通过获取设备在网络中的位置信息,所述位置信息能唯一确定所述设备;将所述位置信息转换为位置信息参数;将所述位置信息参数换算成设备的IP地址和MAC地址;将所述IP和MAC地址自动分配给所述设备。本发明实施例采用的方案,不依赖于外部的DHCP服务器,获取到的IP和MAC地址确定,不存在随即性。也避免了可能导致的IP地址冲突和获取不到地址的问题。The device embodiment of the present invention also obtains the location information of the device in the network, and the location information can uniquely determine the device; converts the location information into a location information parameter; converts the location information parameter into the device's IP address and MAC address; automatically assigning said IP and MAC address to said device. The solution adopted in the embodiment of the present invention does not depend on an external DHCP server, and the acquired IP and MAC addresses are determined without randomness. It also avoids the possible IP address conflict and the problem of not being able to obtain the address.

其中,所述处理模块203包括:Wherein, the processing module 203 includes:

第一处理子模块,用于将所述位置信息参数作为IP地址字段的换算因子,根据所述换算因子和每一个换算因子对应的IP地址换算算法,换算成设备的IP地址;以及The first processing submodule is used to convert the position information parameter into the IP address of the device according to the conversion factor and the IP address conversion algorithm corresponding to each conversion factor as the conversion factor of the IP address field; and

第二处理子模块,用于将所述位置信息参数作为MAC地址字段的换算因子,根据所述换算因子和每一个换算因子对应的MAC地址换算算法,换算成设备的MAC地址。The second processing sub-module is configured to use the position information parameter as a conversion factor of the MAC address field, and convert it into the MAC address of the device according to the conversion factor and the MAC address conversion algorithm corresponding to each conversion factor.

其中,所述第一处理子模块包括:Wherein, the first processing submodule includes:

第一划分子模块,用于将所述位置信息参数划分为4个换算因子,每一个换算因子对应IP地址的一个字段,且每一个换算因子对应的一个IP地址换算算法;The first dividing sub-module is used to divide the position information parameter into 4 conversion factors, each conversion factor corresponds to a field of the IP address, and each conversion factor corresponds to an IP address conversion algorithm;

第一转换子模块,用于将每一个换算因子按照该换算因子对应的IP地址换算算法,转换为IP地址的一个字段;The first conversion submodule is used to convert each conversion factor into a field of the IP address according to the IP address conversion algorithm corresponding to the conversion factor;

第一组合子模块,用于将4个字段组合起来,得到设备的IP地址。The first combination sub-module is used to combine the four fields to obtain the IP address of the device.

其中,上述装置还包括:获得子模块,用于获得该IP地址的类子网掩码,将所述类子网掩码的主机地址部分的前N位置1,得出该IP地址划分子网的子网掩码。Wherein, the above-mentioned device also includes: obtaining a sub-module for obtaining the class subnet mask of the IP address, setting the first N position of the host address part of the class subnet mask to 1, and obtaining the subnet of the IP address subnet mask.

其中,所述第二处理子模块包括:Wherein, the second processing submodule includes:

第二划分子模块,用于将所述位置信息参数划分为6个换算因子,每一个换算因子对应MAC地址的一个字段,且每一个换算因子对应的一个MAC地址换算算法;The second dividing sub-module is used to divide the position information parameter into 6 conversion factors, each conversion factor corresponds to a field of the MAC address, and each conversion factor corresponds to a MAC address conversion algorithm;

第二转换子模块,用于将每一个换算因子按照该换算因子对应的MAC地址换算算法,转换为MAC地址的一个字段;The second conversion submodule is used to convert each conversion factor into a field of the MAC address according to the MAC address conversion algorithm corresponding to the conversion factor;

第二组合子模块,用于将6个字段组合起来,得到设备的MAC地址。The second combination sub-module is used to combine the 6 fields to obtain the MAC address of the device.

其中,所述第二组合子模块用于:将表示此设备的类型值作为MAC地址的前2个字段,其中,第1个字段的最后一位数值不能为1;将后面四个字段每个字段数值设置为和IP地址的四个字段值一致,得到设备的MAC地址。Wherein, the second combination submodule is used to: use the type value representing the device as the first two fields of the MAC address, wherein the last digit value of the first field cannot be 1; each of the following four fields The field value is set to be consistent with the four field values of the IP address to obtain the MAC address of the device.

需要说明的是,该装置是与上述方法对应的装置,上述方法实施例中的所有实现方式均适用于该装置的实施例中,也能达到相同技术效果。It should be noted that the device is a device corresponding to the above-mentioned method, and all the implementation modes in the above-mentioned method embodiments are applicable to the embodiments of the device, and can also achieve the same technical effect.

本发明的实施例还提供一种设备,包括处理器,所述处理器包括如上所述的地址配置装置。An embodiment of the present invention also provides a device, including a processor, where the processor includes the above-mentioned address configuration device.

其中,所述设备还包括接口,所述处理器将所述地址配置装置的所述处理模块得到的所述IP和MAC地址通过所述接口发送给网络中的交换机,并通过所述交换机与其它网络中的设备交换所述设备的IP地址和MAC地址。Wherein, the device further includes an interface, and the processor sends the IP and MAC addresses obtained by the processing module of the address configuration device to a switch in the network through the interface, and communicates with other Devices in the network exchange IP addresses and MAC addresses of the devices.

如图3所示,本实施例描述的是在一个局域网内部,各个设备通过获取位置信息,来换算得到本设备的IP和MAC地址。As shown in FIG. 3 , this embodiment describes that within a local area network, each device obtains the location information to convert the IP and MAC address of the device.

在一个网络系统内部存在多个设备的情况,各个设备与网络交换设备(交换机)相连;各个设备获取到设备自身的位置信息,其中位置信息包括局域网的网络号,和各个设备对应的设备号;In the case of multiple devices in a network system, each device is connected to a network switching device (switch); each device obtains the location information of the device itself, where the location information includes the network number of the LAN and the corresponding device number of each device;

例如,各个设备通过位置信息映射得到的位置信息参数为X、Y、Z、网络号、设备号,使用F1、F2、F3、F4来代表IP四段地址的四个换算算法,通过换算算法得到其IP地址为F1(X,Y).F2(Z).F3(网络号).F4(设备号),每个字段为十进制,其子网掩码用来区分不同的网络,即对应IP的四个字段为255.255.255.0;得到各个设备的MAC地址为00:01:F1(X,Y):F2(Z):F3(网络号):F4(设备号),每个字段为十六进制。For example, the location information parameters obtained by each device through location information mapping are X, Y, Z, network number, and device number. F1, F2, F3, and F4 are used to represent the four conversion algorithms of IP four-segment addresses. Its IP address is F1(X,Y).F2(Z).F3(network number).F4(device number), each field is in decimal, and its subnet mask is used to distinguish different networks, that is, the corresponding IP The four fields are 255.255.255.0; the MAC address of each device is 00:01:F1(X,Y):F2(Z):F3(network number):F4(device number), each field is hexadecimal system.

换算得到IP和MAC地址,通过网络交换机可直接与其他设备进行数据收发和消息互通,本设备要访问网络内的其他设备,根据其他设备的位置信息就可获取到其IP地址,无需再登陆到其设备上查看。The converted IP and MAC addresses can directly send and receive data and communicate with other devices through the network switch. If this device wants to access other devices in the network, it can obtain its IP address according to the location information of other devices without logging in to view on their device.

图3是在分布式系统中存在多个局域网网络,每个网络中有多个设备的情况。Figure 3 shows the situation where there are multiple LAN networks in a distributed system, and there are multiple devices in each network.

在多个网络的情况下,位置信息参数中需要有一个参数值来表示网络编号信息,每个网络中的多个设备存在设备编号,此设备编号在本网络中唯一,可与其它网络中设备编号相同,通过输入参数换算得到IP地址和MAC地址,子网掩码根据网络号所换算来的字段设定,来隔离不同的网络系统。In the case of multiple networks, there needs to be a parameter value in the location information parameter to represent the network number information. There are device numbers for multiple devices in each network. This device number is unique in this network and can be used with devices in other networks. The numbers are the same, and the IP address and MAC address are obtained by converting the input parameters. The subnet mask is set according to the field converted from the network number to isolate different network systems.

本发明的该设备的实施例中,设备的IP地址和MAC地址是设备在本地自动配置,无需通过外部DHCP服务器来分配,和现有技术比较而言,具有IP地址固定,网络通信不受DHCP服务器工作影响等优势。In the embodiment of the device of the present invention, the IP address and MAC address of the device are automatically configured locally by the device, without being distributed by an external DHCP server. Compared with the prior art, the IP address is fixed, and the network communication is not subject to DHCP. Advantages such as server work impact.

以上所述是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明所述原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above description is a preferred embodiment of the present invention, it should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, some improvements and modifications can also be made, and these improvements and modifications can also be made. It should be regarded as the protection scope of the present invention.

Claims (16)

1.一种地址配置方法,其特征在于,包括:1. An address configuration method, characterized in that, comprising: 获取设备在网络中的位置信息,所述位置信息能唯一确定所述设备;Obtain the location information of the device in the network, the location information can uniquely identify the device; 将所述位置信息转换为位置信息参数;converting the location information into location information parameters; 将所述位置信息参数换算成设备的IP地址和MAC地址;Converting the location information parameter into an IP address and a MAC address of the device; 将所述IP和MAC地址自动分配给所述设备。The IP and MAC addresses are automatically assigned to the device. 2.根据权利1所述的地址配置方法,其特征在于,所述位置信息包括:2. The address configuration method according to claim 1, wherein the location information includes: 设备所在网络中能确定其物理位置的一组位置数据,所述一组位置数据能唯一确定所述设备。A set of location data that can determine the physical location of the device in the network where the device is located, and the set of location data can uniquely identify the device. 3.根据权利2所述的地址配置方法,其特征在于,将所述位置信息转换为位置信息参数的步骤包括:3. The address configuration method according to claim 2, wherein the step of converting the location information into location information parameters comprises: 将所述一组位置数据,分别映射为一个位置信息参数,得到一组位置信息参数。The set of position data is mapped to a position information parameter respectively to obtain a set of position information parameters. 4.根据权利1所述的地址配置方法,其特征在于,将所述位置信息参数换算成设备的IP地址和MAC地址的步骤包括:4. The address configuration method according to claim 1, wherein the step of converting the location information parameter into an IP address and a MAC address of the device comprises: 将所述位置信息参数作为IP地址字段的换算因子,根据所述换算因子和每一个换算因子对应的IP地址换算算法,换算成设备的IP地址;以及Using the location information parameter as a conversion factor of the IP address field, and converting it into an IP address of the device according to the conversion factor and an IP address conversion algorithm corresponding to each conversion factor; and 将所述位置信息参数作为MAC地址字段的换算因子,根据所述换算因子和每一个换算因子对应的MAC地址换算算法,换算成设备的MAC地址。The location information parameter is used as the conversion factor of the MAC address field, and converted into the MAC address of the device according to the conversion factor and the MAC address conversion algorithm corresponding to each conversion factor. 5.根据权利要求4所述的地址配置方法,其特征在于,所述将所述位置信息参数作为IP地址字段的换算因子,根据所述换算因子和每一个换算因子对应的IP地址换算算法,换算成设备的IP地址的步骤包括:5. The address configuration method according to claim 4, wherein the location information parameter is used as the conversion factor of the IP address field, and according to the conversion algorithm corresponding to the conversion factor and each conversion factor, The steps of converting to the IP address of the device include: 将所述位置信息参数划分为4个换算因子,每一个换算因子对应IP地址的一个字段,且每一个换算因子对应的一个IP地址换算算法;Dividing the location information parameter into 4 conversion factors, each conversion factor corresponds to a field of the IP address, and an IP address conversion algorithm corresponding to each conversion factor; 将每一个换算因子按照该换算因子对应的IP地址换算算法,转换为IP地址的一个字段;Convert each conversion factor into a field of the IP address according to the IP address conversion algorithm corresponding to the conversion factor; 将4个字段组合起来,得到设备的IP地址。Combine the 4 fields to get the IP address of the device. 6.根据权利要求5所述的地址配置方法,其特征在于,将4个字段组合起来,得到设备的IP地址后还包括:6. The address configuration method according to claim 5, characterized in that, combining the 4 fields to obtain the IP address of the device also includes: 根据所述位置信息中的网络号来获得该IP地址的子网掩码。Obtain the subnet mask of the IP address according to the network number in the location information. 7.根据权利要求4所述的地址配置方法,其特征在于,将所述位置信息参数作为MAC地址字段的换算因子,根据所述换算因子和每一个换算因子对应的MAC地址换算算法,换算成设备的MAC地址的步骤包括:7. The address configuration method according to claim 4, wherein the location information parameter is used as the conversion factor of the MAC address field, and is converted into The steps to get the MAC address of the device include: 将所述位置信息参数划分为6个换算因子,每一个换算因子对应MAC地址的一个字段,且每一个换算因子对应的一个MAC地址换算算法;Divide the location information parameter into 6 conversion factors, each conversion factor corresponds to a field of the MAC address, and each conversion factor corresponds to a MAC address conversion algorithm; 将每一个换算因子按照该换算因子对应的MAC地址换算算法,转换为MAC地址的一个字段;Convert each conversion factor into a field of the MAC address according to the MAC address conversion algorithm corresponding to the conversion factor; 将6个字段组合起来,得到设备的MAC地址。Combine the 6 fields to get the MAC address of the device. 8.根据权利要求7所述的地址配置方法,其特征在于,将6个字段组合起来,得到设备的MAC地址的步骤包括:8. The address configuration method according to claim 7, wherein the step of combining the 6 fields to obtain the MAC address of the device comprises: 将表示此设备的类型值作为MAC地址的前2个字段;Use the type value representing this device as the first 2 fields of the MAC address; 将后面四个字段每个字段数值设置为和IP地址的四个字段值一致,得到设备的MAC地址。Set the values of each of the following four fields to be consistent with the values of the four fields of the IP address to obtain the MAC address of the device. 9.一种地址配置装置,其特征在于,包括:9. An address configuration device, characterized in that it comprises: 获取模块,用于获取设备在网络中的位置信息,所述位置信息能唯一确定所述设备;An acquisition module, configured to acquire location information of the device in the network, where the location information can uniquely identify the device; 转换模块,用于将所述位置信息转换为位置信息参数;A conversion module, configured to convert the location information into location information parameters; 处理模块,用于将所述位置信息参数换算成设备的IP地址和MAC地址;A processing module, configured to convert the location information parameter into an IP address and a MAC address of the device; 配置模块,用于将所述IP和MAC地址自动分配给所述设备。a configuration module, configured to automatically assign the IP and MAC addresses to the device. 10.根据权利9所述的地址配置装置,其特征在于,所述处理模块包括:10. The address configuration device according to claim 9, wherein the processing module includes: 第一处理子模块,用于将所述位置信息参数作为IP地址字段的换算因子,根据所述换算因子和每一个换算因子对应的IP地址换算算法,换算成设备的IP地址;以及The first processing submodule is used to convert the position information parameter into the IP address of the device according to the conversion factor and the IP address conversion algorithm corresponding to each conversion factor as the conversion factor of the IP address field; and 第二处理子模块,用于将所述位置信息参数作为MAC地址字段的换算因子,根据所述换算因子和每一个换算因子对应的MAC地址换算算法,换算成设备的MAC地址。The second processing sub-module is configured to use the position information parameter as a conversion factor of the MAC address field, and convert it into the MAC address of the device according to the conversion factor and the MAC address conversion algorithm corresponding to each conversion factor. 11.根据权利要求4所述的地址配置装置,其特征在于,所述第一处理子模块包括:11. The address configuration device according to claim 4, wherein the first processing submodule comprises: 第一划分子模块,用于将所述位置信息参数划分为4个换算因子,每一个换算因子对应IP地址的一个字段,且每一个换算因子对应的一个IP地址换算算法;The first dividing sub-module is used to divide the position information parameter into 4 conversion factors, each conversion factor corresponds to a field of the IP address, and each conversion factor corresponds to an IP address conversion algorithm; 第一转换子模块,用于将每一个换算因子按照该换算因子对应的IP地址换算算法,转换为IP地址的一个字段;The first conversion submodule is used to convert each conversion factor into a field of the IP address according to the IP address conversion algorithm corresponding to the conversion factor; 第一组合子模块,用于将4个字段组合起来,得到设备的IP地址。The first combination sub-module is used to combine the four fields to obtain the IP address of the device. 12.根据权利要求11所述的地址配置装置,其特征在于,还包括:12. The address configuration device according to claim 11, further comprising: 获得子模块,用于根据所述位置信息中的网络号来获得该IP地址的子网掩码。The obtaining submodule is used to obtain the subnet mask of the IP address according to the network number in the location information. 13.根据权利要求10所述的地址配置装置,其特征在于,所述第二处理子模块包括:13. The address configuration device according to claim 10, wherein the second processing submodule comprises: 第二划分子模块,用于将所述位置信息参数划分为6个换算因子,每一个换算因子对应MAC地址的一个字段,且每一个换算因子对应的一个MAC地址换算算法;The second dividing sub-module is used to divide the position information parameter into 6 conversion factors, each conversion factor corresponds to a field of the MAC address, and each conversion factor corresponds to a MAC address conversion algorithm; 第二转换子模块,用于将每一个换算因子按照该换算因子对应的MAC地址换算算法,转换为MAC地址的一个字段;The second conversion submodule is used to convert each conversion factor into a field of the MAC address according to the MAC address conversion algorithm corresponding to the conversion factor; 第二组合子模块,用于将6个字段组合起来,得到设备的MAC地址。The second combination sub-module is used to combine the 6 fields to obtain the MAC address of the device. 14.根据权利要求13所述的地址配置装置,其特征在于,所述第二组合子模块用于:将表示此设备的类型值作为MAC地址的前2个字段;将后面四个字段每个字段数值设置为和IP地址的四个字段值一致,得到设备的MAC地址。14. The address configuration device according to claim 13, wherein the second combination submodule is used to: use the type value representing the device as the first 2 fields of the MAC address; The field value is set to be consistent with the four field values of the IP address to obtain the MAC address of the device. 15.一种设备,包括处理器,其特征在于,所述处理器包括:如权利要求9-14所述的地址配置装置。15. A device comprising a processor, wherein the processor comprises: the address configuration device according to claims 9-14. 16.根据权利要求15所述的设备,其特征在于,还包括:接口,所述处理器将所述地址配置装置的所述处理模块得到的所述IP和MAC地址通过所述接口发送给网络中的交换机,并通过所述交换机与其它网络中的设备交换所述设备的IP地址和MAC地址。16. The device according to claim 15, further comprising: an interface, the processor sends the IP and MAC addresses obtained by the processing module of the address configuration device to the network through the interface and exchange the IP address and MAC address of the device with devices in other networks through the switch.
CN201410293544.1A 2014-06-25 2014-06-25 Address configuration method and device and equipment Pending CN105282263A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201410293544.1A CN105282263A (en) 2014-06-25 2014-06-25 Address configuration method and device and equipment
PCT/CN2014/091933 WO2015196719A1 (en) 2014-06-25 2014-11-21 Address configuration method, apparatus and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410293544.1A CN105282263A (en) 2014-06-25 2014-06-25 Address configuration method and device and equipment

Publications (1)

Publication Number Publication Date
CN105282263A true CN105282263A (en) 2016-01-27

Family

ID=54936645

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410293544.1A Pending CN105282263A (en) 2014-06-25 2014-06-25 Address configuration method and device and equipment

Country Status (2)

Country Link
CN (1) CN105282263A (en)
WO (1) WO2015196719A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106453680A (en) * 2016-10-10 2017-02-22 杭州昆海信息技术有限公司 IP address allocation method and device
CN112087315A (en) * 2020-07-30 2020-12-15 深圳奇迹智慧网络有限公司 Intelligent gateway configuration method and device, computer equipment and storage medium
CN113556412A (en) * 2021-07-29 2021-10-26 中车南京浦镇车辆有限公司 Network address setting method for rail transit vehicle terminal equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1316151A (en) * 1998-11-02 2001-10-03 综合数据通信公司 Geospacial internet protocol addressing
CN101572692A (en) * 2008-04-28 2009-11-04 华为技术有限公司 Method, system and equipment for IP address assignment
CN101772027A (en) * 2008-12-31 2010-07-07 华为技术有限公司 Method for allocating user identifier for terminal and paging controller
WO2010145286A1 (en) * 2009-10-27 2010-12-23 中兴通讯股份有限公司 Method and system for realizing information interaction in next generation network
CN102318322A (en) * 2011-07-28 2012-01-11 华为技术有限公司 Device and method for distributing MAC address
CN103516547A (en) * 2013-09-18 2014-01-15 深圳市华为技术软件有限公司 Network parameter distribution method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090113021A1 (en) * 2007-10-24 2009-04-30 Telefonaktiebolaget Lm Ericsson (Publ) System and method for generating functional addresses
CN102868761B (en) * 2012-09-28 2014-10-22 无锡江南计算技术研究所 Cluster network automatic configuration and management method based on space coordinates

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1316151A (en) * 1998-11-02 2001-10-03 综合数据通信公司 Geospacial internet protocol addressing
CN101572692A (en) * 2008-04-28 2009-11-04 华为技术有限公司 Method, system and equipment for IP address assignment
CN101772027A (en) * 2008-12-31 2010-07-07 华为技术有限公司 Method for allocating user identifier for terminal and paging controller
WO2010145286A1 (en) * 2009-10-27 2010-12-23 中兴通讯股份有限公司 Method and system for realizing information interaction in next generation network
CN102318322A (en) * 2011-07-28 2012-01-11 华为技术有限公司 Device and method for distributing MAC address
CN103516547A (en) * 2013-09-18 2014-01-15 深圳市华为技术软件有限公司 Network parameter distribution method and device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106453680A (en) * 2016-10-10 2017-02-22 杭州昆海信息技术有限公司 IP address allocation method and device
CN112087315A (en) * 2020-07-30 2020-12-15 深圳奇迹智慧网络有限公司 Intelligent gateway configuration method and device, computer equipment and storage medium
CN113556412A (en) * 2021-07-29 2021-10-26 中车南京浦镇车辆有限公司 Network address setting method for rail transit vehicle terminal equipment

Also Published As

Publication number Publication date
WO2015196719A1 (en) 2015-12-30

Similar Documents

Publication Publication Date Title
TWI568231B (en) Method and system for automatically generating a server network topology
US10298724B2 (en) Communication device and method for transmitting data within an industrial automation system
WO2015066840A1 (en) Device and method for network address conversion
WO2011072540A1 (en) Ip address assignment method and gateway
US10841272B2 (en) Address generating device of remote smart meter reading system, and method therefor
CN110855809B (en) Message processing method and device
CN113660357B (en) Method and device for automatically acquiring IP address by IPv6 dual stack system
US20120198091A1 (en) Network system, control apparatus and network apparatus
CN107241454A (en) A kind of method for realizing address administration, device, aaa server and SDN controllers
KR100462627B1 (en) A method for identifying devices using IPv6 address
KR100532100B1 (en) A method for identifying devices in wireless LAN Home Network environment
JP4852110B2 (en) IPv6 address acquisition apparatus, method, and system
KR20040046431A (en) A method for identifying devices using IPv6 address
US9819641B2 (en) Method of and a processing device handling a protocol address in a network
CN105282263A (en) Address configuration method and device and equipment
CN103167058A (en) Method for acquiring Internet protocol version 6 (IPv6) prefix by adopting internet control message protocol version 6 (ICMPv6) to generate client address
CN105635335A (en) Social resource access method, apparatus, and system
CN104333612B (en) The method and apparatus of switching network address
JP2001308909A (en) Logical network address assignment method and terminal device
US7702812B2 (en) Address allocation system and method
KR100853587B1 (en) IP sharing device and connection method using the same to enable network environment of communication terminal without change
CN115801737A (en) Method and system for configuring IP (Internet protocol) of serial server equipment
US20050259600A1 (en) Translation bridge between ethernet and 1394A local links for consumer electronics devices
CN104662860B (en) Method and device for processing control rules
CN104363310B (en) A kind of method for configuring device IP

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20160127

RJ01 Rejection of invention patent application after publication