Method and device for controlling opening of network port guiding function, server and medium
By obtaining and processing user settings options, users are allowed to customize the boot function of opening the server network port, which solves the problem that cannot meet the configuration requirements of different network cards in traditional methods, and realizes flexible configuration and efficient opening process.
Patent Information
- Application Number
- CN202411755545.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-30
- Publication Date
- 2025-02-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The traditional BIOS version has its own network port boot function activation method can only meet the customer's fixed network card configuration and fixed network port requirements, but cannot meet the different network card configuration requirements, resulting in the need to re-adapt the new BIOS version when the requirements change, which adds The cost and reduce the efficiency of turning on the network port boot function.
By obtaining the current value of the setting options, the user needs to customize the boot function to enable, and prompt the user to enter the network port where the boot function is to be enabled. After the server restarts, the network port entered by the boot system is obtained through the boot system and its boot function is opened, while the boot function of other network ports is turned off.
Different configuration requirements for network port boot function by different users are realized, which reduces costs, improves the efficiency of turning on network port boot function, and improves the compatibility of the boot system version, allowing configuration changes and changes at any time.
Smart Images

Figure CN119402346A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer network technology, and in particular to a method, device, server and medium for controlling the activation of a network port boot function. Background Art
[0002] Traditional operating system installation methods usually require each computer to have a built-in hard disk or other storage device. However, in the absence of built-in storage devices, the Preboot Execution Environment (PXE) technology is widely used to start the computer. PXE technology obtains the operating system image from the server through the network, and does not require local storage devices at all, which not only saves hardware costs, but also improves the flexibility and maintainability of the system.
[0003] With the development of server technology, more and more network card devices are used on servers, and users may have their own customization requirements. However, in the related methods of enabling the network port boot function (i.e., PXE function), the Basic Input Output System (BIOS) version usually comes with a PXE solution. A BIOS version can only adapt to one PXE customization solution, which can only meet the customer's fixed network card configuration and fixed network port requirements, and cannot meet different network card configuration requirements. When the requirements change, a new BIOS version needs to be re-adapted. Since additional development versions or scripts are required, the cost is increased and the efficiency of enabling the network port boot function is reduced.
[0004] It can be seen that providing a new method for enabling the network port boot function is a technical problem that needs to be solved urgently by those skilled in the art. Summary of the invention
[0005] The purpose of the present invention is to provide a method, device, server and medium for controlling the activation of the network port boot function, so as to solve the problem that the method for activating the network port boot function based on the boot function provided by the BIOS version can only meet the customer's fixed network card configuration and fixed network port requirements, and cannot meet different network card configuration requirements. When the requirements change, it is necessary to re-adapt the new BIOS version, which increases the cost and reduces the efficiency of activating the network port boot function due to the need for additional development versions or scripts.
[0006] In order to solve the above technical problems, the present invention provides a method for controlling the activation of a network port boot function, comprising:
[0007] Obtaining the current value of a setting option; wherein the value of the setting option is used to represent a user's customized need to enable a boot function or a need to enable an uncustomized boot function; the user's customized need to enable a boot function includes enabling a boot function of a preset network port of a preset network card;
[0008] In the case where it is detected that the current value represents a user's customized need to enable the boot function, prompting the user to perform an operation of inputting a network port of the boot function to be enabled on a sub-option corresponding to the setting option;
[0009] After the server is restarted, the network port for the boot function to be enabled input by the user is obtained through the boot system, and the boot function of the network port for the boot function to be enabled is enabled.
[0010] On the one hand, after obtaining the network port of the to-be-enabled guidance function input by the user through the guidance system, the method further includes:
[0011] Obtaining the remaining network ports; wherein the remaining network ports are all the network ports on the server except the network ports for which the boot function is to be enabled input by the user;
[0012] The state of the boot function of the remaining network ports is controlled to be closed.
[0013] On the other hand, before the server is restarted, it also includes: obtaining the current network port for enabling the boot function;
[0014] The state of controlling the boot function of the remaining network ports to be in a closed state includes:
[0015] When it is detected that the current remaining network port is the current network port with the boot function enabled, the boot function of the current remaining network port is disabled; wherein the current remaining network port is any network port among the remaining network ports.
[0016] On the other hand, before the server restarts, it also includes:
[0017] Obtaining first information of a network card on a server and a first boot list of the network card; wherein the information of the network card at least includes the name of the network card;
[0018] After the server is restarted, before the boot system obtains the network port of the boot function to be enabled input by the user and opens the boot function of the network port of the boot function to be enabled, the method further includes:
[0019] Get the second information of the network card on the server;
[0020] The first boot list is updated to a second boot list according to the first information and the second information.
[0021] On the other hand, updating the first boot list to a second boot list according to the first information and the second information includes:
[0022] When it is detected that the first information and the second information are the same, using the first boot list as the second boot list;
[0023] When it is detected that the first information and the second information are different, marking the network card included in both the first information and the second information as a first type of network card;
[0024] The network cards included in the first information and not included in the second information are regarded as the second type of network cards;
[0025] The network cards included in the second information and not included in the first information are regarded as the third type of network cards;
[0026] Keeping the boot information of the first type of network card unchanged, deleting the boot information of the second type of network card, and adding the boot information of the third type of network card in the first boot list, so as to obtain the second boot list;
[0027] Before opening the boot function of the network port whose boot function is to be enabled, the following steps are also included:
[0028] Determining whether the second information includes a network card corresponding to the network port for enabling the boot function input by the user;
[0029] If not, outputting a prompt message indicating that the network port of the boot function to be enabled input by the user does not exist, and returning to the step of obtaining the current value of the setting option;
[0030] If so, the value of the network port whose boot function is to be enabled in the second boot list is set to the first preset value, and the values of the remaining network ports in the second boot list are set to the second preset values; and the step of opening the boot function of the network port whose boot function is to be enabled is entered.
[0031] On the other hand, after obtaining the second information of the network card on the server and before opening the boot function of the network port whose boot function is to be enabled, the method further includes:
[0032] Numbering the network cards on the server and the network ports on each network card according to the second information;
[0033] The boot function of the network port that opens the boot function to be enabled includes:
[0034] Obtaining a first number of a network port for which a boot function is to be enabled, which is input by a user, and a second number of a network card on which the network port for which the boot function is to be enabled is located;
[0035] The boot function of the network port whose boot function is to be enabled is opened according to the first number and the second number.
[0036] On the other hand, when it is detected that the current value represents a user's customized need to start the guidance function, the method further includes:
[0037] Get the unique code used to represent the current user identity;
[0038] Determine the network port of the current guidance function to be enabled corresponding to the current user according to the correspondence between the preset unique code used to characterize the user identity and the network port of the guidance function to be enabled;
[0039] After the server is restarted, the network port corresponding to the current user and the boot function to be enabled is opened through the boot system.
[0040] In order to solve the above technical problems, the present invention also provides a device for controlling the activation of a network port boot function, comprising:
[0041] An acquisition module, used to acquire a current value of a setting option; wherein the value of the setting option is used to represent a user's customized need to enable a boot function or a need to enable an uncustomized boot function; the user's customized need to enable a boot function includes enabling a boot function of a preset network port of a preset network card;
[0042] A prompting module, configured to prompt the user to perform an operation of inputting a network port of the booting function to be enabled on a sub-option corresponding to the setting option when it is detected that the current value indicates a user's customized need to enable the booting function;
[0043] The acquisition and opening module is used to acquire the network port of the boot function to be opened input by the user through the boot system after the server is restarted, and to open the boot function of the network port of the boot function to be opened.
[0044] In order to solve the above technical problem, the present invention further provides a server comprising:
[0045] Memory for storing computer programs;
[0046] The processor is used to implement the steps of the above-mentioned method for enabling the boot function of the control network port when executing the computer program.
[0047] In order to solve the above technical problem, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for enabling the above control network port boot function are implemented.
[0048] The beneficial effect of the present invention lies in that, compared with the previous solution of the BIOS version with built-in boot function, when the demand changes, it is necessary to re-adapt the new BIOS version. In the method provided by the present invention, the setting options are used as the input interface, and the setting options and the sub-options corresponding to the setting options allow the user to directly modify the setting options, thereby realizing the function of different users having different configuration requirements for the network port boot function. Since there is no need to re-release the BIOS version, while satisfying the user's customized boot function of enabling the network port, the cost is reduced and the efficiency of enabling the network port boot function is improved. Moreover, one boot system version can adapt to the user's requirements for enabling multiple network port boot functions, thereby improving the compatibility of the boot system version. In addition, the configuration can be changed and altered at any time by modifying the setting options, and customization is more flexible and convenient.
[0049] In addition, when the boot function of the network port to be enabled is enabled, the boot function of other network ports is disabled, thereby avoiding the influence of the network port with the boot function enabled previously on the boot function of the network port to be enabled input by the user, so that the network port with the boot function enabled meets the needs of the user. Before the server is restarted, the current network port with the boot function enabled is first obtained, and then when it is detected that the current remaining network port is the current network port with the boot function enabled, the boot function of the current remaining network port is disabled, thereby achieving a more accurate closure of the boot function of the remaining network ports.
[0050] Before the server is restarted, the first information of the network card on the server and the first boot list of the network card are obtained; after the server is restarted, the second information of the network card on the server is continued to be obtained, and then the first boot list is updated to the second boot list according to the first information and the second information. Because there may be operations such as plugging in or replacing the network card before the server is restarted, the method determines different types of network cards by comparing the first information and the second information, and then updates the first boot list information of different types of network cards, so that the network card to which the boot information belongs is the network card existing on the server; before opening the boot function of the network port with the boot function to be opened, first determine whether the second information includes the network card corresponding to the network port with the boot function to be opened input by the user, and if so, open the boot function of the network port with the boot function to be opened, so as to ensure that the network port with the boot function to be opened input by the user can be opened as much as possible.
[0051] The network cards on the server and the network ports on each network card are numbered. According to the first number of the network port for which the boot function is to be enabled input by the user and the second number of the network card where the network port for which the boot function is to be enabled is located, the network port for which the boot function is to be enabled that the user requires can be quickly located according to the number, thereby improving the efficiency and flexibility of enabling the boot function of the network port.
[0052] In addition, the present invention also provides a device, a server and a computer storage medium for controlling the activation of the network port boot function, which have the same or corresponding technical features as the above-mentioned method for controlling the activation of the network port boot function, and the effect is the same as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0054] Figure 1 A flowchart of a method for controlling the activation of a network port boot function provided by an embodiment of the present invention;
[0055] Figure 2 An overall flow chart of a method for controlling the activation of a network port boot function provided by an embodiment of the present invention;
[0056] Figure 3 A structural diagram of a server provided in another embodiment of the present invention. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] The core of the present invention is to provide a method, device, server and medium for controlling the boot function of the network port, so as to solve the problem that the method for enabling the boot function of the network port based on the boot function of the BIOS version can only meet the customer's fixed network card configuration and fixed network port requirements, and cannot meet different network card configuration requirements. When the requirements change, it is necessary to re-adapt the new BIOS version, which increases the cost and reduces the efficiency of enabling the boot function of the network port because of the need for additional development versions or scripts.
[0059] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Figure 1 A flowchart of a method for controlling the boot function of a network port provided by an embodiment of the present invention, such as Figure 1 As shown, the method includes:
[0060] S10: Get the current value of the setting option;
[0061] S11: when it is detected that the current value indicates a user's customized need to enable the boot function, prompting the user to perform an operation of inputting a network port of the boot function to be enabled on a sub-option corresponding to the setting option;
[0062] S12: After the server is restarted, the network port of the boot function to be enabled input by the user is obtained through the boot system, and the boot function of the network port of the boot function to be enabled is enabled.
[0063] The value of the setup option comes from the user's operation on the setup option on the setup interface. There is no limit on the value entered by the user for the setup option, which is determined according to the needs. The user's customized need to enable the boot function includes enabling the boot function of the preset network port of the preset network card. For example, when the user has a customized need to enable the boot function, the value of the setup option can be set to 1; when the user does not have a customized need to enable the boot function, the value of the setup option can be set to 0.
[0064] After the user operates the setting option, the current value of the setting option is obtained. The value of the setting option is used to characterize the user's customized need to enable the boot function or the need to enable the boot function without customization. For example, when the current value of the setting option is detected to be 0, it indicates that the user has no customized need to enable the boot function. In the case where the user has no customized need to enable the boot function, the boot function of the corresponding network port can be directly enabled according to the solution of the boot function that comes with the boot system version. When the current value of the setting option is detected to be 1, it indicates that the user has a customized need to enable the boot function. In the case where the user has a customized need to enable the boot function, the user is prompted to perform an operation of inputting the network port of the boot function to be enabled on the sub-option corresponding to the setting option. The operation of the user inputting the network port of the boot function to be enabled includes the position of the network port to be enabled (including the position of the network card to which the network port to be enabled belongs and the position of the network port to be enabled on the network card to which it belongs). If the user performs the input of the network card position as 1 on the sub-option corresponding to the setting option, the network port position is 1, that is, the user's enabling requirement is to enable the boot function of the first network port on the first network card.
[0065] After the user selects the network port to be enabled, save and restart the server. The boot system will enable the boot function of the network port to be enabled according to the network port to be enabled input by the user during the next boot process.
[0066] In the method provided in this embodiment, compared with the previous solution of the BIOS version with built-in boot function, when the demand changes, it is necessary to re-adapt the new BIOS version. In the method provided by the present invention, the setting options are used as the input interface, the setting options and the sub-options corresponding to the setting options, so that the user can directly modify the setting options, thereby realizing the function of different users having different configuration requirements for the network port boot function. Since there is no need to re-release the BIOS version, while satisfying the user's customized boot function of enabling the network port, the cost is reduced and the efficiency of enabling the network port boot function is improved. Moreover, one boot system version can adapt to the user's requirements for enabling multiple network port boot functions, thereby improving the compatibility of the boot system version. In addition, the configuration can be changed and modified at any time by modifying the setting options, and customization is more flexible and convenient.
[0067] In practice, after the server is restarted, after obtaining the network port of the boot function to be enabled input by the user, there may be a network port of the boot function to be enabled originally. If the network port of the boot function to be enabled input by the user and the network port of the boot function to be enabled originally are opened, the network port of the boot function finally opened is not only the one required by the user. Therefore, in implementation, after obtaining the network port of the boot function to be enabled input by the user through the boot system, it also includes:
[0068] Obtain the remaining network ports; wherein the remaining network ports are all network ports on the server except the network ports for which the boot function is to be enabled input by the user;
[0069] The status of the boot function controlling the remaining network ports is disabled.
[0070] For example, if the user's requirement is to enable only the boot function of the first network port on the first network card, and the network port whose boot function is to be enabled is the boot function of the first network port on the second network card, if the boot function of the first network port on the second network card is not disabled, it is obvious that enabling the boot function of the first network port on the first network card and enabling the boot function of the first network port on the second network card are not what the user requires. Therefore, in order to meet the user's needs, the boot function of the first network port on the second network card is controlled to be disabled.
[0071] When the state of the boot function controlling the remaining network ports is closed, in order to achieve more accurate closing of the boot function of the remaining network cards, in implementation, before the server is restarted, it also includes: obtaining the current network port with the boot function turned on, and storing the information of the current network port with the boot function turned on.
[0072] The status of the boot function controlling the remaining network ports is closed, including:
[0073] When it is detected that the current remaining network port is the current network port with the boot function enabled, the boot function of the current remaining network port is disabled; wherein the current remaining network port is any network port among the remaining network ports.
[0074] In the method provided in this embodiment, when the boot function of the network port to be enabled is enabled, the boot function of other network ports is disabled, thereby avoiding the influence of the network port with the previously enabled boot function on the boot function of the network port to be enabled input by the user, so that the network port with the enabled boot function meets the needs of the user. Before the server is restarted, the current network port with the boot function enabled is first obtained, and then when it is detected that the current remaining network port is the current network port with the boot function enabled, the boot function of the current remaining network port is disabled, thereby achieving a more accurate closure of the boot function of the remaining network ports.
[0075] In practice, before the server is restarted, operations such as plugging or replacing the network card may occur. In order to ensure that the network port for the boot function to be enabled input by the user exists, before the server is restarted, the following operations are also performed:
[0076] Obtaining first information of a network card on a server and a first boot list of the network card; wherein the information of the network card at least includes the name of the network card;
[0077] After the server is restarted, before the boot system obtains the network port of the boot function to be enabled input by the user and enables the boot function of the network port of the boot function to be enabled, the method further includes:
[0078] Get the second information of the network card on the server;
[0079] The first boot list is updated to a second boot list according to the first information and the second information.
[0080] Specifically, updating the first boot list to the second boot list according to the first information and the second information includes:
[0081] When it is detected that the first information and the second information are the same, the first boot list is used as the second boot list;
[0082] When it is detected that the first information and the second information are different, the network card included in both the first information and the second information is marked as the first type of network card, that is, the existing network card. The network card included in the first information and not included in the second information is marked as the second type of network card, that is, the deleted network card. The network card included in the second information and not included in the first information is marked as the third type of network card, that is, the newly added network card. In the first boot list, the boot information of the first type of network card is kept unchanged, the boot information of the second type of network card is deleted, and the boot information of the third type of network card is added to obtain the second boot list.
[0083] Before opening the boot function of the network port whose boot function is to be enabled, the following steps are also included:
[0084] Determine whether the second information includes the network card corresponding to the network port of the boot function to be enabled input by the user;
[0085] If not, output a prompt message indicating that the network port of the boot function to be enabled input by the user does not exist, and return to the step of obtaining the current value of the setting option;
[0086] If so, the value of the network port whose boot function is to be enabled is set to the first preset value in the second boot list, and the values of the remaining network ports in the second boot list are set to the second preset values; and the step of enabling the boot function of the network port whose boot function is to be enabled is entered.
[0087] There is no limitation on the first preset value and the second preset value, as long as the first preset value is different from the second preset value. For example, the first preset value is 1 and the second preset value is 0.
[0088] In the method provided in this embodiment, before the server is restarted, the first information of the network card on the server and the first boot list of the network card are obtained; after the server is restarted, the second information of the network card on the server is continued to be obtained, and then the first boot list is updated to the second boot list according to the first information and the second information. Because there may be operations such as plugging or replacing the network card before the server is restarted, the method determines different types of network cards by comparing the first information and the second information, and then updates the first boot list information of different types of network cards, so that the network card to which the boot information belongs is the network card existing on the server; before opening the boot function of the network port with the boot function to be opened, first determine whether the second information includes the network card corresponding to the network port with the boot function to be opened input by the user, and if so, open the boot function of the network port with the boot function to be opened, so as to ensure that the network port with the boot function to be opened input by the user can be opened as much as possible.
[0089] In order to quickly locate the network port for enabling the boot function required by the user, after obtaining the second information of the network card on the server and before opening the boot function of the network port for enabling the boot function, the method further includes:
[0090] Numbering the network cards on the server and numbering the network ports on each network card according to the second information;
[0091] The boot functions of the network port that is to be enabled include:
[0092] Obtaining the first number of the network port for which the boot function is to be enabled, which is input by the user, and the second number of the network card where the network port for which the boot function is to be enabled is located;
[0093] The boot function of the network port whose boot function is to be enabled is opened according to the first number and the second number.
[0094] There is no limitation on the numbering method of network cards and network ports, such as sorting all network card devices in ascending order according to the bus identifier (busid), and sorting the network ports on the network card in sequence. For example, if the first number is 1 and the second number is 1, the network port for which the user wants to enable the boot function is the first network port on the first network card.
[0095] In the method provided in this embodiment, the network cards on the server and the network ports on each network card are numbered, and based on the first number of the network port for which the boot function is to be enabled input by the user and the second number of the network card where the network port for which the boot function is to be enabled is located, the network port for which the boot function is to be enabled that the user requires can be quickly located based on the number, thereby improving the efficiency and flexibility of enabling the boot function of the network port.
[0096] In the case where the first number and the second number are digital numbers, after obtaining the first number of the network port for which the boot function is to be enabled and the second number of the network card where the network port for which the boot function is to be enabled is located, the method further includes:
[0097] Obtain the number of network cards and the number of network ports recorded in the second information;
[0098] Determine whether the number of network cards is less than the second number;
[0099] If yes, output a prompt message indicating that the network port boot function has failed to be enabled, and return to the step of obtaining the current value of the setting option;
[0100] If not, when it is detected that the number of Internet ports on the network card corresponding to the second number is less than the first number, the output is used to output a prompt message indicating the failure of enabling the network port boot function; when it is detected that the number of Internet ports on the network card corresponding to the second number is greater than or equal to the first number, the boot function of the network port to be enabled is returned according to the first number and the second number.
[0101] If the number of network cards recorded in the second information is 3, if the second number is 4, then the user's demand for opening the network port cannot be met; if the second number is 2, then continue to judge the relationship between the number of Internet ports on the network card with the second number and the first number. If the number of Internet ports on the network card with the second number is 2, if the first number is 3, then the user's demand for opening the network port cannot be met; if the first number is 1, then the user's demand for opening the network port can be met.
[0102] In the method, the network card number and the network port number corresponding to the network port for which the user requests to enable the boot function are compared with the number corresponding to the network card and the network port number existing on the server. For the situation that indicates a failure in enabling the network port boot function, the method returns to the step of obtaining the current value of the setting option, thereby ensuring as much as possible that the network port for the boot function to be enabled input by the user can be enabled.
[0103] In order to quickly meet the user's network port opening needs, when it is detected that the current value represents the user's customized opening guide function needs, it also includes:
[0104] Get the unique code used to represent the current user identity;
[0105] Determine the network port of the current guidance function to be enabled corresponding to the current user according to the correspondence between the preset unique code used to characterize the user identity and the network port of the guidance function to be enabled;
[0106] After the server is restarted, the network port corresponding to the current user and the boot function to be enabled is opened through the boot system.
[0107] In this method, the user does not need to input requirements through setting options and then enable the corresponding network card according to the user's requirements; instead, after obtaining the unique code representing the user's identity, the boot function of the specified network port is enabled, thereby quickly meeting the user's network port enabling requirements.
[0108] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Figure 2 The overall flow chart of a method for controlling the boot function of a network port provided by an embodiment of the present invention is as follows: Figure 2 As shown, the method includes:
[0109] S13: Get the current option value on the setting option;
[0110] S14: Determine whether the setting option is enabled; if not, end; if so, proceed to step S15;
[0111] S15: Get the values of the network card number and network port number of the sub-option and save them locally, and assign them to the structure variable;
[0112] S16: Determine whether the number of all current network cards is less than the network card number; if so, end; if not, proceed to step S17;
[0113] S17: Enter the boot function customization function entry function and initialize all structure variables storing network card information;
[0114] S18: Check changes in network card devices and handle existing network cards, newly added network cards, and deleted network cards differently;
[0115] S19: Arrange the network card devices in ascending order according to the bus identifier, find the configuration port and set the flag bit;
[0116] S20: Modify the driver corresponding to the network card.
[0117] In the method provided by the embodiment of the present invention, the setup option value "PXE Ctrl" is obtained at startup. When the option is disabled, the function is skipped. When the option is enabled, the values of the sub-options "NIC Number" and "PORT Number" are obtained. All PXE devices are sorted by bus-id according to the input values, the corresponding port is found, the PXE function is enabled, and the PXE functions of all other network card ports are disabled.
[0118] The specific implementation process is as follows:
[0119] 1. Get and determine the value of the setup option "PXE Ctrl";
[0120] 1) When the "PXE Ctrl" option value is disable, it means there is no customization requirement and this function can be directly exited.
[0121] 2) When the value of the "PXE Ctrl" option is enable, the values of the sub-options "NIC Number" and "PORT Number" are obtained and saved locally, and assigned to the structure variable designated_port.
[0122] 2. Configure customized requirements according to the values of NIC_Number and PORT_Number members in the designated_port structure, and use the example of enabling the PXE function of the first network port of the first PCIE network card to illustrate the implementation process:
[0123] 1) Enter the PXE customized function entry function NicRomCtrlEntry, obtain the option control list of the network card, initialize the structure variable that stores the network card information, and determine whether the boot mode is UEFI or Legacy;
[0124] 2) After entering the corresponding mode function, the CheckNicDevChange function will check the changes of the network card device, match the traversed device information with the existing setup device information table, set the devicefound flag, handle the existing network card, newly added network card and deleted network card differently, and update the device list and setup information table;
[0125] 3) Based on 2), the existing device information is updated. The AddNewNicDevIntoSetupList function is called for the new device to be added to the setup device information table. For the deleted device (devicefound flag is set to false), DeleteNotFoundNicDev is called to delete its information, including setup information and boot option information.
[0126] 4) Based on the setup information table in 3) has been updated, including the two levels of network card control and network port control, call the SortingNicCode function to sort all network card devices according to busid, arrange the structure array in ascending order, find designated_port, and set enableflag;
[0127] 5) Modify the network card PXE function, call SetOptionVal function (current value) and SetDefaultVal (default value), modify the default value and current value, and adapt different function packages according to boardid and customerid. In the current case, set flag IsFirstSlotNic, the initial value is true, and assign the first network port in the list to 1. After RomSetup->NicRo mData[Index].OptionVal = 1, assign IsFirstSlotNic to flase to ensure that other ports are closed;
[0128] 6) Modify the optionrom (network card driver) corresponding to the network card. Modify CsmOpromPolicyData->ExecuteThisRom according to the value of RomSetup->NicRomData[Index].OptionVal. BIOS determines whether to execute the optionrom of the network card based on this value, that is, whether to enable the PXE function. In the current case, only the first PXE boot item is retained.
[0129] 7) Based on 6), update the setup startup item list. The PXE category only retains one startup item, which is the first network port of the first network card.
[0130] 3. Synchronize the customization results to the baseboard management controller (BMC) through the Intelligent Platform Management Interface (IPMI) command. The BMC Web interface will display the current configuration results in the device asset information - whether the PXE function of the network card is enabled.
[0131] In the method provided in the embodiment of the present invention, the setup interface is used as an input port to provide custom options that can be modified and configured, so as to realize the functions of different customers having different configuration requirements for the PXE function of the network card. The Setup interface provides a function control option "PXE Ctrl", and the optional values of the option are disable and enable. The default is disable, and the function is not enabled. When the customer has customized requirements, this option can be enabled. At this time, a configuration submenu pops up, and the port number of the network card can be selected to enable. The first port of the first network card is enabled by default. After the customer selects the network port to be enabled, save and restart. The BIOS will open the PXE function of the specified network port in the specified slot according to the BUS-id order and the customized requirements at the next startup. This solves the problem that in the current PXE solution that comes with a given BIOS version, one BIOS version can only adapt to one PXE customized solution and cannot actively cover different network card configuration packages and different customer needs. The current solution can only meet the customer's fixed network card configuration and fixed network port needs. When the needs change, it is necessary to re-adapt the new BIOS version. In the method of the present invention, the setup option is used as the input interface, and an automatic adaptation solution is provided after the PXE function is modified. There is no need to re-release the BIOS version, which has higher compatibility and is more convenient for customers to operate in the future. For example, the function remains unaffected after the network card position is changed; and by providing an input interface-setup interface configuration option, according to the unique device identifier bus-id as the sorting basis, the customer can realize the change and modification of the configuration at any time, the customization is more flexible and convenient, and there is no need for the server to re-provide a customized version to adapt to new needs, thereby realizing a solution that can automatically identify the customer identity and enable the PXE function of the specified port.
[0132] In the above embodiment, the method for controlling the boot function of the network port is described in detail, and the present invention also provides embodiments of the device and server for controlling the boot function of the network port. It should be noted that the present invention describes the embodiments of the device part from two perspectives, one is based on the perspective of the functional module, and the other is based on the perspective of the hardware.
[0133] An embodiment of the present invention provides a device for controlling the activation of a network port boot function, based on the perspective of a functional module, including:
[0134] An acquisition module, used to acquire a current value of a setting option; wherein the value of the setting option is used to represent a user's customized need to enable a boot function or a need to enable an uncustomized boot function; the user's customized need to enable a boot function includes enabling a boot function of a preset network port of a preset network card;
[0135] A prompt module, for prompting the user to perform an operation of inputting a network port of the boot function to be enabled on a sub-option corresponding to the setting option when it is detected that the current value represents a user's customized need to enable the boot function;
[0136] The acquisition and opening module is used to acquire the network port of the boot function to be opened input by the user through the boot system after the server is restarted, and to open the boot function of the network port of the boot function to be opened.
[0137] In some embodiments, the device for controlling the network port boot function to be enabled further includes:
[0138] A first acquisition module is used to acquire remaining network ports; wherein the remaining network ports are all network ports on the server except the network ports for which the boot function is to be enabled input by the user;
[0139] The control module is used to control the boot function status of the remaining network ports to be closed.
[0140] In some embodiments, the device for controlling the network port boot function to be enabled further includes:
[0141] The second acquisition module is used to obtain the current network port that enables the boot function;
[0142] The control module is specifically used for: when it is detected that the current remaining network port is the current network port with the boot function turned on, turning off the boot function of the current remaining network port; wherein the current remaining network port is any network port among the remaining network ports.
[0143] In some embodiments, the device for controlling the network port boot function to be enabled further includes:
[0144] A third acquisition module is used to acquire first information of a network card on a server and a first boot list of the network card; wherein the information of the network card at least includes a name of the network card;
[0145] In some embodiments, the device for controlling the network port boot function to be enabled further includes:
[0146] A fourth acquisition module, used to acquire second information of a network card on the server;
[0147] The updating module is used to update the first boot list to the second boot list according to the first information and the second information.
[0148] In some embodiments, the device for controlling the network port boot function to be enabled further includes:
[0149] A judging module, used to judge whether the second information includes the network card corresponding to the network port of the boot function to be enabled input by the user; if not, trigger the output module; if yes, trigger the setting module;
[0150] An output module, used for outputting a prompt message indicating that the network port of the boot function to be enabled input by the user does not exist, and returning the prompt message to the trigger acquisition module;
[0151] A setting module, used to set the value of the network port whose boot function is to be enabled in the second boot list to the first preset value, and to set the values of the remaining network ports in the second boot list to the second preset value; trigger the opening module in the acquisition and opening module; wherein the opening module is used to open the boot function of the network port whose boot function is to be enabled.
[0152] In some embodiments, the device for controlling the network port boot function to be enabled further includes:
[0153] A numbering module, used for numbering the network cards on the server and the network ports on each network card according to the second information;
[0154] The open modules include:
[0155] A fifth acquisition module, used to acquire the first number of the network port for which the boot function is to be enabled, input by the user, and the second number of the network card where the network port for which the boot function is to be enabled is located;
[0156] The first opening submodule is used to open the boot function of the network port whose boot function is to be enabled according to the first number and the second number.
[0157] In some embodiments, the device for controlling the network port boot function to be enabled further includes:
[0158] A sixth acquisition module, used to acquire a unique code for representing the current user identity;
[0159] A determination module, used to determine the network port of the current guidance function to be enabled corresponding to the current user according to the correspondence between the preset unique code used to characterize the user identity and the network port of the guidance function to be enabled;
[0160] The second opening submodule is used to open the network port of the boot function to be opened corresponding to the current user through the boot system after the server is restarted.
[0161] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.
[0162] Figure 3 This is a structural diagram of a server provided by another embodiment of the present invention. This embodiment is based on the hardware perspective, such as Figure 3 As shown, the server includes:
[0163] A memory 20, used for storing computer programs;
[0164] The processor 21 is used to implement the steps of the method for controlling the activation of the network port boot function mentioned in the above embodiment when executing the computer program.
[0165] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0166] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the method for enabling the boot function of the control network port disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. Data 203 may include, but is not limited to, the data involved in the method for enabling the boot function of the control network port mentioned above, etc.
[0167] In some embodiments, the server may further include a display screen 22 , an input / output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .
[0168] Those skilled in the art will understand that Figure 3The structure shown in the figure does not constitute a limitation on the server, and may include more or fewer components than shown in the figure.
[0169] The server provided by the embodiment of the present invention includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the following method: a method for controlling the activation of the network port boot function, with the same effect as above.
[0170] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned method for enabling the boot function of a control network port when the computer program / instruction is executed by a processor.
[0171] Finally, the present invention also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.
[0172] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes.
[0173] The computer-readable storage medium provided by the present invention includes the above-mentioned method for controlling the activation of the network port boot function, and the effect is the same as above.
[0174] The above is a detailed introduction to a method, device, server and medium for controlling the boot function of a network port provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.
[0175] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device 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 device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A method for controlling the activation of a network port boot function, characterized in that: include: Obtaining the current value of a setting option; wherein the value of the setting option is used to represent a user's customized need to enable a boot function or a need to enable an uncustomized boot function; the user's customized need to enable a boot function includes enabling a boot function of a preset network port of a preset network card; In the case where it is detected that the current value represents a user's customized need to enable the boot function, prompting the user to perform an operation of inputting a network port of the boot function to be enabled on a sub-option corresponding to the setting option; After the server is restarted, the network port for the boot function to be enabled input by the user is obtained through the boot system, and the boot function of the network port for the boot function to be enabled is enabled.
2. The method for controlling the activation of the network port boot function according to claim 1, characterized in that: After obtaining the network port of the boot function to be enabled input by the user through the boot system, the method further includes: Obtaining the remaining network ports; wherein the remaining network ports are all the network ports on the server except the network ports for which the boot function is to be enabled input by the user; The state of the boot function of the remaining network ports is controlled to be closed.
3. The method for controlling the activation of the network port boot function according to claim 2, characterized in that: Before the server is restarted, it also includes: obtaining the current network port for enabling the boot function; The state of controlling the boot function of the remaining network ports to be in a closed state includes: When it is detected that the current remaining network port is the current network port with the boot function enabled, the boot function of the current remaining network port is disabled; wherein the current remaining network port is any one of the remaining network ports.
4. The method for controlling the activation of the network port boot function according to claim 2 or 3, characterized in that: Before the server restarts, also include: Obtaining first information of a network card on a server and a first boot list of the network card; wherein the information of the network card at least includes the name of the network card; After the server is restarted, before the boot system obtains the network port of the boot function to be enabled input by the user and opens the boot function of the network port of the boot function to be enabled, the method further includes: Get the second information of the network card on the server; The first boot list is updated to a second boot list according to the first information and the second information.
5. The method for controlling the activation of the network port boot function according to claim 4, characterized in that: The updating the first boot list to the second boot list according to the first information and the second information comprises: When it is detected that the first information and the second information are the same, using the first boot list as the second boot list; When it is detected that the first information and the second information are different, marking the network card included in both the first information and the second information as a first type of network card; The network cards included in the first information and not included in the second information are regarded as the second type of network cards; The network cards included in the second information and not included in the first information are regarded as the third type of network cards; Keeping the boot information of the first type of network card unchanged, deleting the boot information of the second type of network card, and adding the boot information of the third type of network card in the first boot list, so as to obtain the second boot list; Before opening the boot function of the network port whose boot function is to be enabled, the following steps are also included: Determining whether the second information includes a network card corresponding to the network port for enabling the boot function input by the user; If not, outputting a prompt message indicating that the network port of the boot function to be enabled input by the user does not exist, and returning to the step of obtaining the current value of the setting option; If so, the value of the network port whose boot function is to be enabled in the second boot list is set to the first preset value, and the values of the remaining network ports in the second boot list are set to the second preset value; and the step of opening the boot function of the network port whose boot function is to be enabled is entered.
6. The method for controlling the activation of the network port boot function according to claim 5, characterized in that: After obtaining the second information of the network card on the server and before opening the boot function of the network port whose boot function is to be enabled, the method further includes: Numbering the network cards on the server and the network ports on each network card according to the second information; The boot function of the network port that opens the boot function to be enabled includes: Obtaining a first number of a network port for which a boot function is to be enabled, which is input by a user, and a second number on a network card where the network port for which the boot function is to be enabled is located; The boot function of the network port whose boot function is to be enabled is opened according to the first number and the second number.
7. The method for controlling the activation of the network port boot function according to claim 1, characterized in that: In the case where it is detected that the current value represents a user customized need to start the guidance function, the method further includes: Get the unique code used to represent the current user identity; Determine the network port of the current guidance function to be enabled corresponding to the current user according to the correspondence between the unique code for representing the user identity and the network port of the guidance function to be enabled; After the server is restarted, the network port corresponding to the current user and the boot function to be enabled is opened through the boot system.
8. A device for controlling the opening of a network port boot function, characterized in that: include: An acquisition module, used to acquire a current value of a setting option; wherein the value of the setting option is used to represent a user's customized need to enable a boot function or a need to enable an uncustomized boot function; the user's customized need to enable a boot function includes enabling a boot function of a preset network port of a preset network card; A prompting module, configured to prompt the user to perform an operation of inputting a network port of the booting function to be enabled on a sub-option corresponding to the setting option when it is detected that the current value indicates a user's customized need to enable the booting function; The acquisition and opening module is used to acquire the network port of the boot function to be opened input by the user through the boot system after the server is restarted, and to open the boot function of the network port of the boot function to be opened.
9. A server, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the method for controlling the activation of the network port boot function as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for controlling the activation of the network port boot function as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
PXE function enabling method and device for network card port and related equipment
CN110413328A
Pre-starting function control method and system and medium
CN113190279A
PXE guide configuration method, device and equipment for specified network port, and medium
CN113867821A
Self-adaptive support method and device for pre-starting function of server
CN116700809A
Individual control method, apparatus and device for network card switch, and medium
CN116841232A