CN114531420A - IP address configuration method and device, storage medium and electronic equipment - Google Patents

IP address configuration method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN114531420A
CN114531420A CN202011197810.2A CN202011197810A CN114531420A CN 114531420 A CN114531420 A CN 114531420A CN 202011197810 A CN202011197810 A CN 202011197810A CN 114531420 A CN114531420 A CN 114531420A
Authority
CN
China
Prior art keywords
address
server
service unit
network
bus
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011197810.2A
Other languages
Chinese (zh)
Other versions
CN114531420B (en
Inventor
张朝阳
缪云清
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Aisino Corp
Original Assignee
Aisino Corp
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 Aisino Corp filed Critical Aisino Corp
Priority to CN202011197810.2A priority Critical patent/CN114531420B/en
Publication of CN114531420A publication Critical patent/CN114531420A/en
Application granted granted Critical
Publication of CN114531420B publication Critical patent/CN114531420B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0876Aspects of the degree of configuration automation
    • H04L41/0886Fully automatic configuration

Landscapes

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

Abstract

The present disclosure relates to a method, an apparatus, a storage medium and an electronic device for configuring an IP address, and relates to the technical field of electronic control, wherein the method is applied to a server, the server is connected with a service unit through a bus, and the method includes: determining a network identifier corresponding to a server according to a network to which the server belongs, acquiring a physical address of a service unit on the bus through the bus, generating a host identifier corresponding to the service unit according to the physical address, generating a target address according to the network identifier and the host identifier, and sending the target address to the service unit through the bus so as to configure an IP address corresponding to the service unit as the target address. According to the method and the system, the server configures the IP address of the service unit through the bus, and can automatically configure the effective IP address for the service unit without manual participation, so that the efficiency and the accuracy of configuring the IP address of the service unit are improved.

Description

IP address configuration method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of electronic control technologies, and in particular, to a method and an apparatus for configuring an IP address, a storage medium, and an electronic device.
Background
With the rapid development of internet technology, an integrated service system has been widely applied in various technical fields due to its advantages of high scalability, high availability, high manageability, etc. In an integrated service system, a server and a plurality of service units are usually included, and each service unit can perform independent data transmission with the server through a network. To ensure that each service unit can perform data transmission with the server through the network, an IP address needs to be configured for each service unit. Generally, the IP addresses of the service units are manually configured by operation and maintenance personnel, so that problems that the IP addresses of some service units are invalid, such as IP address errors or IP address duplication, may occur, and the efficiency and accuracy of configuring the IP addresses are reduced.
Disclosure of Invention
The invention aims to provide a configuration method, a configuration device, a storage medium and electronic equipment of an IP address, which are used for solving the problems of low efficiency and low accuracy of IP address configuration.
According to a first aspect of the embodiments of the present disclosure, there is provided a method for configuring an IP address, which is applied to a server, where the server is connected to a service unit through a bus, and the method includes:
determining a network identifier corresponding to the server according to the network to which the server belongs;
acquiring a physical address of the service unit on the bus through the bus;
generating a host identifier corresponding to the service unit according to the physical address;
generating a target address according to the network identifier and the host identifier;
and sending the target address to the service unit through the bus so as to configure the IP address corresponding to the service unit as the target address.
Optionally, the determining, according to the network to which the server belongs, a network identifier corresponding to the server includes:
and searching the network identification from a preset database according to the server identification of the server.
Optionally, the determining, according to the network to which the server belongs, a network identifier corresponding to the server includes:
searching first data from a preset database according to the server identifier of the server;
acquiring second data of a first appointed address bit in the physical address through the bus;
determining the network identification according to the first data and the second data;
the generating the host identifier corresponding to the service unit according to the physical address includes:
and taking third data of a second specified address bit in the physical address as the host identifier, wherein the second specified address bit is different from the first specified address bit.
Optionally, after determining the network identifier corresponding to the server according to the network to which the server belongs, the method further includes:
detecting the legality of the network identification;
and if the network identifier is illegal, modifying the network identifier into a specified identifier.
Optionally, after the acquiring, by the bus, the physical address of the service unit on the bus, the method further includes:
detecting the validity of the physical address;
and if the physical address is illegal, sending a prompt message, wherein the prompt message is used for indicating that the server and/or the service unit has hardware faults.
According to a second aspect of the embodiments of the present disclosure, there is provided an IP address configuration apparatus, applied to a server, the apparatus including:
the network identification determining module is used for determining the network identification corresponding to the server according to the network to which the server belongs;
a physical address obtaining module, configured to obtain, through the bus, a physical address of the service unit on the bus;
a host identifier generating module, configured to generate a host identifier corresponding to the service unit according to the physical address;
the target address generating module is used for generating a target address according to the network identifier and the host identifier;
and the target address sending module is used for sending the target address to the service unit through the bus so as to configure the IP address corresponding to the service unit as the target address.
Optionally, the network identification determining module is configured to:
and searching the network identification from a preset database according to the server identification of the server.
Optionally, the network identification determining module includes:
the first data searching sub-module is used for searching first data from a preset database according to the server identification of the server;
the second data acquisition submodule is used for acquiring second data of a first appointed address bit in the physical address through the bus;
a network identifier generation submodule, configured to determine the network identifier according to the first data and the second data;
the host identity generation module is configured to:
and taking third data of a second specified address bit in the physical address as the host identifier, wherein the second specified address bit is different from the first specified address bit.
Optionally, the apparatus further comprises:
the network identification detection module is used for detecting the legality of the network identification;
and the network identifier modification module is used for modifying the network identifier into a specified identifier if the network identifier is illegal.
Optionally, the apparatus further comprises:
the physical address detection module is used for detecting the legality of the physical address;
and the fault information prompting module is used for sending out prompting information if the physical address is illegal, wherein the prompting information is used for indicating that the server and/or the service unit have hardware faults.
According to a third aspect of embodiments of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of any one of the first aspects of the embodiments of the present disclosure.
According to a fourth aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of any one of the first aspects of the embodiments of the present disclosure.
According to the technical scheme, the server determines the network identifier corresponding to the server according to the network where the server is located, acquires the physical address of the service unit on the bus through the bus, generates the host identifier corresponding to the service unit according to the physical address, generates the target address according to the acquired network identifier and the host identifier, and finally sends the target address to the service unit through the bus so as to configure the IP address corresponding to the service unit into the target address, thereby realizing the configuration of the IP address of the service unit. According to the method and the system, the server configures the IP address of the service unit through the bus, and can automatically configure the effective IP address for the service unit without manual participation, so that the efficiency and the accuracy of configuring the IP address of the service unit are improved.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
FIG. 1 is a flow chart illustrating a method of configuration of an IP address in accordance with an exemplary embodiment;
FIG. 2 is a flow chart illustrating another method of configuring an IP address in accordance with an illustrative embodiment;
FIG. 3 is a flow chart illustrating another method of configuring an IP address in accordance with an illustrative embodiment;
FIG. 4 is a flow chart illustrating another method of configuring an IP address in accordance with an illustrative embodiment;
fig. 5 is a block diagram illustrating an apparatus for configuring an IP address in accordance with an exemplary embodiment;
fig. 6 is a block diagram illustrating another IP address configuration apparatus in accordance with an illustrative embodiment;
fig. 7 is a block diagram illustrating another apparatus for configuring an IP address in accordance with an illustrative embodiment;
fig. 8 is a block diagram illustrating another IP address configuration apparatus in accordance with an illustrative embodiment;
FIG. 9 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
Fig. 1 is a flowchart illustrating a configuration method of an IP address according to an exemplary embodiment, where the method is applied to a server, and the server is connected to a service unit through a bus, as shown in fig. 1, and the method may include the following steps:
step 101, determining a network identifier corresponding to a server according to a network to which the server belongs.
For example, the server may be a server in an integrated service system, and the service system further includes a service unit, and the service unit is connected to the server through a bus, and the service system may be, for example, a tax system, a ticket selling system, or the like. The servers may be deployed in a cluster, and each server may be connected to one or more service units via a bus. The Bus may be, for example, an I2C (Inter-Integrated Circuit) Bus, an SMBus (System Management Bus, Chinese), an SPI (Serial Peripheral Interface, Chinese) Bus, or the like. The server provides at least one group of 9PIN interfaces, the 9PIN interfaces can comprise network interfaces and bus interfaces, the network interfaces can supply power to the service units and perform network interaction with the service units, and the bus interfaces can be used for configuring the IP addresses of the service units. Since each device on the bus has a different physical address, the bus interface in each 9-PIN socket corresponds to a different physical address. Thus, when multiple business units are plugged into different 9-PIN sockets, each business unit has a different physical address.
The service unit is plugged in the 9PIN plug-in interface and is connected with the server through the bus, and the server firstly determines the corresponding network identification according to the network in which the server is located. It should be noted that the network identifier of the server may be stored in a preset database, or may also be stored in a local storage space of the server, so that the server may search for the corresponding network identifier in the preset database, or may search for the corresponding network identifier in the local storage space. In addition, the server may also search a first part of data of the network identifier in a preset database or a local storage space, then obtain a physical address of the service unit on the bus through the bus, generate a second part of data of the network identifier according to the physical address, and finally obtain a corresponding network identifier according to the first part of data and the second part of data. In another implementation manner, the server may also send a PING command to other servers or hosts with known IP addresses, and obtain the network identifier corresponding to the server according to the return information of the PING command.
And 102, acquiring a physical address of the service unit on the bus through the bus.
And 103, generating a host identity corresponding to the service unit according to the physical address.
For example, the server obtains a physical address of the service unit on the bus through the bus, and converts the physical address of the service unit on the bus into a host identifier of the service unit according to a preset rule, where the preset conversion rule may take all or part of a numerical value of the physical address as the host identifier of the service unit, or may specifically convert a part of the numerical value of the physical address, and use a conversion result as the host identifier of the service unit.
It should be noted that different physical addresses may be set for each bus interface by using different circuit board wiring manners for the bus interface in each 9PIN jack, for example, the bus interfaces in different 9PIN jacks may be set with pull-up resistors or pull-down resistors having different resistance values, and the bus interfaces in different 9PIN jacks may be connected to a power supply or ground. Therefore, when a service unit is plugged in the 9PIN plug-in interface, the service unit corresponds to a specific physical address, and the server can generate a corresponding host identity according to the physical address of the service unit on the bus. When a plurality of service units are plugged in the 9PIN plug-in interface, each service unit has different physical addresses, so that the server generates different host identifiers according to the physical addresses corresponding to the service units.
And 104, generating a target address according to the network identifier and the host identifier.
And 105, sending the target address to the service unit through the bus so as to configure the IP address corresponding to the service unit as the target address.
In an example, after the server acquires a corresponding network identifier according to a network to which the server belongs and generates a host identifier corresponding to a service unit according to a physical address acquired from a bus, the acquired network identifier and the host identifier of the service unit are combined to generate a target address, where the target address is an IP address of the service unit, and further, the server may send the target address to the service unit through the bus, so that the service unit configures the IP address after receiving the target address, thereby achieving an effect of configuring the IP address corresponding to the service unit as the target address.
It should be noted that, when a service unit is plugged into the 9PIN socket, because the service unit has a corresponding host identifier, a destination address is generated according to the network identifier and the host identifier, and the server sends the destination address to the service unit through the bus, and can automatically configure a corresponding IP address for the service unit, thereby avoiding the problem of incorrect IP address input due to manual configuration. When a plurality of service units are plugged in the 9PIN plug-in interface, each service unit has different host identifiers, so that target addresses generated according to the network identifiers and the host identifiers are different, the server sends the target addresses to the service units through the buses, different IP addresses can be configured for each service unit, each service unit can be ensured to be configured with different IP addresses, and the problem that the IP addresses are repeated due to manual configuration is solved.
In summary, in the present disclosure, a server first determines a network identifier corresponding to the server according to a network in which the server is located, then obtains a physical address of a service unit on a bus through the bus, generates a host identifier corresponding to the service unit according to the physical address, then generates a target address according to the obtained network identifier and the host identifier, and finally sends the target address to the service unit through the bus, so as to configure an IP address corresponding to the service unit as a target address, thereby implementing configuration of an IP address of the service unit. According to the method and the system, the server configures the IP address of the service unit through the bus, and can automatically configure the effective IP address for the service unit without manual participation, so that the efficiency and the accuracy of configuring the IP address of the service unit are improved.
In an application scenario, the implementation manner of step 101 may be:
and searching the network identification from a preset database according to the server identification of the server.
For example, a preset database may be specified to store the network identifier of the server, and when the server configures the IP address of the service unit, the server may search the preset database for the corresponding network identifier as the network identifier of the service unit. For example, there may be multiple servers in a business system, each server being connected to one or more business units via a bus. A predetermined database may be designated for storing the network identification corresponding to each of the plurality of servers. It is understood that the preset database stores a plurality of identification records, and each identification record includes a server identifier of a server (which can uniquely identify the server), and a network identifier corresponding to the server. If a certain server needs to determine the network identifier, the server identifier of the certain server may be first sent to a preset database to search for an identifier record matching with the server identifier, and then the network identifier included in the identifier record matching with the server identifier is the network identifier corresponding to the server.
It should be noted that the preset database may be deployed on a server, that is, the server may directly obtain the corresponding network identifier from the local. The preset database may also be deployed on another preset server, that is, the server obtains the corresponding network identifier from the preset server.
Fig. 2 is a flowchart illustrating another IP address configuration method according to an exemplary embodiment, and as shown in fig. 2, step 101 may also be implemented by the following steps:
step 1011, according to the server identifier of the server, searching the first data from the preset database.
At step 1012, second data of the first designated address bits in the physical address is obtained via the bus.
And step 1013, determining the network identification according to the first data and the second data.
Accordingly, the implementation manner of step 103 may be:
and taking third data of a second specified address bit in the physical address as a host identifier, wherein the second specified address bit is different from the first specified address bit.
For example, the network identifier of the service unit may be composed of two parts, which are first data and second data of the network identifier, respectively, where the first data may be obtained by the server from a preset database, and the second data may be obtained by the server obtaining a physical address of the service unit on the bus through the bus. Specifically, a part of the physical address of the bus interface may be designated as a first designated address bit, which is used as the second data of the IP address of the service unit. And finally, combining the first data and the second data to be used as the network identification of the service unit.
Specifically, taking the IP address as 4 bytes, each byte having 8 bits as an example, the IP address can be divided into A, B, C, D four parts, each part corresponding to one byte. According to different types of IP addresses, the corresponding parts of the network identification and the host identification are different. For example, the network identifier may correspond to two parts a and B, the host identifier may correspond to two parts C and D, the network identifier may also correspond to part a, and the host identifier may correspond to three parts B, C and D. The present disclosure does not specifically limit this.
If the network identifier corresponds to the part a and the part B, and the host identifier corresponds to the part C and the part D, the server may search for first data from the preset database according to the server identifier, where the first data may be a byte and may correspond to the part a (or the part B), and second data of a first designated address bit in the physical address acquired through the bus may be a byte and may correspond to the part B (or the part a), where the first designated address bit may be the upper 8 bits of the physical address or the lower 8 bits of the physical address. If the network identifier corresponds to part a, and the host identifier corresponds to parts B, C and D, then the server, according to the server identifier, may look up first data from the preset database as 4 bits, and may correspond to 4 bits in part a, and second data of a first designated address bit in the physical address obtained through the bus may be 4 bits, and may correspond to the remaining 4 bits in part a, where the first designated address bit may be the upper 4 bits of the physical address, may also be the lower 4 bits of the physical address, and may also be any 4 bits in the physical address.
Wherein, the first designated address bit of the physical address of the service unit on the bus can be controlled by the dial switch, so that when a plurality of service units exist in the system, the first designated address bit of the physical address of each service unit on the bus is the same.
Furthermore, a part of the physical address of the service unit on the bus except the first designated address bit can be designated as a second designated address bit to serve as third data of the IP address of the service unit, and the third data serves as a host identity. The first designated address bits and the second designated address bits of the service unit may cover the entire physical address or may be a part of the physical address. For example, the first specified address bits may be the upper 8 bits of the physical address and the second specified address bits may be the lower 8 bits of the physical address. Alternatively, the first designated address bits may be the upper 4 bits of the physical address and the second designated address bits may be the lower 8 bits of the physical address. Wherein the second designated address bits of the physical address of the service unit on the bus may be set by circuit board routing such that when there are multiple service units in the system, the second designated address bits of the physical address of each service unit on the bus are different.
Fig. 3 is a flowchart illustrating another IP address configuration method according to an exemplary embodiment, and as shown in fig. 3, after step 101, the method may further include the following steps:
and 106, detecting the legality of the network identifier.
And 107, if the network identifier is illegal, modifying the network identifier into a specified identifier.
For example, after determining the network identifier corresponding to the server according to the network to which the server belongs, the server may detect validity of the obtained network identifier, that is, detect whether the network identifier is wrong or empty, if the network identifier is wrong or empty, the network identifier is illegal, and if the network identifier is correct, the network identifier is legal. The error condition may be, for example, that the network identifier is not consistent with the actual network identifier or the network identifier format is wrong, and if the network identifier is wrong or empty, the network identifier may be modified to be the designated identifier, so as to ensure that the network identifier of the service unit is valid. Wherein, taking the network identifier as the first 3 bytes of the IP address as an example, the specified identifier may be 198.168.1.
Fig. 4 is a flowchart illustrating another IP address configuration method according to an exemplary embodiment, and as shown in fig. 4, after step 102, the method may further include the following steps:
step 108, detecting the validity of the physical address.
And step 109, if the physical address is illegal, sending a prompt message, wherein the prompt message is used for indicating that the server and/or the service unit has a hardware fault.
For example, after the server acquires the physical address of the service unit on the bus through the bus, the legitimacy of the acquired physical address may be detected, that is, whether the physical address is wrong or null is detected, if the physical address is wrong or null, the physical address is illegal, and if the physical address is correct, the physical address is legal. The error condition may be, for example, a mismatch with an actual physical address or a physical address format error, and if the physical address is incorrect or empty, a prompt may be issued to prompt the user that there may be a hardware failure in the server and/or the service unit.
In summary, in the present disclosure, a server first determines a network identifier corresponding to the server according to a network in which the server is located, then obtains a physical address of a service unit on a bus through the bus, generates a host identifier corresponding to the service unit according to the physical address, then generates a target address according to the obtained network identifier and the host identifier, and finally sends the target address to the service unit through the bus, so as to configure an IP address corresponding to the service unit as a target address, thereby implementing configuration of an IP address of the service unit. According to the method and the system, the server configures the IP address of the service unit through the bus, and can automatically configure the effective IP address for the service unit without manual participation, so that the efficiency and the accuracy of configuring the IP address of the service unit are improved.
Fig. 5 is a block diagram illustrating an IP address configuration apparatus according to an exemplary embodiment, and as shown in fig. 5, the apparatus 200 applied to the server may include the following modules:
the network identifier determining module 201 is configured to determine a network identifier corresponding to a server according to a network to which the server belongs.
And a physical address obtaining module 202, configured to obtain a physical address of the service unit on the bus through the bus.
And a host identifier generating module 203, configured to generate a host identifier corresponding to the service unit according to the physical address.
And the target address generating module 204 is configured to generate a target address according to the network identifier and the host identifier.
And a destination address sending module 205, configured to send the destination address to the service unit through the bus, so as to configure the IP address corresponding to the service unit as the destination address.
In one implementation, the network identification determining module 201 may be further configured to:
and searching the network identification from a preset database according to the server identification of the server.
Fig. 6 is a block diagram illustrating another IP address configuration apparatus according to an exemplary embodiment, and as shown in fig. 6, in another implementation, the network identity determining module 201 may further include:
the first data searching sub-module 2011 is configured to search the first data from the preset database according to the server identifier of the server.
The second data obtaining submodule 2012 is configured to obtain second data of the first specified address bit in the physical address through the bus.
And the network identifier generation submodule 2013 is used for determining the network identifier according to the first data and the second data.
Accordingly, the host identity generation module 203 may be further configured to:
and taking third data of a second specified address bit in the physical address as a host identifier, wherein the second specified address bit is different from the first specified address bit.
Fig. 7 is a block diagram illustrating another IP address configuration apparatus according to an exemplary embodiment, and as shown in fig. 7, the apparatus 200 further includes:
a network identifier detecting module 206, configured to detect validity of the network identifier.
And a network identifier modification module 207, configured to modify the network identifier into the designated identifier if the network identifier is illegal.
Fig. 8 is a block diagram illustrating another IP address configuration apparatus according to an exemplary embodiment, and as shown in fig. 8, the apparatus 200 further includes:
and a physical address detection module 208, configured to detect validity of the physical address.
And the failure information prompting module 209 is configured to send a prompting message if the physical address is illegal, where the prompting message is used to indicate that a hardware failure exists in the server and/or the service unit.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
In summary, in the present disclosure, a server first determines a network identifier corresponding to the server according to a network in which the server is located, then obtains a physical address of a service unit on a bus through the bus, generates a host identifier corresponding to the service unit according to the physical address, then generates a target address according to the obtained network identifier and the host identifier, and finally sends the target address to the service unit through the bus, so as to configure an IP address corresponding to the service unit as a target address, thereby implementing configuration of an IP address of the service unit. According to the method and the system, the server configures the IP address of the service unit through the bus, and can automatically configure the effective IP address for the service unit without manual participation, so that the efficiency and the accuracy of configuring the IP address of the service unit are improved.
Fig. 9 is a block diagram illustrating an electronic device 900 in accordance with an example embodiment. For example, the electronic device 900 may be provided as a server. Referring to fig. 9, the electronic device 900 includes a processor 922, which may be one or more in number, and a memory 932 for storing computer programs executable by the processor 922. The computer programs stored in memory 932 may include one or more modules that each correspond to a set of instructions. Further, the processor 922 may be configured to execute the computer program to perform the above-described IP address configuration method.
Additionally, the electronic device 900 may also include a power component 926 and a communication component 950, the power component 926 may be configured to perform power management of the electronic device 900, and the communication component 950 may be configured to enable communication, e.g., wired or wireless communication, of the electronic device 900. The electronic device 900 may also include input/output (I/O) interfaces 958. The electronic device 900 may operate based on an operating system stored in the memory 932, such as Windows ServerTM,Mac OS XTM,UnixTM,LinuxTMAnd so on.
In another exemplary embodiment, there is also provided a computer readable storage medium including program instructions, which when executed by a processor, implement the steps of the above-described method of configuring an IP address. For example, the computer readable storage medium may be the memory 932 described above that includes program instructions executable by the processor 922 of the electronic device 900 to perform the IP address configuration method described above.
In another exemplary embodiment, a computer program product is also provided, which contains a computer program executable by a programmable apparatus, the computer program having code portions for performing the above-mentioned method of configuring an IP address when executed by the programmable apparatus.
In summary, in the present disclosure, a server first determines a network identifier corresponding to the server according to a network in which the server is located, then obtains a physical address of a service unit on a bus through the bus, generates a host identifier corresponding to the service unit according to the physical address, then generates a target address according to the obtained network identifier and the host identifier, and finally sends the target address to the service unit through the bus, so as to configure an IP address corresponding to the service unit as a target address, thereby implementing configuration of an IP address of the service unit. According to the method and the system, the server configures the IP address of the service unit through the bus, and can automatically configure the effective IP address for the service unit without manual participation, so that the efficiency and the accuracy of configuring the IP address of the service unit are improved.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that, in the foregoing embodiments, various features described in the above embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, various combinations that are possible in the present disclosure are not described again.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.

Claims (10)

1. A method for configuring an IP address, which is applied to a server, wherein the server is connected with a service unit through a bus, and the method comprises the following steps:
determining a network identifier corresponding to the server according to the network to which the server belongs;
acquiring a physical address of the service unit on the bus through the bus;
generating a host identifier corresponding to the service unit according to the physical address;
generating a target address according to the network identifier and the host identifier;
and sending the target address to the service unit through the bus so as to configure the IP address corresponding to the service unit as the target address.
2. The method according to claim 1, wherein the determining, according to the network to which the server belongs, the network identifier corresponding to the server includes:
and searching the network identification from a preset database according to the server identification of the server.
3. The method according to claim 1, wherein the determining, according to the network to which the server belongs, the network identifier corresponding to the server includes:
searching first data from a preset database according to the server identifier of the server;
acquiring second data of a first appointed address bit in the physical address through the bus;
determining the network identification according to the first data and the second data;
the generating a host identifier corresponding to the service unit according to the physical address includes:
and taking third data of a second specified address bit in the physical address as the host identifier, wherein the second specified address bit is different from the first specified address bit.
4. The method according to claim 1, wherein after determining the network identifier corresponding to the server according to the network to which the server belongs, the method further comprises:
detecting the legality of the network identification;
and if the network identifier is illegal, modifying the network identifier into a specified identifier.
5. The method of claim 1, wherein after the obtaining the physical address of the service unit on the bus via the bus, the method further comprises:
detecting the validity of the physical address;
and if the physical address is illegal, sending a prompt message, wherein the prompt message is used for indicating that the server and/or the service unit has hardware faults.
6. An IP address configuration device, applied to a server, the device comprising:
the network identification determining module is used for determining the network identification corresponding to the server according to the network to which the server belongs;
a physical address obtaining module, configured to obtain, through the bus, a physical address of the service unit on the bus;
a host identifier generating module, configured to generate a host identifier corresponding to the service unit according to the physical address;
the target address generating module is used for generating a target address according to the network identifier and the host identifier;
and the target address sending module is used for sending the target address to the service unit through the bus so as to configure the IP address corresponding to the service unit as the target address.
7. The apparatus of claim 6, wherein the network identification determination module is configured to:
and searching the network identification from a preset database according to the server identification of the server.
8. The apparatus of claim 6, wherein the network identity determination module comprises:
the first data searching submodule is used for searching first data from a preset database according to the server identification of the server;
the second data acquisition submodule is used for acquiring second data of a first appointed address bit in the physical address through the bus;
a network identifier generation submodule, configured to determine the network identifier according to the first data and the second data;
the host identity generation module is configured to:
and taking third data of a second specified address bit in the physical address as the host identifier, wherein the second specified address bit is different from the first specified address bit.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.
10. An electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to carry out the steps of the method of any one of claims 1 to 5.
CN202011197810.2A 2020-10-30 2020-10-30 IP address configuration method and device, storage medium and electronic equipment Active CN114531420B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011197810.2A CN114531420B (en) 2020-10-30 2020-10-30 IP address configuration method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011197810.2A CN114531420B (en) 2020-10-30 2020-10-30 IP address configuration method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN114531420A true CN114531420A (en) 2022-05-24
CN114531420B CN114531420B (en) 2024-04-30

Family

ID=81618430

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011197810.2A Active CN114531420B (en) 2020-10-30 2020-10-30 IP address configuration method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114531420B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6101499A (en) * 1998-04-08 2000-08-08 Microsoft Corporation Method and computer program product for automatically generating an internet protocol (IP) address
US20060026325A1 (en) * 2004-07-13 2006-02-02 Jen-Hsuen Huang Method for automatically assigning a communication port address and the blade server system thereof
US20150222593A1 (en) * 2014-02-06 2015-08-06 Lenovo Enterprise Solutions (Singapore) Pte. Ltd. Network address allocation
CN106506712A (en) * 2015-09-04 2017-03-15 施耐德电器工业公司 Automatic addressing method in ethernet communication architectural framework
US20170339102A1 (en) * 2016-05-19 2017-11-23 Lenovo Enterprise Solutions (Singapore) Pte. Ltd. Methods and apparatus for an ip address assignment
CN111294413A (en) * 2018-12-06 2020-06-16 航天信息股份有限公司 Method, device and readable medium for determining Internet Protocol (IP) address
CN111711714A (en) * 2020-06-17 2020-09-25 厦门亿联网络技术股份有限公司 IP address query method, device, server, control equipment and medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6101499A (en) * 1998-04-08 2000-08-08 Microsoft Corporation Method and computer program product for automatically generating an internet protocol (IP) address
US20060026325A1 (en) * 2004-07-13 2006-02-02 Jen-Hsuen Huang Method for automatically assigning a communication port address and the blade server system thereof
US20150222593A1 (en) * 2014-02-06 2015-08-06 Lenovo Enterprise Solutions (Singapore) Pte. Ltd. Network address allocation
CN106506712A (en) * 2015-09-04 2017-03-15 施耐德电器工业公司 Automatic addressing method in ethernet communication architectural framework
US20170339102A1 (en) * 2016-05-19 2017-11-23 Lenovo Enterprise Solutions (Singapore) Pte. Ltd. Methods and apparatus for an ip address assignment
CN111294413A (en) * 2018-12-06 2020-06-16 航天信息股份有限公司 Method, device and readable medium for determining Internet Protocol (IP) address
CN111711714A (en) * 2020-06-17 2020-09-25 厦门亿联网络技术股份有限公司 IP address query method, device, server, control equipment and medium

Also Published As

Publication number Publication date
CN114531420B (en) 2024-04-30

Similar Documents

Publication Publication Date Title
US7817583B2 (en) Method for verifying a storage area network configuration
US8793351B2 (en) Automated configuration of new racks and other computing assets in a data center
US20060218326A1 (en) Blade server system and method of managing same
CN111289922B (en) Cable plugging detection method and related equipment
CN110633177A (en) Method and device for acquiring equipment information, server and storage medium
CN110704115A (en) Method, device and system for configuring BMC (baseboard management controller) of server
CN109656755A (en) The method and system of detection device state
CN113342280A (en) Kubernetes-based storage configuration method and system and electronic equipment
CN114327571B (en) File configuration method, chip testing machine and computer readable storage medium
CN107181606B (en) Method and apparatus for controlling network nodes
CN111064786A (en) Account identifier management method and device
CN111124437A (en) Bare computer resource configuration information acquisition method, system and equipment based on OpenStack
CN112311574A (en) Method, device and equipment for checking network topology connection
CN114531420B (en) IP address configuration method and device, storage medium and electronic equipment
CN116737640A (en) Information acquisition method, device, equipment and storage medium
CN107678917B (en) Test machine automation management method, device, equipment and storage medium
CN116048889A (en) Detection method and related device for cable connection of cabinet server
CN116226008A (en) Port address configurator, configuration method and terminal
US7984136B2 (en) Methods, systems, and computer program products for determining locations of interconnected processing modules and for verifying consistency of interconnect wiring of processing modules
CN114860271A (en) PXE starting method, system and device and readable storage medium
CN113726543B (en) Operation and maintenance service processing method, device, system, server and storage medium
CN115514733A (en) Configuration method and configuration device for domain name resolution service (DNS)
CN113468027A (en) Monitoring device address management method and device, substrate management controller and equipment
WO2021097825A1 (en) Device marking method, apparatus, and system, computer device, and storage medium
US20240106703A1 (en) Network management apparatus and network management method

Legal Events

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