Disclosure of Invention
In view of this, the present application provides the following technical solutions:
A server system includes a basic input output system BIOS and a first storage medium;
The method comprises the steps that a basic input/output system BIOS obtains a starting signal and completes starting, a first callback function is registered, configuration data is received and stored in a storage space corresponding to the basic input/output system BIOS, the first callback function is triggered to write the configuration data into a first storage medium, and the first callback function is used for synchronously storing the configuration data written into the basic input/output system BIOS into the first storage medium;
the first storage medium is used for storing configuration data of the basic input output system BIOS.
Optionally, the basic input output system BIOS is further configured to: before registering a first callback function, determining whether the current start of the basic input output system BIOS is the first start after refreshing; if yes, the previously stored configuration data is read from the first storage medium and written into the basic input output system BIOS.
Optionally, the BIOS is connected to the first storage medium through a carrier chip PCH thereof.
Optionally, the server system further includes a baseboard management controller BMC, the first storage medium is a storage chip connected to the baseboard management controller BMC, and the baseboard management controller BMC is connected to an access interface I2C of the first storage medium.
Optionally, the BIOS is connected to the access interface I2C of the first storage medium through its carrier chip PCH.
Optionally, one or two connection lines of general purpose input/output GPIOs are provided between the baseboard management controller BMC and the BIOS, where the connection lines of general purpose input/output GPIOs are used to transmit access status information of the baseboard management controller BMC or the BIOS, and the access status information includes a control right for acquiring the access interface I2C or a control right for releasing the access interface I2C.
Optionally, the basic input output system BIOS is further configured to: and before the configuration data is written into the memory chip, obtaining the control right of the access interface I2C based on the message transmission in the connection line of the general purpose input/output GPIO.
A data processing method of a server system, comprising:
the basic input/output system BIOS obtains a starting signal and completes starting;
Registering a first callback function, wherein the first callback function is used for synchronizing configuration data written into a Basic Input Output System (BIOS) to a first storage medium;
Configuration data is received and the first callback function is triggered to write the configuration data to the first storage medium.
Optionally, before the registering the first callback function, the method further includes:
Determining whether the current starting of the basic input output system BIOS is the first starting after refreshing;
if so, the previously stored configuration data is read from the first storage medium and written into the basic input output system BIOS.
Optionally, the first storage medium is a storage chip connected to a baseboard management controller BMC in the server system, and before writing the configuration data into the first storage medium, the method further includes:
and obtaining the control right of the memory chip access interface.
As can be seen from the above technical solution, the embodiment of the present application discloses a server system and a data processing method thereof, where the server system includes a BIOS and a first storage medium, where the BIOS obtains a start signal and completes the start, registers a first callback function, receives configuration data and stores the configuration data in a storage space corresponding to the BIOS, and triggers the first callback function to write the configuration data into the first storage medium, where the first callback function is used to implement synchronous storage of the configuration data written into the BIOS into the first storage medium; the first storage medium is used for storing configuration data of the basic input output system BIOS. According to the implementation scheme, the configuration data of the BIOS is backed up and stored in the storage medium which is independent of the BIOS, and after the BIOS is upgraded, the configuration data stored in the storage medium can be read out and written back to the BIOS, so that repeated configuration work after the BIOS is upgraded is avoided, the upgraded BIOS can be quickly put into work, and the availability of the server system is improved as a whole.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Fig. 1 is a schematic structural diagram of a server system according to an embodiment of the present application, and referring to fig. 1, a server system 10 may include a basic input output system BIOS (11) and a first storage medium (12); of course, the server system also includes other physical structures of processors, chips, interfaces, etc., which are not shown in fig. 1 because they are not directly related to the core technology of the present application. It will be appreciated that the architecture shown in fig. 1 is for illustrative purposes only and does not exclude that the server system may include other physical structures that support its operational functioning.
The method comprises the steps that a basic input/output system BIOS obtains a starting signal and completes starting, a first callback function is registered, configuration data is received and stored in a storage space corresponding to the basic input/output system BIOS, the first callback function is triggered to write the configuration data into a first storage medium, and the first callback function is used for synchronously storing the configuration data written into the basic input/output system BIOS into the first storage medium.
The first storage medium is used for storing configuration data of the basic input output system BIOS. The first storage medium may be, but is not limited to, any one of an SD card, an SM card, a memory stick, and a micro hard disk.
The configuration data may include, but is not limited to, a BIOS password, an encryption key, and some other configuration information of the system. When the configuration data in the BIOS is updated, including writing new configuration data by a user or modifying original configuration data, the server system synchronously stores the updated configuration data in a first storage medium independent of the BIOS chip besides storing the updated configuration data in the BIOS. In this way, in the subsequent process of upgrading the BIOS chip, although the BIOS chip is burned, all data in the BIOS chip including operation data and configuration data are erased, because the configuration data of the BIOS are backed up in the first storage medium, after the BIOS is upgraded, the configuration data can be read from the first storage medium and rewritten into the BIOS, so that the related configuration work of the BIOS is not required to be performed again.
And the first callback function is used for synchronizing the updated configuration data to the first storage medium. After each BIOS start, a first callback function needs to be registered, so that the BIOS can timely synchronize the updated configuration data to the first storage medium every time the configuration data is updated in the process of each power-on operation.
In a specific implementation, when the configuration data is updated in the BIOS, the first callback function is triggered, so that the first callback function executes the function of the first callback function, and the updated configuration data is stored in the first storage medium.
According to the server system, the configuration data of the BIOS are backed up in a storage medium which is independent of the BIOS, and after the BIOS is upgraded, the configuration data stored in the storage medium can be read out and written back to the BIOS, so that repeated configuration work after the BIOS is upgraded is avoided, the upgraded BIOS can be quickly put into work, the workload of staff is reduced as a whole, and the usability of the server system is improved.
In other implementations, the basic input output system BIOS may also be used to: before registering a first callback function, determining whether the current start of the basic input output system BIOS is the first start after refreshing; if yes, the previously stored configuration data is read from the first storage medium and written into the basic input output system BIOS.
In practical application, there are two situations in the starting of the BIOS, one is that the BIOS enters the working mode from the shutdown mode or the standby mode, and the other is that the BIOS is powered on and restarted after being updated. The corresponding processing of the basic input output system BIOS is different for different starting situations.
After the BIOS is started and before the first callback function is registered, the BIOS may further determine whether the current start of the BIOS is the first start after refreshing. If the BIOS is started for the first time after refreshing, the BIOS chip is burnt to erase all the data on the BIOS chip during refreshing, and the BIOS which is refreshed successfully only contains some updated running programs and no configuration data, so that the configuration data backed up before is read from the first storage medium and is rewritten into the BIOS; and after the backup configuration data is written into the BIOS, registering the first callback function.
If the current start of the BIOS is not the first start after refreshing, configuration data is still present in the BIOS, and no re-writing is needed, so that the first callback function can be directly registered.
Since in practical applications, the BIOS is usually mounted on the PCH chip, all communications with other structural components need to be performed through the PCH chip. In one embodiment, the BIOS is coupled to the first storage medium via its carrier chip PCH.
Fig. 2 is a schematic structural connection diagram of a server system according to an embodiment of the present application, and referring to fig. 2, in this implementation, the server system includes a baseboard management controller BMC in addition to a basic input output system BIOS and a first storage medium.
The first storage medium may be a storage chip connected to the baseboard management controller BMC, that is, the first storage medium is a storage chip of the baseboard management controller BMC; in the implementation, the memory chip of the baseboard management controller BMC is multiplexed to store the configuration data of the BIOS, so that the overall cost of the server system is saved.
In an implementation, the baseboard management controller BMC may be connected to the access interface I2C of the first storage medium, and the BIOS is also connected to the access interface I2C of the first storage medium through its carrier chip PCH. Only through the access interface I2C of the first storage medium can read and write operations to the first storage medium be performed.
Since both the BIOS and the BMC can access the first storage medium through the access interface I2C, and the first storage medium can be accessed by only one processing device at a time, in a specific implementation, in order to avoid an access conflict, a communication line may be set between the PCH of the BIOS and the BMC. Through the communication line, the BIOS may communicate with the baseboard management controller BMC through its carrying chip PCH to inform each other whether itself is currently accessing the first storage medium. Only after one processing device has finished accessing the first storage medium, the other processing device is able to perform an accurate read or write operation to the first storage device. In one implementation, the communication line between the carrier chip PCH and the baseboard management controller BMC may be a connection line of a general purpose input/output GPIO.
Fig. 3 is a schematic structural connection diagram of another server system according to an embodiment of the present application, and as shown in fig. 3, two connection lines of general purpose input/output GPIOs may be disposed between the baseboard management controller BMC and the basic input/output system BIOS. The connection line of the general purpose input/output GPIO is used for transmitting access status information of a baseboard management controller BMC or the basic input/output system BIOS, where the access status information includes obtaining a control right of the access interface I2C or releasing a control right of the access interface I2C.
One of the two connecting lines of the general purpose input/output GPIO is used for sending an access state message to the baseboard management controller BMC by the basic input/output system BIOS, and the other is used for sending the access state message to the basic input/output system BIOS by the baseboard management controller BMC.
Of course, a connection line of the general purpose input/output GPIO may also be provided between the baseboard management controller BMC and the basic input/output system BIOS. In this implementation, to prevent the baseboard management controller BMC and the BIOS from sending status access messages at the same time, a time-sharing usage mechanism may be used; that is, the baseboard management controller BMC and the basic input output system BIOS share the use right of the connection circuit of the general purpose input/output GPIO respectively in different time periods. For example, the 1 st second baseboard management controller BMC may send a message to the BIOS using the GPIO connection, but the BIOS may not send a message to the baseboard management controller BMC using the GPIO connection; the next second BIOS may send a message to the baseboard management controller BMC using the connection line of the GPIO, and the baseboard management controller BMC may not send a message to the BIOS using the connection line of the GPIO; therefore, the two circuits can circularly use the same general purpose input/output GPIO connection circuit, and the conflict generated by the simultaneous message transmission of the two circuits can be avoided.
Based on the above, the basic input output system BIOS is further configured to: and before the configuration data is written into the memory chip, obtaining the control right of the access interface I2C based on the message transmission in the connection line of the general purpose input/output GPIO.
Only after having obtained control of the access interface I2C can the corresponding processing means access said first storage medium via the access interface I2C. After the first storage medium is accessed, the processing device may also release the control right of the access interface I2C, and then other processing devices may obtain the control right of the access interface I2C and access the first storage medium.
In one implementation, and with reference to fig. 3, the I2C interfaces of the PCH and the BMC are both connected to the first storage medium, so that both the BIOS and the BMC can access the first storage medium.
And simultaneously interconnecting the 2 GPIOs carrying the chip PCH and the baseboard management controller BMC. Since the I2C cannot be accessed by 2 processing apparatuses at the same time, the BIOS and BMC can notify the other party whether or not the I2C is being accessed by the other party by using the connection lines of the 2 GPIOs, so as to avoid collision. At the beginning and end of accessing the first storage medium, the corresponding processing means need to join an action of acquiring/releasing the control right of the access interface I2C of the first storage medium.
For the foregoing method embodiments, for simplicity of explanation, the methodologies are shown as a series of acts, but one of ordinary skill in the art will appreciate that the present application is not limited by the order of acts, as some steps may, in accordance with the present application, occur in other orders or concurrently. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present application.
The method is described in detail in the embodiments disclosed in the present application, and the method can be implemented by using various types of devices, so that the present application also discloses a device, and specific embodiments are given below for details.
Fig. 4 is a flowchart of a data processing method of a server system according to an embodiment of the present application. The processing method shown in fig. 4 is applied to the server system disclosed in the foregoing embodiment. As shown in connection with fig. 4, the data processing method of the server system may include:
Step 401: the basic input output system BIOS obtains a start signal and completes the start.
Step 402: and registering a first callback function, wherein the first callback function is used for synchronizing the configuration data written into the basic input output system BIOS to a first storage medium.
Step 403: configuration data is received and the first callback function is triggered to write the configuration data to the first storage medium.
According to the processing method of the server system, configuration data of the BIOS are backed up in a storage medium which is independent of the BIOS, after the BIOS is upgraded, the configuration data stored in the storage medium can be read out and written back to the BIOS, so that repeated configuration work after the BIOS is upgraded is avoided, the upgraded BIOS can be put into work quickly, workload of staff is reduced as a whole, and usability of the server system is improved.
In another implementation, before the registering the first callback function, the method may further include: determining whether the current starting of the basic input output system BIOS is the first starting after refreshing; if yes, reading the previously stored configuration data from the first storage medium and writing the configuration data into the basic input/output system BIOS; if not, directly entering the step of registering the first callback function.
In another implementation, the first storage medium is a storage chip connected to a baseboard management controller BMC in a server system, and before writing configuration data into the first storage medium, the method may further include: and obtaining the control right of the memory chip access interface.
Based on the foregoing, FIG. 5 shows a flowchart of another data processing method of a server system, a more complete implementation of which can be understood in conjunction with the content shown in FIG. 5.
Fig. 6 is a flowchart of an application example of a data processing method of a server system according to an embodiment of the present application, and is shown in conjunction with fig. 6:
firstly, after BIOS is started, judging whether it is the first start after refreshing, if so, reading out the configuration data from the first storage medium and writing back to BIOS chip. If not, no processing is performed.
Then a callback function, i.e. a callback function, is registered, the function of which is to write data to the first storage medium. The method comprises the following steps: when the memory chip is accessed, the GPIO state is read and written firstly, the I2C control right of the memory chip is obtained, data is written, and then the GPIO is rewritten to release the I2C control right.
In the subsequent starting process, when the basic input/output BIOS sets the password, the password data is written into the BIOS chip, and the callback function is triggered at the same time, so that the password data is written into the storage chip.
When the BIOS imports the encryption key, the password key data is written into the BIOS chip, and the callback function is triggered at the same time, so that the password key data is written into the storage chip.
When the BIOS performs other configuration to be stored, the configuration data is sucked into the BIOS chip, and a callback function is triggered to write the configuration data into the storage chip.
Specific implementation and other possible implementation of each step in the data processing method of the server system may refer to the content description of the corresponding part in the foregoing embodiment of the server system, and the detailed description is not repeated here.
In addition, the application also discloses a data processing device of the server system, which is applied to the basic input and output system and comprises:
the starting control module is used for obtaining a starting signal and finishing starting;
The function registration module is used for registering a first callback function, and the first callback function is used for synchronizing configuration data written into the basic input output system BIOS to a first storage medium;
And the data backup module is used for receiving the configuration data and triggering the first callback function to write the configuration data into the first storage medium.
The data processing device of the server system in the above embodiment includes a processor and a memory, where the start control module, the function registration module, and the data backup module in the above embodiment are stored as program modules, and the processor executes the program modules stored in the memory to implement corresponding functions.
The processor comprises a kernel, and the kernel fetches the corresponding program module from the memory. The kernel can be provided with one or more kernels, and the processing of the return visit data is realized by adjusting kernel parameters.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
An embodiment of the present application provides a storage medium having stored thereon a program which, when executed by a processor, implements the data processing method of the server system described in the above embodiment.
The embodiment of the application provides a processor, which is used for running a program, wherein the program runs to execute the data processing method of the server system in the embodiment.
Further, the embodiment provides an electronic device, which comprises a processor and a memory. Wherein the memory is for storing executable instructions of the processor configured to perform the data processing method of the server system described in the above embodiments via execution of the executable instructions.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer 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 points refer to the description of the method section.
It is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
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. The software modules may be disposed 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 previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.