WO2020113478A1 - Address information processing method and apparatus, electronic device, and storage medium - Google Patents

Address information processing method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2020113478A1
WO2020113478A1 PCT/CN2018/119413 CN2018119413W WO2020113478A1 WO 2020113478 A1 WO2020113478 A1 WO 2020113478A1 CN 2018119413 W CN2018119413 W CN 2018119413W WO 2020113478 A1 WO2020113478 A1 WO 2020113478A1
Authority
WO
WIPO (PCT)
Prior art keywords
server
mac address
address
partition
network card
Prior art date
Application number
PCT/CN2018/119413
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 北京比特大陆科技有限公司
Priority to PCT/CN2018/119413 priority Critical patent/WO2020113478A1/en
Priority to CN201880098358.9A priority patent/CN112930664B/en
Publication of WO2020113478A1 publication Critical patent/WO2020113478A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/66Layer 2 routing, e.g. in Ethernet based MAN's

Definitions

  • the present application relates to the computer field, for example, to an address information processing method, device, electronic device, and storage medium.
  • the MAC address When communicating between different servers, it depends on the network card set on the server, and the Media Access Control (MAC) address of the server is stored on the network card.
  • the MAC address is stored in the electrically erasable programmable read-only memory (Electrically Programmable Read-Only Memory, EEPROM) of the network card.
  • EEPROM Electrically Programmable Read-Only Memory
  • the MAC address is usually stored in a storage device such as an embedded memory card (Embedded Multi Card (eMMC)) in the related art.
  • eMMC embedded Multi Card
  • the MAC address stored in the storage partition still has the risk of being easily erased during the programming process.
  • Embodiments of the present disclosure provide address information processing methods, apparatuses, electronic devices, and storage media, which solves the risk that related technologies store MAC addresses in storage partitions of storage devices, which may be easily erased during the programming process.
  • an embodiment of the present disclosure provides an address information processing method, including:
  • the first partition is the first in the storage device of the first server The partition where the kernel file of the operating system of the server is located;
  • the address information processing method further includes:
  • the first MAC address When the first MAC address is not stored in the first partition, generate the first MAC address according to the identity of the first server, and store the first MAC address to the first In the partition.
  • the first server By generating and storing the first MAC address when the first MAC address is not stored in the first partition, it is convenient for the first server to directly use the first MAC address stored in the first partition as the first during the subsequent startup process The MAC address of the server.
  • the first server includes a control board and a computing power board, and the computing power board stores preset field values; the address information processing method further includes:
  • the internal network card of the control board By updating the last field of the IP address of the internal network card of the control board according to the value of the preset field, the internal network card of the control board has a fixed IP address, which facilitates communication between the computing board and the control board of the first server.
  • the address information processing method before reading the first MAC address from the first partition, the address information processing method further includes:
  • the address information processing method before reading the first MAC address from the first partition, the address information processing method further includes:
  • the trigger condition including at least one of the following: the internal network card of the first server is disconnected, the external network card of the first server is disconnected, the first server is started, the first A server restarts.
  • the operating system of the first server is a Linux system.
  • the first partition is a boot1 partition in the storage device.
  • the value of the preset field is 254.
  • the identity of the first server is a universal unique identification code.
  • an embodiment of the present disclosure also provides an address information processing apparatus, which serves as a first server for executing the address information processing method in any possible implementation manner of the first aspect, including:
  • the MAC address acquisition module is configured to read the first MAC address from the first partition and use the first MAC address as the MAC address of the external network card of the first server;
  • the first partition is the first server's The partition where the kernel file of the operating system of the first server in the storage device is located;
  • the sending module is configured to communicate with the second server according to the external network IP address corresponding to the MAC address of the external network card.
  • the MAC address acquisition module is further configured to generate, according to the identity of the first server, when the first MAC address is not stored in the first partition A first MAC address, and store the first MAC address in the first partition.
  • the first server includes a control board and a computing power board, and the computing power board stores preset field values; the address information processing device further includes:
  • the IP address update module is configured to update the last field of the IP address of the internal network card of the control board according to the value of the preset field, so that the computing board of the first server can control the updated The IP address of the internal network card of the board interacts with the control board.
  • the address information processing device further includes:
  • the external network card detection module is configured to determine whether the external network card is assigned an IP address before reading the first MAC address from the first partition.
  • the address information processing device further includes:
  • the trigger condition detection module is configured to determine that the trigger condition is established before reading the first MAC address from the first partition.
  • the trigger condition includes at least one of the following: the internal network card of the first server is disconnected, the The external network card of the first server is disconnected, the first server is started, and the first server is restarted.
  • the operating system of the first server is a Linux system.
  • the first partition is a boot1 partition in the storage device.
  • the value of the preset field is 254.
  • the identity of the first server is a universal unique identification code.
  • an embodiment of the present disclosure provides an electronic device, including: a processor and a memory;
  • At least one processor At least one processor
  • a memory communicatively connected to the at least one processor; wherein,
  • the memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, causes the at least one processor to perform the method of any one of the first aspects .
  • an embodiment of the present disclosure provides a computer-readable storage medium that stores computer-executable instructions, and the computer-executable instructions are configured to perform the method according to any one of the first aspects.
  • an embodiment of the present disclosure provides a computer program product, the computer program product including a computer program stored on a computer-readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer So that the computer executes the method described in any one of the first aspects above.
  • the address information processing method, device, electronic device, and storage medium read the first MAC address from the first partition, and use the first MAC address as the MAC address of the external network card of the first server.
  • the external network IP address corresponding to the MAC address of the network card communicates with the second server.
  • FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present disclosure
  • FIG. 2 is a schematic flowchart 1 of an address information processing method provided by an embodiment of the present disclosure
  • FIG. 3 is a second schematic flowchart of an address information processing method provided by an embodiment of the present disclosure.
  • FIG. 4 is a third schematic flowchart of an address information processing method provided by an embodiment of the present disclosure.
  • FIG. 5 is a fourth schematic flowchart of an address information processing method according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic flowchart 5 of an address information processing method according to an embodiment of the present disclosure.
  • FIG. 7 is a schematic structural diagram 1 of an address information processing device provided by an embodiment of the present disclosure.
  • FIG. 8 is a second schematic structural diagram of an address information processing device according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic structural diagram 3 of an address information processing device provided by an embodiment of the present disclosure.
  • FIG. 10 is a fourth schematic structural diagram of an address information processing device according to an embodiment of the present disclosure.
  • FIG. 11 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
  • FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present disclosure.
  • the server 11 involved in the present disclosure includes an internal network card 12, an external network card 13, a control board 14 and at least one computing board 15.
  • the interaction between the control board 14 and the computing board 15 inside the server 11 depends on the internal network card 12 in the server 11, and the interaction between different servers 11 depends on the external network card 13 in each server 11.
  • the interaction between the servers 11 will use the MAC address of the server 11, and the MAC address of the server 11 is usually stored in the EEPROM of the external network card 13.
  • the MAC address is usually stored in the storage partition of the storage device of the server 11, and the storage partition is a user-operable partition in the storage device.
  • the storage device is being updated or formatted, there may still be a risk of the MAC address being erased.
  • the server 11 lacking a MAC address will dynamically obtain a random MAC address each time it starts, resulting in the server 11 re-acquiring a new IP address from the router each time it is started.
  • the interaction between the servers 11 is not convenient.
  • An embodiment of the present disclosure provides an address information processing method, device, electronic device, and storage medium.
  • the first MAC address is read from the partition where the kernel file of the operating system of the first server is located, and the first MAC address is used as the first
  • the MAC address of the external network card of a server is convenient for the first server to communicate with the second server according to the external network IP address corresponding to the MAC address of the external network card.
  • FIG. 2 is a first schematic flowchart of an address information processing method according to an embodiment of the present disclosure.
  • the execution body of the address information processing method provided by the embodiment of the present disclosure may be an address information processing device, or may be a device integrating the address information processing device, or may be a server as shown in FIG. 1. The following uses the execution body as the server as an example.
  • the address information processing method includes:
  • the first partition is a partition where the kernel file of the operating system of the first server is located in the storage device of the first server.
  • the first server includes a storage device, and the storage device may be a hard disk of the first server.
  • the storage device is divided into a first partition and a second partition according to different storage contents.
  • the first partition stores the kernel file of the operating system running on the first server.
  • the first server reads relevant data of the operating system from the kernel file to implement operating system configuration.
  • the second partition is used to store the data written by the user and the mirror data of the operating system. It can be called a storage partition.
  • the user may upgrade and format the storage partition according to the needs. During the programming operation, All data stored in the storage partition may be lost.
  • the first server reads the first partition to check whether there is a MAC address when it is started, and if so, the MAC address is recorded as the first MAC address, and it can be determined that the first MAC address is stored before The MAC address of the external network card of the first server.
  • the first server By storing the MAC address in the first partition, it is convenient for the first server to read the MAC address of the first server from the kernel file of the operating system when it is started, and configure the MAC address as the MAC address of the external network card. It avoids dynamically acquiring a random MAC address when the first server is started, and further avoids that the router of the local area network where the first server is located allocates a new IP address according to the random MAC address.
  • the router of the local area network where the first server is located can directly using the first MAC address read in the first partition as the MAC address of the external network card of the first server when the first server is started, the router of the local area network where the first server is located can
  • the MAC address is assigned a fixed IP address, which avoids the waste of the IP address, avoids the inconvenience of communication between the servers caused by the change of the IP address after each startup, and improves the communication convenience between the servers.
  • the operating system of the first server may be a Linux system.
  • the first partition may be the boot1 partition in the storage device.
  • the first server communicates with the second server according to the obtained MAC address of the external network card and the corresponding external network IP address.
  • the second server is any other server except the first server.
  • the first MAC address is read from the first partition, and the first MAC address is used as the MAC address of the external network card of the first server.
  • the external network IP address corresponding to the MAC address of the external network card
  • the The two servers communicate.
  • By storing the MAC address of the server in the partition where the kernel file of the operating system is located it not only prevents the MAC address from being lost when the storage device is burned, but also avoids the IP address from being wasted, and also prevents the IP address from occurring after each startup.
  • the inconvenience in communication between the servers caused by the change improves the communication convenience between the servers.
  • FIG. 3 is a second schematic flowchart of an address information processing method according to an embodiment of the present disclosure.
  • the embodiment of the present disclosure relates to a MAC address generation process in the case where the first MAC address is not stored in the first partition.
  • the address information processing method further includes:
  • the first server when the first server starts, it detects whether the first MAC address is stored in the first partition. Exemplarily, at the time of detection, it may be detected whether any MAC address exists in the first partition. When the first MAC address is not stored in the first partition, the first MAC address is generated according to the identity of the first server, and the generated first MAC address is stored in the first partition. The first MAC address and the identity of the first server may have a one-to-one correspondence. Exemplarily, when the first server is started for the first time, there may be a case where the first MAC address is not stored in the first partition. By generating and storing the first MAC address when the first MAC address is not stored in the first partition, it is convenient for the first server to directly use the first MAC address stored in the first partition as the first during the subsequent startup process The MAC address of the server.
  • the identity of the first server may be a universally unique identifier (Universally Unique Identifier, UUID) of the first server.
  • UUID Universally Unique Identifier
  • S202 and S203 in the embodiment of the present disclosure are the same as S101 and S102 in the disclosed embodiment shown in FIG. 2, and details are not described in this embodiment of the present disclosure.
  • the first MAC address when the first MAC address is not stored in the first partition, the first MAC address is generated according to the identity of the first server, and the first MAC address is stored in the first partition.
  • the first server By generating and storing the first MAC address when the first MAC address is not stored in the first partition, it is convenient for the first server to directly use the first MAC address stored in the first partition as the first during the subsequent startup process The MAC address of the server.
  • FIG. 4 is a third schematic flowchart of an address information processing method according to an embodiment of the present disclosure.
  • the server includes a control board and a computing board, and relates to the configuration process of the IP address of the internal network card of the server.
  • the address information processing method further includes:
  • S301 has no strict timing relationship with subsequent S302 to S304, and S301 may also be executed after S304, which is not limited in the embodiment of the present disclosure.
  • the computing board and the control board rely on the network card on the computing board and the control board when communicating, and the network board on the control board is called an internal network card.
  • the last field of the IP address of the internal network card of the control board can be configured as a fixed value.
  • the IP address of the internal network card of the control board can be configured as 156.168.1.X, where the last field is configured with a fixed value of X.
  • the IP address of the force card's network card is configured as 156.168.1.Y, where Y is a different value from X to 0-255. According to the first three fields of the configured IP address and fixed values, the hash board can quickly determine the IP address of the internal network card of the control board.
  • the First determine that the router in the LAN to which the first server belongs is the network segment of the IP address configured by the external network card. For example, according to the first three fields of the IP address, the network segment can be determined as 156.158.0.1-255, and then the control board and the computing board The configured network card is configured on different network segments, for example, 156.158.1.1-255.
  • the value of the preset field may be 254. Considering that when the router in the first server configures the IP address for the computing board, the principle of small to large is usually used for configuration. The larger the value of the preset field, the more you can avoid the IP address and control that the router configures for the computing board. The board's IP address conflicts.
  • S302 and S303 in the embodiment of the present disclosure are the same as S101 and S102 in the disclosed embodiment shown in FIG. 2, and details are not described in this embodiment of the present disclosure.
  • the last field of the IP address of the internal network card of the control board is updated according to the value of the preset field, so that the computing board of the first server can control and control the IP address of the internal network card of the updated control board Board to interact.
  • the internal network card of the control board has a fixed IP address, which facilitates the communication between the computing board and the control board of the first server.
  • FIG. 5 is a fourth schematic flowchart of an address information processing method according to an embodiment of the present disclosure.
  • the address information processing method includes:
  • the router of the local area network to which the first server belongs will immediately assign a dynamic IP address to the external network card, so it can be determined whether the external network card is activated by determining whether the external network card is assigned an IP address , When the external network card is assigned an IP address, it is determined that the external network card is started; when the external network card is not assigned an IP address, it is determined that the external network card is not started.
  • S402 and S403 in the embodiment of the present disclosure are the same as S101 and S102 in the disclosed embodiment shown in FIG. 2, and details are not described in this embodiment of the present disclosure.
  • the external network IP address of the external network card of the first server before determining the external network IP address of the external network card of the first server, first determine whether the external network card is assigned an IP address, determine whether the external network card is activated by determining whether the external network card is activated, and determine whether the external network card is activated When determining the MAC address of the external network card and the IP address of the external network, you can avoid wasting resources.
  • FIG. 6 is a schematic flowchart 5 of an address information processing method according to an embodiment of the present disclosure.
  • the embodiment of the present disclosure relates to the trigger condition of the address information processing method.
  • the address information processing method includes:
  • the trigger condition includes at least one of the following: the internal network card of the first server is disconnected, the external network card of the first server is disconnected, the first server is started, and the first server is restarted.
  • the first server executes the following S502 to S506, or when the first server is started/restarted, executes the following S502 to S506.
  • the MAC address of the external network card and the IP address corresponding to the MAC address are determined, and the internal network card can also be determined.
  • the IP address ensures that the internal and external network cards of the first server are all fixed IP addresses, which facilitates the internal and external communication of the first server.
  • FIG. 7 is a schematic structural diagram 1 of an address information processing device provided by an embodiment of the present disclosure.
  • the address information processing apparatus may implement part or all of the address information processing apparatus through software, hardware, or a combination of both.
  • the address information processing device may be the first server shown in FIG. 1.
  • the address information processing apparatus may include:
  • the MAC address acquisition module 11 is configured to read the first MAC address from the first partition and use the first MAC address as the MAC address of the external network card of the first server; the first partition is the first in the storage device of the first server The partition where the kernel file of the operating system of the server is located;
  • the sending module 12 is configured to communicate with the second server according to the external network IP address corresponding to the MAC address of the external network card.
  • the MAC address acquisition module is further configured to generate the first MAC address according to the identity of the first server when the first MAC address is not stored in the first partition, and convert the first MAC address The address is stored in the first partition.
  • FIG. 8 is a second structural diagram of an address information processing device provided by an embodiment of the present disclosure.
  • the first server includes a control board and a hash board, and the preset value of the field is stored in the hash board; the address information processing device further includes:
  • the IP address update module 13 is configured to update the last field of the IP address of the internal network card of the control board according to the value of the preset field, so that the computing board of the first server can use the updated IP address of the internal network card of the control board To interact with the control panel.
  • FIG. 9 is a third structural diagram of an address information processing device provided by an embodiment of the present disclosure. Based on the above example, as shown in FIG. 9, the address information processing device further includes:
  • the external network card detection module 14 is configured to determine whether the external network card is assigned an IP address before reading the first MAC address from the first partition.
  • FIG. 10 is a fourth structural diagram of an address information processing apparatus provided by an embodiment of the present disclosure. Based on the above example, as shown in FIG. 10, the address information processing device further includes:
  • the trigger condition detection module 15 is configured to determine that the trigger condition is established before reading the first MAC address from the first partition.
  • the trigger condition includes at least one of the following: the internal network card of the first server is disconnected, and the external of the first server The network card is disconnected, the first server is started, and the first server is restarted.
  • the operating system of the first server is a Linux system.
  • the first partition is a boot1 partition in the storage device of the first server.
  • the preset field value is 254.
  • the identity of the first server is UUID.
  • Embodiments of the present disclosure also provide a computer-readable storage medium that stores computer-executable instructions that are configured to perform the above address information processing method.
  • An embodiment of the present disclosure also provides a computer program product.
  • the computer program product includes a computer program stored on a computer-readable storage medium.
  • the computer program includes program instructions. When the program instructions are executed by a computer, the The computer executes the above address information processing method.
  • the aforementioned computer-readable storage medium may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
  • FIG. 11 is a schematic structural diagram of the electronic device according to an embodiment of the present disclosure. As shown in FIG. 11, the electronic device includes:
  • At least one processor (processor) 110 one processor 110 is taken as an example in FIG. 11; and the memory (memory) 111 may further include a communication interface (Communication) Interface 112 and a bus 113. Among them, the processor 110, the communication interface 112, and the memory 111 can complete communication with each other through the bus 113.
  • the communication interface 112 may be used for information transmission.
  • the processor 110 may call logic instructions in the memory 111 to execute the address information processing method of the above-mentioned embodiment.
  • logic instructions in the memory 111 described above can be implemented in the form of software functional units and when sold or used as an independent product, they can be stored in a computer-readable storage medium.
  • the memory 111 is a computer-readable storage medium and can be used to store software programs and computer-executable programs, such as program instructions/modules corresponding to the methods in the embodiments of the present disclosure.
  • the processor 110 executes functional applications and data processing by running software programs, instructions, and modules stored in the memory 111, that is, implementing the address information processing method in the foregoing method embodiment.
  • the memory 111 may include a storage program area and a storage data area, where the storage program area may store an operating system and application programs required for at least one function; the storage data area may store data created according to the use of a terminal device and the like.
  • the memory 111 may include a high-speed random access memory, and may also include a non-volatile memory.
  • the size of the sequence numbers of the above processes does not mean the order of execution order, and the execution order of each process should be determined by its function and internal logic, and not There should be no limitation on the implementation process of the embodiments of the present disclosure.
  • the technical solutions of the embodiments of the present disclosure may be embodied in the form of software products, which are stored in a storage medium and include one or more instructions to make a computer device (which may be a personal computer, server, or network) Equipment, etc.) to perform all or part of the steps of the method described in the embodiments of the present disclosure.
  • the aforementioned storage medium may be a non-transitory storage medium, including: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc.
  • a medium that can store program codes may also be a transient storage medium.
  • first, second, etc. may be used in the embodiments of the present disclosure to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another.
  • the first element can be called the second element, and likewise, the second element can be called the first element, as long as all occurrences of the "first element” are consistently renamed and all occurrences of The “second component” can be renamed consistently.
  • the first element and the second element are both elements, but they may not be the same element.
  • the term “comprise” and its variations “comprises” and/or includes refers to the stated features, wholes, steps, operations, elements, and The presence of/or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and/or groups of these.
  • the various aspects, implementations, implementations or features in the described embodiments can be used alone or in any combination.
  • Various aspects in the described embodiments may be implemented by software, hardware, or a combination of software and hardware.
  • the described embodiments may also be embodied by a computer-readable medium that stores computer-readable code including instructions executable by at least one computing device.
  • the computer-readable medium can be associated with any data storage device capable of storing data, which can be read by a computer system.
  • Computer-readable media used for examples may include read-only memory, random access memory, CD-ROM, HDD, DVD, magnetic tape, optical data storage devices, and the like.
  • the computer-readable medium may also be distributed in computer systems connected through a network, so that computer-readable codes can be stored and executed in a distributed manner.

Abstract

An address information processing method and apparatus, an electronic device, and a storage medium; the method comprising: reading a first MAC address from a first partition, and using the first MAC address as the MAC address of an external network card (13) of a first server (S101); and according to an external network IP address corresponding to the MAC address of the external network card (13), carrying out communication with a second server (S102). By means of storing the MAC address of a server in a partition in which a kernel file of an operating system is located, MAC address loss which may occur during burn-in by a storage device is prevented, IP address waste is also prevented, and communication between servers is further prevented from being inconvenient due to an IP address changing each time after start-up; meanwhile, the convenience of communication between servers is increased.

Description

地址信息处理方法、装置、电子设备及存储介质Address information processing method, device, electronic equipment and storage medium 技术领域Technical field
本申请涉及计算机领域,例如涉及一种地址信息处理方法、装置、电子设备及存储介质。The present application relates to the computer field, for example, to an address information processing method, device, electronic device, and storage medium.
背景技术Background technique
不同服务器之间通信时,依赖服务器上设置的网卡,网卡上存储有本服务器的媒体访问控制(Media Access Control,MAC)地址。通常,MAC地址存储在网卡的带电可擦可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)中。When communicating between different servers, it depends on the network card set on the server, and the Media Access Control (MAC) address of the server is stored on the network card. Generally, the MAC address is stored in the electrically erasable programmable read-only memory (Electrically Programmable Read-Only Memory, EEPROM) of the network card.
由于并不是所有的网卡上都设置有EEPROM,相关技术中通常将MAC地址存储在存储设备,如内嵌式存储卡(Embedded Multi Media Card,eMMC),的存储分区中。Since not all network cards are equipped with EEPROM, the MAC address is usually stored in a storage device such as an embedded memory card (Embedded Multi Card (eMMC)) in the related art.
但是,存储在存储分区中的MAC地址仍然存在容易在烧写过程中被擦除的风险。However, the MAC address stored in the storage partition still has the risk of being easily erased during the programming process.
发明内容Summary of the invention
本公开实施例提供地址信息处理方法、装置、电子设备及存储介质,解决了相关技术将MAC地址存储在存储设备的存储分区中,存在在烧写过程中容易被擦除的风险。Embodiments of the present disclosure provide address information processing methods, apparatuses, electronic devices, and storage media, which solves the risk that related technologies store MAC addresses in storage partitions of storage devices, which may be easily erased during the programming process.
第一方面,本公开实施例提供了一种地址信息处理方法,包括:In a first aspect, an embodiment of the present disclosure provides an address information processing method, including:
从第一分区中读取第一MAC地址,并将所述第一MAC地址作为第一服务器的外网卡的MAC地址;所述第一分区为所述第一服务器的存储设备中所述第一服务器的操作***的内核文件所在的分区;Read the first MAC address from the first partition and use the first MAC address as the MAC address of the external network card of the first server; the first partition is the first in the storage device of the first server The partition where the kernel file of the operating system of the server is located;
根据所述外网卡的MAC地址对应的外网IP地址,与第二服务器进行通信。Communicate with the second server according to the external network IP address corresponding to the MAC address of the external network card.
通过将服务器的MAC地址存储在操作***的内核文件所在的分区中,既避免了存储设备烧写时可能导致的MAC地址丢失,也避免了IP地址浪费, 还避免了每次启动后IP地址发生变化导致的服务器之间的通信不便,提高了服务器之间的通信便利性。By storing the MAC address of the server in the partition where the kernel file of the operating system is located, it not only prevents the MAC address from being lost when the storage device is programmed, but also avoids the IP address from being wasted, and also prevents the IP address from occurring after each startup. The inconvenience in communication between the servers caused by the change improves the communication convenience between the servers.
在一种可能的实现方式中,地址信息处理方法还包括:In a possible implementation manner, the address information processing method further includes:
在所述第一分区中未存储有所述第一MAC地址时,根据所述第一服务器的身份标识,生成所述第一MAC地址,并将所述第一MAC地址存储至所述第一分区中。When the first MAC address is not stored in the first partition, generate the first MAC address according to the identity of the first server, and store the first MAC address to the first In the partition.
通过在第一分区中未存储有第一MAC地址时,生成并存储第一MAC地址,方便第一服务器在后续启动过程中,可直接将存储在第一分区中的第一MAC地址作为第一服务器的MAC地址。By generating and storing the first MAC address when the first MAC address is not stored in the first partition, it is convenient for the first server to directly use the first MAC address stored in the first partition as the first during the subsequent startup process The MAC address of the server.
在一种可能的实现方式中,所述第一服务器包括控制板和算力板,所述算力板中存储有预设字段取值;地址信息处理方法还包括:In a possible implementation manner, the first server includes a control board and a computing power board, and the computing power board stores preset field values; the address information processing method further includes:
根据所述预设字段取值,更新所述控制板的内网卡的IP地址的最后一个字段,使得所述第一服务器的算力板可根据更新后的所述控制板的内网卡的IP地址,与所述控制板进行交互。Update the last field of the IP address of the internal network card of the control board according to the value of the preset field, so that the computing board of the first server can update the IP address of the internal network card of the control board To interact with the control board.
通过根据预设字段取值,更新控制板的内网卡的IP地址的最后一个字段,使得控制板的内网卡具有固定IP地址,方便了第一服务器的算力板与控制板的沟通。By updating the last field of the IP address of the internal network card of the control board according to the value of the preset field, the internal network card of the control board has a fixed IP address, which facilitates communication between the computing board and the control board of the first server.
在一种可能的实现方式中,所述从第一分区中读取第一MAC地址之前,地址信息处理方法还包括:In a possible implementation manner, before reading the first MAC address from the first partition, the address information processing method further includes:
确定所述外网卡分配有IP地址。It is determined that the external network card is assigned an IP address.
通过首先确定外网卡是否分配有IP地址,通过外网卡是否分配有IP地址,确定外网卡是否启动,并在确定外网卡启动时,确定外网卡的MAC地址以及外网IP地址,可避免资源浪费。By first determining whether the external network card is assigned an IP address, whether the external network card is assigned an IP address, determining whether the external network card is activated, and determining the external network card's MAC address and external network IP address when the external network card is started, it can avoid waste of resources .
在一种可能的实现方式中,所述从第一分区中读取第一MAC地址之前,地址信息处理方法还包括:In a possible implementation manner, before reading the first MAC address from the first partition, the address information processing method further includes:
确定触发条件成立,所述触发条件包括下述至少一项:所述第一服务器的内网卡断开连接、所述第一服务器的外网卡断开连接、所述第一服务器启动、所述第一服务器重启。Determine that the trigger condition is established, the trigger condition including at least one of the following: the internal network card of the first server is disconnected, the external network card of the first server is disconnected, the first server is started, the first A server restarts.
在一种可能的实现方式中,所述第一服务器的操作***为Linux***。In a possible implementation manner, the operating system of the first server is a Linux system.
在一种可能的实现方式中,所述第一分区为所述存储设备中的boot1分 区。In a possible implementation manner, the first partition is a boot1 partition in the storage device.
在一种可能的实现方式中,所述预设字段取值为254。In a possible implementation manner, the value of the preset field is 254.
在一种可能的实现方式中,所述第一服务器的身份标识为通用唯一识别码。In a possible implementation manner, the identity of the first server is a universal unique identification code.
第二方面,本公开实施例还提供了一种地址信息处理装置,作为第一服务器,用于执行上述第一方面中任一可能的实现方式中的地址信息处理方法,包括:In a second aspect, an embodiment of the present disclosure also provides an address information processing apparatus, which serves as a first server for executing the address information processing method in any possible implementation manner of the first aspect, including:
MAC地址获取模块,配置为从第一分区中读取第一MAC地址,并将所述第一MAC地址作为第一服务器的外网卡的MAC地址;所述第一分区为所述第一服务器的存储设备中所述第一服务器的操作***的内核文件所在的分区;The MAC address acquisition module is configured to read the first MAC address from the first partition and use the first MAC address as the MAC address of the external network card of the first server; the first partition is the first server's The partition where the kernel file of the operating system of the first server in the storage device is located;
发送模块,配置为根据所述外网卡的MAC地址对应的外网IP地址,与第二服务器进行通信。The sending module is configured to communicate with the second server according to the external network IP address corresponding to the MAC address of the external network card.
在一种可能的实现方式中,所述MAC地址获取模块还配置为,在所述第一分区中未存储有所述第一MAC地址时,根据所述第一服务器的身份标识,生成所述第一MAC地址,并将所述第一MAC地址存储至所述第一分区中。In a possible implementation manner, the MAC address acquisition module is further configured to generate, according to the identity of the first server, when the first MAC address is not stored in the first partition A first MAC address, and store the first MAC address in the first partition.
在一种可能的实现方式中,所述第一服务器包括控制板和算力板,所述算力板中存储有预设字段取值;地址信息处理装置还包括:In a possible implementation manner, the first server includes a control board and a computing power board, and the computing power board stores preset field values; the address information processing device further includes:
IP地址更新模块,配置为根据所述预设字段取值,更新所述控制板的内网卡的IP地址的最后一个字段,使得所述第一服务器的算力板可根据更新后的所述控制板的内网卡的IP地址,与所述控制板进行交互。The IP address update module is configured to update the last field of the IP address of the internal network card of the control board according to the value of the preset field, so that the computing board of the first server can control the updated The IP address of the internal network card of the board interacts with the control board.
在一种可能的实现方式中,地址信息处理装置还包括:In a possible implementation, the address information processing device further includes:
外网卡检测模块,配置为从第一分区中读取第一MAC地址之前,确定所述外网卡是否分配有IP地址。The external network card detection module is configured to determine whether the external network card is assigned an IP address before reading the first MAC address from the first partition.
在一种可能的实现方式中,地址信息处理装置还包括:In a possible implementation, the address information processing device further includes:
触发条件检测模块,配置为从第一分区中读取第一MAC地址之前,确定触发条件成立,所述触发条件包括下述至少一项:所述第一服务器的内网卡断开连接、所述第一服务器的外网卡断开连接、所述第一服务器启动、所述第一服务器重启。The trigger condition detection module is configured to determine that the trigger condition is established before reading the first MAC address from the first partition. The trigger condition includes at least one of the following: the internal network card of the first server is disconnected, the The external network card of the first server is disconnected, the first server is started, and the first server is restarted.
在一种可能的实现方式中,所述第一服务器的操作***为Linux***。In a possible implementation manner, the operating system of the first server is a Linux system.
在一种可能的实现方式中,所述第一分区为所述存储设备中的boot1分区。In a possible implementation manner, the first partition is a boot1 partition in the storage device.
在一种可能的实现方式中,所述预设字段取值为254。In a possible implementation manner, the value of the preset field is 254.
在一种可能的实现方式中,所述第一服务器的身份标识为通用唯一识别码。In a possible implementation manner, the identity of the first server is a universal unique identification code.
第三方面,本公开实施例提供一种电子设备,包括:处理器和存储器;In a third aspect, an embodiment of the present disclosure provides an electronic device, including: a processor and a memory;
至少一个处理器;以及At least one processor; and
与所述至少一个处理器通信连接的存储器;其中,A memory communicatively connected to the at least one processor; wherein,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行时,使所述至少一个处理器执行上述第一方面中任一项所述的方法。The memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, causes the at least one processor to perform the method of any one of the first aspects .
第四方面,本公开实施例提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令设置为执行上述第一方面中任一项所述的方法。According to a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium that stores computer-executable instructions, and the computer-executable instructions are configured to perform the method according to any one of the first aspects.
第五方面,本公开实施例提供一种计算机程序产品,所述计算机程序产品包括存储在计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行上述第一方面中任一项所述的方法。According to a fifth aspect, an embodiment of the present disclosure provides a computer program product, the computer program product including a computer program stored on a computer-readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer So that the computer executes the method described in any one of the first aspects above.
本公开实施例提供的地址信息处理方法、装置、电子设备及存储介质,从第一分区中读取第一MAC地址,并将第一MAC地址作为第一服务器的外网卡的MAC地址,根据外网卡的MAC地址对应的外网IP地址,与第二服务器进行通信。通过将服务器的MAC地址存储在操作***的内核文件所在的分区中,既避免了存储设备烧写时可能导致的MAC地址丢失,也避免了IP地址浪费,还避免了每次启动后IP地址发生变化导致的服务器之间的通信不便,提高了服务器之间的通信便利性。The address information processing method, device, electronic device, and storage medium provided in the embodiments of the present disclosure read the first MAC address from the first partition, and use the first MAC address as the MAC address of the external network card of the first server. The external network IP address corresponding to the MAC address of the network card communicates with the second server. By storing the MAC address of the server in the partition where the kernel file of the operating system is located, it not only prevents the MAC address from being lost when the storage device is programmed, but also avoids the IP address from being wasted, and also prevents the IP address from occurring after each startup. The inconvenience in communication between the servers caused by the change improves the communication convenience between the servers.
附图说明BRIEF DESCRIPTION
一个或多个实施例通过与之对应的附图进行示例性说明,这些示例性说明和附图并不构成对实施例的限定,附图中具有相同参考数字标号的元件示 为类似的元件,附图不构成比例限制,并且其中:One or more embodiments are exemplified by the corresponding drawings. These exemplary descriptions and the drawings do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements. The drawings do not constitute a proportional limitation, and among them:
图1为本公开实施例提供的一种应用场景示意图;FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present disclosure;
图2为本公开实施例提供的地址信息处理方法的流程示意图一;2 is a schematic flowchart 1 of an address information processing method provided by an embodiment of the present disclosure;
图3为本公开实施例提供的地址信息处理方法的流程示意图二;3 is a second schematic flowchart of an address information processing method provided by an embodiment of the present disclosure;
图4为本公开实施例提供的地址信息处理方法的流程示意图三;4 is a third schematic flowchart of an address information processing method provided by an embodiment of the present disclosure;
图5为本公开实施例提供的地址信息处理方法的流程示意图四;5 is a fourth schematic flowchart of an address information processing method according to an embodiment of the present disclosure;
图6为本公开实施例提供的地址信息处理方法的流程示意图五;6 is a schematic flowchart 5 of an address information processing method according to an embodiment of the present disclosure;
图7为本公开实施例提供的地址信息处理装置的结构示意图一;7 is a schematic structural diagram 1 of an address information processing device provided by an embodiment of the present disclosure;
图8为本公开实施例提供的地址信息处理装置的结构示意图二;8 is a second schematic structural diagram of an address information processing device according to an embodiment of the present disclosure;
图9为本公开实施例提供的地址信息处理装置的结构示意图三;9 is a schematic structural diagram 3 of an address information processing device provided by an embodiment of the present disclosure;
图10为本公开实施例提供的地址信息处理装置的结构示意图四;10 is a fourth schematic structural diagram of an address information processing device according to an embodiment of the present disclosure;
图11为本公开实施例提供的电子设备的结构示意图。11 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
具体实施方式detailed description
为了能够更加详尽地了解本公开实施例的特点与技术内容,下面结合附图对本公开实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本公开实施例。在以下的技术描述中,为方便解释起见,通过多个细节以提供对所披露实施例的充分理解。然而,在没有这些细节的情况下,一个或多个实施例仍然可以实施。在其它情况下,为简化附图,熟知的结构和装置可以简化展示。In order to understand the features and technical contents of the embodiments of the present disclosure in more detail, the following describes the implementation of the embodiments of the present disclosure in detail with reference to the drawings. The accompanying drawings are for reference only and are not intended to limit the embodiments of the present disclosure. In the following technical description, for convenience of explanation, various details are provided to provide a sufficient understanding of the disclosed embodiments. However, without these details, one or more embodiments can still be implemented. In other cases, to simplify the drawings, well-known structures and devices can be simplified.
首先,对本公开实施例所涉及的应用场景和部分词汇进行介绍。First, the application scenarios and some vocabulary involved in the embodiments of the present disclosure will be introduced.
图1为本公开实施例提供的一种应用场景示意图。如图1所示,本公开涉及的服务器11包括内网卡12、外网卡13、控制板14和至少一个算力板15。服务器11内部的控制板14和算力板15之间的交互依靠服务器11中的内网卡12,不同服务器11之间的交互需依靠各服务器11中的外网卡13。服务器11之间的交互会用到服务器11的MAC地址,服务器11的MAC地址通常存储在外网卡13的EEPROM中。FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present disclosure. As shown in FIG. 1, the server 11 involved in the present disclosure includes an internal network card 12, an external network card 13, a control board 14 and at least one computing board 15. The interaction between the control board 14 and the computing board 15 inside the server 11 depends on the internal network card 12 in the server 11, and the interaction between different servers 11 depends on the external network card 13 in each server 11. The interaction between the servers 11 will use the MAC address of the server 11, and the MAC address of the server 11 is usually stored in the EEPROM of the external network card 13.
但是,市场上的网卡并不是全都设置有EEPROM,相关技术中,通常将MAC地址存储在服务器11的存储设备的存储分区中,存储分区为存储设备 中的用户可操作分区。当存储设备进行升级或格式化等烧写操作时,仍可能存在MAC地址被擦除的风险。缺少MAC地址的服务器11每次启动时会动态获取一个随机的MAC地址,从而导致在服务器11每次启动时都会重新从路由器上获取新的IP地址,一方面造成了IP地址的浪费,另一方面由于IP地址动态变化使得服务器11之间的交互不方便。However, not all network cards on the market are provided with EEPROM. In the related art, the MAC address is usually stored in the storage partition of the storage device of the server 11, and the storage partition is a user-operable partition in the storage device. When the storage device is being updated or formatted, there may still be a risk of the MAC address being erased. The server 11 lacking a MAC address will dynamically obtain a random MAC address each time it starts, resulting in the server 11 re-acquiring a new IP address from the router each time it is started. On the one hand, due to the dynamic change of the IP address, the interaction between the servers 11 is not convenient.
本公开实施例提供了一种地址信息处理方法、装置、电子设备及存储介质,从第一服务器的操作***的内核文件所在的分区中读取第一MAC地址,并将第一MAC地址作为第一服务器的外网卡的MAC地址,方便第一服务器根据外网卡的MAC地址对应的外网IP地址,与第二服务器进行通信。通过将服务器的MAC地址存储在操作***的内核文件所在的分区中,避免了存储设备烧写时导致的MAC丢失,同时避免了采用动态MAC地址,使得第一服务器的外网IP地址固定,减少了IP地址的浪费,提高了服务器之间的交互便捷性。An embodiment of the present disclosure provides an address information processing method, device, electronic device, and storage medium. The first MAC address is read from the partition where the kernel file of the operating system of the first server is located, and the first MAC address is used as the first The MAC address of the external network card of a server is convenient for the first server to communicate with the second server according to the external network IP address corresponding to the MAC address of the external network card. By storing the MAC address of the server in the partition where the kernel file of the operating system is located, the MAC loss caused by the storage device during programming is avoided, and the use of dynamic MAC addresses is avoided, so that the external network IP address of the first server is fixed and reduced. This saves the waste of IP addresses and improves the convenience of interaction between servers.
下面对本公开实施例的技术方案以及本公开实施例的技术方案如何解决上述技术问题进行详细说明。下面这几个实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。The technical solutions of the embodiments of the present disclosure and how the technical solutions of the embodiments of the present disclosure solve the above technical problems will be described in detail below. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
图2为本公开实施例提供的地址信息处理方法的流程示意图一。本公开实施例提供的地址信息处理方法的执行主体可以为地址信息处理装置,还可以为集成了地址信息处理装置的设备,还可以为如图1中的服务器。下述以执行主体为服务器为例进行说明。如图2所示,地址信息处理方法包括:FIG. 2 is a first schematic flowchart of an address information processing method according to an embodiment of the present disclosure. The execution body of the address information processing method provided by the embodiment of the present disclosure may be an address information processing device, or may be a device integrating the address information processing device, or may be a server as shown in FIG. 1. The following uses the execution body as the server as an example. As shown in FIG. 2, the address information processing method includes:
S101、从第一分区中读取第一MAC地址,并将第一MAC地址作为第一服务器的外网卡的MAC地址。S101. Read the first MAC address from the first partition, and use the first MAC address as the MAC address of the external network card of the first server.
其中,第一分区为第一服务器的存储设备中第一服务器的操作***的内核文件所在的分区。The first partition is a partition where the kernel file of the operating system of the first server is located in the storage device of the first server.
本步骤中,第一服务器包括存储设备,存储设备可以为第一服务器的硬盘。存储设备中根据存储内容的不同划分有第一分区和第二分区。第一分区存储第一服务器上运行的操作***的内核文件,第一服务器启动时,第一服务器从内核文件中读取操作***的相关数据实现操作***配置。第二分区用于存储用户写入的资料数据以及操作***的镜像数据等,可称为存储分区,用户可能会根据需求对存储分区进行升级、格式化等烧写操作,在烧写操作 中,可能会丢失存储在存储分区中的所有数据。In this step, the first server includes a storage device, and the storage device may be a hard disk of the first server. The storage device is divided into a first partition and a second partition according to different storage contents. The first partition stores the kernel file of the operating system running on the first server. When the first server starts, the first server reads relevant data of the operating system from the kernel file to implement operating system configuration. The second partition is used to store the data written by the user and the mirror data of the operating system. It can be called a storage partition. The user may upgrade and format the storage partition according to the needs. During the programming operation, All data stored in the storage partition may be lost.
本实施例中,第一服务器例如在启动时,读取第一分区,查看是否存在一个MAC地址,若存在,则将该MAC地址记为第一MAC地址,可确定第一MAC地址为之前存储的第一服务器的外网卡的MAC地址。通过将MAC地址存储在第一分区中,方便第一服务器在启动时,从操作***的内核文件中读取第一服务器的MAC地址,并将该MAC地址配置为外网卡的MAC地址。避免第一服务器启动时动态获取一个随机的MAC地址,也进而避免了第一服务器所在局域网的路由器根据随机的MAC地址分配新的IP地址。本步骤中,通过在第一服务器启动时,直接将第一分区中读取到的第一MAC地址作为第一服务器的外网卡的MAC地址,可使得第一服务器所在局域网的路由器根据该固定的MAC地址分配固定的IP地址,避免了IP地址浪费,避免了每次启动后IP地址发生变化导致的服务器之间的通信不便,提高了服务器之间的通信便利性。In this embodiment, for example, the first server reads the first partition to check whether there is a MAC address when it is started, and if so, the MAC address is recorded as the first MAC address, and it can be determined that the first MAC address is stored before The MAC address of the external network card of the first server. By storing the MAC address in the first partition, it is convenient for the first server to read the MAC address of the first server from the kernel file of the operating system when it is started, and configure the MAC address as the MAC address of the external network card. It avoids dynamically acquiring a random MAC address when the first server is started, and further avoids that the router of the local area network where the first server is located allocates a new IP address according to the random MAC address. In this step, by directly using the first MAC address read in the first partition as the MAC address of the external network card of the first server when the first server is started, the router of the local area network where the first server is located can The MAC address is assigned a fixed IP address, which avoids the waste of the IP address, avoids the inconvenience of communication between the servers caused by the change of the IP address after each startup, and improves the communication convenience between the servers.
示例性地,第一服务器的操作***可以为Linux***。示例性的,当第一服务器的操作***为Linux***时,第一分区可以为存储设备中的boot1分区。Exemplarily, the operating system of the first server may be a Linux system. Exemplarily, when the operating system of the first server is a Linux system, the first partition may be the boot1 partition in the storage device.
S102、根据外网卡的MAC地址对应的外网IP地址,与第二服务器进行通信。S102. Perform communication with the second server according to the external network IP address corresponding to the MAC address of the external network card.
本步骤中,第一服务器根据获取到的外网卡的MAC地址以及对应的外网IP地址与第二服务器进行通信。其中,第二服务器为除第一服务器外的其他任意服务器。In this step, the first server communicates with the second server according to the obtained MAC address of the external network card and the corresponding external network IP address. Among them, the second server is any other server except the first server.
本公开实施例中,从第一分区中读取第一MAC地址,并将第一MAC地址作为第一服务器的外网卡的MAC地址,根据外网卡的MAC地址对应的外网IP地址,与第二服务器进行通信。通过将服务器的MAC地址存储在操作***的内核文件所在的分区中,既避免了存储设备烧写时可能导致的MAC地址丢失,也避免了IP地址浪费,还避免了每次启动后IP地址发生变化导致的服务器之间的通信不便,提高了服务器之间的通信便利性。In the embodiment of the present disclosure, the first MAC address is read from the first partition, and the first MAC address is used as the MAC address of the external network card of the first server. According to the external network IP address corresponding to the MAC address of the external network card, the The two servers communicate. By storing the MAC address of the server in the partition where the kernel file of the operating system is located, it not only prevents the MAC address from being lost when the storage device is burned, but also avoids the IP address from being wasted, and also prevents the IP address from occurring after each startup. The inconvenience in communication between the servers caused by the change improves the communication convenience between the servers.
图3为本公开实施例提供的地址信息处理方法的流程示意图二。本公开实施例涉及第一分区中未存储有第一MAC地址的情况下的MAC地址的生成过程。如图3所示,地址信息处理方法还包括:FIG. 3 is a second schematic flowchart of an address information processing method according to an embodiment of the present disclosure. The embodiment of the present disclosure relates to a MAC address generation process in the case where the first MAC address is not stored in the first partition. As shown in FIG. 3, the address information processing method further includes:
S201、在第一分区中未存储有第一MAC地址时,根据第一服务器的身份标识,生成第一MAC地址,并将第一MAC地址存储至第一分区中。S201. When the first MAC address is not stored in the first partition, generate a first MAC address according to the identity of the first server, and store the first MAC address in the first partition.
本步骤中,第一服务器在启动时,检测第一分区中是否存储有第一MAC地址。示例性地,在检测时,可检测第一分区中是否存在任一MAC地址。当第一分区中未存储有第一MAC地址时,根据第一服务器的身份标识,生成第一MAC地址,并将生成的第一MAC地址存储至第一分区中。其中,第一MAC地址与第一服务器的身份标识可以具有一一对应关系。示例性地,在第一服务器第一次启动时,可能存在第一分区中未存储有第一MAC地址的情况。通过在第一分区中未存储有第一MAC地址时,生成并存储第一MAC地址,方便第一服务器在后续启动过程中,可直接将存储在第一分区中的第一MAC地址作为第一服务器的MAC地址。In this step, when the first server starts, it detects whether the first MAC address is stored in the first partition. Exemplarily, at the time of detection, it may be detected whether any MAC address exists in the first partition. When the first MAC address is not stored in the first partition, the first MAC address is generated according to the identity of the first server, and the generated first MAC address is stored in the first partition. The first MAC address and the identity of the first server may have a one-to-one correspondence. Exemplarily, when the first server is started for the first time, there may be a case where the first MAC address is not stored in the first partition. By generating and storing the first MAC address when the first MAC address is not stored in the first partition, it is convenient for the first server to directly use the first MAC address stored in the first partition as the first during the subsequent startup process The MAC address of the server.
示例性地,第一服务器的身份标识可以选用第一服务器的通用唯一识别码(Universally Unique Identifier,UUID)。Exemplarily, the identity of the first server may be a universally unique identifier (Universally Unique Identifier, UUID) of the first server.
S202、从第一分区中读取第一MAC地址,并将第一MAC地址作为第一服务器的外网卡的MAC地址。S202. Read the first MAC address from the first partition, and use the first MAC address as the MAC address of the external network card of the first server.
S203、根据外网卡的MAC地址对应的外网IP地址,与第二服务器进行通信。S203. Perform communication with the second server according to the external network IP address corresponding to the MAC address of the external network card.
本公开实施例中的S202和S203与图2所示公开实施例中的S101和S102相同,本公开实施例对此不再赘述。S202 and S203 in the embodiment of the present disclosure are the same as S101 and S102 in the disclosed embodiment shown in FIG. 2, and details are not described in this embodiment of the present disclosure.
本公开实施例中,在第一分区中未存储有第一MAC地址时,根据第一服务器的身份标识,生成第一MAC地址,并将第一MAC地址存储至第一分区中。通过在第一分区中未存储有第一MAC地址时,生成并存储第一MAC地址,方便第一服务器在后续启动过程中,可直接将存储在第一分区中的第一MAC地址作为第一服务器的MAC地址。In the embodiment of the present disclosure, when the first MAC address is not stored in the first partition, the first MAC address is generated according to the identity of the first server, and the first MAC address is stored in the first partition. By generating and storing the first MAC address when the first MAC address is not stored in the first partition, it is convenient for the first server to directly use the first MAC address stored in the first partition as the first during the subsequent startup process The MAC address of the server.
图4为本公开实施例提供的地址信息处理方法的流程示意图三。本公开实施例中服务器包括控制板和算力板,涉及服务器的内网卡的IP地址的配置过程,如图4所示,地址信息处理方法还包括:FIG. 4 is a third schematic flowchart of an address information processing method according to an embodiment of the present disclosure. In the embodiment of the present disclosure, the server includes a control board and a computing board, and relates to the configuration process of the IP address of the internal network card of the server. As shown in FIG. 4, the address information processing method further includes:
S301、根据预设字段取值,更新控制板的内网卡的IP地址的最后一个字段,使得第一服务器的算力板可根据更新后的控制板的内网卡的IP地址,与控制板进行交互。S301. Update the last field of the IP address of the internal network card of the control board according to the value of the preset field, so that the hash board of the first server can interact with the control board according to the updated IP address of the internal network card of the control board .
示例性地,S301与后续S302至S304没有严格的时序关系,还可以在S304之后执行S301,本公开实施例对此不作限定。Exemplarily, S301 has no strict timing relationship with subsequent S302 to S304, and S301 may also be executed after S304, which is not limited in the embodiment of the present disclosure.
本步骤中,在第一服务器内,算力板与控制板通信时依靠算力板与控制板上的网卡,控制板的网卡称为内网卡。为方便算力板快速确定控制板的内网卡的IP地址,考虑到算力板数目有限,可将控制板的内网卡的IP地址的最后一个字段配置为固定数值。例如,当第一服务器内的路由器为控制板和算力板配置IP地址时,可将控制板的内网卡的IP地址配置为156.168.1.X,其中最后一个字段配置为固定数值X,算力板的网卡的IP地址配置为156.168.1.Y,其中Y为与X不同的0-255之间的其他数值。算力板根据配置的IP地址的前三个字段以及固定数值,即可快速确定控制板的内网卡的IP地址。In this step, in the first server, the computing board and the control board rely on the network card on the computing board and the control board when communicating, and the network board on the control board is called an internal network card. In order to facilitate the computing board to quickly determine the IP address of the internal network card of the control board, considering the limited number of computing boards, the last field of the IP address of the internal network card of the control board can be configured as a fixed value. For example, when the router in the first server configures the IP address of the control board and the hash board, the IP address of the internal network card of the control board can be configured as 156.168.1.X, where the last field is configured with a fixed value of X. The IP address of the force card's network card is configured as 156.168.1.Y, where Y is a different value from X to 0-255. According to the first three fields of the configured IP address and fixed values, the hash board can quickly determine the IP address of the internal network card of the control board.
示例性地,第一服务器中的路由器在为控制板和算力板配置IP地址时,考虑到可能存在与第一服务器所属的局域网中的路由器为外网卡配置的IP地址相冲突的情况,可先确定第一服务器所属的局域网中的路由器为外网卡配置的IP地址的网段,例如根据IP地址的前三个字段可确定网段为156.158.0.1-255,然后将控制板和算力板配置的网卡配置在不同的网段,例如,156.158.1.1-255。Exemplarily, when the router in the first server configures the IP address for the control board and the computing board, considering that there may be a conflict with the IP address configured for the external network card by the router in the local area network to which the first server belongs, the First determine that the router in the LAN to which the first server belongs is the network segment of the IP address configured by the external network card. For example, according to the first three fields of the IP address, the network segment can be determined as 156.158.0.1-255, and then the control board and the computing board The configured network card is configured on different network segments, for example, 156.158.1.1-255.
示例性地,预设字段取值可以为254。考虑到第一服务器内的路由器在为算力板配置IP地址时,通常采用从小到大的原则进行配置,预设字段取值越大,越可以避免路由器为算力板配置的IP地址与控制板的IP地址冲突。Exemplarily, the value of the preset field may be 254. Considering that when the router in the first server configures the IP address for the computing board, the principle of small to large is usually used for configuration. The larger the value of the preset field, the more you can avoid the IP address and control that the router configures for the computing board. The board's IP address conflicts.
S302、从第一分区中读取第一MAC地址,并将第一MAC地址作为第一服务器的外网卡的MAC地址。S302. Read the first MAC address from the first partition, and use the first MAC address as the MAC address of the external network card of the first server.
S303、根据外网卡的MAC地址对应的外网IP地址,与第二服务器进行通信。S303. Perform communication with the second server according to the external network IP address corresponding to the MAC address of the external network card.
本公开实施例中的S302和S303与图2所示公开实施例中的S101和S102相同,本公开实施例对此不再赘述。S302 and S303 in the embodiment of the present disclosure are the same as S101 and S102 in the disclosed embodiment shown in FIG. 2, and details are not described in this embodiment of the present disclosure.
本公开实施例,根据预设字段取值,更新控制板的内网卡的IP地址的最后一个字段,使得第一服务器的算力板可根据更新后的控制板的内网卡的IP地址,与控制板进行交互。通过根据预设字段取值,更新控制板的内网卡的IP地址的最后一个字段,使得控制板的内网卡具有固定IP地址,方便了第一 服务器的算力板与控制板的沟通。In the embodiment of the present disclosure, the last field of the IP address of the internal network card of the control board is updated according to the value of the preset field, so that the computing board of the first server can control and control the IP address of the internal network card of the updated control board Board to interact. By updating the last field of the IP address of the internal network card of the control board according to the value of the preset field, the internal network card of the control board has a fixed IP address, which facilitates the communication between the computing board and the control board of the first server.
图5为本公开实施例提供的地址信息处理方法的流程示意图四。本公开实施例在确定外网卡的IP地址之前还需先确定外网卡是否启动。如图5所示,地址信息处理方法包括:FIG. 5 is a fourth schematic flowchart of an address information processing method according to an embodiment of the present disclosure. In the embodiment of the present disclosure, before determining the IP address of the external network card, it is further necessary to determine whether the external network card is activated. As shown in FIG. 5, the address information processing method includes:
S401、确定外网卡分配有IP地址。S401. Determine that an IP address is allocated to the external network card.
本步骤中,在执行S402和S403之前,先确定外网卡是否启动,当外网卡启动时,再执行S402和S403。示例性地,当外网卡未启动(例如,外网卡未与网线连接,外网卡故障等)时,可不执行下述S402和S403,可避免第一服务器执行不必要的步骤,减少资源浪费。示例性地,考虑到第一服务器启动,外网卡正常时,第一服务器所属局域网的路由器会立即为外网卡分配一个动态IP地址,故可通过确定外网卡是否分配有IP地址确定外网卡是否启动,当外网卡分配有IP地址时确定外网卡启动;当外网卡未分配有IP地址时确定外网卡未启动。In this step, before performing S402 and S403, first determine whether the external network card is activated, and when the external network card is activated, then execute S402 and S403. Exemplarily, when the external network card is not started (for example, the external network card is not connected to the network cable, the external network card is faulty, etc.), the following S402 and S403 may not be performed, which may prevent the first server from performing unnecessary steps and reduce waste of resources. Exemplarily, considering that the first server is started, when the external network card is normal, the router of the local area network to which the first server belongs will immediately assign a dynamic IP address to the external network card, so it can be determined whether the external network card is activated by determining whether the external network card is assigned an IP address , When the external network card is assigned an IP address, it is determined that the external network card is started; when the external network card is not assigned an IP address, it is determined that the external network card is not started.
S402、从第一分区中读取第一MAC地址,并将第一MAC地址作为第一服务器的外网卡的MAC地址。S402. Read the first MAC address from the first partition, and use the first MAC address as the MAC address of the external network card of the first server.
S403、根据外网卡的MAC地址对应的外网IP地址,与第二服务器进行通信。S403. Perform communication with the second server according to the external network IP address corresponding to the MAC address of the external network card.
本公开实施例中的S402和S403与图2所示公开实施例中的S101和S102相同,本公开实施例对此不再赘述。S402 and S403 in the embodiment of the present disclosure are the same as S101 and S102 in the disclosed embodiment shown in FIG. 2, and details are not described in this embodiment of the present disclosure.
本公开实施例在确定第一服务器的外网卡的外网IP地址之前,首先确定外网卡是否分配有IP地址,通过外网卡是否分配有IP地址,确定外网卡是否启动,并在确定外网卡启动时,确定外网卡的MAC地址以及外网IP地址,可避免资源浪费。In the embodiment of the present disclosure, before determining the external network IP address of the external network card of the first server, first determine whether the external network card is assigned an IP address, determine whether the external network card is activated by determining whether the external network card is activated, and determine whether the external network card is activated When determining the MAC address of the external network card and the IP address of the external network, you can avoid wasting resources.
图6为本公开实施例提供的地址信息处理方法的流程示意图五。本公开实施例涉及地址信息处理方法的触发条件。如图6所示,地址信息处理方法包括:FIG. 6 is a schematic flowchart 5 of an address information processing method according to an embodiment of the present disclosure. The embodiment of the present disclosure relates to the trigger condition of the address information processing method. As shown in FIG. 6, the address information processing method includes:
S501、确定触发条件成立。S501. Determine that the trigger condition is established.
其中,触发条件包括下述至少一项:第一服务器的内网卡断开连接、第一服务器的外网卡断开连接、第一服务器启动、第一服务器重启。The trigger condition includes at least one of the following: the internal network card of the first server is disconnected, the external network card of the first server is disconnected, the first server is started, and the first server is restarted.
本步骤中,第一服务器在检测到内网卡断开连接或者外网卡断开连接时, 执行下述S502至S506,或者当第一服务器启动/重启时,执行下述S502至S506。In this step, when detecting that the internal network card is disconnected or the external network card is disconnected, the first server executes the following S502 to S506, or when the first server is started/restarted, executes the following S502 to S506.
S502、根据预设字段取值,更新控制板的内网卡的IP地址的最后一个字段,使得第一服务器的算力板可根据更新后的控制板的内网卡的IP地址,与控制板进行交互。S502. Update the last field of the IP address of the internal network card of the control board according to the value of the preset field, so that the hash board of the first server can interact with the control board according to the updated IP address of the internal network card of the control board .
S503、确定外网卡是否分配有IP地址。S503. Determine whether an IP address is assigned to the external network card.
S504、在第一分区中未存储有第一MAC地址时,根据第一服务器的身份标识,生成第一MAC地址,并将第一MAC地址存储至第一分区中。S504. When the first MAC address is not stored in the first partition, generate a first MAC address according to the identity of the first server, and store the first MAC address in the first partition.
S505、从第一分区中读取第一MAC地址,并将第一MAC地址作为第一服务器的外网卡的MAC地址。S505. Read the first MAC address from the first partition, and use the first MAC address as the MAC address of the external network card of the first server.
S506、根据外网卡的MAC地址对应的外网IP地址,与第二服务器进行通信。S506. Perform communication with the second server according to the external network IP address corresponding to the MAC address of the external network card.
本公开实施例中的S502至S506与上述各公开实施例中的步骤相同,本公开实施例对此不再赘述。The steps S502 to S506 in the embodiment of the present disclosure are the same as the steps in the above disclosed embodiments, which will not be repeated in the embodiments of the present disclosure.
本公开实施例在检测到内网卡断开连接或者外网卡断开连接,或者当第一服务器启动/重启时,确定外网卡的MAC地址以及MAC地址对应的IP地址,还同时可确定内网卡的IP地址,确保了第一服务器的内外网卡均为固定IP地址,方便了第一服务器内部和外部的通信。In the embodiment of the present disclosure, when the internal network card is disconnected or the external network card is disconnected, or when the first server is started/restarted, the MAC address of the external network card and the IP address corresponding to the MAC address are determined, and the internal network card can also be determined The IP address ensures that the internal and external network cards of the first server are all fixed IP addresses, which facilitates the internal and external communication of the first server.
图7为本公开实施例提供的地址信息处理装置的结构示意图一。该地址信息处理装置可以通过软件、硬件或者两者的结合实现地址信息处理装置的部分或者全部。示例性的,该地址信息处理装置可以为如图1所示的第一服务器。如图7所示,该地址信息处理装置可以包括:FIG. 7 is a schematic structural diagram 1 of an address information processing device provided by an embodiment of the present disclosure. The address information processing apparatus may implement part or all of the address information processing apparatus through software, hardware, or a combination of both. Exemplarily, the address information processing device may be the first server shown in FIG. 1. As shown in FIG. 7, the address information processing apparatus may include:
MAC地址获取模块11,配置为从第一分区中读取第一MAC地址,并将第一MAC地址作为第一服务器的外网卡的MAC地址;第一分区为第一服务器的存储设备中第一服务器的操作***的内核文件所在的分区;The MAC address acquisition module 11 is configured to read the first MAC address from the first partition and use the first MAC address as the MAC address of the external network card of the first server; the first partition is the first in the storage device of the first server The partition where the kernel file of the operating system of the server is located;
发送模块12,配置为根据外网卡的MAC地址对应的外网IP地址,与第二服务器进行通信。The sending module 12 is configured to communicate with the second server according to the external network IP address corresponding to the MAC address of the external network card.
在一种可能的实现方式中,MAC地址获取模块还配置为,在第一分区中未存储有第一MAC地址时,根据第一服务器的身份标识,生成第一MAC地址,并将第一MAC地址存储至第一分区中。In a possible implementation manner, the MAC address acquisition module is further configured to generate the first MAC address according to the identity of the first server when the first MAC address is not stored in the first partition, and convert the first MAC address The address is stored in the first partition.
图8为本公开实施例提供的地址信息处理装置的结构示意图二。在上述实例的基础上,如图8所示,第一服务器包括控制板和算力板,算力板中存储有预设字段取值;地址信息处理装置还包括:FIG. 8 is a second structural diagram of an address information processing device provided by an embodiment of the present disclosure. On the basis of the above example, as shown in FIG. 8, the first server includes a control board and a hash board, and the preset value of the field is stored in the hash board; the address information processing device further includes:
IP地址更新模块13,配置为根据预设字段取值,更新控制板的内网卡的IP地址的最后一个字段,使得第一服务器的算力板可根据更新后的控制板的内网卡的IP地址,与控制板进行交互。The IP address update module 13 is configured to update the last field of the IP address of the internal network card of the control board according to the value of the preset field, so that the computing board of the first server can use the updated IP address of the internal network card of the control board To interact with the control panel.
图9为本公开实施例提供的地址信息处理装置的结构示意图三。在上述实例的基础上,如图9所示,地址信息处理装置还包括:9 is a third structural diagram of an address information processing device provided by an embodiment of the present disclosure. Based on the above example, as shown in FIG. 9, the address information processing device further includes:
外网卡检测模块14,配置为从第一分区中读取第一MAC地址之前,确定外网卡是否分配有IP地址。The external network card detection module 14 is configured to determine whether the external network card is assigned an IP address before reading the first MAC address from the first partition.
图10为本公开实施例提供的地址信息处理装置的结构示意图四。在上述实例的基础上,如图10所示,地址信息处理装置还包括:FIG. 10 is a fourth structural diagram of an address information processing apparatus provided by an embodiment of the present disclosure. Based on the above example, as shown in FIG. 10, the address information processing device further includes:
触发条件检测模块15,配置为从第一分区中读取第一MAC地址之前,确定触发条件成立,触发条件包括下述至少一项:第一服务器的内网卡断开连接、第一服务器的外网卡断开连接、第一服务器启动、第一服务器重启。The trigger condition detection module 15 is configured to determine that the trigger condition is established before reading the first MAC address from the first partition. The trigger condition includes at least one of the following: the internal network card of the first server is disconnected, and the external of the first server The network card is disconnected, the first server is started, and the first server is restarted.
在一种可能的实现方式中,第一服务器的操作***为Linux***。In a possible implementation manner, the operating system of the first server is a Linux system.
在一种可能的实现方式中,第一分区为第一服务器的存储设备中的boot1分区。In a possible implementation manner, the first partition is a boot1 partition in the storage device of the first server.
在一种可能的实现方式中,预设字段取值为254。In a possible implementation, the preset field value is 254.
在一种可能的实现方式中,第一服务器的身份标识为UUID。In a possible implementation, the identity of the first server is UUID.
本公开实施例还提供了一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令设置为执行上述地址信息处理方法方法。Embodiments of the present disclosure also provide a computer-readable storage medium that stores computer-executable instructions that are configured to perform the above address information processing method.
本公开实施例还提供了一种计算机程序产品,所述计算机程序产品包括存储在计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行上述地址信息处理方法方法。An embodiment of the present disclosure also provides a computer program product. The computer program product includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the The computer executes the above address information processing method.
上述的计算机可读存储介质可以是暂态计算机可读存储介质,也可以是非暂态计算机可读存储介质。The aforementioned computer-readable storage medium may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
本公开实施例还提供了一种电子设备,图11为本公开实施例提供的电子设备的结构示意图。如图11所示,该电子设备包括:An embodiment of the present disclosure also provides an electronic device. FIG. 11 is a schematic structural diagram of the electronic device according to an embodiment of the present disclosure. As shown in FIG. 11, the electronic device includes:
至少一个处理器(processor)110,图11中以一个处理器110为例;和存储器(memory)111,还可以包括通信接口(Communication Interface)112和总线113。其中,处理器110、通信接口112、存储器111可以通过总线113完成相互间的通信。通信接口112可以用于信息传输。处理器110可以调用存储器111中的逻辑指令,以执行上述实施例的地址信息处理方法。At least one processor (processor) 110, one processor 110 is taken as an example in FIG. 11; and the memory (memory) 111 may further include a communication interface (Communication) Interface 112 and a bus 113. Among them, the processor 110, the communication interface 112, and the memory 111 can complete communication with each other through the bus 113. The communication interface 112 may be used for information transmission. The processor 110 may call logic instructions in the memory 111 to execute the address information processing method of the above-mentioned embodiment.
此外,上述的存储器111中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。In addition, the logic instructions in the memory 111 described above can be implemented in the form of software functional units and when sold or used as an independent product, they can be stored in a computer-readable storage medium.
存储器111作为一种计算机可读存储介质,可用于存储软件程序、计算机可执行程序,如本公开实施例中的方法对应的程序指令/模块。处理器110通过运行存储在存储器111中的软件程序、指令以及模块,从而执行功能应用以及数据处理,即实现上述方法实施例中的地址信息处理方法。The memory 111 is a computer-readable storage medium and can be used to store software programs and computer-executable programs, such as program instructions/modules corresponding to the methods in the embodiments of the present disclosure. The processor 110 executes functional applications and data processing by running software programs, instructions, and modules stored in the memory 111, that is, implementing the address information processing method in the foregoing method embodiment.
存储器111可包括存储程序区和存储数据区,其中,存储程序区可存储操作***、至少一个功能所需的应用程序;存储数据区可存储根据终端设备的使用所创建的数据等。此外,存储器111可以包括高速随机存取存储器,还可以包括非易失性存储器。The memory 111 may include a storage program area and a storage data area, where the storage program area may store an operating system and application programs required for at least one function; the storage data area may store data created according to the use of a terminal device and the like. In addition, the memory 111 may include a high-speed random access memory, and may also include a non-volatile memory.
本领域普通技术人员可以理解,在本公开的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本公开实施例的实施过程构成任何限定。A person of ordinary skill in the art may understand that in various embodiments of the present disclosure, the size of the sequence numbers of the above processes does not mean the order of execution order, and the execution order of each process should be determined by its function and internal logic, and not There should be no limitation on the implementation process of the embodiments of the present disclosure.
本公开实施例的技术方案可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括一个或多个指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开实施例所述方法的全部或部分步骤。而前述的存储介质可以是非暂态存储介质,包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等多种可以存储程序代码的介质,也可以是暂态存储介质。The technical solutions of the embodiments of the present disclosure may be embodied in the form of software products, which are stored in a storage medium and include one or more instructions to make a computer device (which may be a personal computer, server, or network) Equipment, etc.) to perform all or part of the steps of the method described in the embodiments of the present disclosure. The aforementioned storage medium may be a non-transitory storage medium, including: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc. A medium that can store program codes may also be a transient storage medium.
当用于本公开实施例中时,虽然术语“第一”、“第二”等可能会在本公开实施例中使用以描述各元件,但这些元件不应受到这些术语的限制。这些术语仅用于将一个元件与另一个元件区别开。比如,在不改变描述的含义的情况下,第一元件可以叫做第二元件,并且同样第,第二元件可以叫做第一 元件,只要所有出现的“第一元件”一致重命名并且所有出现的“第二元件”一致重命名即可。第一元件和第二元件都是元件,但可以不是相同的元件。When used in embodiments of the present disclosure, although the terms "first", "second", etc. may be used in the embodiments of the present disclosure to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, without changing the meaning of the description, the first element can be called the second element, and likewise, the second element can be called the first element, as long as all occurrences of the "first element" are consistently renamed and all occurrences of The "second component" can be renamed consistently. The first element and the second element are both elements, but they may not be the same element.
本公开实施例中使用的用词仅用于描述实施例并且不用于限制权利要求。如在实施例以及权利要求的描述中使用的,除非上下文清楚地表明,否则单数形式的“一个”(a)、“一个”(an)和“所述”(the)旨在同样包括复数形式。类似地,如在本公开实施例中所使用的术语“和/或”是指包含一个或一个以上相关联的列出的任何以及所有可能的组合。另外,当用于本公开实施例中时,术语“包括”(comprise)及其变型“包括”(comprises)和/或包括(comprising)等指陈述的特征、整体、步骤、操作、元素,和/或组件的存在,但不排除一个或一个以上其它特征、整体、步骤、操作、元素、组件和/或这些的分组的存在或添加。The terms used in the embodiments of the present disclosure are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "said" are intended to include plural forms as well . Similarly, the term "and/or" as used in embodiments of the present disclosure is meant to include any and all possible combinations of one or more associated lists. In addition, when used in the embodiments of the present disclosure, the term "comprise" and its variations "comprises" and/or includes refers to the stated features, wholes, steps, operations, elements, and The presence of/or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and/or groups of these.
所描述的实施例中的各方面、实施方式、实现或特征能够单独使用或以任意组合的方式使用。所描述的实施例中的各方面可由软件、硬件或软硬件的结合实现。所描述的实施例也可以由存储有计算机可读代码的计算机可读介质体现,该计算机可读代码包括可由至少一个计算装置执行的指令。所述计算机可读介质可与任何能够存储数据的数据存储装置相关联,该数据可由计算机***读取。用于举例的计算机可读介质可以包括只读存储器、随机存取存储器、CD-ROM、HDD、DVD、磁带以及光数据存储装置等。所述计算机可读介质还可以分布于通过网络联接的计算机***中,这样计算机可读代码就可以分布式存储并执行。The various aspects, implementations, implementations or features in the described embodiments can be used alone or in any combination. Various aspects in the described embodiments may be implemented by software, hardware, or a combination of software and hardware. The described embodiments may also be embodied by a computer-readable medium that stores computer-readable code including instructions executable by at least one computing device. The computer-readable medium can be associated with any data storage device capable of storing data, which can be read by a computer system. Computer-readable media used for examples may include read-only memory, random access memory, CD-ROM, HDD, DVD, magnetic tape, optical data storage devices, and the like. The computer-readable medium may also be distributed in computer systems connected through a network, so that computer-readable codes can be stored and executed in a distributed manner.
上述技术描述可参照附图,这些附图形成了本公开实施例的一部分,并且通过描述在附图中示出了依照所描述的实施例的实施方式。虽然这些实施例描述的足够详细以使本领域技术人员能够实现这些实施例,但这些实施例是非限制性的;这样就可以使用其它的实施例,并且在不脱离所描述的实施例的范围的情况下还可以做出变化。比如,流程图中所描述的操作顺序是非限制性的,因此在流程图中阐释并且根据流程图描述的两个或两个以上操作的顺序可以根据若干实施例进行改变。作为另一个例子,在若干实施例中,在流程图中阐释并且根据流程图描述的一个或一个以上操作是可选的,或是可删除的。另外,某些步骤或功能可以添加到所公开的实施例中,或两个以上的步骤顺序被置换。所有这些变化被认为包含在所公开的实施例以及权利 要求中。The above technical description may refer to the accompanying drawings, which form part of the embodiments of the present disclosure, and the description shows an implementation according to the described embodiments in the drawings. Although these embodiments are described in sufficient detail to enable those skilled in the art to implement these embodiments, these embodiments are non-limiting; so that other embodiments can be used without departing from the scope of the described embodiments Changes can also be made under circumstances. For example, the sequence of operations described in the flowchart is non-limiting, so the sequence of two or more operations explained in the flowchart and described according to the flowchart may be changed according to several embodiments. As another example, in several embodiments, one or more operations illustrated in the flowchart and described in accordance with the flowchart are optional or may be deleted. In addition, certain steps or functions may be added to the disclosed embodiments, or two or more steps may be replaced in sequence. All these changes are considered to be included in the disclosed embodiments and claims.
另外,上述技术描述中使用术语以提供所描述的实施例的透彻理解。然而,并不需要过于详细的细节以实现所描述的实施例。因此,实施例的上述描述是为了阐释和描述而呈现的。上述描述中所呈现的实施例以及根据这些实施例所公开的例子是单独提供的,以添加上下文并有助于理解所描述的实施例。上述说明书不用于做到无遗漏或将所描述的实施例限制到本公开的精确形式。根据上述教导,若干修改、选择适用以及变化是可行的。在某些情况下,没有详细描述为人所熟知的处理步骤以避免不必要地影响所描述的实施例。In addition, terminology is used in the above technical description to provide a thorough understanding of the described embodiments. However, no excessively detailed details are required to implement the described embodiments. Therefore, the above description of the embodiments is presented for explanation and description. The embodiments presented in the above description and the examples disclosed according to these embodiments are provided separately to add context and help to understand the described embodiments. The above description is not intended to be without omission or to limit the described embodiments to the precise form of this disclosure. Based on the above teachings, several modifications, choices and changes are possible. In some cases, well-known processing steps are not described in detail to avoid unnecessarily affecting the described embodiments.

Claims (21)

  1. 一种地址信息处理方法,其特征在于,包括:An address information processing method, characterized in that it includes:
    从第一分区中读取第一MAC地址,并将所述第一MAC地址作为第一服务器的外网卡的MAC地址;所述第一分区为所述第一服务器的存储设备中所述第一服务器的操作***的内核文件所在的分区;Read the first MAC address from the first partition and use the first MAC address as the MAC address of the external network card of the first server; the first partition is the first in the storage device of the first server The partition where the kernel file of the operating system of the server is located;
    根据所述外网卡的MAC地址对应的外网IP地址,与第二服务器进行通信。Communicate with the second server according to the external network IP address corresponding to the MAC address of the external network card.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    在所述第一分区中未存储有所述第一MAC地址时,根据所述第一服务器的身份标识,生成所述第一MAC地址,并将所述第一MAC地址存储至所述第一分区中。When the first MAC address is not stored in the first partition, generate the first MAC address according to the identity of the first server, and store the first MAC address to the first In the partition.
  3. 根据权利要求1所述的方法,其特征在于,所述第一服务器包括控制板和算力板,所述算力板中存储有预设字段取值;所述方法还包括:The method according to claim 1, wherein the first server includes a control board and a computing power board, and the computing power board stores preset field values; the method further includes:
    根据所述预设字段取值,更新所述控制板的内网卡的IP地址的最后一个字段,使得所述第一服务器的算力板可根据更新后的所述控制板的内网卡的IP地址,与所述控制板进行交互。Update the last field of the IP address of the internal network card of the control board according to the value of the preset field, so that the computing board of the first server can update the IP address of the internal network card of the control board To interact with the control board.
  4. 根据权利要求1所述的方法,其特征在于,所述从第一分区中读取第一MAC地址之前,所述方法还包括:The method according to claim 1, wherein before the first MAC address is read from the first partition, the method further comprises:
    确定所述外网卡分配有IP地址。It is determined that the external network card is assigned an IP address.
  5. 根据权利要求1-4中任一项所述的方法,其特征在于,所述从第一分区中读取第一MAC地址之前,所述方法还包括:The method according to any one of claims 1 to 4, wherein before the first MAC address is read from the first partition, the method further comprises:
    确定触发条件成立,所述触发条件包括下述至少一项:所述第一服务器的内网卡断开连接、所述第一服务器的外网卡断开连接、所述第一服务器启动、所述第一服务器重启。Determine that the trigger condition is established, the trigger condition including at least one of the following: the internal network card of the first server is disconnected, the external network card of the first server is disconnected, the first server is started, the first A server restarts.
  6. 根据权利要求1-4中任一项所述的方法,其特征在于,所述第一服务器的操作***为Linux***。The method according to any one of claims 1 to 4, wherein the operating system of the first server is a Linux system.
  7. 根据权利要求6所述的方法,其特征在于,所述第一分区为所述存储设备中的boot1分区。The method according to claim 6, wherein the first partition is a boot1 partition in the storage device.
  8. 根据权利要求3所述的方法,其特征在于,所述预设字段取值为254。The method according to claim 3, wherein the value of the preset field is 254.
  9. 根据权利要求1-4中任一项所述的方法,其特征在于,所述第一服务器的身份标识为通用唯一识别码。The method according to any one of claims 1-4, wherein the identity of the first server is a universal unique identification code.
  10. 一种地址信息处理装置,作为第一服务器,其特征在于,包括:An address information processing device, as a first server, is characterized by comprising:
    MAC地址获取模块,配置为从第一分区中读取第一MAC地址,并将所述第一MAC地址作为第一服务器的外网卡的MAC地址;所述第一分区为所述第一服务器的存储设备中所述第一服务器的操作***的内核文件所在的分区;The MAC address acquisition module is configured to read the first MAC address from the first partition and use the first MAC address as the MAC address of the external network card of the first server; the first partition is the first server's The partition where the kernel file of the operating system of the first server in the storage device is located;
    发送模块,配置为根据所述外网卡的MAC地址对应的外网IP地址,与第二服务器进行通信。The sending module is configured to communicate with the second server according to the external network IP address corresponding to the MAC address of the external network card.
  11. 根据权利要求10所述的装置,其特征在于,所述MAC地址获取模块还配置为,在所述第一分区中未存储有所述第一MAC地址时,根据所述第一服务器的身份标识,生成所述第一MAC地址,并将所述第一MAC地址存储至所述第一分区中。The apparatus according to claim 10, wherein the MAC address acquisition module is further configured to, according to the identity of the first server when the first MAC address is not stored in the first partition , Generate the first MAC address, and store the first MAC address in the first partition.
  12. 根据权利要求10所述的装置,其特征在于,所述第一服务器包括控制板和算力板,所述算力板中存储有预设字段取值;所述装置还包括:The device according to claim 10, wherein the first server includes a control board and a computing power board, and the computing power board stores preset field values; the device further includes:
    IP地址更新模块,配置为根据所述预设字段取值,更新所述控制板的内网卡的IP地址的最后一个字段,使得所述第一服务器的算力板可根据更新后的所述控制板的内网卡的IP地址,与所述控制板进行交互。The IP address update module is configured to update the last field of the IP address of the internal network card of the control board according to the value of the preset field, so that the computing board of the first server can control the updated The IP address of the internal network card of the board interacts with the control board.
  13. 根据权利要求10所述的装置,其特征在于,所述装置还包括:The device of claim 10, wherein the device further comprises:
    外网卡检测模块,配置为从第一分区中读取第一MAC地址之前,确定所述外网卡是否分配有IP地址。The external network card detection module is configured to determine whether the external network card is assigned an IP address before reading the first MAC address from the first partition.
  14. 根据权利要求10-13中任一项所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 10-13, wherein the device further comprises:
    触发条件检测模块,配置为从第一分区中读取第一MAC地址之前,确定触发条件成立,所述触发条件包括下述至少一项:所述第一服务器的内网卡断开连接、所述第一服务器的外网卡断开连接、所述第一服务器启动、所述第一服务器重启。The trigger condition detection module is configured to determine that the trigger condition is established before reading the first MAC address from the first partition. The trigger condition includes at least one of the following: the internal network card of the first server is disconnected, the The external network card of the first server is disconnected, the first server is started, and the first server is restarted.
  15. 根据权利要求10-13中任一项所述的装置,其特征在于,所述第一服务器的操作***为Linux***。The device according to any one of claims 10-13, wherein the operating system of the first server is a Linux system.
  16. 根据权利要求15所述的装置,其特征在于,所述第一分区为所述存储设备中的boot1分区。The apparatus according to claim 15, wherein the first partition is a boot1 partition in the storage device.
  17. 根据权利要求12所述的装置,其特征在于,所述预设字段取值为254。The apparatus according to claim 12, wherein the value of the preset field is 254.
  18. 根据权利要求10-13中任一项所述的装置,其特征在于,所述第一服务器的身份标识为通用唯一识别码。The apparatus according to any one of claims 10-13, wherein the identity of the first server is a universal unique identification code.
  19. 一种电子设备,其特征在于,包括:至少一个处理器;以及与所述至少一个处理器通信连接的存储器;其中,An electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行时,使所述至少一个处理器执行权利要求1-9中任一项所述的方法。The memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, causes the at least one processor to execute any one of claims 1-9 method.
  20. 一种计算机可读存储介质,其特征在于,存储有计算机可执行指令,所述计算机可执行指令设置为执行权利要求1-9中任一项所述的方法。A computer-readable storage medium, characterized in that computer-executable instructions are stored, the computer-executable instructions being configured to perform the method of any one of claims 1-9.
  21. 一种计算机程序产品,其特征在于,所述计算机程序产品包括存储在计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行权利要求1-9中任一项所述的方法。A computer program product, characterized in that the computer program product includes a computer program stored on a computer-readable storage medium, the computer program includes program instructions, and when the program instructions are executed by a computer, the computer Performing the method of any one of claims 1-9.
PCT/CN2018/119413 2018-12-05 2018-12-05 Address information processing method and apparatus, electronic device, and storage medium WO2020113478A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/119413 WO2020113478A1 (en) 2018-12-05 2018-12-05 Address information processing method and apparatus, electronic device, and storage medium
CN201880098358.9A CN112930664B (en) 2018-12-05 2018-12-05 Address information processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/119413 WO2020113478A1 (en) 2018-12-05 2018-12-05 Address information processing method and apparatus, electronic device, and storage medium

Publications (1)

Publication Number Publication Date
WO2020113478A1 true WO2020113478A1 (en) 2020-06-11

Family

ID=70974498

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/119413 WO2020113478A1 (en) 2018-12-05 2018-12-05 Address information processing method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN112930664B (en)
WO (1) WO2020113478A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112073556A (en) * 2020-09-15 2020-12-11 成都申威科技有限责任公司 MAC address programming method for batch network cards, storage medium and terminal
CN112134702A (en) * 2020-10-29 2020-12-25 北京邮电大学 Method and device for sending and receiving vehicle intranet safety communication
CN113726897A (en) * 2021-09-01 2021-11-30 马上消费金融股份有限公司 Data processing method, device and equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101156408A (en) * 2005-04-01 2008-04-02 国际商业机器公司 Network communications for operating system partitions
CN106301959A (en) * 2016-10-10 2017-01-04 烽火通信科技股份有限公司 Gateway batch upgrading method based on WINDOWS and LINUX platform and system
CN106789168A (en) * 2016-11-28 2017-05-31 华为技术有限公司 A kind of data center server manages the dispositions method and frame top formula interchanger of network
US20170170990A1 (en) * 2015-12-15 2017-06-15 Microsoft Technology Licensing, Llc Scalable Tenant Networks

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101156408A (en) * 2005-04-01 2008-04-02 国际商业机器公司 Network communications for operating system partitions
US20170170990A1 (en) * 2015-12-15 2017-06-15 Microsoft Technology Licensing, Llc Scalable Tenant Networks
CN106301959A (en) * 2016-10-10 2017-01-04 烽火通信科技股份有限公司 Gateway batch upgrading method based on WINDOWS and LINUX platform and system
CN106789168A (en) * 2016-11-28 2017-05-31 华为技术有限公司 A kind of data center server manages the dispositions method and frame top formula interchanger of network

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112073556A (en) * 2020-09-15 2020-12-11 成都申威科技有限责任公司 MAC address programming method for batch network cards, storage medium and terminal
CN112073556B (en) * 2020-09-15 2021-11-09 成都申威科技有限责任公司 MAC address programming method for batch network cards, storage medium and terminal
CN112134702A (en) * 2020-10-29 2020-12-25 北京邮电大学 Method and device for sending and receiving vehicle intranet safety communication
CN112134702B (en) * 2020-10-29 2022-02-15 北京邮电大学 Method and device for sending and receiving vehicle intranet safety communication
CN113726897A (en) * 2021-09-01 2021-11-30 马上消费金融股份有限公司 Data processing method, device and equipment
CN113726897B (en) * 2021-09-01 2024-04-19 马上消费金融股份有限公司 Data processing method, device and equipment

Also Published As

Publication number Publication date
CN112930664A (en) 2021-06-08
CN112930664B (en) 2023-06-23

Similar Documents

Publication Publication Date Title
EP4113291B1 (en) Request processing method, system on chip, and public cloud management component
US9009453B2 (en) Network storage target boot and network connectivity through a common network device
US20150074386A1 (en) Boot method and boot system
US10917291B2 (en) RAID configuration
WO2020113478A1 (en) Address information processing method and apparatus, electronic device, and storage medium
CN108509215B (en) System software replacing method and device, terminal equipment and storage medium
US20180046399A1 (en) Storage Partitioning Method and Terminal
US10235048B2 (en) Data processing method and smart device
US20230221784A1 (en) System and method for power state enforced subscription management
US11671379B1 (en) System and method for subscription management using dynamically composed management entities
KR101821016B1 (en) Apparatus, system and method for allocating identifiers to components of a control system
CN108702395B (en) Wireless mesh network formation
CN108563472B (en) Service plug-in loading method and device based on multi-open application
WO2017177892A1 (en) Installation of operating system
CN102257475A (en) System and method for booting a computer system using preboot data
US11218441B2 (en) Use of a network address by a network accessory
US10635606B2 (en) Method and apparatus for maintaining continuity of on-going session over wired or wireless interface
WO2023198056A1 (en) Firmware update method for embedded device, and embedded device
WO2020113562A1 (en) Computing power control method, apparatus and device, and storage medium
US11630591B1 (en) System and method to manage storage system for startup
CN110308914B (en) Upgrade processing method, device, equipment, system and computer readable storage medium
CN107659621B (en) RAID control card configuration method and device
KR101361513B1 (en) Computer and control method thereof
US20230325203A1 (en) Provisioning dpu management operating systems using host and dpu boot coordination
CN107483226B (en) Information processing method and electronic equipment

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: 18942065

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: 18942065

Country of ref document: EP

Kind code of ref document: A1