Internet protocol address configuration method and device, terminal equipment and storage medium
Through the substrate management controller, the core board is traversed in the server and sent custom Ethernet protocol configuration instructions, the server automatically configures the IP address, solves the problems of IP address configuration complexity and cost in the existing technology, and realizes efficient IP Address configuration.
Patent Information
- Application Number
- CN202310854182.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-12
- Publication Date
- 2025-01-14
AI Technical Summary
Existing servers need to connect to DHCP server when obtaining IP addresses, which increases the cost and complexity of the test environment and lacks an efficient IP address configuration method.
Through the substrate management controller, traverse the core board, send Internet protocol address configuration instructions based on the custom Ethernet protocol, realize automatic IP address configuration of the core board, and avoid relying on DHCP server.
Without increasing server costs and test environment complexity, efficient configuration of core board IP addresses in server cabinets is achieved, simplifying automated testing and production processes.
Smart Images

Figure CN119316393A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of server technology, and in particular to a configuration method, device, terminal equipment and computer storage medium for an Internet Protocol address. Background Art
[0002] Most servers today support the DHCP protocol (Dynamic Host Configuration Protocol) to dynamically obtain IP addresses (Internet Protocol Address). However, to use the DHCP protocol to dynamically obtain IP addresses, the server cabinet must be connected to the DHCP server via a network cable to obtain the IP address, which will undoubtedly increase the cost of the server and the complexity of the server test environment.
[0003] Therefore, how to efficiently configure the IP address of the server cabinet without increasing the server cost and complexity of the test environment is a technical problem that needs to be solved urgently in the industry. Summary of the invention
[0004] The main purpose of this application is to provide a configuration method, device, terminal equipment and computer storage medium for an Internet Protocol address, aiming to achieve efficient configuration of the IP address of a server cabinet without increasing the server cost and the complexity of the test environment.
[0005] To achieve the above object, the present application provides a method for configuring an Internet Protocol address, the method for configuring an Internet Protocol address is applied to a baseboard management controller of a server, and the baseboard management controller is connected to each core board of the server;
[0006] The method for configuring the Internet Protocol address comprises the following steps:
[0007] Traversing each core board to determine a target core board to be configured with an Internet Protocol address;
[0008] An Internet Protocol address configuration instruction is sent to the target core board based on a preset custom Ethernet protocol, so that the target core board configures the Internet Protocol address according to the Internet Protocol address configuration instruction.
[0009] Optionally, after the step of sending an Internet Protocol address configuration instruction to the target core board based on a preset custom Ethernet protocol, the method further includes:
[0010] Detecting whether each core board is configured with an Internet Protocol address;
[0011] The core board that is not configured with the Internet Protocol address is used as the target core board to repeatedly perform the operations of traversing the target core board and sending the Internet Protocol address configuration instruction to the target core board until each core board is configured with the Internet Protocol address.
[0012] Optionally, the method further comprises:
[0013] Establishing a communication data packet based on the custom protocol;
[0014] The step of sending an Internet Protocol address configuration instruction to the target core board based on a preset custom Ethernet protocol includes:
[0015] Encapsulating the Internet Protocol address to be configured in the communication data packet to generate an Internet Protocol address configuration instruction;
[0016] The Internet Protocol address configuration instruction is sent to the target core board according to the custom Ethernet protocol.
[0017] Optionally, the method further comprises:
[0018] According to the respective media access control addresses of the respective core boards, traversing the respective core boards to determine the target core board to be configured with the Internet Protocol address among the respective core boards;
[0019] An Internet Protocol address uniquely identifying the target core board is generated according to the media access control address of the target core board.
[0020] Optionally, the step of generating a unique Internet Protocol address of the target core board according to the media access control address of the target core board comprises:
[0021] Acquire the correspondence between the media access control address and the Internet Protocol address;
[0022] According to the corresponding relationship, determining the target Internet Protocol address corresponding to the media access control address of the target core board in each Internet Protocol address;
[0023] The target Internet Protocol address is used as an Internet Protocol address that uniquely identifies the target core board.
[0024] In addition, to achieve the above purpose, the present application also provides another method for configuring an Internet Protocol address, wherein the method for configuring an Internet Protocol address is applied to each core board of a server, and each core board is connected to a baseboard management controller of the server;
[0025] The method for configuring the Internet Protocol address comprises the following steps:
[0026] receiving an Internet Protocol address configuration instruction sent by the baseboard management controller according to a preset custom Ethernet protocol;
[0027] The Internet Protocol address is configured according to the Internet Protocol address configuration instruction.
[0028] Optionally, the step of receiving an Internet Protocol address configuration instruction sent by the baseboard management controller according to a preset custom Ethernet protocol includes:
[0029] Monitoring communication data based on the custom Ethernet protocol to receive an Internet Protocol address configuration instruction sent by the baseboard management controller;
[0030] The step of configuring the Internet Protocol address according to the Internet Protocol address configuration instruction comprises:
[0031] The Internet Protocol address configuration instruction is subjected to Ethernet data parsing to obtain the Internet Protocol address to be configured for address setting.
[0032] In addition, to achieve the above-mentioned purpose, the present application also provides an Internet Protocol address configuration device, the Internet Protocol address configuration device is applied to a baseboard management controller of a server, and the baseboard management controller is connected to each core board of the server;
[0033] The configuration device of the Internet Protocol address includes:
[0034] A core board determination module, used for traversing the core boards to determine a target core board to be configured with an Internet Protocol address;
[0035] A first address configuration module, used for sending an Internet Protocol address configuration instruction to the target core board based on a preset custom Ethernet protocol, so that the target core board configures the Internet Protocol address according to the Internet Protocol address configuration instruction;
[0036] The configuration device of the Internet Protocol address is also used for the core board, and the configuration device of the Internet Protocol address also includes:
[0037] A communication interaction module, configured to receive an Internet Protocol address configuration instruction sent by the baseboard management controller according to a preset custom Ethernet protocol;
[0038] The second address configuration module is used to configure the Internet Protocol address according to the Internet Protocol address configuration instruction.
[0039] Optionally, each functional module of the Internet Protocol address configuration device implements the steps of the Internet Protocol address configuration method described above during operation.
[0040] In addition, to achieve the above-mentioned purpose, the present application also provides a terminal device, which includes: a memory, a processor, and an Internet Protocol address configuration program stored in the memory and runnable on the processor, and the Internet Protocol address configuration program, when executed by the processor, implements the steps of the Internet Protocol address configuration method as described above.
[0041] In addition, to achieve the above-mentioned purpose, the present application also provides a computer storage medium, on which a configuration program for an Internet Protocol address is stored, and when the configuration program for the Internet Protocol address is executed by a processor, the steps of the Internet Protocol address configuration method as described above are implemented.
[0042] The embodiments of the present application provide a method, apparatus, terminal device, and computer storage medium for configuring an Internet Protocol address. The method for configuring an Internet Protocol address is applied to a baseboard management controller of a server. The baseboard management controller is connected to each core board of the server, and determines a target core board for configuring an Internet Protocol address by traversing each core board; and sends an Internet Protocol address configuration instruction to the target core board based on a preset custom Ethernet protocol, so that the target core board configures the Internet Protocol address according to the Internet Protocol address configuration instruction.
[0043] In an embodiment of the present application, a method for configuring an Internet Protocol address provided by the present application, during the process of configuring the Internet Protocol address for a core board in a server, after determining the target core board to be configured with the Internet Protocol address among the core boards, based on the communication connection between the baseboard management controller and each core board, sends an Internet Protocol address configuration instruction to the target core board based on a preset custom Ethernet protocol, so that the target core board configures the Internet Protocol address according to the Internet Protocol address configuration instruction.
[0044] Thus, compared with the traditional method of using the DHCP protocol to dynamically obtain the Internet Protocol for IP address configuration, the embodiment of the present application can realize the operation of automatically configuring the IP address of the server based on the communication connection between the baseboard management controller and each core board, thereby eliminating the need to rely on the DHCP server, which can greatly save equipment costs and simplify test complexity during server automated testing and production. That is, the embodiment of the present application realizes efficient configuration of the IP address of the core board in the server cabinet without increasing the server cost and the complexity of the test environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a schematic diagram of the structure of a terminal device in the hardware operating environment involved in the embodiment of the present application;
[0046] Figure 2 A schematic diagram of the steps of an embodiment of a method for configuring an Internet Protocol address of the present application;
[0047] Figure 3 A schematic diagram of a server topology structure involved in an embodiment of a method for configuring an Internet Protocol address of the present application;
[0048] Figure 4 A schematic flow chart of another embodiment of the method for configuring an Internet Protocol address of the present application;
[0049] Figure 5 This is a schematic diagram of the functional module structure involved in an embodiment of an Internet Protocol address configuration device of the present application.
[0050] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0051] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0052] Reference Figure 1 , Figure 1 This is a schematic diagram of the terminal device structure of the hardware operating environment involved in the embodiment of the present application.
[0053] It should be noted that Figure 1 That is, it can be a structural diagram of the hardware operating environment of the terminal device. The terminal device of the embodiment of the present application can be a server that executes the configuration method of the Internet Protocol address of the present application, a BMC (Baseboard Management Controller) in the server, a core board in the server that is connected to the baseboard management controller BMC, and a device or terminal that is integrated in the server or connected to the server so as to control the server, BMC or core board to execute the configuration method of the Internet Protocol address of the present application.
[0054] It should be understood that, based on different design requirements of actual applications, the terminal device of the embodiment of the present application may of course also be other devices or apparatus modules. For example, the terminal device may specifically be a data storage control terminal, a PC or a portable computer, etc.
[0055] like Figure 1As shown, the terminal device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0056] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the terminal device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0057] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a data storage module, a network communication module, a user interface module, and an Internet Protocol address configuration program.
[0058] exist Figure 1 In the terminal device shown, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with the user; in the embodiment of the present application, the processor 1001 and the memory 1005 can be set in the terminal device. Based on this, when the terminal device is the above-mentioned mobile terminal, the configuration program of the Internet Protocol address stored in the memory 1005 is called by the processor 1001, and the following operations are performed:
[0059] Traversing each core board to determine a target core board to be configured with an Internet Protocol address;
[0060] An Internet Protocol address configuration instruction is sent to the target core board based on a preset custom Ethernet protocol, so that the target core board configures the Internet Protocol address according to the Internet Protocol address configuration instruction.
[0061] Further, the processor 1001 calls the configuration program of the Internet Protocol address stored in the memory 1005, and after executing the step of sending the Internet Protocol address configuration instruction to the target core board based on the preset custom Ethernet protocol, further performs the following operations:
[0062] Detecting whether each core board is configured with an Internet Protocol address;
[0063] The core board that is not configured with the Internet Protocol address is used as the target core board to repeatedly perform the operations of traversing the target core board and sending the Internet Protocol address configuration instruction to the target core board until each core board is configured with the Internet Protocol address.
[0064] Further, the processor 1001 calls the configuration program of the Internet Protocol address stored in the memory 1005, and also performs the following operations:
[0065] Establishing a communication data packet based on the custom protocol;
[0066] Encapsulating the Internet Protocol address to be configured in the communication data packet to generate an Internet Protocol address configuration instruction;
[0067] The Internet Protocol address configuration instruction is sent to the target core board according to the custom Ethernet protocol.
[0068] Further, the processor 1001 calls the configuration program of the Internet Protocol address stored in the memory 1005, and also performs the following operations:
[0069] According to the respective media access control addresses of the respective core boards, traversing the respective core boards to determine the target core board to be configured with the Internet Protocol address among the respective core boards;
[0070] An Internet Protocol address uniquely identifying the target core board is generated according to the media access control address of the target core board.
[0071] Further, the processor 1001 calls the configuration program of the Internet Protocol address stored in the memory 1005, and also performs the following operations:
[0072] Acquire the correspondence between the media access control address and the Internet Protocol address;
[0073] According to the corresponding relationship, determining the target Internet Protocol address corresponding to the media access control address of the target core board in each Internet Protocol address;
[0074] The target Internet Protocol address is used as an Internet Protocol address that uniquely identifies the target core board.
[0075] Further, the processor 1001 calls the configuration program of the Internet Protocol address stored in the memory 1005, and performs the following operations:
[0076] receiving an Internet Protocol address configuration instruction sent by the baseboard management controller according to a preset custom Ethernet protocol;
[0077] The Internet Protocol address is configured according to the Internet Protocol address configuration instruction.
[0078] Further, the processor 1001 calls the configuration program of the Internet Protocol address stored in the memory 1005, and also performs the following operations:
[0079] Monitoring communication data based on the custom Ethernet protocol to receive an Internet Protocol address configuration instruction sent by the baseboard management controller;
[0080] The Internet Protocol address configuration instruction is subjected to Ethernet data parsing to obtain the Internet Protocol address to be configured for address setting.
[0081] Based on the above-mentioned terminal device, various embodiments of the method for configuring the Internet Protocol address of the present application are provided.
[0082] Please refer to Figure 2 , Figure 2 This is a flow chart of the first embodiment of the method for configuring an Internet Protocol address of the present application.
[0083] It should be understood that, although a logical order is shown in the flowchart, in some cases, the configuration method of the Internet Protocol address of the present application can certainly perform the steps shown or described in a different order from that herein. In addition, the configuration method of the Internet Protocol address of the present application is applied to the above-mentioned terminal device. In order to clearly illustrate the configuration method of the Internet Protocol address of the present application, the following text will respectively use one of the terminal device, the baseboard management controller BMC, and another type of the terminal device, the core board, as the execution subject to describe the configuration method of the Internet Protocol address of the present application.
[0084] like Figure 2 As shown, in the first embodiment of the method for configuring the Internet Protocol address of the present application, the method for configuring the Internet Protocol address of the present application may include the following steps:
[0085] Step S10: traverse the core boards to determine the target core board to be configured with the Internet Protocol address;
[0086] In this embodiment, during the configuration of the Internet Protocol address for the core board in the server, the baseboard management controller BMC in the server first traverses and detects each core board in the server to determine one or more target core boards among the core boards for which the Internet Protocol address is to be configured.
[0087] It should be noted that in this embodiment and other feasible embodiments described below, the baseboard management controller BMC in the server is connected to the server cabinet where each core board of the server is located through a network cable. Figure 3 As shown, the baseboard management controller BMC is connected to the switch chip in the server cabinet through the network cable, and the switch chip is connected to each core board through the next-level switch chip using the USB3.0 to network port. In this way, the baseboard management controller BMC can configure the Internet Protocol address for each target core board in each core board through the connection architecture of BMC-network cable-switch chip-core board.
[0088] Step S20: Sending an Internet Protocol address configuration instruction to the target core board based on a preset custom Ethernet protocol, so that the target core board configures the Internet Protocol address according to the Internet Protocol address configuration instruction.
[0089] In this embodiment, after the baseboard management controller BMC determines one or more target core boards to be configured with Internet Protocol addresses from the various core boards of the server, it immediately uses a preset custom Ethernet protocol to send an Internet Protocol address configuration instruction to the target core board, and the target core board receives the Internet Protocol address configuration instruction based on the custom Ethernet protocol, and configures itself based on the Internet Protocol address obtained by parsing the instruction.
[0090] It should be noted that, in the present embodiment, when the baseboard management controller BMC determines multiple target core boards, it can issue the Internet protocol address configuration instructions of each target core board to each target core board respectively in sequence, or, when the server performance allows, the baseboard management controller BMC can also issue the Internet protocol address configuration instructions of each target core board to each target core board at the same time. Thus, each target core board can configure its own unique Internet protocol address according to its own exclusive Internet protocol address configuration instructions.
[0091] In addition, the preset custom Ethernet protocol is based on the connection architecture between the above-mentioned baseboard management controller BMC and each core board, and the protocol for data communication interaction between the baseboard management controller BMC and each core board is autonomously set. It should be understood that, based on the different design needs of actual applications, among different feasible implementation methods, based on the differences in the communication protocols that the server itself can support, the above-mentioned custom Ethernet protocol can certainly be replaced with other types of protocols, but no matter how the protocol type is, as long as the protocol is defined as data communication interaction between the baseboard management controller BMC and each core board, it should belong to the technical scope of the configuration method of the Internet Protocol address of this application.
[0092] In addition, each core board in the server can specifically control the data communication interaction process with the baseboard management controller BMC through the core board application program.
[0093] Optionally, in a feasible embodiment, the configuration method of the Internet Protocol address of the present application may also include:
[0094] Establishing a communication data packet based on the custom protocol;
[0095] In this embodiment, before the baseboard management controller BMC sends an Internet Protocol address configuration instruction to the target core board based on the above-mentioned preset custom Ethernet protocol, the baseboard management controller BMC also pre-establishes a communication data packet based on the custom protocol for data communication interaction with each core board in the server.
[0096] Exemplarily, in a feasible embodiment, the above-mentioned communication data packet may specifically be a SOCK_RAW type SOCKET based on the above-mentioned custom Ethernet protocol.
[0097] Based on this, the step of "sending an Internet Protocol address configuration instruction to the target core board based on a preset custom Ethernet protocol" in the above step S20 may include:
[0098] Encapsulating the Internet Protocol address to be configured in the communication data packet to generate an Internet Protocol address configuration instruction;
[0099] The Internet Protocol address configuration instruction is sent to the target core board according to the custom Ethernet protocol.
[0100] In the present embodiment, when the baseboard management controller BMC issues an Internet Protocol address configuration instruction to the target core board based on the above-mentioned preset custom Ethernet protocol, the Internet Protocol address to be configured to the target core board that has been generated is first encapsulated in the communication data packet established based on the above-mentioned custom Ethernet protocol, thereby generating an Internet Protocol address configuration instruction exclusive to the target core board. Afterwards, the baseboard management controller BMC can further send the generated Internet Protocol address configuration instruction to the target core board or the application corresponding to the target core board according to the content of the above-mentioned custom Ethernet protocol.
[0101] For example, in this embodiment, after the baseboard management controller BMC establishes the SOCK_RAW type SOCKET based on the custom Ethernet protocol, it can fill the generated Internet Protocol address of the target core board into the Ethernet data frame by further constructing the Ethernet data frame, thereby generating an Internet Protocol address configuration instruction exclusive to the target core board.
[0102] Optionally, in some feasible embodiments, the configuration method of the Internet Protocol address of the present application may also include:
[0103] According to the respective media access control addresses of the respective core boards, traversing the respective core boards to determine the target core board to be configured with the Internet Protocol address among the respective core boards;
[0104] An Internet Protocol address uniquely identifying the target core board is generated according to the media access control address of the target core board.
[0105] In this embodiment, when the baseboard management controller BMC determines the target core board to be configured with the Internet Protocol address among the core boards of the server, the baseboard management controller BMC traverses the core boards in sequence based on the media access control addresses of the core boards to confirm one or more core boards among the core boards that have not been configured with the Internet Protocol address at the current moment. After that, the baseboard management controller BMC can determine the one or more core boards as the target core boards to be configured with the Internet Protocol address.
[0106] Exemplarily, after the baseboard management controller BMC completes the configuration of the Internet Protocol address of a core board among each core board, the baseboard management controller BMC marks the media access control address of the core board. Then, the baseboard management controller BMC takes an unmarked media access control address as the target MAC address in order through the respective media access control addresses of each core board, thereby setting the target MAC address to the media access control address of the server core board that currently needs to configure the Internet Protocol address - the MAC address, so that the server core board is the target core board to be configured with the Internet Protocol address.
[0107] In addition, in this embodiment, the baseboard management controller BMC can also automatically and sequentially generate an Internet Protocol address for uniquely identifying the target core board according to the media access control address of the target core board whose Internet Protocol address is currently to be configured.
[0108] Optionally, in a feasible embodiment, the above step of "generating a unique Internet Protocol address of the target core board according to the media access control address of the target core board" may include:
[0109] Acquire the correspondence between the media access control address and the Internet Protocol address;
[0110] According to the corresponding relationship, determining the target Internet Protocol address corresponding to the media access control address of the target core board in each Internet Protocol address;
[0111] The target Internet Protocol address is used as an Internet Protocol address that uniquely identifies the target core board.
[0112] In the present embodiment, when the baseboard management controller BMC generates the Internet Protocol address that uniquely identifies the target core board, the corresponding relationship between the respective media access control addresses of each core board and the Internet Protocol address can be obtained. Then, the baseboard management controller BMC can determine the media access control address of the current target core board according to the corresponding relationship, and the only target Internet Protocol address corresponding to each Internet Protocol address. Finally, the baseboard management controller BMC can determine the target Internet Protocol address as the Internet Protocol address for uniquely identifying the target core board.
[0113] It should be noted that, in the present embodiment, the correspondence between the media access control addresses and the Internet Protocol addresses can specifically be a relationship table in which a media access control address corresponds to an Internet Protocol address one to one, so that the baseboard management controller BMC can determine the Internet Protocol address used to uniquely identify the target core board by performing a table lookup operation based on the media access control address of the target core board.
[0114] Optionally, in a feasible embodiment, in the above-mentioned step S20: sending an Internet Protocol address configuration instruction to the target core board based on a preset custom Ethernet protocol, so that the target core board configures the Internet Protocol address according to the Internet Protocol address configuration instruction, the configuration method of the Internet Protocol address of the present application may also include:
[0115] Detecting whether each core board is configured with an Internet Protocol address;
[0116] The core board that is not configured with the Internet Protocol address is used as the target core board to repeatedly perform the operations of traversing the target core board and sending the Internet Protocol address configuration instruction to the target core board until each core board is configured with the Internet Protocol address.
[0117] In the present embodiment, baseboard management controller BMC, after each time according to each embodiment of above-mentioned steps S10 and step S20, performs the configuration operation of Internet protocol address to target core board, further traverses each core board to detect and determine whether Internet protocol address has been configured in each core board. Afterwards, if it is detected that there is still a core board without configuring Internet protocol address in each core board, baseboard management controller BMC will re-execute each embodiment of above-mentioned steps S10 to step S20 by this core board as new target core board, traverse target core board and send Internet protocol address configuration instruction to target core board, so that this new target core also carries out the setting of Internet protocol address according to this Internet protocol address configuration instruction. In this way, baseboard management controller BMC can make all core boards in server automatically complete the configuration of Internet protocol address by the circulation of above-mentioned operation process.
[0118] In the present embodiment, in the process of configuring the Internet Protocol address for the core board in the server, the baseboard management controller BMC in the server first determines one or more target core boards to be configured with the Internet Protocol address among the core boards by traversing and detecting each core board in the server. After the baseboard management controller BMC determines one or more target core boards to be configured with the Internet Protocol address from the core boards of the server, it immediately uses a preset custom Ethernet protocol to send an Internet Protocol address configuration instruction to the target core board, and the target core board receives the Internet Protocol address configuration instruction based on the custom Ethernet protocol, and configures the Internet Protocol address based on parsing the instruction to obtain the Internet Protocol address.
[0119] Thus, compared with the traditional method of using the DHCP protocol to dynamically obtain the Internet Protocol for IP address configuration, the embodiment of the present application can realize the operation of automatically configuring the IP address of the server based on the communication connection between the baseboard management controller and each core board, thereby eliminating the need to rely on the DHCP server, which can greatly save equipment costs and simplify test complexity during server automated testing and production. That is, the embodiment of the present application realizes efficient configuration of the IP address of the core board in the server cabinet without increasing the server cost and the complexity of the test environment.
[0120] Furthermore, to achieve the above-mentioned purpose, the present application also provides a method for configuring an Internet Protocol address. The method for configuring an Internet Protocol address of the present application is applied to each core board in the above-mentioned server, or is applied to the application programs corresponding to each core board.
[0121] like Figure 4 As shown, when the configuration method of the Internet Protocol address of the present application is applied to the core board, the configuration method of the Internet Protocol address of the present application may include the following steps:
[0122] Step S30: receiving an Internet Protocol address configuration instruction sent by the baseboard management controller according to a preset custom Ethernet protocol;
[0123] In this embodiment, before setting its own Internet Protocol address, each core board in the server also establishes a monitoring event for the connected baseboard management controller BMC based on the above-mentioned custom Ethernet protocol, thereby receiving the Internet Protocol address configuration instructions sent by the baseboard management controller BMC based on monitoring the baseboard management controller BMC.
[0124] Step S40: configuring the Internet Protocol address according to the Internet Protocol address configuration instruction.
[0125] In this embodiment, after receiving the Internet Protocol address configuration instruction sent by the baseboard management controller BMC, each core board in the server can obtain the Internet Protocol address encapsulated in the communication data packet by parsing the instruction. In this way, the core board can set the Internet Protocol address as its own unique address for subsequent server testing and / or self-test processes.
[0126] It should be noted that, in this embodiment, each core board in the server can be managed by an application program, that is, the application program is based on the above-mentioned Figure 3The core board shown is physically connected to the baseboard management controller BMC to monitor the communication interaction data sent by the baseboard management controller BMC according to the custom Ethernet protocol, so that after receiving the exclusive Internet Protocol address configuration instruction sent by the baseboard management controller BMC for a certain target core board, the application program parses the instruction and sets the Internet Protocol address carried in the instruction as the Internet Protocol address of the target core board. Exemplarily, in a feasible embodiment, the application program of each core board can specifically set the Internet Protocol address for each core board of the server through commands such as SIOCSIFADDR.
[0127] Optionally, in a feasible embodiment, the above step S30: receiving the Internet Protocol address configuration instruction sent by the baseboard management controller according to a preset custom Ethernet protocol may include:
[0128] Monitoring communication data based on the custom Ethernet protocol to receive an Internet Protocol address configuration instruction sent by the baseboard management controller;
[0129] In this embodiment, each core board in the server can create communication data monitoring for the baseboard management controller BMC based on the above-mentioned custom Ethernet protocol, so that when the baseboard management controller BMC sends communication interaction data, it receives the Internet Protocol address configuration instruction sent by the baseboard management controller.
[0130] Optionally, in other feasible embodiments, the core board in the server can also be uniformly monitored by an application program for communication data of the baseboard management controller BMC. Exemplarily, the application program can create a SOCK_RAW type SOCKET and monitor it, so as to receive Internet protocol address configuration instructions for one or more target core boards from the baseboard management controller BMC.
[0131] In addition, in a feasible embodiment, the above step S40: configuring the Internet Protocol address according to the Internet Protocol address configuration instruction may include:
[0132] The Internet Protocol address configuration instruction is subjected to Ethernet data parsing to obtain the Internet Protocol address to be configured for address setting.
[0133] In this embodiment, after receiving the Internet Protocol address configuration instruction for one or more target core boards from the baseboard management controller BMC, each core board in the server or the application corresponding to the core board can immediately perform Ethernet data parsing on the instruction to obtain the Internet Protocol address encapsulated in the communication data packet by the baseboard management controller BMC, and then use the Internet Protocol address for address setting.
[0134] It should be noted that, in the present embodiment, if multiple target core boards all receive the Internet Protocol address configuration instruction issued by the baseboard management controller BMC, the target core board can determine whether the Internet Protocol address configuration instruction is an instruction exclusive to itself based on its own media access control address. Thus, when it is determined that it is an instruction exclusive to itself only, the target core board will continue to parse the instruction to obtain the Internet Protocol address therein for setting.
[0135] If the application corresponding to each core board receives an Internet Protocol address configuration instruction issued by the baseboard management controller BMC, the application can directly parse the instruction and obtain the Internet Protocol address therein, and then configure the Internet Protocol address of each target core board in sequence according to the media access control address of each target core board. That is, the Internet Protocol address is currently configured to the target core board with the first media access control address sorted, and the next time a new Internet Protocol address configuration instruction is received from the baseboard management controller BMC, the new Internet Protocol address is parsed to obtain the new Internet Protocol address, and then the new Internet Protocol address is configured to the next target core board.
[0136] For example, after receiving the Internet Protocol address configuration instruction sent by the baseboard management controller BMC, the application of the core board can parse the Ethernet data frame according to the instruction to obtain the Internet Protocol address filled in the Ethernet data frame by the baseboard management controller BMC, because the Internet Protocol address configuration instruction is actually data of a custom Ethernet protocol type.
[0137] In the present embodiment, the configuration method of the Internet Protocol address of the present application is that each core board in the server also establishes a monitoring event for the connected baseboard management controller BMC based on the above-mentioned custom Ethernet protocol before setting its own Internet Protocol address, thereby receiving the Internet Protocol address configuration instruction sent by the baseboard management controller BMC based on monitoring the baseboard management controller BMC. After receiving the Internet Protocol address configuration instruction sent by the baseboard management controller BMC, each core board in the server can obtain the Internet Protocol address encapsulated in the communication data packet by parsing the instruction, so that the core board can set the Internet Protocol address to its own unique address for subsequent server testing and / or self-test processes.
[0138] Thus, compared with the traditional method of using the DHCP protocol to dynamically obtain the Internet Protocol for IP address configuration, the configuration method of the Internet Protocol address of the present application can realize the operation of automatically configuring the IP address of the server based on the communication connection between the baseboard management controller and each core board, thereby eliminating the need to rely on the DHCP server, which can greatly save equipment costs and simplify test complexity during server automated testing and production. That is, the embodiment of the present application realizes efficient configuration of the IP address of the core board in the server cabinet without increasing the server cost and the complexity of the test environment.
[0139] For further information, please refer to Figure 5 To achieve the above purpose, the present application also provides an Internet Protocol address configuration device. The Internet Protocol address configuration device of the present application is applied to a baseboard management controller of a server, and the baseboard management controller is connected to each core board of the server;
[0140] The configuration device of the Internet Protocol address of this application includes:
[0141] A core board determination module 10, used for traversing the core boards to determine a target core board to be configured with an Internet Protocol address;
[0142] A first address configuration module 20, configured to send an Internet Protocol address configuration instruction to the target core board based on a preset custom Ethernet protocol, so that the target core board configures the Internet Protocol address according to the Internet Protocol address configuration instruction;
[0143] Optionally, the configuration device of the Internet Protocol address of the present application is also used for the core board, and the configuration device of the Internet Protocol address further includes:
[0144] The communication interaction module 30 is used to receive the Internet protocol address configuration instruction sent by the baseboard management controller according to a preset custom Ethernet protocol;
[0145] The second address configuration module 40 is used to configure the Internet Protocol address according to the Internet Protocol address configuration instruction.
[0146] Optionally, the configuration device of the Internet Protocol address of the present application further includes:
[0147] A detection module, used to detect whether each core board is configured with an Internet Protocol address;
[0148] The loop module is used to use the core board without Internet Protocol address as the target core board to repeatedly perform the operations of traversing the target core board and sending Internet Protocol address configuration instructions to the target core board until each core board is configured with an Internet Protocol address.
[0149] Optionally, the configuration device of the Internet Protocol address of the present application further includes:
[0150] A first data establishment module, used to establish a communication data packet based on the custom protocol;
[0151] Optionally, the first address configuration module 20 is further used to encapsulate the Internet Protocol address to be configured in the communication data packet to generate an Internet Protocol address configuration instruction; and send the Internet Protocol address configuration instruction to the target core board according to the custom Ethernet protocol.
[0152] Optionally, the core board determination module 10 is further used to traverse the core boards to determine a target core board to be configured with an Internet Protocol address among the core boards according to the respective media access control addresses of the core boards;
[0153] Optionally, the configuration device of the Internet Protocol address of the present application further includes:
[0154] The address generation module is used to generate an Internet Protocol address that uniquely identifies the target core board according to the media access control address of the target core board.
[0155] Optionally, the address generation module is also used to obtain the correspondence between the media access control address and the Internet Protocol address; determine the target Internet Protocol address corresponding to the media access control address of the target core board in each Internet Protocol address based on the correspondence; and use the target Internet Protocol address as the Internet Protocol address that uniquely identifies the target core board.
[0156] Optionally, the communication interaction module 30 is further used to monitor communication data based on the custom Ethernet protocol to receive an Internet Protocol address configuration instruction sent by the baseboard management controller;
[0157] Optionally, the second address configuration module 40 is further used to perform Ethernet data parsing on the Internet Protocol address configuration instruction to obtain the Internet Protocol address to be configured for address setting.
[0158] The specific embodiments of the operation of the various functional modules of the Internet Protocol address configuration device provided in the present application are basically the same as the embodiments of the Internet Protocol address configuration method described above, and will not be described in detail here.
[0159] In addition, the present application also provides a terminal device, which includes: a memory, a processor, and an Internet Protocol address configuration program stored in the memory and executable on the processor, wherein the processor of the terminal device implements the steps of the Internet Protocol address configuration method as described in any of the above embodiments when executing the Internet Protocol address configuration program.
[0160] The specific embodiments of the terminal device of the present application are basically the same as the embodiments of the above-mentioned Internet Protocol address configuration method, and will not be described in detail here.
[0161] In addition, the present application also provides a computer storage medium, on which a configuration program for an Internet Protocol address is stored. When the configuration program for the Internet Protocol address is executed by a processor, the steps of the Internet Protocol address configuration method described in any of the above embodiments are implemented.
[0162] The specific embodiments of the computer storage medium of the present invention are basically the same as the embodiments of the above-mentioned Internet Protocol address configuration method, and will not be described in detail here.
[0163] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0164] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0165] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes several instructions for enabling a terminal device (which can be a device for executing the configuration method of the Internet Protocol address of the present application, and the terminal device can specifically be a mobile terminal, a data storage control terminal, a PC or a portable computer, etc.) to execute the methods described in each embodiment of the present application.
[0166] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for configuring an Internet Protocol address, characterized in that: The configuration method of the Internet Protocol address is applied to a baseboard management controller of a server, and the baseboard management controller is connected to each core board of the server; The method for configuring the Internet Protocol address comprises the following steps: Traversing each core board to determine a target core board to be configured with an Internet Protocol address; An Internet Protocol address configuration instruction is sent to the target core board based on a preset custom Ethernet protocol, so that the target core board configures the Internet Protocol address according to the Internet Protocol address configuration instruction.
2. The method for configuring an Internet Protocol address as claimed in claim 1, wherein: After the step of sending an Internet Protocol address configuration instruction to the target core board based on a preset custom Ethernet protocol, the method further includes: Detecting whether each core board is configured with an Internet Protocol address; The core board that is not configured with the Internet Protocol address is used as the target core board to repeatedly perform the operations of traversing the target core board and sending the Internet Protocol address configuration instruction to the target core board until each core board is configured with the Internet Protocol address.
3. The method for configuring an Internet Protocol address as claimed in claim 1, wherein: The method further comprises: Establishing a communication data packet based on the custom protocol; The step of sending an Internet Protocol address configuration instruction to the target core board based on a preset custom Ethernet protocol includes: Encapsulating the Internet Protocol address to be configured in the communication data packet to generate an Internet Protocol address configuration instruction; The Internet Protocol address configuration instruction is sent to the target core board according to the custom Ethernet protocol.
4. The method for configuring an Internet Protocol address according to any one of claims 1 to 3, characterized in that: The method further comprises: According to the respective media access control addresses of the respective core boards, traversing the respective core boards to determine the target core board to be configured with the Internet Protocol address among the respective core boards; An Internet Protocol address uniquely identifying the target core board is generated according to the media access control address of the target core board.
5. The method for configuring an Internet Protocol address as claimed in claim 4, characterized in that: The step of generating a unique Internet Protocol address of the target core board according to the media access control address of the target core board comprises: Acquire the correspondence between the media access control address and the Internet Protocol address; According to the corresponding relationship, determining the target Internet Protocol address corresponding to the media access control address of the target core board in each Internet Protocol address; The target Internet Protocol address is used as an Internet Protocol address that uniquely identifies the target core board.
6. A method for configuring an Internet Protocol address, characterized in that: The configuration method of the Internet Protocol address is applied to each core board of the server, and each core board is connected to the baseboard management controller of the server; The method for configuring the Internet Protocol address comprises the following steps: receiving an Internet Protocol address configuration instruction sent by the baseboard management controller according to a preset custom Ethernet protocol; The Internet Protocol address is configured according to the Internet Protocol address configuration instruction.
7. The method for configuring an Internet Protocol address as claimed in claim 6, characterized in that: The step of receiving the Internet Protocol address configuration instruction sent by the baseboard management controller according to the preset custom Ethernet protocol includes: Monitoring communication data based on the custom Ethernet protocol to receive an Internet Protocol address configuration instruction sent by the baseboard management controller; The step of configuring the Internet Protocol address according to the Internet Protocol address configuration instruction comprises: The Internet Protocol address configuration instruction is subjected to Ethernet data parsing to obtain the Internet Protocol address to be configured for address setting.
8. A device for configuring an Internet Protocol address, characterized in that: The Internet Protocol address configuration device is applied to a baseboard management controller of a server, and the baseboard management controller is connected to each core board of the server; The configuration device of the Internet Protocol address includes: A core board determination module, used for traversing the core boards to determine a target core board to be configured with an Internet Protocol address; A first address configuration module, used for sending an Internet Protocol address configuration instruction to the target core board based on a preset custom Ethernet protocol, so that the target core board configures the Internet Protocol address according to the Internet Protocol address configuration instruction; The configuration device of the Internet Protocol address is also used for the core board, and the configuration device of the Internet Protocol address further includes: A communication interaction module, configured to receive an Internet Protocol address configuration instruction sent by the baseboard management controller according to a preset custom Ethernet protocol; The second address configuration module is used to configure the Internet Protocol address according to the Internet Protocol address configuration instruction.
9. A terminal device, characterized in that: The terminal device includes: a memory, a processor, and an Internet Protocol address configuration program stored in the memory and executable on the processor. When the Internet Protocol address configuration program is executed by the processor, the steps of the Internet Protocol address configuration method as described in any one of claims 1 to 7 are implemented.
10. A computer storage medium, characterized in that: The computer storage medium stores an Internet Protocol address configuration program, and when the Internet Protocol address configuration program is executed by the processor, the steps of the Internet Protocol address configuration method as described in any one of claims 1 to 7 are implemented.