CN114531420B - 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
CN114531420B
CN114531420B CN202011197810.2A CN202011197810A CN114531420B CN 114531420 B CN114531420 B CN 114531420B CN 202011197810 A CN202011197810 A CN 202011197810A CN 114531420 B CN114531420 B CN 114531420B
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.)
Active
Application number
CN202011197810.2A
Other languages
Chinese (zh)
Other versions
CN114531420A (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

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. According to the network to which the server belongs, determining the network identifier corresponding to the server, acquiring the physical address of the service unit on the bus through the bus, generating the host identifier corresponding to the service unit according to the physical address, generating the 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. According to the method and the device, 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 disclosure relates to the technical field of electronic control, and in particular relates to a configuration method and device of an IP address, a storage medium and electronic equipment.
Background
With the rapid development of internet technology, integrated service systems have been widely used in various technical fields due to their advantages of high scalability, high availability, high manageability, etc. In an integrated service system, a server and a plurality of service units are generally included, and each service unit can perform independent data transmission with the server through a network. To ensure that each service unit is capable of data transmission with the server over the network, it is necessary to configure each service unit with an IP address. In general, the IP addresses of service units are manually configured by operation staff, so that problems of invalid IP addresses of certain service units, such as an IP address error or an IP address repetition, may occur, which reduces the efficiency and accuracy of configuring the IP addresses.
Disclosure of Invention
The invention aims to provide a configuration method, a 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 an embodiment 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:
According to the network to which the server belongs, determining a network identifier corresponding to the server;
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 an IP address corresponding to the service unit as the target address.
Optionally, 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.
Optionally, 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 identification of the server;
acquiring second data of a first designated 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 second designated address bits in the physical address as the host identity, wherein the second designated address bits are different from the first designated address bits.
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 validity of the network identification;
and if the network identification is illegal, modifying the network identification into a designated identification.
Optionally, after the acquiring, by the bus, the physical address of the service unit on the bus, the method further includes:
Detecting the legitimacy of the physical address;
If the physical address is illegal, a prompt message is sent, wherein the prompt message is used for indicating 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 a network identification corresponding to the server according to the network to which the server belongs;
A physical address acquisition module, configured to acquire a physical address of the service unit on the bus through the bus;
the host identity generation module is used for generating a host identity corresponding to the service unit according to the physical address;
the target address generation 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;
a second data obtaining sub-module, configured to obtain second data of the first specified address bit in the physical address through the bus;
A network identifier generating sub-module, configured to determine the network identifier according to the first data and the second data;
The host identity generation module is used for:
And taking third data of second designated address bits in the physical address as the host identity, wherein the second designated address bits are different from the first designated address bits.
Optionally, the apparatus further comprises:
The network identification detection module is used for detecting the validity of the network identification;
and the network identification modification module is used for modifying the network identification into the appointed identification if the network identification is illegal.
Optionally, the apparatus further comprises:
The physical address detection module is used for detecting the validity of the physical address;
And the fault information prompt module is used for sending prompt information if the physical address is illegal, wherein the prompt information is used for indicating the server and/or the service unit has hardware faults.
According to a third aspect of the disclosed embodiments, there is provided a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the steps of the method of any of the first aspects of the disclosed embodiments.
According to a fourth aspect of embodiments of the present disclosure, there is provided an electronic device, comprising:
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 of the first aspects of the embodiments of the present disclosure.
Through the technical scheme, the server in the disclosure firstly determines the network identifier corresponding to the server according to the network where the server is located, then obtains 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 obtained 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 as the target address, thereby configuring the IP address of the service unit. According to the method and the device, 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 present disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings are included to provide a further understanding of the disclosure, and are incorporated in and constitute a part of this specification, illustrate the disclosure and together with the description serve to explain, but do not limit the disclosure. In the drawings:
FIG. 1 is a flow chart illustrating a method of configuring IP addresses according to an exemplary embodiment;
FIG. 2 is a flow chart illustrating another method of configuring IP addresses according to an example embodiment;
FIG. 3 is a flow chart illustrating another method of configuring IP addresses according to an example embodiment;
FIG. 4 is a flow chart illustrating another method of configuring IP addresses according to an example embodiment;
FIG. 5 is a block diagram of an IP address configuration apparatus according to an exemplary embodiment;
FIG. 6 is a block diagram of another IP address configuration apparatus, shown in accordance with an exemplary embodiment;
FIG. 7 is a block diagram of another IP address configuration apparatus, shown in accordance with an exemplary embodiment;
FIG. 8 is a block diagram of another IP address configuration apparatus, shown in accordance with an exemplary embodiment;
Fig. 9 is a block diagram of an electronic device, according to an example embodiment.
Detailed Description
Specific embodiments of the present disclosure are described in detail below with reference to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating and illustrating the disclosure, are not intended to limit the disclosure.
Fig. 1 is a flowchart illustrating a method for configuring an IP address according to an exemplary embodiment, which is applied to a server connected to a service unit through a bus, as shown in fig. 1, and may include the steps of:
step 101, determining a network identifier corresponding to the server according to the network to which the server belongs.
For example, the server may be a server in an integrated service system, where the service system further includes a service unit, and the service unit is connected to the server through a bus, where the service system may be, for example, a tax system, a ticket vending system, and the like. Servers may be deployed in clusters, where each server may be connected to one or more service units via a bus. The Bus may be, for example, an I2C (English: inter-INTEGRATED CIRCUIT) Bus, an SMBus (English: SYSTEM MANAGEMENT Bus, chinese: system management Bus), an SPI (English: SERIAL PERIPHERAL INTERFACE, chinese: serial peripheral interface) Bus, or the like. The server provides at least one group of 9PIN interfaces, the 9PIN interfaces can comprise a network interface and a bus interface, wherein the network interface can realize power supply and network interaction with the service unit, and the bus interface can be used for configuring the IP address of the service unit. Since each device on the bus has a different physical address, the bus interface in each 9PIN interface corresponds to a different physical address. Thus, when multiple service units are plugged onto different 9PIN plug-ins, each service unit has a different physical address.
The service unit is spliced on the 9PIN interface and is connected with the server through the bus, and the server firstly determines a corresponding network identifier according to the network where the server is located. It should be noted that, the network identifier of the server may be stored in a preset database, or may be stored in a local storage space of the server, so that the server may search the preset database for the corresponding network identifier, or may search the local storage space for the corresponding network identifier. In addition, the server may search the first part of data of the network identifier in a preset database or a local storage space, obtain a physical address of the service unit on the bus through the bus, generate the second part of data of the network identifier according to the physical address, and finally obtain the 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.
Step 102, obtaining the physical address of the service unit on the bus through the bus.
And 103, generating a host identifier corresponding to the service unit according to the physical address.
The server obtains the 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 the host identifier of the service unit according to a preset rule, where the preset conversion rule may take all or part of the numerical value of the physical address as the host identifier of the service unit, or perform specific conversion on a part of the numerical value of the physical address, and take the conversion result as the host identifier of the service unit.
It should be noted that, setting different physical addresses for each bus interface may be achieved by using different wiring manners of the circuit board for each bus interface in the 9PIN interfaces, for example, pull-up resistors or pull-down resistors with different resistance values may be set for the bus interfaces in the 9PIN interfaces, and also the bus interfaces in the 9PIN interfaces may be connected to a power source or a ground. Therefore, when a service unit is plugged into the 9PIN plug-in interface, the service unit corresponds to a specific physical address, and the server can generate a corresponding host identifier 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 a different physical address, so that the server generates different host identities according to the physical address corresponding to each service unit.
Step 104, generating a target address according to the network identification and the host identification.
And step 105, the target address is sent to the service unit through the bus, so that the IP address corresponding to the service unit is configured as the target address.
The server obtains the corresponding network identifier according to the network, and after generating the host identifier corresponding to the service unit according to the physical address obtained from the bus, combines the obtained network identifier of the service unit with the host identifier to generate a target address, where the target address is the 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 implementing the 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 in the 9PIN plug-in interface, because the service unit has a corresponding host identifier, a target address is generated according to the network identifier and the host identifier, and the server sends the target address to the service unit through the bus, so that a corresponding IP address can be automatically configured for the service unit, and the problem of input errors of the IP address due to manual configuration is avoided. When a plurality of service units are spliced on the 9PIN plug-in interface, because each service unit is provided with different host identities, the target address generated according to the network identity and the host identities is also different, the server sends the target address to the service units through the bus, different IP addresses can be configured for each service unit, and the problem of repeated IP addresses due to manual configuration is avoided.
In summary, in the present disclosure, the server first determines a network identifier corresponding to the server according to a network where 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 the target address, thereby implementing configuration of the IP address of the service unit. According to the method and the device, 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 designated to store network identifiers 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 of which may be connected to one or more business units via a bus. A predetermined database may be designated for storing network identifications corresponding to each of the plurality of servers. It will be understood that a plurality of identification records are stored in the preset database, and each identification record includes a server identifier of a server (capable of uniquely identifying 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 can be sent to a preset database to search an identifier record matched with the server identifier, and then the network identifier included in the identifier record matched 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 area. The preset database can 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 method of configuring an IP address according to an exemplary embodiment, and as shown in fig. 2, step 101 may be further implemented by:
In step 1011, the first data is searched from the preset database according to the server identification of the server.
Step 1012, obtaining second data of the first specified address bit in the physical address through the bus.
In step 1013, a network identification is determined based on the first data and the second data.
Accordingly, the implementation manner of step 103 may be:
And taking third data of second designated address bits in the physical address as a host identifier, wherein the second designated address bits are different from the first designated address bits.
The network identifier of the service unit may be, for example, two parts, namely, first data and second data of the network identifier, 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, through a bus, a physical address of the service unit on 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 second data of the service unit IP address. And finally, combining the first data and the second data to serve as a network identifier of the service unit.
Specifically, with an IP address of 4 bytes and 8 bits per byte for illustration, the IP address can be divided into A, B, C, D parts, one for each part. The network identification and the host identification are different in corresponding parts according to different types of IP addresses. For example, the network identifier may correspond to the two parts a and B, the host identifier may correspond to the two parts C and D, and the network identifier may correspond to the part a, and the host identifier may correspond to the three parts B, C and D. The present disclosure is not particularly limited thereto.
If the network identifier corresponds to the two parts a and B and the host identifier corresponds to the two parts C and D, the first data searched by the server from the preset database according to the server identifier may be one byte, may correspond to the part a (or the part B), and the second data of the first specified address bit in the physical address acquired through the bus may be one byte, may correspond to the part B (or the part a), where the first specified address bit may be the upper 8 bits of the physical address, or may be the lower 8 bits of the physical address. If the network identifier corresponds to the a part and the host identifier corresponds to the B, C and the D part, the server may search the first data from the preset database according to the server identifier, may correspond to the 4 bits in the a part, may correspond to the 4 bits in the first specified address bits in the physical address obtained through the bus, may correspond to the remaining 4 bits in the a part, where the first specified address bits may be the upper 4 bits of the physical address, may also be the lower 4 bits of the physical address, or may also be any 4 bits in the physical address.
Wherein the first assigned address bits of the physical addresses of the service units on the bus can be controlled by the dial switch such that when there are multiple service units in the system, the first assigned address bits in the physical addresses of each service unit on the bus are the same.
Further, a part of the physical address of the service unit on the bus except the first specified address bit is also specified as a second specified address bit, so as to be used as third data of the service unit IP address, and the third data is used as a host identifier. The first designated address bit and the second designated address bit 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 bit may be the upper 8 bits of the physical address and the second specified address bit may be the lower 8 bits of the physical address. Or the first specified address bit may be the upper 4 bits of the physical address and the second specified address bit may be the lower 8 bits of the physical address. Wherein the second assigned address bits of the physical addresses of the service units on the bus may be set by the circuit board wiring such that when there are multiple service units in the system, the second assigned address bits in the physical addresses of each service unit on the bus are different.
Fig. 3 is a flowchart illustrating another method of configuring an IP address according to an exemplary embodiment, as shown in fig. 3, and after step 101, the method may further include the steps of:
And step 106, detecting the validity of the network identification.
And 107, if the network identification is illegal, modifying the network identification into a designated identification.
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 not legal, and if the network identifier is correct, the network identifier is legal. The error condition may be, for example, a failure to match the actual network identifier or a network identifier format error, etc., and if the network identifier is wrong or empty, the network identifier may be modified to a specified identifier, ensuring that the network identifier of the service unit is valid. Taking the first 3 bytes of the network identifier as an IP address as an example, the specified identifier may be 198.168.1.
Fig. 4 shows a flowchart of another method for configuring an IP address according to an exemplary embodiment, as shown in fig. 4, after step 102, the method may further include the steps of:
Step 108, detecting the validity of the physical address.
Step 109, if the physical address is illegal, a prompt message is sent, where the prompt message is used to indicate that the server and/or the service unit has a hardware failure.
For example, after the server obtains the physical address of the service unit on the bus through the bus, the validity of the obtained 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 not legal, and if the physical address is correct, the physical address is legal. The error condition may be, for example, a physical address error or a physical address format error, etc., and if the physical address is wrong or empty, a hint may be sent to hint that the user server and/or service unit may have hardware failure.
In summary, in the present disclosure, the server first determines a network identifier corresponding to the server according to a network where 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 the target address, thereby implementing configuration of the IP address of the service unit. According to the method and the device, 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 of an IP address configuration apparatus according to an exemplary embodiment, and as shown in fig. 5, the apparatus 200 may include the following modules applied to a server:
the network identifier determining module 201 is configured to determine, according to a network to which the server belongs, a network identifier corresponding to the server.
The physical address obtaining module 202 is configured to obtain, through a bus, a physical address of the service unit on the bus.
The host identifier generating module 203 is configured to generate a host identifier corresponding to the service unit according to the physical address.
The destination address generating module 204 is configured to generate a destination address according to the network identifier and the host identifier.
The destination address sending module 205 is configured to send the destination address to the service unit through the bus, so as to configure an IP address corresponding to the service unit as the destination address.
In one implementation, the network identification determination module 201 may also be 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 of another IP address configuration apparatus, as shown in fig. 6, according to an exemplary embodiment, in another implementation, the network identification determining module 201 may further include:
the first data searching submodule 2011 is configured to search first data from a preset database according to a server identifier of a server.
A second data acquisition submodule 2012 for acquiring second data of the first specified address bit in the physical address through the bus.
A network identification generation sub-module 2013 is configured to determine a network identification 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 second designated address bits in the physical address as a host identifier, wherein the second designated address bits are different from the first designated address bits.
Fig. 7 is a block diagram of another IP address configuration apparatus according to an exemplary embodiment, and as shown in fig. 7, the apparatus 200 further includes:
the network identifier detection module 206 is configured to detect validity of the network identifier.
The network identifier modifying module 207 is configured to modify the network identifier into a specified identifier if the network identifier is illegal.
Fig. 8 is a block diagram of another IP address configuration apparatus according to an exemplary embodiment, and as shown in fig. 8, the apparatus 200 further includes:
The physical address detection module 208 is configured to detect validity of a physical address.
The fault 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 the server and/or the service unit has a hardware fault.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
In summary, in the present disclosure, the server first determines a network identifier corresponding to the server according to a network where 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 the target address, thereby implementing configuration of the IP address of the service unit. According to the method and the device, 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 of an electronic device 900, according to 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 program stored in memory 932 may include one or more modules each corresponding to a set of instructions. Further, the processor 922 may be configured to execute the computer program to perform the IP address configuration method described above.
In addition, the electronic device 900 may further include a power supply component 926 and a communication component 950, the power supply 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 of the electronic device 900, e.g., wired or wireless communication. In addition, the electronic device 900 may also include an input/output (I/O) interface 958. The electronic device 900 may operate based on an operating system stored in the memory 932, such as Windows Server TM,Mac OS XTM,UnixTM,LinuxTM or the like.
In another exemplary embodiment, a computer readable storage medium is also provided, comprising program instructions which, when executed by a processor, implement the steps of the above-described IP address configuration method. 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, comprising a computer program executable by a programmable apparatus, the computer program having code portions for performing the above-described IP address configuration method when executed by the programmable apparatus.
In summary, in the present disclosure, the server first determines a network identifier corresponding to the server according to a network where 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 the target address, thereby implementing configuration of the IP address of the service unit. According to the method and the device, 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 have been described in detail above with reference to the accompanying drawings, but the present disclosure is not limited to the specific details of the embodiments described above, and various simple modifications may be made to the technical solutions of the present disclosure within the scope of the technical concept of the present disclosure, and all the simple modifications belong to the protection scope of the present disclosure.
In addition, the specific features described in the foregoing embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, the present disclosure does not further describe various possible combinations.
Moreover, any combination between the various embodiments of the present disclosure is possible as long as it does not depart from the spirit of the present disclosure, which should also be construed as the disclosure of the present disclosure.

Claims (8)

1. A method for configuring an IP address, applied to a server, where the server is connected to a service unit through a bus, the method comprising:
According to the network to which the server belongs, determining a network identifier corresponding to the server;
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;
the target address is sent to the service unit through the bus so as to configure an IP address corresponding to the service unit as the target address;
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 identification of the server;
acquiring second data of a first designated 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 second designated address bits in the physical address as the host identity, wherein the second designated address bits are different from the first designated address bits.
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 after determining the network identifier corresponding to the server according to the network to which the server belongs, the method further comprises:
Detecting the validity of the network identification;
and if the network identification is illegal, modifying the network identification into a designated identification.
4. The method of claim 1, wherein after said obtaining the physical address of the service unit on the bus via the bus, the method further comprises:
Detecting the legitimacy of the physical address;
If the physical address is illegal, a prompt message is sent, wherein the prompt message is used for indicating the server and/or the service unit has hardware faults.
5. An IP address configuration apparatus, applied to a server, comprising:
The network identification determining module is used for determining a network identification corresponding to the server according to the network to which the server belongs;
the physical address acquisition module is used for acquiring the physical address of the service unit on the bus through the bus;
the host identity generation module is used for generating a host identity corresponding to the service unit according to the physical address;
the target address generation module is used for generating a target address according to the network identifier and the host identifier;
A target address sending module, configured to send 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;
the network identification determining module comprises:
The first data searching sub-module is used for searching first data from a preset database according to the server identification of the server;
a second data obtaining sub-module, configured to obtain second data of the first specified address bit in the physical address through the bus;
A network identifier generating sub-module, configured to determine the network identifier according to the first data and the second data;
The host identity generation module is used for:
And taking third data of second designated address bits in the physical address as the host identity, wherein the second designated address bits are different from the first designated address bits.
6. The apparatus of claim 5, 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.
7. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the steps of the method according to any one of claims 1-4.
8. An electronic device, comprising:
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 claims 1-4.
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 CN114531420A (en) 2022-05-24
CN114531420B true 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 (4)

* 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
CN106506712A (en) * 2015-09-04 2017-03-15 施耐德电器工业公司 Automatic addressing method in ethernet communication architectural framework
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

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI244594B (en) * 2004-07-13 2005-12-01 Quanta Comp Inc Method for automatically assigning the address of communication ports and a blade server system
US9450910B2 (en) * 2014-02-06 2016-09-20 Lenovo Enterprise Solutions (Singapore) Pte. Ltd. Network address allocation
CN107404544B (en) * 2016-05-19 2020-10-30 联想企业解决方案(新加坡)有限公司 Method and apparatus for IP address assignment

Patent Citations (4)

* 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
CN106506712A (en) * 2015-09-04 2017-03-15 施耐德电器工业公司 Automatic addressing method in ethernet communication architectural framework
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
CN114531420A (en) 2022-05-24

Similar Documents

Publication Publication Date Title
US7844768B2 (en) Blade server system and method of managing same
CN107592209B (en) Method and system for automatically configuring IP address information by multi-network card server
US7817583B2 (en) Method for verifying a storage area network configuration
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
CN111490908B (en) Network speed measurement method, device, equipment, medium and speed measurement system
TWI638553B (en) Method for detecting internet protocol address and media access control address
CN107729038A (en) The baseboard management controller of firmware update and renewable firmware
CN104516838A (en) Management path determining method and device
CN107078806A (en) Optical transceiver apparatus and method
CN111506358B (en) Method and device for updating container configuration
US8055772B2 (en) System for effecting communication among a plurality of devices and method for assigning addresses therefor
CN111064786B (en) Account identifier management method and device
CN114327571B (en) File configuration method, chip testing machine and computer readable storage medium
CN109769038A (en) A kind of method and device of configuring internet protocol address
CN114531420B (en) IP address configuration method and device, storage medium and electronic equipment
CN111124828B (en) Data processing method, device, equipment and storage medium
US20120054391A1 (en) Apparatus and method for testing smnp cards
CN116303200A (en) PCIE equipment positioning management method, system, terminal and storage medium
CN116226008A (en) Port address configurator, configuration method and terminal
CN116048889A (en) Detection method and related device for cable connection of cabinet server
CN115333933A (en) Automatic management method, medium and equipment for server on rack in machine room
CN114860271A (en) PXE starting method, system and device and readable 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

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