Disclosure of Invention
The application aims to provide a BIOS option configuration method, a BIOS option configuration device, a server and a computer readable storage medium, option configuration data are verified through a verification code when a BIOS is started, so that the option configuration data are verified, errors of the option configuration data are avoided, and the safety and reliability of the option configuration data are improved.
To solve the above technical problem, the present application provides a BIOS option configuration method, including:
the BMC receives option configuration data and a check code;
when the BIOS is started, the BMC checks the option configuration data according to the check code;
when the verification is passed, the option configuration data are sent to the BIOS, so that the BIOS can carry out setting according to the option configuration data;
and when the verification fails, repairing the option configuration data to obtain repaired configuration data, and sending the repaired configuration data to the BIOS.
Optionally, the method further includes:
and when the BMC receives the option configuration data, backing up the option configuration data to obtain standby configuration data.
Optionally, when the verification fails, performing a repair process on the option configuration data to obtain repaired configuration data, and sending the repaired configuration data to the BIOS, where the repairing process includes:
when the check is failed, judging whether the standby configuration data is correct or not according to the check code;
if yes, sending the standby configuration data to the BIOS;
if not, carrying out verification calculation according to the verification code to obtain the repaired configuration data, and sending the repaired configuration data to the BIOS.
Optionally, performing a verification calculation according to the verification code to obtain the repaired configuration data includes:
and carrying out check calculation on the check code according to a parity check algorithm to obtain the repaired configuration data.
Optionally, performing a verification calculation according to the verification code to obtain the repaired configuration data includes:
and carrying out check calculation on the check code according to a cyclic redundancy check algorithm to obtain the repaired configuration data.
The present application further provides a BIOS option configuration device, including:
the data receiving module is used for receiving the option configuration data and the check code;
the data verification module is used for verifying the option configuration data according to the verification code when the BIOS is started;
the verification passing module is used for sending the option configuration data to the BIOS when the verification is passed so that the BIOS can carry out setting according to the option configuration data;
and the data restoration module is used for restoring the option configuration data to obtain restored configuration data when the verification fails, and sending the restored configuration data to the BIOS.
Optionally, the method further includes:
and the data backup module is used for backing up the option configuration data to obtain standby configuration data when the BMC receives the option configuration data.
Optionally, the data recovery module includes:
the backup checking unit is used for judging whether the standby configuration data is correct or not according to the check code when the check is failed;
the backup data sending unit is used for sending the standby configuration data to the BIOS when the standby configuration data are correct;
and the verification calculation unit is used for performing verification calculation according to the verification code to obtain the repaired configuration data and sending the repaired configuration data to the BIOS when the standby configuration data is incorrect.
The present application further provides a server, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the BIOS option configuration method as described above when executing the computer program.
The present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the BIOS option configuration method as described above.
The application provides a BIOS option configuration method, which comprises the following steps: the BMC receives option configuration data and a check code; when the BIOS is started, the BMC checks the option configuration data according to the check code; when the verification is passed, the option configuration data are sent to the BIOS, so that the BIOS can carry out setting according to the option configuration data; and when the verification fails, repairing the option configuration data to obtain repaired configuration data, and sending the repaired configuration data to the BIOS.
The option configuration data is verified through the verification code when the BIOS is started, so that the option configuration data is verified, errors of the option configuration data are avoided, and the safety and reliability of the option configuration data are improved.
The application further provides a BIOS option configuration device, a server, and a computer readable storage medium, which have the above beneficial effects and are not described herein again.
Detailed Description
The core of the application is to provide a BIOS option configuration method, a BIOS option configuration device, a server and a computer readable storage medium, and option configuration data is verified through a verification code when a BIOS is started, so that verification of the option configuration data is realized, errors of the option configuration data are avoided, and the safety and reliability of the option configuration data are improved.
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the related art, during the actual operation and maintenance operation of the server, the BIOS option of the server needs to be remotely configured. Specifically, an ipmi command is sent out-of-band to the BMC, and then the BIOS reads the stored data from the BMC to complete the option setting operation. However, data problems are easily caused in the process of reading data from the BMC by the BIOS, for example, if the data is tampered, the security of the BIOS option is directly affected, and the reliability of the BIOS is reduced.
Therefore, the application provides a BIOS option configuration method, which is characterized in that option configuration data is verified through a verification code when a BIOS is started, so that the option configuration data is verified, errors of the option configuration data are avoided, and the safety and reliability of the option configuration data are improved.
The following describes a BIOS option configuration method provided in the present application, by way of an embodiment.
Referring to fig. 1, fig. 1 is a flowchart illustrating a BIOS option configuration method according to an embodiment of the present disclosure.
In this embodiment, the method may include:
s101, the BMC receives option configuration data and a check code;
as can be seen, in this step, the BMC receives the option configuration data and the corresponding check code.
It is conceivable that the present embodiment further includes a step of sending the option configuration data and the check code to the BMC. The BMC may send data to the local server, send data to the BMC by another server in a remote manner, and send data to the BMC by another computing device. It can be seen that, in this embodiment, the manner of sending data to the BMC is not unique, and is not specifically limited herein.
And, only option configuration data is transmitted to the BMC in the related art. Therefore, when the BMC obtains the option configuration data, the BMC directly sends the option configuration data to the BIOS. However, if the option configuration data is modified at this time, damage may be done to the BIOS. Therefore, in order to avoid the modified option configuration data from failing, the check code corresponding to the option configuration data needs to be sent to the BMC.
S102, when the BIOS is started, the BMC checks option configuration data according to the check code;
on the basis of S101, this step aims at checking, by the BMC, the option configuration data according to the check code when the BIOS is started. That is, whether the option configuration data is correct is determined according to the check code.
In this step, different check processes may be performed according to different check codes, so as to implement corresponding check operations, which is not specifically limited herein.
S103, when the verification is passed, sending the option configuration data to the BIOS so that the BIOS can set according to the option configuration data;
on the basis of S102, this step is intended to send the option configuration data to the BIOS when the verification passes, so that the BIOS performs setting according to the option configuration data.
That is, the option configuration data at this time has no problem and can be used as it is. Therefore, the option configuration data is directly sent to the BIOS so as to carry out corresponding setting operation on the BIOS.
The operation of setting according to the option configuration data may adopt any BIOS setting operation provided in the prior art, which is not specifically limited herein.
The process of sending the option configuration data to the BIOS, that is, the process of acquiring the option configuration data from the BMC in the BIOS, transfers the option configuration data from the BMC to the BIOS.
And S104, when the verification fails, repairing the option configuration data to obtain repaired configuration data, and sending the repaired configuration data to the BIOS.
On the basis of S102, this step aims to repair the option configuration data to obtain repaired configuration data when the verification fails, and send the repaired configuration data to the BIOS.
That is, it has been determined at this time that the option configuration data is erroneous. Therefore, the option configuration data is not sent to the BMC at this time. But the option configuration data is repaired to obtain repaired configuration data.
The repair processing may be to encode and repair the option configuration data according to the check code to obtain the repaired configuration data, or to take out the backed-up option configuration data as the repaired configuration data, or to adopt a scheme of combining the two.
As can be seen, in order to provide a further way for configuring option configuration data, this embodiment may further include:
and when the BMC receives the option configuration data, backing up the option configuration data to obtain standby configuration data.
That is to say, in this alternative, the option configuration data may also be backed up, so as to avoid the option configuration data being modified in the BMC, and further ensure the reliability that the option configuration data can be repaired.
On this basis, the step can comprise:
step 1, judging whether the standby configuration data is correct or not according to the check code when the check code does not pass; if yes, executing the step 2, otherwise, executing the step 3;
step 2, sending the standby configuration data to the BIOS;
and 3, carrying out verification calculation according to the verification code to obtain repaired configuration data, and sending the repaired configuration data to the BIOS.
It can be seen that the present alternative is mainly illustrative of how to recover option configuration data. In this alternative, when the check fails, whether the standby configuration data is correct is determined according to the check code. I.e. to determine whether the backed up option configuration data is correct. If yes, sending the standby configuration data to the BIOS; if not, carrying out verification calculation according to the verification code to obtain repaired configuration data, and sending the repaired configuration data to the BIOS. The check calculation can be performed by selecting different calculation modes according to different check codes.
Wherein, the verification method in the previous step may include:
and carrying out check calculation on the check code according to a parity check algorithm to obtain the repaired configuration data.
The parity check algorithm may be any one of parity check algorithms provided in the prior art, and is not specifically limited herein.
Wherein, the verification method in the previous step may include:
and carrying out check calculation on the check code according to a cyclic redundancy check algorithm to obtain repaired configuration data.
The cyclic redundancy check algorithm may be any one of cyclic redundancy check algorithms provided in the prior art, and is not specifically limited herein.
In summary, in the embodiment, the option configuration data is verified through the check code when the BIOS is started, so that the option configuration data is verified, an error in the option configuration data is avoided, and the security and reliability of the option configuration data are improved.
The BIOS option configuration method provided in the present application is further described below by an embodiment of a specific scenario.
In this embodiment, when the command for configuring the BIOS option is sent remotely from the out-of-band, the check code is also sent to the BMC at the same time, after receiving the data packet, the BMC copies one copy of the data and stores the copy of the data in an EEPROM (Electrically Erasable Programmable read only memory), when the BIOS is started, the BMC reads the configuration option data from the BMC, first checks valid data and compares the valid data with the check code, if the check code is different, the backup data is checked continuously, if the backup check passes, the backup data is updated to the main data, if the backup data check also fails, data bits of the main data and the backup data are compared in sequence, and if different data bits exist, the stored check code is compared and restored to a correct value, thereby achieving the purpose of data error correction.
As can be seen, the steps of this embodiment may include:
step 1, remotely sending a BIOS configuration option command and a check code to a BMC;
step 2, the BMC backs up and stores the data into the EEPROM;
step 3, starting the BIOS to read the configuration option data from the BMC;
step 4, the BMC checks the main data and the check code, and returns the main data and the check code to the BIOS if the main data and the check code pass the check;
step 5, if the verification fails, the BMC reads the backup data and verifies the backup data, and if the verification succeeds, the BMC copies the main data and returns the main data to the BIOS;
and 6, if the backup data is failed to be verified, sequentially comparing the main data bits and the standby data bits, if the data bits are different, confirming correct data through a verification code and correcting, and returning the corrected data to the BIOS.
Therefore, the option configuration data can be verified through the verification code when the BIOS is started, so that the option configuration data can be verified, errors in the option configuration data are avoided, and the security and reliability of the option configuration data are improved.
In the following, the BIOS option configuration device provided in the embodiment of the present application is introduced, and the BIOS option configuration device described below and the BIOS option configuration method described above may be referred to correspondingly.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a BIOS option configuration device according to an embodiment of the present disclosure.
In this embodiment, the apparatus may include:
a data receiving module 100, configured to receive option configuration data and a check code;
the data verification module 200 is used for verifying the option configuration data according to the verification code when the BIOS is started;
the verification passing module 300 is configured to send the option configuration data to the BIOS when the verification passes, so that the BIOS performs setting according to the option configuration data;
and the data repair module 400 is configured to, when the verification fails, repair the option configuration data to obtain repaired configuration data, and send the repaired configuration data to the BIOS.
Optionally, the apparatus may further include:
and the data backup module is used for backing up the option configuration data to obtain standby configuration data when the BMC receives the option configuration data.
Optionally, the data recovery module 400 may include:
the backup checking unit is used for judging whether the standby configuration data is correct or not according to the check code when the check is failed;
the backup data sending unit is used for sending the standby configuration data to the BIOS when the standby configuration data are correct;
and the verification calculation unit is used for performing verification calculation according to the verification code to obtain repaired configuration data and sending the repaired configuration data to the BIOS when the standby configuration data is incorrect.
An embodiment of the present application further provides a server, including:
a memory for storing a computer program;
a processor for implementing the steps of the BIOS option configuration method as described in the above embodiments when executing the computer program.
Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the BIOS option configuration method according to the above embodiments are implemented.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The BIOS option configuration method, the BIOS option configuration device, the server, and the computer readable storage medium provided by the present application are described in detail above. The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.