Server log generation method and apparatus, nonvolatile readable storage medium, and electronic device
By executing pre-set functions in the server's operating system, obtaining firmware version information and sending it to BMC, the problem that BMC cannot record firmware version information is solved, and the function of BMC recording version information in the log is realized.
Patent Information
- Application Number
- PCT/CN2024/121988
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-29
- Filing Date
- 2024-09-27
- Publication Date
- 2025-06-05
AI Technical Summary
In the event that the server's firmware is updated through the target program in the server's operating system, the substrate management controller (BMC) cannot record the firmware version information in the log.
By executing pre-set functions in the server's operating system, the version information of the target firmware is obtained and the update start and end information is sent to the BMC, so that the BMC can record this information.
It realizes that when the server's firmware is updated through tools in the server's operating system, BMC can record the firmware version information in the log, solving the problem that BMC cannot record the version information.
Smart Images

Figure CN2024121988_05062025_PF_FP_ABST
Abstract
Description
Server log generation method and device, non-volatile readable storage medium and electronic device
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on November 29, 2023, with application number 202311615385.8, and application name “Server log generation method and device, storage medium and electronic device”, all contents of which are incorporated by reference in this application. Technical Field
[0003] The embodiments of the present application relate to the field of computers, and in particular, to a server log generation method and device, a non-volatile readable storage medium, and an electronic device. Background Art
[0004] In the related art, when the server's firmware is updated through the BMC, the BMC can record the firmware version changes. However, when the server's firmware is not updated through the BMC, for example, when the server's firmware is updated through the update tool in the server's operating system, since the process of updating the server's firmware is performed within the server's operating system and is not updated through the BMC, the BMC is not aware of this. It is understandable that the BMC cannot obtain the relevant information and record it in the log.
[0005] Summary of the Invention
[0006] Embodiments of the present application provide a server log generation method and apparatus, a non-volatile readable storage medium, and an electronic device to at least address the related art issue of a BMC being unable to record firmware version information in a log when the server's firmware is updated via a target program in the server's operating system.
[0007] According to a first aspect of an embodiment of the present application, a server log generation method is provided, comprising: when updating target firmware in a server from a first version to a second version through a target program in an operating system of the server, obtaining first version information of the target firmware, and sending the update start information to a baseboard management controller (BMC) of the server, wherein the update start information includes first version information, which is description information of the first version, and the BMC is configured to record the received update start information in a target log; when completing the update of the target firmware from the first version to the second version through the target program, obtaining second version information of the target firmware, and sending update end information to the BMC, wherein the update end information includes second version information, which is description information of the second version, and the BMC is configured to record the received update end information in the target log.
[0008] In an exemplary embodiment, when updating the target firmware in the server from the first version to the second version starting through a target program in the operating system of the server, first version information of the target firmware is obtained, and the update start information is sent to the baseboard management controller BMC of the server, including: when updating the target firmware in the server from the first version to the second version starting through the target program, a pre-set first function is executed, wherein the first function is used to obtain the first version information of the target firmware and send the update start information to the BMC.
[0009] In an exemplary embodiment, when updating the target firmware in the server from the first version to the second version starting through the target program, a pre-set first function is executed, including: when updating the target firmware in the server from the first version to the second version starting through the target program, the first function is executed through the target firmware to obtain first version information of the target firmware, and update start information is sent to the BMC.
[0010] In an exemplary embodiment, when updating the target firmware in the server from a first version to a second version starting through a target program, executing a first function through the target firmware includes: when updating the target firmware in the server from a first version to a second version starting through a target program, switching the operating system from a running state to a suspended running state, switching the target firmware from a suspended running state to a running state, and executing the first function through the target firmware.
[0011] In an exemplary embodiment, when updating the target firmware in the server from the first version to the second version starting through the target program, executing the first function through the target firmware includes: when updating the target firmware in the server from the first version to the second version starting through the target program, triggering the target interrupt, and executing the first function through the target firmware, wherein the first function is the function triggered to be executed after the target interrupt is triggered.
[0012] In an exemplary embodiment, executing a first function through target firmware includes: when a first version of the target firmware is copied from a first storage space to a second storage space, executing the first function through the first version of the target firmware stored in the second storage space, wherein the second storage space is a storage space in the memory of the server, the first function is used to read first version information from the first storage space and send update start information to the BMC, the first storage space is used to store the first function, the current version of the target firmware and the current version information of the target firmware, and when the current version of the target firmware is the first version, the current version information is the first version information.
[0013] In an exemplary embodiment, executing a preset first function includes: executing a first portion of code in the first function, wherein the first portion of code is used to read first version information from a first storage space, the first storage space is used to store the current version of the target firmware and the current version information of the target firmware, and when the current version of the target firmware is the first version, the current version information is the first version information; executing a second portion of code in the first function, wherein the second portion of code is used to send update start information to the BMC.
[0014] In an exemplary embodiment, before executing the preset first function, the method also includes: when the first version information is the version information of the initial version of the target firmware, storing the first version information in the first storage space; or when the target firmware is updated from the third version to the first version through the target program, updating the current version information stored in the first storage space from the third version information to the first version information, wherein the third version information is the description information of the third version.
[0015] In an exemplary embodiment, executing a preset first function includes: executing the first function stored in a first storage space, wherein the first function is used to read the first version information from the first storage space and send the update start information to the BMC, and the first storage space is used to store the first function, the current version of the target firmware, and the current version information of the target firmware. When the current version of the target firmware is the first version, the current version information is the first version information; or when the first function is copied from the first storage space to the second storage space, executing the first function stored in the second storage space, wherein the second storage space is a storage space in the memory of the server, and the first function is used to read the first version information from the first storage space and send the update start information to the BMC. The first storage space is used to store the first function, the current version of the target firmware, and the current version information of the target firmware. When the current version of the target firmware is the first version, the current version information is the first version information.
[0016] In an exemplary embodiment, sending the update start information to the baseboard management controller (BMC) of the server includes: calling a target interface to send the update start information to the BMC.
[0017] In an exemplary embodiment, sending update start information to a baseboard management controller (BMC) of a server includes sending the update start information to the BMC, wherein the update start information further includes first status information, and the first status information is used to indicate that the target firmware has started to be updated.
[0018] In an exemplary embodiment, when the target firmware is updated from the first version to the second version through the target program, the second version information of the target firmware is obtained, and before the update completion information is sent to the BMC, the method further includes: after sending the update start information to the BMC, switching the target firmware from the running state to the suspended running state, and switching the operating system from the suspended running state to the running state, and continuing to update the target firmware from the first version to the second version through the target program.
[0019] In an exemplary embodiment, when the target firmware is updated from the first version to the second version through the target program, the second version information of the target firmware is obtained, and the update completion information is sent to the BMC, including: when the target firmware is updated from the first version to the second version through the target program, a preset second function is executed, wherein the second function is used to obtain the second version information of the target firmware and send the update completion information to the BMC.
[0020] In an exemplary embodiment, when the target firmware is updated from the first version to the second version through the target program, a pre-set second function is executed, including: when the target firmware is updated from the first version to the second version through the target program, the second function is executed through the target firmware to obtain the second version information of the target firmware, and the update completion information is sent to the BMC.
[0021] In an exemplary embodiment, when the target firmware is updated from a first version to a second version through a target program, a second function is executed through the target firmware, including: when the target firmware is updated from a first version to a second version through a target program, the operating system is switched from a running state to a suspended running state, the target firmware is switched from a suspended running state to a running state, and the second function is executed through the target firmware.
[0022] In an exemplary embodiment, when the target firmware is updated from a first version to a second version through a target program, a second function is executed through the target firmware, including: when the target firmware is updated from a first version to a second version through a target program, a target interrupt is triggered, and the second function is executed through the target firmware, wherein the second function is a function triggered to be executed after the target interrupt is triggered.
[0023] In an exemplary embodiment, executing a second function through the target firmware includes: when the first version of the target firmware is copied from the first storage space to the second storage space, executing the second function through the first version of the target firmware stored in the second storage space, wherein the second storage space is a storage space in the memory of the server, the second function is used to read the second version information from the first storage space and send the update end information to the BMC, the first storage space is used to store the second function, the current version of the target firmware and the current version information of the target firmware, and when the current version of the target firmware is the second version, the current version information is the second version information.
[0024] In an exemplary embodiment, executing a preset second function includes: executing a third portion of code in the second function, wherein the third portion of code in the second function is used to read the second version information from a first storage space, the first storage space is used to store the current version of the target firmware and the current version information of the target firmware, and when the current version of the target firmware is the second version, the current version information is the second version information; executing a fourth portion of code in the second function, wherein the fourth portion of code in the second function is used to send update completion information to the BMC.
[0025] In an exemplary embodiment, executing a pre-set second function includes: executing the second function stored in a first storage space, wherein the second function is used to read the second version information from the first storage space and send the update completion information to the BMC, and the first storage space is used to store the second function, the current version of the target firmware, and the current version information of the target firmware. When the current version of the target firmware is the second version, the current version information is the second version information; or when the second function is copied from the first storage space to the second storage space, executing the second function stored in the second storage space, wherein the second storage space is a storage space in the memory of the server, and the second function is used to read the second version information from the first storage space and send the update completion information to the BMC. The first storage space is used to store the second function, the current version of the target firmware, and the current version information of the target firmware. When the current version of the target firmware is the second version, the current version information is the second version information.
[0026] In an exemplary embodiment, when the target firmware is updated from a first version to a second version through a target program, the current version information stored in the first storage space is updated from the first version information to the second version information, wherein when the current version of the target firmware is the second version, the current version information is the second version information.
[0027] In an exemplary embodiment, sending the update completion information to the BMC includes: calling a target interface to send the update completion information to the BMC.
[0028] In an exemplary embodiment, sending the update completion information to the BMC includes: sending the update completion information to the BMC, wherein the update completion information further includes second status information, and the second status information is used to indicate that the update of the target firmware is completed.
[0029] In an exemplary embodiment, the target firmware includes at least one of the following: a basic input and output system (BIOS), a complex programmable logic device (CPLD), a field replaceable unit (FRU), and a power management device.
[0030] According to the second aspect of the embodiment of the present application, another server log generation method is also provided, including: when updating the target firmware in the server from the first version to the second version through the target program in the operating system of the server, receiving the update start information sent by the target firmware, and recording the received update start information in the target log, wherein the update start information includes first version information, the first version information is the description information of the first version, the first version information is the version information obtained from the first storage space by executing the preset first function, the first storage space is set to store the first function and the preset second function, and when starting to update the target firmware from the first version to the second version, the first storage space is also set to store the first version and First version information; when the target firmware is updated from the first version to the second version through the target program, the update completion information sent by the target firmware is received, and the received update completion information is recorded in the target log, wherein the update completion information includes the second version information, the second version information is the description information of the second version, and the second version information is the version information obtained from the first storage space by executing the preset second function. When the target firmware is updated from the first version to the second version, the first storage space is also set to store the second version and second version information of the target firmware. The second version of the target firmware is set to replace the first version of the target firmware stored in the first storage space, and the second version information is used to replace the first version information stored in the first storage space.
[0031] In an exemplary embodiment, the update start information further includes first status information, which is used to indicate that the update of the target firmware has started; the update end information further includes second status information, which is used to indicate that the update of the target firmware has been completed.
[0032] According to a third aspect of an embodiment of the present application, a server log generation device is provided, including: a first acquisition module, configured to obtain first version information of the target firmware when updating the target firmware in the server from the first version to the second version through a target program in the operating system of the server, and send the update start information to the baseboard management controller BMC of the server, wherein the update start information includes first version information, the first version information is description information of the first version, and the BMC is configured to record the received update start information in a target log; a second acquisition module, configured to obtain second version information of the target firmware when completing the update of the target firmware from the first version to the second version through the target program, and send update end information to the BMC, wherein the update end information includes second version information, the second version information is description information of the second version, and the BMC is configured to record the received update end information in the target log.
[0033] According to the fourth aspect of the embodiment of the present application, a server log generation device is also provided, including: a first receiving module, which is configured to receive update start information sent by the target firmware when the target firmware in the server is updated from the first version to the second version through the target program in the operating system of the server, and record the received update start information in the target log, wherein the update start information includes first version information, the first version information is description information of the first version, the first version information is version information obtained from the first storage space by executing a preset first function, the first storage space is configured to store the first function and the preset second function, and when starting to update the target firmware from the first version to the second version, the first storage space is also configured to store the first version and First version information; a second receiving module, which is configured to receive the update completion information sent by the target firmware when the target firmware is updated from the first version to the second version through the target program, and record the received update completion information in the target log, wherein the update completion information includes the second version information, the second version information is the description information of the second version, and the second version information is the version information obtained from the first storage space by executing the preset second function. When the target firmware is updated from the first version to the second version, the first storage space is also configured to store the second version and second version information of the target firmware. The second version of the target firmware is configured to replace the first version of the target firmware stored in the first storage space, and the second version information is used to replace the first version information stored in the first storage space.
[0034] According to a fifth aspect of the embodiments of the present application, a computer non-volatile readable storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0035] According to the sixth aspect of the embodiments of the present application, an electronic device is also provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any of the above method embodiments.
[0036] Through the present application, when updating the firmware in the server by using a tool in the server's operating system, it is possible but not limited to obtaining the first version information of the firmware before the update, and sending the update start information carrying the first version information to the BMC. When updating the firmware in the server by using the tool in the server's operating system, it is possible but not limited to obtaining the second version information of the firmware after the update, and sending the update end information carrying the second version information to the BMC. In this way, when updating the server's firmware by using a tool in the server's operating system, the update start information and the update end information can be sent to the BMC, and the BMC records the update start information and the update end information in a log. Therefore, the problem that the BMC cannot record the firmware version information in the log when updating the server's firmware by using a target program in the server's operating system can be solved, and the technical effect that the BMC can record the firmware version information in the log when updating the server's firmware by using a target program in the server's operating system is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] FIG1 is an architecture diagram of a server of a server log generation method according to an embodiment of the present application;
[0038] FIG2 is a schematic diagram of an application scenario of an optional server log generation method according to an embodiment of the present application;
[0039] FIG3 is a flowchart of a method for generating a server log according to an embodiment of the present application;
[0040] FIG4 is a first schematic diagram of an optional execution of a first function according to an embodiment of the present application;
[0041] FIG5 is a schematic diagram of an optional method of storing first version information in a first storage space according to an embodiment of the present application;
[0042] FIG6 is a second schematic diagram of an optional execution of the first function according to an embodiment of the present application;
[0043] FIG7 is a first schematic diagram of an optional execution of a second function according to an embodiment of the present application;
[0044] FIG8 is a second schematic diagram of an optional execution of the second function according to an embodiment of the present application;
[0045] FIG9 is a second flowchart of a server log generation method according to an embodiment of the present application;
[0046] FIG10 is a schematic diagram of an optional server log generation method according to an embodiment of the present application;
[0047] FIG11 is a timing diagram of an optional server log generation method according to an embodiment of the present application;
[0048] FIG12 is a structural block diagram of a server log generating device according to an embodiment of the present application. DETAILED DESCRIPTION
[0049] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0050] It should be noted that the terms "first", "second", etc. in the description and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0051] The method embodiment provided in the embodiment of the present application can be executed in a server device or a similar computing device. Taking operation on a server device as an example, Figure 1 is an architectural diagram of a server of a server log generation method in an embodiment of the present application. The server may be, but not limited to, deployed with a target firmware. As shown in Figure 1, the server may be, but not limited to, deployed with a CPU (Central Processing Unit), target firmware, memory and BMC. A communication connection is established between the CPU and the target firmware and the memory, and a communication connection is established between the CPU and the BMC. The BMC may be, but not limited to, establishing a communication connection between the CPU and the target firmware. The BMC is an independent management controller located on the server motherboard, with remote management, monitoring and control functions. For example, when the target firmware in the server is updated, a target log is generated in the BMC, and the target firmware update status is recorded in the target log, for example, the version information before the target firmware is updated, the version information after the target firmware is updated, and so on.
[0052] First, the English abbreviations appearing in the examples of this application are explained as follows:
[0053] BIOS: Basic Input Output System, used to boot the server system.
[0054] BMC: Baseboard Management Controller.
[0055] SEL: System Event Log, system event log.
[0056] SMI: System Management Interrupt, system management interrupt.
[0057] SMM: System Management Mode, system management mode.
[0058] IPMI: Intelligent Platform Management Interface.
[0059] FLASH: Flash EEPROM Memory, a non-volatile storage device.
[0060] In order to better understand the server log generation method in the embodiment of the present application, the application scenario of the server log generation method in the embodiment of the present application is explained and illustrated in combination with optional embodiments below, which can be applied to but not limited to the embodiment of the present application.
[0061] FIG2 is a schematic diagram of an application scenario of an optional server log generation method according to an embodiment of the present application. As shown in FIG2 , target firmware 204 and a BMC (Baseboard Management Controller) 206 are deployed on a server 202. When a target program in an operating system of the server initiates an update of the target firmware in the server from a first version to a second version, changes in the version information of the target firmware 204 may be recorded in a target log through, but not limited to, the following steps:
[0062] Step S202, when the target firmware 204 in the server 202 is updated from the first version to the second version through the target program in the operating system of the server 202, the first version information of the target firmware 204 is obtained, and the update start information is sent to the baseboard management controller BMC206 of the server 202, wherein the update start information includes the first version information, the first version information is the description information of the first version, and the BMC206 is configured to record the received update start information in the target log.
[0063] Step S204, when the target firmware is updated from the first version to the second version through the target program, obtain the second version information of the target firmware and send the update completion information to the BMC, wherein the update completion information includes the second version information, and the second version information is the description information of the second version. The BMC is configured to record the received update completion information in the target log.
[0064] As an optional example, when BMC206 receives the update start information, it may, but is not limited to, record the first version information of the target firmware 204 and the start of updating the target firmware 204 at 14:00 on the day of b month and year a in the target log; when BMC206 receives the update end information, it may, but is not limited to, record the second version information of the target firmware 204 and the completion of updating the target firmware 204 at 16:00 on the day of b month and year a in the target log.
[0065] For example, when the server firmware is updated through the BMC, the BMC can record the corresponding version information in the log. When the update starts, the log records: a year b month c day 14:00, the current firmware version number is 2.0, and the update starts; when the update is completed, the log records: a year b month c day 18:00, the current firmware version number is 3.0, the version is upgraded, and the update is completed.
[0066] In this way, when the target firmware version in the server is updated through the target program in the server's operating system, the BMC can record the update status of the target firmware in the log in a timely manner. When the system encounters an abnormality or failure, the administrator can understand the update process and results of the target firmware by checking the log, discover problems in time, and thus better handle failures and abnormal situations, thereby improving the stability and reliability of the system.
[0067] In this embodiment, a server log generation method is provided. FIG3 is a flowchart of the server log generation method according to an embodiment of the present application. As shown in FIG3 , the process includes the following steps:
[0068] Step S302: When updating target firmware in the server from a first version to a second version through a target program in the operating system of the server, first version information of the target firmware is obtained, and update start information is sent to a baseboard management controller (BMC) of the server, wherein the update start information includes the first version information, which is descriptive information of the first version. The BMC is configured to record the received update start information in a target log.
[0069] Step S304: When the target firmware is updated from the first version to the second version through the target program, the second version information of the target firmware is obtained, and the update completion information is sent to the BMC, wherein the update completion information includes the second version information, and the second version information is the description information of the second version. The BMC is configured to record the received update completion information in the target log.
[0070] Through the above steps, when the server firmware is updated by starting the update through the tool in the server operating system, the first version information of the firmware before the update can be obtained, but is not limited to, and the update start information carrying the first version information is sent to the BMC. When the server firmware is updated by the tool in the server operating system, the second version information of the firmware after the update can be obtained, but is not limited to, and the update end information carrying the second version information is sent to the BMC. In this way, when the server firmware is updated by the tool in the server operating system, the update start information and the update end information can be sent to the BMC, and the BMC records the update start information and the update end information in the log. Therefore, the problem that the BMC cannot record the firmware version information in the log when the server firmware is updated by the target program in the server operating system can be solved, and the technical effect of the BMC being able to record the firmware version information in the log when the server firmware is updated by the target program in the server operating system is achieved.
[0071] The execution entity of the above steps may be a server, etc., but is not limited thereto.
[0072] In the technical solution provided in the above step S302, the BMC is an independent management controller located on the server motherboard, which has remote management, monitoring and control functions. SEL (System Event Log, also known as target log) is one of the functions of BMC to record system events. In order to provide the ability to track and analyze important events occurring in the server system, various system events such as hardware errors, power status changes, sensor alarms, etc. are recorded. By monitoring and analyzing the SEL log, the administrator can better understand the health status of the system, discover problems in a timely manner, handle faults and abnormal situations, and improve the stability and reliability of the system. At the same time, the SEL log also provides an important reference for troubleshooting and maintenance, helping administrators to locate and solve problems.
[0073] Recording firmware version numbers and changes is a crucial component of the SEL, serving several purposes. 1. Problem Tracking and Troubleshooting: The SEL logs system events and status changes, including information about firmware updates. When a system anomaly or failure occurs, administrators can review the SEL log to understand the firmware update process and results, enabling better problem tracking and troubleshooting. 2. Maintenance History: By recording BIOS version numbers and related events, the SEL provides a historical record of system maintenance. Administrators can review the SEL log as needed to understand the time, content, and results of system maintenance, providing a reference for subsequent maintenance work. 3. Security Checks: The SEL log records detailed information about each firmware update, including the time, date, and version number. This is crucial for security checks, ensuring the legitimacy and integrity of firmware updates and preventing unauthorized tampering or malicious operations. 4. Remote Management and Monitoring: BMCs typically support remote management and monitoring. By generating SEL logs, the BMC can transmit information related to firmware updates to a remote management terminal. Administrators can view and analyze SEL logs from a remote location, enabling centralized management and monitoring of multiple servers.
[0074] In general, recording firmware version numbers and generating SEL logs on the BMC facilitates problem tracking and troubleshooting. It also provides a system maintenance history, strengthens security checks, and supports remote management and monitoring. These advantages improve system management efficiency and reliability, providing administrators with more convenient management tools. Therefore, recording firmware version numbers and generating SEL logs on the BMC are essential.
[0075] The target firmware in the server can be updated through, but is not limited to, the BMC. In such cases, the BMC can record the firmware version changes in a log. For example, when updating the server's BIOS (Basic Input / Output System) firmware through the BMC, the BMC can update the pre-encrypted and packaged BIOS hpm file and monitor its update progress. First, a configuration file with a .conf suffix is created, which contains configuration information such as device information, manufacturer information, product information, firmware major version number, firmware minor version number, and motherboard ID (Identity document). Second, the compiled BIOS bin file is combined with the configuration file and encrypted into an hpm file for the BMC to use for updates. Finally, when the BMC updates the BIOS hpm file, it parses the configuration file to obtain the firmware major and minor version numbers, integrates them to obtain the BIOS version number, and generates the corresponding SEL record through the pre-agreed IPMI command to achieve version number control during BIOS upgrades.
[0076] However, when the server firmware is updated through a target program in the server operating system, the BMC cannot know that the server firmware has been updated, which results in the BMC being unable to record the firmware update status in the log. In order to record the firmware version change in the log even when the server firmware is not updated through the BMC, it is possible, but not limited to, to obtain the first version information of the target firmware and send the update start information to the server's baseboard management controller (BMC) when starting to update the target firmware in the server from a first version to a second version through a target program in the server operating system.
[0077] Optionally, in this embodiment, the target program may include, but is not limited to, a target application of an update tool, or target software, etc. The first version is the current version of the target firmware, and the second version is the version of the target firmware to be updated. The second version may be lower than the first version, for example, the target firmware version is downgraded, or the second version may be higher than the first version, for example, the target firmware version is upgraded, or the second version may be the same as the first version, for example, the target firmware version is reflashed.
[0078] Optionally, in this embodiment, the first version information is description information of the first version. The description information may include, but is not limited to, the version number, version size, and version source of the first version. For example, the version number of the first version is V2.1, the version size is 30M (Mega), and the version source is Software 1. The version number of the first version may include, but is not limited to, a major version number and a minor version number. For example, the major version number of the first version is 2 in V2.1, and the minor version number of the first version is 1 in V2.1.
[0079] Optionally, in this embodiment, the BMC may, but is not limited to, record the received update start information in a target log. For example, when the server firmware is updated through a target program in the server's operating system, the BMC records in the log: 14:00 on the cth day of the bth month of the ath year, the firmware version number is V2.0, and the update starts.
[0080] In an exemplary embodiment, when updating the target firmware in the server from the first version to the second version is started through a target program in the operating system of the server, the first version information of the target firmware is obtained and the update start information is sent to the baseboard management controller BMC of the server in the following manner, but is not limited to: when updating the target firmware in the server from the first version to the second version is started through the target program, a pre-set first function is executed, wherein the first function is used to obtain the first version information of the target firmware and send the update start information to the BMC.
[0081] Optionally, in this embodiment, the preset first function may be, but is not limited to, a target type function. As an optional example, the target type function may be, but is not limited to, an SMM module type function.
[0082] Optionally, in this embodiment, the first function can be, but is not limited to, used to obtain the first version information of the target firmware and send the update start information to the BMC, so that when the target firmware in the server is updated from the first version to the second version through the target program in the server's operating system, the BMC can promptly receive the first version information before the target firmware is updated.
[0083] In an exemplary embodiment, a preset first function may be executed when the target firmware in the server is updated from the first version to the second version starting through the target program, but is not limited to the following manner: when the target firmware in the server is updated from the first version to the second version starting through the target program, the first function is executed through the target firmware to obtain first version information of the target firmware and send update start information to the BMC.
[0084] Optionally, in this embodiment, when updating the target firmware in the server from the first version to the second version through the target program, the first function can be executed through but not limited to the target firmware to obtain the first version information of the target firmware and send the update start information to the BMC.
[0085] In an exemplary embodiment, the first function may be executed by the target firmware when the target firmware in the server is updated from the first version to the second version starting through the target program in the following manner, but is not limited to: when the target firmware in the server is updated from the first version to the second version starting through the target program, the operating system is switched from a running state to a suspended running state, the target firmware is switched from the suspended running state to a running state, and the first function is executed by the target firmware.
[0086] Optionally, in this embodiment, the server's operating system and target firmware can be, but are not limited to, run serially. It is understandable that the server's operating system and target firmware cannot run at the same time. In such a case, the server's operating system can be, but is not limited to, switched from a running state to a suspended state, for example, the server's operating system is switched from running to suspended, and the target firmware is switched from a suspended state to a running state, for example, the target firmware is switched from suspended to running, and the first function is executed through the target firmware.
[0087] In an exemplary embodiment, the first function may be executed by the target firmware when the target firmware in the server is updated from the first version to the second version starting through the target program, but is not limited to the following method, including: when the target firmware in the server is updated from the first version to the second version starting through the target program, a target interrupt is triggered, and the first function is executed by the target firmware, wherein the first function is a function triggered to be executed after the target interrupt is triggered.
[0088] Optionally, in this embodiment, the target interrupt may be, but is not limited to, used to transfer control from the server's operating system to the target firmware. It is understood that the target interrupt may be, but is not limited to, used to switch the server's operating system from a running state to a suspended state, or to switch the target firmware from a suspended state to a running state. The target interrupt may include, but is not limited to, an SMI interrupt.
[0089] For example, when the target firmware in the server is updated from the first version to the second version through the target program (for example, from version 1.02 to version 1.03), the SMI interrupt can be triggered but is not limited to enter the SMM mode. At this time, the control right will be transferred from the OS (Operating System) to the target firmware, and the target firmware will execute the first SMM module function (or called the first function).
[0090] In an exemplary embodiment, the first function can be executed through the target firmware in the following manner, but is not limited to: when the first version of the target firmware is copied from the first storage space to the second storage space, the first function is executed through the first version of the target firmware stored in the second storage space, wherein the second storage space is a storage space in the memory of the server, the first function is used to read the first version information from the first storage space and send the update start information to the BMC, the first storage space is used to store the first function, the current version of the target firmware and the current version information of the target firmware, and when the current version of the target firmware is the first version, the current version information is the first version information.
[0091] Optionally, in this embodiment, the target firmware may include, but is not limited to, a set of fixed programs or codes, and the version of the target firmware may include, but is not limited to, a certain version of the program or code. For example, the first version of the target firmware may include, but is not limited to, the first version of the program or code, and the second version of the target firmware may include, but is not limited to, the second version of the program or code.
[0092] Optionally, in this embodiment, when the target firmware in the server is updated from the first version to the second version through the target program, in order to improve the efficiency of the update, the first version of the target firmware stored in the first storage space may be copied to the second storage space, but is not limited to. The first storage space may include, but is not limited to, the storage space in the hard disk where the target firmware is solidified, such as a Flash device, etc. The first storage space may store, but is not limited to, the current version information of the target firmware, the current version of the target firmware, and the first function. For example, the storage space corresponding to 0x20FF0 to 0x20FFF in the Flash device is the storage space for storing the current version information of the target firmware.
[0093] FIG4 is a schematic diagram of an optional execution of a first function according to an embodiment of the present application. As shown in FIG4 , target firmware 204, a BMC (Baseboard Management Controller) 206, and a memory 208 are deployed on a server 202. A second storage space is deployed in the memory 208. The first storage space is used to store the first function, the current version of the target firmware, and the current version information of the target firmware. When the current version of the target firmware is the first version, the current version information is the first version information.
[0094] It is possible, but not limited to, to execute the first function through the first version of the target firmware stored in the second storage space when the first version of the target firmware is copied from the first storage space to the second storage space. For example, its operation is to obtain information at positions 0x20FF0 to 0x20FFF in the first storage space through the read and write IO interface.
[0095] In an exemplary embodiment, a preset first function can be executed in the following manner, but is not limited to: executing a first portion of code in the first function, wherein the first portion of code is used to read first version information from a first storage space, the first storage space is used to store the current version of the target firmware and the current version information of the target firmware, and when the current version of the target firmware is the first version, the current version information is the first version information; executing a second portion of code in the first function, wherein the second portion of code is used to send update start information to the BMC.
[0096] Optionally, in this embodiment, the first function may include, but is not limited to, two parts of code. The first part of the code may be, but is not limited to, used to read the first version information from the first storage space, such as the version number, version size, and version source of the first version. The second part of the code may be, but is not limited to, sending an update start message carrying the first version information to the BMC.
[0097] In an exemplary embodiment, before executing the preset first function, the above method also includes: when the first version information is the version information of the initial version of the target firmware, storing the first version information in the first storage space; or when the target firmware is updated from the third version to the first version through the target program, updating the current version information stored in the first storage space from the third version information to the first version information, wherein the third version information is the description information of the third version.
[0098] Optionally, in this embodiment, the first version information may be the version information of the initial version of the target firmware. For example, the first version information is the version information of the default version of the target firmware. In this case, the first version information may be stored in the first storage space but is not limited to being stored.
[0099] Optionally, in this embodiment, the first version information may not be the version information of the initial version of the target firmware. It can be understood that the first version information is not the version information of the default version of the target firmware. For example, when the target firmware is updated from the third version to the first version through the target program, the third version information stored in the first storage space can be updated to the first version information, but is not limited to.
[0100] Figure 5 is a schematic diagram of an optional storage of first version information in a first storage space according to an embodiment of the present application. As shown in Figure 5, before the target firmware is updated from the third version to the first version through the target program, the third version of the target firmware, the third version information of the target firmware, and the first function are stored in the first storage space. When the target firmware is updated from the third version to the first version through the target program, the third version information stored in the first storage space is updated to the first version information. In this case, the first version of the target firmware, the first version information of the target firmware, and the first function are stored in the first storage space.
[0101] In an exemplary embodiment, the pre-set first function can be executed in the following manner, but is not limited to: executing the first function stored in the first storage space, wherein the first function is used to read the first version information from the first storage space and send the update start information to the BMC, and the first storage space is used to store the first function, the current version of the target firmware, and the current version information of the target firmware. When the current version of the target firmware is the first version, the current version information is the first version information; or when the first function is copied from the first storage space to the second storage space, executing the first function stored in the second storage space, wherein the second storage space is a storage space in the memory of the server, and the first function is used to read the first version information from the first storage space and send the update start information to the BMC. The first storage space is used to store the first function, the current version of the target firmware, and the current version information of the target firmware. When the current version of the target firmware is the first version, the current version information is the first version information.
[0102] Optionally, in this embodiment, the first function stored in the second storage space can be executed by the first version of the target firmware in the second storage space, but is not limited to this. As shown in FIG4 , only the current version (e.g., the first version) of the target firmware is copied to the second storage space, and then the first function stored in the first storage space is executed by the first version of the target firmware in the second storage space. In this way, the storage space of the memory occupied by the first function is reduced, and the utilization rate of the storage space of the memory is improved.
[0103] Optionally, in this embodiment, FIG6 is a second schematic diagram of an optional execution of the first function according to an embodiment of the present application. As shown in FIG6 , target firmware 204, a BMC (Baseboard Management Controller) 206, and a memory 208 are deployed on a server 202, and a second storage space is deployed in the memory 208. The first storage space is used to store the first function, the current version of the target firmware, and the current version information of the target firmware. When the current version of the target firmware is the first version, the current version information is the first version information.
[0104] When the current version (e.g., first version) of the target firmware and the first function are copied from the first storage space to the second storage space, the first function stored in the second storage space may be executed by the current version (e.g., first version) of the target firmware in the second storage space, but is not limited to being executed. In this way, the time required for the current version of the target firmware in the second storage space to execute the first function stored in the first storage space is saved, thereby improving the efficiency of executing functions in memory.
[0105] In an exemplary embodiment, the update start information may be sent to the baseboard management controller (BMC) of the server in the following manner, but is not limited to: calling a target interface to send the update start information to the BMC.
[0106] Optionally, in this embodiment, the target interface is an interface between the BMC and the target firmware. For example, the target interface is an interface that satisfies the target protocol. As an optional example, the target interface may include, but is not limited to, an interface that satisfies the IPMI protocol.
[0107] In an exemplary embodiment, the update start information may be sent to the baseboard management controller (BMC) of the server in the following manner, but is not limited to: sending the update start information to the BMC, wherein the update start information further includes first status information, and the first status information is used to indicate the start of updating the target firmware.
[0108] Optionally, in this embodiment, the first status information may be, but is not limited to, fixed in the first function. It is understandable that when the first function is triggered to execute after the target interrupt is triggered, it may indicate that the target firmware has started to be updated.
[0109] In an exemplary embodiment, when the target firmware is updated from the first version to the second version through the target program, obtaining the second version information of the target firmware, and before sending the update completion information to the BMC, the above method further includes: after sending the update start information to the BMC, switching the target firmware from the running state to the suspended state, and switching the operating system from the suspended state to the running state, and continuing to update the target firmware from the first version to the second version through the target program.
[0110] Optionally, in this embodiment, after the update start information is sent to the BMC, there is no need to pay attention to whether the BMC has completed receiving the update start information. Instead, the target firmware is switched from the running state to the suspended running state, and the operating system is switched from the suspended running state to the running state, and the target firmware is continued to be updated from the first version to the second version through the target program. It can be understood that when the update start information is sent to the BMC, the target firmware is continued to be updated through the target program, which reduces the time waiting for the BMC to complete receiving the update start information and improves the efficiency of the firmware update.
[0111] In the technical solution provided in the above step S304, the second version information is the description information of the second version. The description information of the second version may include, but is not limited to, the version number of the second version, the version size of the second version, and the version source of the second version, etc. For example, the version number of the second version is V3.0, the version size is 40M, and the version source is software 2.
[0112] Optionally, in this embodiment, the BMC may, but is not limited to, record the received update completion information in a target log. For example, when the server firmware is updated through a target program in the server's operating system, the BMC records in the log: 16:00 on day b month c of year a, the firmware version number is V3.0, and the update is completed.
[0113] In an exemplary embodiment, when the target firmware is updated from the first version to the second version using the target program, the second version information of the target firmware is obtained, and the update completion information is sent to the BMC in the following manner, but not limited to: when the target firmware is updated from the first version to the second version using the target program, a preset second function is executed, wherein the second function is used to obtain the second version information of the target firmware and send the update completion information to the BMC.
[0114] Optionally, in this embodiment, the preset second function may be, but is not limited to, a target type function. As an optional example, the target type function may be, but is not limited to, an SMM module type function.
[0115] Optionally, in this embodiment, the second function can be, but is not limited to, used to obtain the second version information of the target firmware and send the update completion information to the BMC, so that when the target firmware in the server is updated from the first version to the second version through the target program in the server's operating system, the BMC can promptly receive the second version information after the target firmware is updated.
[0116] In an exemplary embodiment, the pre-set second function may be executed when the target firmware is updated from the first version to the second version through the target program, but is not limited to the following method: when the target firmware is updated from the first version to the second version through the target program, the second function is executed through the target firmware to obtain the second version information of the target firmware and send the update completion information to the BMC.
[0117] Optionally, in this embodiment, when the target firmware in the server is updated from the first version to the second version through the target program, the second function can be executed through the target firmware, but is not limited to, so as to obtain the second version information of the target firmware and send the update completion information to the BMC.
[0118] In an exemplary embodiment, the second function may be executed by the target firmware when the target firmware is updated from the first version to the second version through the target program, but is not limited to the following method: when the target firmware is updated from the first version to the second version through the target program, the operating system is switched from a running state to a suspended state, the target firmware is switched from the suspended state to a running state, and the second function is executed by the target firmware.
[0119] Optionally, in this embodiment, when the target firmware is updated from the first version to the second version through the target program, the server's operating system can be switched from a running state to a suspended state, for example, the server's operating system is switched from running to suspended, the target firmware is switched from a suspended state to a running state, for example, the target firmware is switched from suspended to running, and the second function is executed through the target firmware.
[0120] In an exemplary embodiment, the second function may be executed by the target firmware when the target firmware is updated from the first version to the second version through the target program, but is not limited to the following method: when the target firmware is updated from the first version to the second version through the target program, a target interrupt is triggered, and the second function is executed by the target firmware, wherein the second function is a function triggered to be executed after the target interrupt is triggered.
[0121] Optionally, in this embodiment, the target interrupt may be, but is not limited to, used to transfer control from the server's operating system to the target firmware. It is understood that the target interrupt may be, but is not limited to, used to switch the server's operating system from a running state to a suspended state, or to switch the target firmware from a suspended state to a running state. The target interrupt may include, but is not limited to, an SMI interrupt.
[0122] For example, when the target firmware in the server is updated from the first version to the second version through the target program (for example, the update from version 1.02 to version 1.03 is completed), the SMI interrupt can be triggered but is not limited to enter the SMM mode. At this time, the control right will be transferred from the OS to the target firmware, and the target firmware will execute the second SMM module function (or called the first function).
[0123] In an exemplary embodiment, the second function can be executed through the target firmware in the following manner, but is not limited to: when the first version of the target firmware is copied from the first storage space to the second storage space, the second function is executed through the first version of the target firmware stored in the second storage space, wherein the second storage space is a storage space in the memory of the server, the second function is used to read the second version information from the first storage space and send the update end information to the BMC, the first storage space is used to store the second function, the current version of the target firmware and the current version information of the target firmware, and when the current version of the target firmware is the second version, the current version information is the second version information.
[0124] Optionally, in this embodiment, to improve update efficiency, the first version of the target firmware stored in the first storage space may be copied to the second storage space, but is not limited to, and the second function may be executed by the first version of the target firmware stored in the second storage space.
[0125] FIG7 is a schematic diagram of an optional execution of the second function according to an embodiment of the present application. As shown in FIG7 , target firmware 204, a BMC (Baseboard Management Controller) 206, and a memory 208 are deployed on a server 202. A second storage space is deployed in the memory 208. The first storage space is used to store the first function, the second function, the current version of the target firmware, and the current version information of the target firmware. When the current version of the target firmware is the second version, the current version information is the second version information. It can be understood that the target firmware in the server has been updated from the first version to the second version through the target program.
[0126] It is possible, but not limited to, to execute the second function through the first version of the target firmware stored in the second storage space when the first version of the target firmware is copied from the first storage space to the second storage space. For example, its operation is to obtain the second version information of the target firmware stored at positions 0x20FF0 to 0x20FFF in the first storage space through the read and write IO interface.
[0127] In an exemplary embodiment, the preset second function can be executed in the following manner, but is not limited to: executing a third portion of code in the second function, wherein the third portion of code in the second function is used to read the second version information from the first storage space, the first storage space is used to store the current version of the target firmware and the current version information of the target firmware, and when the current version of the target firmware is the second version, the current version information is the second version information; executing a fourth portion of code in the second function, wherein the fourth portion of code in the second function is used to send update completion information to the BMC.
[0128] Optionally, in this embodiment, the second function may include, but is not limited to, a third portion of code and a fourth portion of code. The third portion of code may be, but is not limited to, used to read the second version information from the first storage space, such as the version number, size, and source of the second version. The fourth portion of code may be, but is not limited to, sending update completion information carrying the second version information to the BMC.
[0129] In an exemplary embodiment, the pre-set second function can be executed in the following manner, but is not limited to: executing the second function stored in the first storage space, wherein the second function is used to read the second version information from the first storage space and send the update completion information to the BMC, and the first storage space is used to store the second function, the current version of the target firmware, and the current version information of the target firmware. When the current version of the target firmware is the second version, the current version information is the second version information; or when the second function is copied from the first storage space to the second storage space, executing the second function stored in the second storage space, wherein the second storage space is a storage space in the memory of the server, and the second function is used to read the second version information from the first storage space and send the update completion information to the BMC, and the first storage space is used to store the second function, the current version of the target firmware, and the current version information of the target firmware. When the current version of the target firmware is the second version, the current version information is the second version information.
[0130] Optionally, in this embodiment, the second function stored in the second storage space can be executed using the first version of the target firmware in the second storage space, but is not limited to this. As shown in FIG7 , only the first version of the target firmware is copied to the second storage space, and then the second function stored in the first storage space is executed using the first version of the target firmware in the second storage space. In this way, the memory storage space occupied by the second function is reduced, and the utilization rate of the memory storage space is improved.
[0131] Optionally, in this embodiment, FIG8 is a second schematic diagram of an optional execution of the second function according to an embodiment of the present application. As shown in FIG8 , target firmware 204, a BMC (Baseboard Management Controller) 206, and a memory 208 are deployed on the server 202, and a second storage space is deployed in the memory 208. The first storage space is used to store the first function, the second function, the current version of the target firmware, and the current version information of the target firmware. When the current version of the target firmware is the second version, the current version information is the second version information.
[0132] When the first version of the target firmware and the second function are copied from the first storage space to the second storage space, the second function stored in the second storage space can be executed using, but is not limited to, the first version of the target firmware in the second storage space. In this way, the time required for the first version of the target firmware in the second storage space to execute the first function stored in the first storage space is reduced, thereby improving the efficiency of executing functions in memory.
[0133] In an exemplary embodiment, the current version information stored in the first storage space can be updated in the following manner, but is not limited to: when the target firmware is updated from the first version to the second version through the target program, the current version information stored in the first storage space is updated from the first version information to the second version information, wherein, when the current version of the target firmware is the second version, the current version information is the second version information.
[0134] Optionally, in this embodiment, when the target firmware is updated from the first version to the second version through the target program, the current version information stored in the first storage space can be updated from the first version information to the second version information, for example, the first version information of the target firmware stored at positions 0x20FF0 to 0x20FFF in the first storage space is updated to the second version information.
[0135] In an exemplary embodiment, the update completion information may be sent to the BMC in, but is not limited to, the following manner: calling a target interface to send the update completion information to the BMC.
[0136] Optionally, in this embodiment, the target interface is an interface between the BMC and the target firmware. As an optional example, the target interface may include but is not limited to an interface that satisfies the target protocol. Optionally, the target interface may include but is not limited to an interface that satisfies the IPMI protocol.
[0137] In an exemplary embodiment, the update completion information may be sent to the BMC in the following manner, but is not limited to: sending the update completion information to the BMC, wherein the update completion information further includes second status information, and the second status information is used to indicate that the update of the target firmware is completed.
[0138] Optionally, in this embodiment, the second status information may be, but is not limited to, fixed in the second function. It is understandable that when the second function is triggered to execute after the target interrupt is triggered, it may indicate that the target firmware update is completed.
[0139] Optionally, in this embodiment, the update completion information may also include, but is not limited to, third status information, wherein the third status information is used to indicate the upgrade status of the target firmware when the update of the target firmware is completed, for example, whether the version of the target firmware is upgraded, downgraded, or the same version of the target firmware is reflashed, etc.
[0140] In an exemplary embodiment, the target firmware includes at least one of the following: a basic input and output system (BIOS), a complex programmable logic device (CPLD), a field replaceable unit (FRU), and a power management device.
[0141] Optionally, in this embodiment, the target firmware may include, but is not limited to, at least one of the following: a basic input and output system BIOS, a complex programmable logic device CPLD (Complex Programmable Logic Device), a field replaceable unit FRU (Field Replaceable Unit), a power management device, and a network card.
[0142] Optionally, in this embodiment, the network card may include, but is not limited to, a hot-swappable network card device, such as an OCP (Open Compute Project Network Interface) network card, or other network cards, etc., and this application does not impose any restrictions on this. In this way, by transferring control from the system to the BIOS through a target interrupt, information including but not limited to the BIOS version number can be transmitted, and some monitoring functions that the BMC cannot actively perform can be implemented, thereby expanding the monitoring scope of the BMC.
[0143] Another server log generation method is also provided in this embodiment. FIG9 is a second flow chart of the server log generation method according to an embodiment of the present application. As shown in FIG9 , the flow chart includes the following steps:
[0144] Step S902: When updating the target firmware in the server from the first version to the second version through the target program in the operating system of the server, receiving update start information sent by the target firmware, and recording the received update start information in the target log, wherein the update start information includes first version information, the first version information is description information of the first version, the first version information is version information obtained from the first storage space by executing a preset first function, the first storage space is configured to store the first function and the preset second function, and when starting to update the target firmware from the first version to the second version, the first storage space is also configured to store the first version of the target firmware and the first version information;
[0145] Step S904, when the target firmware is updated from the first version to the second version through the target program, the update completion information sent by the target firmware is received, and the received update completion information is recorded in the target log, wherein the update completion information includes the second version information, the second version information is the description information of the second version, and the second version information is the version information obtained from the first storage space by executing the preset second function. When the target firmware is updated from the first version to the second version, the first storage space is also set to store the second version and the second version information of the target firmware. The second version of the target firmware is set to replace the first version of the target firmware stored in the first storage space, and the second version information is used to replace the first version information stored in the first storage space.
[0146] Through the above steps, when the firmware in the server is updated by starting to be updated through the tool in the server's operating system, the first version information of the firmware before the update can be obtained, but is not limited to, the BMC receives the update start information carrying the first version information sent by the target firmware. When the firmware in the server is updated by the tool in the server's operating system, the BMC receives the update end information carrying the second version information sent by the target firmware. In this way, when the firmware in the server is updated by the tool in the server's operating system, the update start information and the update end information can be sent to the BMC, and the BMC records the update start information and the update end information in the log. Therefore, the problem that the BMC cannot record the firmware version information in the log when the server's firmware is updated by the target program in the server's operating system can be solved, and the technical effect of the BMC being able to record the firmware version information in the log when the server's firmware is updated by the target program in the server's operating system is achieved.
[0147] The execution entity of the above steps may be a server, etc., but is not limited thereto.
[0148] In the technical solution provided in the above step S902, when the target firmware in the server is updated from the first version to the second version through the target program in the server's operating system, the target firmware can, but is not limited to, sending update start information to the BMC. The BMC receives the update start information sent by the target firmware and records the received update start information in the target log.
[0149] Optionally, in this embodiment, when the target firmware in the server is updated from the first version to the second version through the target program in the server's operating system, the target firmware may, but is not limited to, send update completion information to the BMC, the BMC receives the update completion information sent by the target firmware, and records the received update completion information in the target log.
[0150] In an exemplary embodiment, the update start information further includes first status information, which is used to indicate that the update of the target firmware has started; the update end information further includes second status information, which is used to indicate that the update of the target firmware has been completed.
[0151] Optionally, in this embodiment, the update completion information may also include, but is not limited to, third status information, wherein the third status information is used to indicate the upgrade status of the target firmware when the update of the target firmware is completed, for example, whether the version of the target firmware is upgraded, downgraded, or the same version of the target firmware is reflashed.
[0152] For example, when the target firmware is updated from the first version to the second version through the target program, and the second version is higher than the first version, the third status information may be, but is not limited to, a version upgrade of the target firmware; when the target firmware is updated from the first version to the second version through the target program, and the second version is lower than the first version, the third status information may be, but is not limited to, a version downgrade of the target firmware; when the target firmware is updated from the first version to the second version through the target program, and the second version is the same as the first version, the third status information may be, but is not limited to, a version re-flash of the target firmware.
[0153] For example, if the target firmware is updated from a first version to a second version using the target program, and the second version is higher than the first version, the third status information may be, but is not limited to, the target firmware version upgrade. In this case, the BMC may, but is not limited to, record the update completion time, the second version information of the target firmware, the completion of the update, and the upgrade of the target firmware version in the target log. As an optional example, the target log may, but is not limited to, record "a year b month c day 17:00, target firmware version is V4.2, update completed, and target firmware version upgrade."
[0154] Through the embodiment of the present application, taking the target firmware as BIOS as an example, when the server has updated the BIOS version under the system, by triggering the target interrupt and taking advantage of the fact that the content of the Flash device has changed after the BIOS has been updated, a method for recording the BIOS version number change record is implemented through the BIOS. The current BIOS version number is recorded through the content of the specified address of the BIOS to obtain the corresponding BIOS version number. The SEL record is implemented through the BIOS code, which covers the situation where the BMC cannot monitor the update of the BIOS firmware. Therefore, the problem that the BMC cannot record the BIOS version change record SEL when updating the BIOS under the system can be solved.
[0155] In order to better understand the server log generation method in the embodiment of the present application, the server log generation method in the implementation of the present application can be explained and illustrated by taking the target firmware as BIOS as an example, but not limited to being applicable to the embodiment of the present application.
[0156] During the server BIOS code development phase, a designated area in the BIOS area must be pre-allocated to store version information, such as the BIOS version number. For example, the space from 0x20FF0 to 0x20FFF is defined to store the current BIOS version number. Two SMM module-type functions are added to obtain the current BIOS version number and transmit the current update status and BIOS version number to the BMC via a specified IPMI command. The first SMM module function (or "first function") is triggered before the system update tool begins updating the BIOS firmware. It is configured to record the BIOS update status (e.g., "BIOS update started," equivalent to the first status information) and BIOS version information, and transmits it to the BMC via an IPMI command for analysis. The second SMM module function (or "second function") is triggered when the system update tool completes the BIOS firmware update. It is configured to record the BIOS update status (e.g., "BIOS update completed," equivalent to the second status information) and the updated BIOS version information, and transmit it to the BMC via an IPMI command for analysis.
[0157] When a server begins a BIOS firmware update (for example, from BIOS version 1.02 to 1.03), an SMI interrupt is triggered to enter SMM mode. Control transfers from the OS to the BIOS, and the BIOS executes the first SMM module function (equivalent to the first function). This function retrieves the information stored at locations 0x20FF0 to 0x20FFF (the old version is 1.02) through read and write I / O interfaces and sends it to the BMC via an IPMI command. The BMC interprets the information passed by the BIOS (initiating the BIOS firmware update, with the current version number being 1.02). The BIOS then exits SMM mode, and the system continues the BIOS update. After the BIOS firmware update is complete, the BIOS flash memory contains the new BIOS version, with the information stored at locations 0x20FF0 to 0x20FFF now updated to 1.03. The target interrupt (for example, an SMI interrupt) is triggered, and control is transferred from the system to the BIOS. The BIOS executes the second SMM module function (equivalent to the second function), which obtains the information stored at positions 0x20FF0 to 0x20FFF (1.03) through the read and write IO interface, and sends it to the BMC through the IPMI command. The BMC parses the information passed by the BIOS (BIOS update is completed, the current version number is 1.03).
[0158] FIG10 is a schematic diagram of an optional server log generation method according to an embodiment of the present application. As shown in FIG10 , the method may, but is not limited to, take the target firmware as BIOS as an example, and may, but is not limited to, include the following steps:
[0159] Step S1001 , starting to update the BIOS firmware, for example, executing an operation of updating the BIOS firmware under the operating system of the server.
[0160] Step S1002: trigger a target interrupt (eg, an SMI interrupt), and transfer control from the system to the BIOS.
[0161] In step S1003, the BIOS obtains the first version information stored at a specified address in the Flash device through a read / write IO method, and transmits the update start information to the BMC, wherein the update start information includes the first version information and the first status information (for example, starting to update the BIOS). The BMC records the received first version information and the first status information in a target log (for example, SEL). For example, the BIOS obtains the version information stored at offset 0x20FF0 in the BIOS Flash (for example, the current version number is 1.02) through a read / write IO method. The BIOS sends the update status (for example, starting to update the BIOS firmware) and the current BIOS version information, for example, the current BIOS version number (1.02), to the BMC through a target interface (for example, an IPMI interface). The BMC parses this IPMI command and presents it to the system event log (SEL, equivalent to the target log).
[0162] In step S1004, the BIOS ends the SMM mode and the control right is transferred from the BIOS to the system.
[0163] In step S1005, the system continues to execute the BIOS firmware update operation, which generally takes 3 to 5 minutes.
[0164] Step S1006, determine whether the update is completed within the preset first time threshold (for example, 10 minutes or 20 minutes, etc.). If the update is completed within the preset first time threshold, execute steps S1007 to S1008. If the update is not completed within the preset time threshold, execute step S1009.
[0165] Step S1007, the update is completed, the BIOS version in the Flash has been updated from the first version to the second version, triggering the SMI interrupt, and the control is transferred from the system to the BIOS. For example, when the BIOS firmware update is completed, the version information stored at 0x20FF0 to 0x20FFF in the Flash (equivalent to the first storage space) is updated from the first version information to the second version information, for example, from version number 1.02 to 1.03, triggering the target interrupt (for example, SMI interrupt), and the control is transferred from the system to the BIOS.
[0166] In step S1008, the BIOS retrieves the second version information stored at a specified address in the Flash device through read / write I / O, and transmits an update completion message to the BMC. The update completion message includes the second version information and the first status information (e.g., "BIOS update started"). The BMC records the received second version information and the second status information in a target log (e.g., SEL). For example, the BIOS retrieves the information stored at offsets 0x20FF0 to 0x20FFF in the BIOS Flash through read / write I / O (e.g., "current version: 1.03"). The BIOS transmits the update status (update completed) and version number (1.03) to the BMC via the IPMI interface. The BMC parses this IPMI command and displays it in the system event log (SEL, equivalent to the target log).
[0167] In step S1009, if the BMC does not receive the update completion information transmitted by the BIOS within the preset second time threshold, the BMC records the SEL of the update failure. If the update is not completed within the preset second time threshold, the BMC starts timing from step S1003. If the BMC does not obtain the update completion information transmitted by the BIOS within the preset second time threshold (for example, 10 minutes or 15 minutes, etc., which is not limited in this application), the BMC reports the SEL of the BIOS firmware update failure.
[0168] FIG11 is a timing diagram of an optional server log generation method according to an embodiment of the present application. As shown in FIG11 , the method may, but is not limited to, take the target firmware as BIOS as an example, and may, but is not limited to, include the following steps.
[0169] Step 1101: execute a BIOS update command in the server operating system (equivalent to starting to update the BIOS in the server from the first version to the second version through a target program in the server operating system).
[0170] Step 1102: trigger an SMI interrupt (equivalent to a target interrupt) and enter the SMM mode.
[0171] In step 1103, the BIOS obtains the first version information of the BIOS, for example, the old version number of the BIOS, sends the update start information to the BMC through the target interface (for example, the IPMI interface) and records it in the target log (for example, the SEL), wherein the update start information includes the first version information and the first status information, and the first status information is used to indicate the start of updating the BIOS.
[0172] In step 1104, the BMC starts timing. If the information of step S1108 is not received within 10 minutes (or 15 minutes, 20 minutes, etc., which is not limited in this application), the BIOS update failure is recorded in the target log (eg, SEL).
[0173] Step S1105: BIOS exits SMM mode.
[0174] Step S1106: Update the BIOS device content, for example, update the BIOS from the first version to the second version.
[0175] Step S1107 : triggering a target interrupt (eg, an SMI interrupt) to enter the SMM mode.
[0176] In step S1108, the BIOS obtains the second version information of the BIOS, for example, the new version number after the BIOS is updated, and sends the update completion information to the BMC through the target interface (for example, the IPMI interface). The BMC records the second version information and the second status information in the target log (for example, the SEL), wherein the update completion information includes the second version information and the second status information, and the second status information is used to indicate that the BIOS update is completed.
[0177] Step S1109: exit the SMM mode.
[0178] Step S1110, completing the BIOS version update process.
[0179] Through the above embodiment, an SMI interrupt is triggered under the operating system of the server, and the characteristic that the content of the Flash device changes after the BIOS firmware is updated is utilized to obtain the version number of the current actual version through the BIOS. The relevant information is transmitted to the BMC through the BIOS through the IPMI command, so that a change record of the BIOS version number is generated when the BIOS firmware is updated under the system. This makes up for the deficiency of the current solution that the BIOS version number change record can only be recorded in the BIOS update scenario through the BMC, and realizes the timely acquisition of the BIOS version number.
[0180] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a non-volatile readable storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0181] This embodiment also provides a server log generation device, which is configured to implement the above-mentioned embodiments and optional implementations. Details already described will not be repeated here. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0182] FIG12 is a structural block diagram of a server log generating device according to an embodiment of the present application. As shown in FIG12 , the device includes:
[0183] a first obtaining module 1202 configured to, when a target firmware in the server is updated from a first version to a second version through a target program in the operating system of the server, obtain first version information of the target firmware and send update start information to a baseboard management controller (BMC) of the server, wherein the update start information includes the first version information, which is descriptive information of the first version. The BMC is configured to record the received update start information in a target log;
[0184] The second acquisition module 1204 is configured to obtain the second version information of the target firmware when the target firmware is updated from the first version to the second version through the target program, and send update completion information to the BMC, wherein the update completion information includes the second version information, and the second version information is description information of the second version. The BMC is configured to record the received update completion information in the target log.
[0185] In an exemplary embodiment, the first acquisition module includes:
[0186] The first execution unit is configured to execute a preset first function when the target firmware in the server is updated from the first version to the second version through the target program, wherein the first function is used to obtain first version information of the target firmware and send update start information to the BMC.
[0187] In an exemplary embodiment, the first execution unit is configured to:
[0188] When updating the target firmware in the server from the first version to the second version through the target program, the target firmware executes a first function to obtain first version information of the target firmware and sends update start information to the BMC.
[0189] In an exemplary embodiment, the first execution unit is configured to:
[0190] When updating the target firmware in the server from the first version to the second version through the target program, the operating system is switched from the running state to the suspended running state, the target firmware is switched from the suspended running state to the running state, and the first function is executed through the target firmware.
[0191] In an exemplary embodiment, the first execution unit is configured to:
[0192] When updating the target firmware in the server from the first version to the second version through the target program, a target interrupt is triggered, and a first function is executed through the target firmware, wherein the first function is a function triggered to be executed after the target interrupt is triggered.
[0193] In an exemplary embodiment, the first execution unit is configured to:
[0194] When the first version of the target firmware is copied from the first storage space to the second storage space, the first function is executed by the first version of the target firmware stored in the second storage space, wherein the second storage space is a storage space in the memory of the server, the first function is used to read the first version information from the first storage space and send the update start information to the BMC, the first storage space is used to store the first function, the current version of the target firmware and the current version information of the target firmware, and when the current version of the target firmware is the first version, the current version information is the first version information.
[0195] In an exemplary embodiment, the first execution unit is configured to:
[0196] Executing a first portion of code in a first function, wherein the first portion of code is used to read first version information from a first storage space, the first storage space being used to store a current version of the target firmware and current version information of the target firmware, and when the current version of the target firmware is the first version, the current version information is the first version information;
[0197] A second portion of code in the first function is executed, wherein the second portion of code is used to send update start information to the BMC.
[0198] In one exemplary embodiment, the apparatus further comprises:
[0199] The storage module is configured to store the first version information in the first storage space before executing a preset first function when the first version information is the version information of the initial version of the target firmware; or the first update module is configured to update the current version information stored in the first storage space from the third version information to the first version information when the target firmware is updated from the third version to the first version through the target program, wherein the third version information is descriptive information of the third version.
[0200] In an exemplary embodiment, the first execution unit is configured to:
[0201] Execute the first function stored in the first storage space, wherein the first function is used to read the first version information from the first storage space and send the update start information to the BMC, and the first storage space is used to store the first function, the current version of the target firmware, and the current version information of the target firmware. When the current version of the target firmware is the first version, the current version information is the first version information; or when the first function is copied from the first storage space to the second storage space, execute the first function stored in the second storage space, wherein the second storage space is the storage space in the memory of the server, and the first function is used to read the first version information from the first storage space and send the update start information to the BMC. The first storage space is used to store the first function, the current version of the target firmware, and the current version information of the target firmware. When the current version of the target firmware is the first version, the current version information is the first version information.
[0202] In an exemplary embodiment, the first acquisition module includes: a first sending unit configured to call a target interface to send the update start information to the BMC.
[0203] In an exemplary embodiment, the first acquisition module includes: a second sending unit configured to send update start information to the BMC, wherein the update start information further includes first status information, and the first status information is used to indicate the start of updating the target firmware.
[0204] In an exemplary embodiment, the device further includes: a switching module, which is configured to obtain the second version information of the target firmware when the target firmware is updated from the first version to the second version through the target program, and before sending the update end information to the BMC, after sending the update start information to the BMC, switch the target firmware from the running state to the suspended running state, and switch the operating system from the suspended running state to the running state, and continue to update the target firmware from the first version to the second version through the target program.
[0205] In an exemplary embodiment, the second acquisition module includes:
[0206] The second execution unit is configured to execute a preset second function when the target firmware is updated from the first version to the second version through the target program, wherein the second function is used to obtain the second version information of the target firmware and send update completion information to the BMC.
[0207] In an exemplary embodiment, the second execution unit is configured to:
[0208] When the target firmware is updated from the first version to the second version through the target program, the second function is executed through the target firmware to obtain the second version information of the target firmware, and update completion information is sent to the BMC.
[0209] In an exemplary embodiment, the second execution unit is configured to:
[0210] When the target firmware is updated from the first version to the second version through the target program, the operating system is switched from the running state to the suspended running state, the target firmware is switched from the suspended running state to the running state, and the second function is executed through the target firmware.
[0211] In an exemplary embodiment, the second execution unit is configured to:
[0212] When the target firmware is updated from the first version to the second version through the target program, a target interrupt is triggered, and a second function is executed through the target firmware, wherein the second function is a function triggered to be executed after the target interrupt is triggered.
[0213] In an exemplary embodiment, the second execution unit is configured to:
[0214] When the first version of the target firmware is copied from the first storage space to the second storage space, the second function is executed by the first version of the target firmware stored in the second storage space, wherein the second storage space is the storage space in the memory of the server, the second function is used to read the second version information from the first storage space and send the update end information to the BMC, and the first storage space is used to store the second function, the current version of the target firmware and the current version information of the target firmware. When the current version of the target firmware is the second version, the current version information is the second version information.
[0215] In an exemplary embodiment, the second execution unit is configured to:
[0216] Executing a third portion of code in the second function, wherein the third portion of code in the second function is used to read second version information from a first storage space, the first storage space being used to store a current version of the target firmware and current version information of the target firmware, and when the current version of the target firmware is the second version, the current version information is the second version information;
[0217] The fourth portion of code in the second function is executed, wherein the fourth portion of code in the second function is used to send update completion information to the BMC.
[0218] In an exemplary embodiment, the second execution unit is configured to:
[0219] Execute the second function stored in the first storage space, wherein the second function is used to read the second version information from the first storage space and send the update completion information to the BMC, and the first storage space is used to store the second function, the current version of the target firmware and the current version information of the target firmware. When the current version of the target firmware is the second version, the current version information is the second version information; or when the second function is copied from the first storage space to the second storage space, execute the second function stored in the second storage space, wherein the second storage space is the storage space in the memory of the server, and the second function is used to read the second version information from the first storage space and send the update completion information to the BMC. The first storage space is used to store the second function, the current version of the target firmware and the current version information of the target firmware. When the current version of the target firmware is the second version, the current version information is the second version information.
[0220] In an exemplary embodiment, the second update module is configured to update the current version information stored in the first storage space from the first version information to the second version information when the target firmware is updated from the first version to the second version through the target program, wherein when the current version of the target firmware is the second version, the current version information is the second version information.
[0221] In an exemplary embodiment, sending the update completion information to the BMC includes: calling a target interface to send the update completion information to the BMC.
[0222] In an exemplary embodiment, the second acquisition module includes: a third sending unit configured to send update completion information to the BMC, wherein the update completion information further includes second status information, and the second status information is used to indicate that the update of the target firmware is completed.
[0223] In one exemplary embodiment, the target firmware includes at least one of the following:
[0224] Basic input and output system BIOS, complex programmable logic device CPLD, field replaceable unit FRU, power management device.
[0225] In this embodiment, another server log generating device is provided, including:
[0226] a first receiving module configured to receive update start information sent by the target firmware when updating the target firmware in the server from the first version to the second version through a target program in the operating system of the server, and record the received update start information in a target log, wherein the update start information includes first version information, the first version information is description information of the first version, the first version information is version information obtained from a first storage space by executing a preset first function, the first storage space is configured to store the first function and the preset second function, and when starting to update the target firmware from the first version to the second version, the first storage space is further configured to store the first version of the target firmware and the first version information;
[0227] The second receiving module is configured to receive update completion information sent by the target firmware when the target firmware is updated from the first version to the second version through the target program, and record the received update completion information in the target log, wherein the update completion information includes second version information, the second version information is description information of the second version, and the second version information is version information obtained from the first storage space by executing a preset second function. When the target firmware is updated from the first version to the second version, the first storage space is also configured to store the second version and second version information of the target firmware. The second version of the target firmware is configured to replace the first version of the target firmware stored in the first storage space, and the second version information is used to replace the first version information stored in the first storage space.
[0228] In an exemplary embodiment, the update start information further includes first status information, which is used to indicate that the update of the target firmware has started; the update end information further includes second status information, which is used to indicate that the update of the target firmware has been completed.
[0229] It should be noted that the above modules can be implemented through software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0230] An embodiment of the present application further provides a computer non-volatile readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0231] In an exemplary embodiment, the above-mentioned computer non-volatile readable storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0232] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0233] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0234] For optional examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementations, and this embodiment will not be described in detail here.
[0235] Obviously, those skilled in the art should understand that the modules or steps of the present application described above can be implemented using a general-purpose computing device, they can be concentrated on a single computing device, or distributed across a network composed of multiple computing devices, they can be implemented using program code executable by the computing device, and thus, they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be performed in a different order than herein, or they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0236] The above are merely optional embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may be subject to various modifications and variations. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A server log generation method, characterized in that: include: In the case of starting to update the target firmware in the server from the first version to the second version through the target program in the operating system of the server, obtaining the first version information of the target firmware, and sending the update start information to the baseboard management controller BMC of the server, wherein the update start information includes the first version information, the first version information is the description information of the first version, and the BMC is configured to record the received update start information in a target log; When the target firmware is updated from the first version to the second version through the target program, the second version information of the target firmware is obtained, and update completion information is sent to the BMC, wherein the update completion information includes the second version information, and the second version information is description information of the second version, and the BMC is configured to record the received update completion information in the target log.
2. The method according to claim 1, characterized in that: In the case where the target firmware in the server is updated from the first version to the second version through the target program in the operating system of the server, the first version information of the target firmware is obtained, and the update start information is sent to the baseboard management controller BMC of the server, including: When the target firmware in the server is updated from the first version to the second version through the target program, a preset first function is executed, wherein the first function is used to obtain the first version information of the target firmware and send the update start information to the BMC.
3. The method according to claim 2, characterized in that In the case where the target firmware in the server is updated from the first version to the second version by the target program, executing a preset first function includes: When the target firmware in the server is updated from the first version to the second version through the target program, the first function is executed through the target firmware to obtain the first version information of the target firmware, and the update start information is sent to the BMC.
4. The method according to claim 3, characterized in that In the case where the target firmware in the server is updated from the first version to the second version by the target program, executing the first function by the target firmware includes: When the target firmware in the server is updated from the first version to the second version starting through the target program, the operating system is switched from a running state to a suspended state, the target firmware is switched from a suspended state to a running state, and the first function is executed through the target firmware.
5. The method according to claim 3, characterized in that: In the case where the target firmware in the server is updated from the first version to the second version by the target program, executing the first function by the target firmware includes: When the target firmware in the server is updated from the first version to the second version through the target program, a target interrupt is triggered, and the first function is executed through the target firmware, wherein the first function is a function triggered to be executed after the target interrupt is triggered.
6. The method according to claim 3, characterized in that The executing the first function by the target firmware includes: In a case where the first version of the target firmware is copied from the first storage space to the second storage space, the first function is executed by the first version of the target firmware stored in the second storage space, wherein the second storage space is a storage space in the memory of the server, and the first function is used to read the first version information from the first storage space and start the update The information is sent to the BMC, the first storage space is used to store the first function, the current version of the target firmware and the current version information of the target firmware, and when the current version of the target firmware is the first version, the current version information is the first version information.
7. The method according to claim 2, characterized in that The executing of the preset first function includes: Execute a first portion of code in the first function, wherein the first portion of code is used to read the first version information from a first storage space, the first storage space is used to store the current version of the target firmware and the current version information of the target firmware, and when the current version of the target firmware is the first version, the current version information is the first version information; A second portion of code in the first function is executed, wherein the second portion of code is used to send the update start information to the BMC.
8. The method according to claim 7, characterized in that Before executing the preset first function, the method further includes: In a case where the first version information is version information of an initial version of the target firmware, storing the first version information in the first storage space; or When the target firmware is updated from the third version to the first version through the target program, the current version information stored in the first storage space is updated from the third version information to the first version information, wherein the third version information is description information of the third version.
9. The method according to claim 2, characterized in that: The executing of the preset first function includes: executing the first function stored in a first storage space, wherein the first function is used to read the first version information from the first storage space and send the update start information to the BMC, the first storage space is used to store the first function, the current version of the target firmware and the current version information of the target firmware, and when the current version of the target firmware is the first version, the current version information is the first version information; or In the case where the first function is copied from the first storage space to the second storage space, the first function stored in the second storage space is executed, wherein the second storage space is a storage space in the memory of the server, the first function is used to read the first version information from the first storage space and send the update start information to the BMC, the first storage space is used to store the first function, the current version of the target firmware and the current version information of the target firmware, and when the current version of the target firmware is the first version, the current version information is the first version information.
10. The method according to claim 1, characterized in that The sending of the update start information to the baseboard management controller BMC of the server includes: calling a target interface to send the update start information to the BMC.
11. The method according to claim 1, characterized in that: The sending of the update start information to the baseboard management controller BMC of the server includes: sending the update start information to the BMC, wherein the update start information also includes first status information, and the first status information is used to indicate the start of updating the target firmware.
12. The method according to claim 4, characterized in that In the case where the target firmware is updated from the first version to the second version through the target program, the second version information of the target firmware is obtained, and before the update completion information is sent to the BMC, the method further includes: after sending the update start information to the BMC, switching the target firmware from a running state to a suspended state, and switching the operating system from a suspended state to a running state, and continuing to update the target firmware from the first version to the second version through the target program.
13. The method according to claim 1, characterized in that The method of obtaining the second version information of the target firmware and sending update completion information to the BMC after the target firmware is updated from the first version to the second version by the target program comprises: When the target firmware is updated from the first version to the second version through the target program, a preset second function is executed, wherein the second function is used to obtain the second version information of the target firmware and send the update completion information to the BMC.
14. The method according to claim 13, characterized in that When the target firmware is updated from the first version to the second version through the target program, executing a preset second function includes: When the target firmware is updated from the first version to the second version through the target program, the second function is executed through the target firmware to obtain the second version information of the target firmware, and the update completion information is sent to the BMC.
15. The method according to claim 14, characterized in that In the case where the target firmware is updated from the first version to the second version by the target program, executing the second function by the target firmware includes: When the target firmware is updated from the first version to the second version through the target program, the operating system is switched from a running state to a suspended state, the target firmware is switched from a suspended state to a running state, and the second function is executed through the target firmware.
16. The method according to claim 14, characterized in that In the case where the target firmware is updated from the first version to the second version by the target program, executing the second function by the target firmware includes: When the target firmware is updated from the first version to the second version through the target program, a target interrupt is triggered, and the second function is executed through the target firmware, wherein the second function is a function triggered and executed after the target interrupt is triggered.
17. The method according to claim 14, characterized in that The executing the second function by the target firmware includes: In a case where the first version of the target firmware is copied from the first storage space to the second storage space, the second function is executed by the first version of the target firmware stored in the second storage space, wherein the second storage space is a storage space in the memory of the server, the second function is used to read the second version information from the first storage space and send the update end information to the BMC, the first storage space is used to store the second function, the current version of the target firmware and the current version information of the target firmware, and when the current version of the target firmware is the second version, the current version information is the second version information.
18. The method according to claim 13, characterized in that The executing of the preset second function comprises: Execute a third portion of code in the second function, wherein the third portion of code in the second function is used to read the second version information from a first storage space, the first storage space is used to store the current version of the target firmware and the current version information of the target firmware, and when the current version of the target firmware is the second version, the current version information is the second version information; A fourth portion of code in the second function is executed, wherein the fourth portion of code in the second function is used to send the update completion information to the BMC.
19. The method according to claim 13, characterized in that The executing of the preset second function comprises: Execute the second function stored in the first storage space, wherein the second function is used to read the second version information from the first storage space and send the update end information to the BMC, and the first storage space is used to store the second function, the a current version of the target firmware and the current version information of the target firmware, and when the current version of the target firmware is the second version, the current version information is the second version information; or In the case where the second function is copied from the first storage space to the second storage space, the second function stored in the second storage space is executed, wherein the second storage space is a storage space in the memory of the server, the second function is used to read the second version information from the first storage space, and send the update end information to the BMC, the first storage space is used to store the second function, the current version of the target firmware and the current version information of the target firmware, and when the current version of the target firmware is the second version, the current version information is the second version information.
20. The method according to any one of claims 6 to 9, 17 and 18, characterized in that When the target firmware is updated from the first version to the second version through the target program, the current version information stored in the first storage space is updated from the first version information to the second version information, wherein when the current version of the target firmware is the second version, the current version information is the second version information.
21. The method according to any one of claims 1 to 19, characterized in that The sending the update completion information to the BMC includes: calling a target interface to send the update completion information to the BMC.
22. The method according to any one of claims 1 to 19, characterized in that The sending the update completion information to the BMC includes: sending the update completion information to the BMC, wherein the update completion information also includes second status information, and the second status information is used to indicate that the update of the target firmware is completed.
23. The method according to any one of claims 1 to 19, characterized in that The target firmware includes at least one of the following: Basic input and output system BIOS, complex programmable logic device CPLD, field replaceable unit FRU, power management equipment.
24. A server log generation method, characterized in that: In the case of starting to update the target firmware in the server from the first version to the second version through the target program in the operating system of the server, receiving update start information sent by the target firmware, and recording the received update start information in a target log, wherein the update start information includes first version information, the first version information is description information of the first version, the first version information is version information obtained from a first storage space by executing a preset first function, the first storage space is configured to store the first function and a preset second function, and when starting to update the target firmware from the first version to the second version, the first storage space is also configured to store the first version of the target firmware and the first version information; When the target firmware is updated from the first version to the second version through the target program, update completion information sent by the target firmware is received, and the received update completion information is recorded in the target log, wherein the update completion information includes second version information, the second version information is description information of the second version, and the second version information is version information obtained from the first storage space by executing the preset second function. When the target firmware is updated from the first version to the second version, the first storage space is also set to store the second version and the second version information of the target firmware, the second version of the target firmware is set to replace the first version of the target firmware stored in the first storage space, and the second version information is used to replace the first version information stored in the first storage space.
25. The method according to claim 24, characterized in that The update start information further includes first status information, and the first status information is used to indicate that the update of the target firmware has started; the update end information further includes second status information, and the second status information is used to indicate that the update of the target firmware has been completed.
26. A server log generating device, characterized in that: include: a first acquisition module, configured to acquire first version information of the target firmware in the server when updating the target firmware in the server from the first version to the second version through a target program in the operating system of the server, and send update start information to a baseboard management controller BMC of the server, wherein the update start information includes the first version information, the first version information is description information of the first version, and the BMC is configured to record the received update start information in a target log; The second acquisition module is configured to acquire the second version information of the target firmware when the target firmware is updated from the first version to the second version through the target program, and send update completion information to the BMC, wherein the update completion information includes the second version information, and the second version information is description information of the second version, and the BMC is configured to record the received update completion information in the target log.
27. A computer non-volatile readable storage medium, characterized in that: The computer non-volatile readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 23 are implemented, or the steps of the method described in any one of claims 24-25 are implemented.
28. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the processor implements the steps of the method described in any one of claims 1 to 23, or implements the steps of the method described in any one of claims 24-25.
Citation Information
Patent Citations
Automatic application program hot-updating method based on function modules
CN107608706A
Method and system of recording server BIOS version information
CN108170476A
Firmware updating method and device, equipment and computer readable storage medium
CN110347414A
BIOS (Basic Input / Output System) control method and device and medium
CN114153503A
Server log generation method and device, storage medium and electronic equipment
CN117311769A