Cross-validation method and device for server's BMC and BIOS adaptability and storage medium
By building a firmware resource library and a multi-level verification mechanism, BMC and BIOS versions are automatically managed, solving the problem of low manual operation efficiency in existing technologies and ensuring the stability and compatibility of server firmware updates.
Patent Information
- Application Number
- CN202510725036.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-06-03
AI Technical Summary
The existing server firmware update and verification process relies on manual operations, which is inefficient and error-prone. It lacks a systematic process and cannot fully verify the compatibility of BMC and BIOS, affecting server stability and performance.
Build a firmware resource library to automatically manage different versions of BMC and BIOS. Through serial port, hardware information verification and web server performance verification, a multi-level verification mechanism is formed to ensure the adaptability of BMC and BIOS.
Improves the stability and accuracy of firmware updates, reduces the risk of mismatches or update failures, and ensures stable server operation and management efficiency.
Smart Images

Figure CN120234037B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a cross-verification method, device and storage medium for the adaptability of a BMC and BIOS of a server. Background Art
[0002] In modern server systems, the Baseboard Management Controller (BMC) and Basic Input / Output System (BIOS) are two key firmware components that play a vital role in the proper operation and management of the server. The BMC manages and monitors the hardware, while the BIOS initializes the hardware and boots the operating system. With the continuous advancement of server technology, BMC and BIOS version updates are becoming increasingly frequent, increasing the risk of compatibility issues between different versions.
[0003] In the related art, the firmware update and verification process for many servers still relies on manual operations. This is not only inefficient but also prone to errors. Manual firmware updates require administrators to download and upload firmware files one by one to the server, then perform the update operation through the command line or management interface. Verifying firmware compatibility often requires manual checking of hardware information, BIOS version, and BMC version. This is not only time-consuming but also prone to missing critical information. Furthermore, existing firmware update and verification methods lack a systematic process. After the firmware is updated, there is typically no comprehensive verification mechanism to ensure BMC and BIOS compatibility. Even when verification is performed, it is often based on testing a single version and lacks systematic verification of multiple version combinations. After verifying the firmware update, comprehensive hardware information is often lacking. Existing methods often only check BIOS version information and ignore hardware verification. This can result in compatibility issues between hardware and firmware going undetected after the update, impacting server stability and performance.
[0004] The BMC web interface is an important tool for administrators to manage and monitor servers. However, existing verification methods often lack verification of the BMC web server's performance. This can cause the BMC web interface to malfunction after an update, affecting administrator management efficiency. Summary of the Invention
[0005] The present invention provides a cross-verification method, device and storage medium for the adaptability of a BMC and BIOS of a server, aiming to solve at least one of the technical problems existing in the prior art.
[0006] The technical solution of the present invention is a cross-verification method for the compatibility of a server's BMC and BIOS, which includes the following steps:
[0007] S100: Build a firmware resource library, and upload m versions of BMC and n versions of BIOS to be verified to the firmware resource library, wherein the firmware resource library stores m*n versions of BMC and BIOS combinations;
[0008] S200: The server obtains a first version of a BMC and BIOS combination from the firmware resource library, and performs update operations on the first versions of the BMC and BIOS in sequence to obtain first updated versions of the BMC and BIOS;
[0009] S300: Obtaining and verifying version information of the first updated version of the BIOS through a serial port, obtaining hardware information of the server and verifying the hardware information, verifying performance of the web server of the first updated version of the BMC through web self-starting to verify compatibility between the first updated version of the BMC and the BIOS, and recording a first adaptation result;
[0010] S400: Traversing m*n-1 versions of BMC and BIOS combinations stored in the firmware resource library, performing update operations on the m*n-1 versions of BMC and BIOS respectively, and verifying the adaptability of the m*n-1 updated versions of BMC and BIOS respectively, and recording the m*n-1 adaptation results;
[0011] S500: Form a BMC and BIOS version compatibility list according to the first adaptation result and the m*n-1 adaptation results.
[0012] According to some embodiments of the present invention, step S300 includes:
[0013] S310: When the version information verification of the first updated version of the BIOS succeeds, the hardware information verification succeeds, and the performance verification of the web server of the first updated version of the BMC succeeds, determining that the first updated version of the BMC and the BIOS are adapted, and recording a first adaptation result as the adaptation of the first updated version of the BMC and the BIOS;
[0014] S320: When any one of the version information verification of the first updated version of the BIOS, the hardware information verification, and the performance verification of the web server of the first updated version of the BMC fails, it is determined that the first updated version of the BMC and the BIOS are incompatible, and a first adaptation result is recorded as the first updated version of the BMC and the BIOS are incompatible.
[0015] According to some embodiments of the present application, the step S100 comprises:
[0016] S110: creating a static folder for storing firmware version files, and copying version files of m versions of BMC to be verified and n versions of BIOS to be verified into the static folder;
[0017] S120: creating a static resource server in the firmware repository using Flask, the static resource server generating one-to-one hyperlinks for the version files of the m versions of BMC to be verified and the n versions of BIOS to be verified respectively, each hyperlink corresponding to an IP address;
[0018] S130: determining a download list of firmware version files by accessing the IP address, and downloading the version files of BMC and BIOS through the download list of firmware version files;
[0019] S140: directly downloading and pulling the version files of the m versions of BMC to be verified and the n versions of BIOS to be verified through network requests of the http protocol.
[0020] According to some embodiments of the present application, the method further comprises:
[0021] S101: defining a preset data parsing function, the data parsing function being fetch_versions_from_url, and the url representing the address of a target webpage;
[0022] S102: sending an HTTP request to obtain an HTML document of the target webpage, and parsing the HTML document by using a BeautifulSoup library to obtain firmware version information;
[0023] S103: creating a first list and a second list, the first list being used to store parsed version file names of BMC, and the second list being used to store parsed version file names of BIOS;
[0024] S104: traversing all Label, Tags represent hyperlinks;
[0025] S105: Obtain the target IP address corresponding to each hyperlink through the link.get('href') function, and extract the version file name from the target IP address;
[0026] S106: Determine, based on the extracted version file name, whether the version file name belongs to a BMC version or a BIOS version; if the current version file name contains "BMC" or "bmc", add the current version file name to the first list; if the current version file name contains "BIOS" or "bios", add the current version file name to the second list.
[0027] According to some embodiments of the present invention, step S200 includes:
[0028] S210: Send an update request to the server, where the update request carries the type of firmware to be updated and the corresponding IP address, where the firmware types include BMC and BIOS.
[0029] S220: Determine the target firmware for the update operation according to the update request, and define the update configuration of the redfish interface using update parameters, wherein the update parameters include BMC update parameters and BIOS update parameters;
[0030] S230: performing an update operation on the target firmware based on the update request and the update parameters through the redfish interface;
[0031] S240: querying the update progress information of the target firmware through an HTTP GET request, and generating an update progress bar according to the update progress information of the target firmware;
[0032] S250: Restarting the server after the target firmware completes the update operation.
[0033] According to some embodiments of the present invention, step S300 includes:
[0034] S331: Acquire data information from the serial port, and when the server restarts, send a delete keyboard command to the server through the serial port to enable the server to enter the BIOS interface;
[0035] S332: defining a def read_from_serial_until function, wherein the def read_from_serial_until function is used to read data information from the serial port to capture characters to determine BIOS version information;
[0036] S333: Capture the BIOS Version field through the def read_from_serial_until function, and determine the current version information of the BIOS according to the BIOS Version field;
[0037] S334: Verify the consistency between the current version information of the BIOS and the BIOS update parameters. When the current version information of the BIOS and the BIOS update parameters are consistent, determine that the BIOS update is successful.
[0038] According to some embodiments of the present invention, step S300 further includes:
[0039] S341: Use the paramiko library to create an SSH client and automatically add the host key;
[0040] S342: The SSH client connects to the server to establish an SSH connection, and the server obtains hardware information through the lscpu command;
[0041] S343: If the lscpu command returns CPU information, forming a dictionary with the lscpu command as a key and the CPU information returned by the lscpu command as a value;
[0042] S344: If the lscpu command returns error information, forming a dictionary with the lscpu command plus the error flag as a key and the error information returned by the lscpu command as a value;
[0043] S345: Returning the dictionary to display the execution result of the lscpu command, and when the dictionary displays an error message, determining that the hardware information verification has failed;
[0044] S346: Close the SSH connection.
[0045] According to some embodiments of the present invention, step S300 further includes:
[0046] S351: Get the current version information of BMC through the redfish interface;
[0047] S352: Verify the consistency between the current version information of the BMC and the BMC update parameters. If the current version information of the BMC and the BMC update parameters are consistent, determine that the BMC update is successful.
[0048] S353: Use Selenium to configure an environment that automatically calls the local Chrome browser to start, start Chrome, and automatically enter the BMC account and password;
[0049] S354: acquire return information within a preset time, and determine the login state of the BMC according to the return information;
[0050] S355: when the return information is a flag element of successful login, it indicates that the BMC login is normal, and it is determined that the web server performance of the BMC is normal; when the return information is None or the return information is timed out, it indicates that the BMC login is abnormal or the flag of successful login cannot be found, and it is determined that the web server performance of the BMC is abnormal.
[0051] The technical scheme of the application also relates to a computer device comprising a memory and a processor, wherein the processor executes a computer program stored in the memory to implement the above method.
[0052] The technical scheme of the application also relates to a computer readable storage medium, which stores computer program instructions, and the computer program instructions are executed by a processor to implement the above method.
[0053] The server BMC and BIOS adaptability cross verification method, device and storage medium provided by the embodiment of the application at least have one of the following advantages or beneficial effects: a firmware resource library is established to store firmware files of different versions, and m versions of BMC and n versions of BIOS to be verified are uploaded to the firmware resource library, so that maintenance personnel can conveniently access and manage important resources, and work efficiency is improved. The firmware resource library stores m*n versions of BMC and BIOS combinations, and a controller can automatically parse all available BMC and BIOS versions from the firmware resource library, and each combination corresponds to one BMC and BIOS combination. Automatic processing reduces the possibility of human error and ensures the best compatibility between different components. The server automatically pulls the first version of BMC and BIOS combination from the firmware resource library, sequentially performs update operation on the first version of BMC and BIOS, and obtains the first updated version of BMC and BIOS. The version information of the first updated version of BIOS is acquired through a serial port, and the version information is verified. Hardware information of the server is acquired, and the hardware information is verified to ensure the compatibility between the hardware and the updated BIOS. The performance of the web server of the first updated version of BMC is verified through web self-starting, so as to verify the adaptability of the first updated version of BMC and BIOS. The three-layer verification mechanism ensures the stability and correctness of the firmware update. The risk caused by firmware mismatching or update failure is effectively reduced through multiple verification methods, the accuracy of the adaptability verification result of the first updated version of BMC and BIOS is improved, the first adaptation result is recorded, including verification result, problems found in the verification process, performance, and other key information, and the visualization degree of the first adaptation result is improved.
[0054] Traverse the m*n-1 versions of BMC and BIOS combinations stored in the firmware resource library, perform update operations on the m*n-1 versions of BMC and BIOS respectively, and verify the compatibility of the m*n-1 updated versions of BMC and BIOS respectively. For each combination, first update the BMC, then trigger the BIOS update by the BMC, and verify the compatibility of each updated version of BMC and BIOS respectively. Repeat the above steps of serial port information verification, hardware information verification, and BMC web server performance verification. Record the adaptation results of each combination and record various situations during the verification process in detail, including combinations that are successfully adapted and combinations that have compatibility issues and their specific problems. Based on the first adaptation result and the m*n-1 adaptation results, organize and analyze the adaptation status of all verified BMC and BIOS version combinations to form a BMC and BIOS version compatibility list, which clearly lists which versions of BMC and BIOS combinations are compatible, which combinations have compatibility issues, as well as the specific manifestations of compatibility issues and possible solutions, etc., to provide a reference basis for subsequent firmware updates and maintenance. Through the system's adaptability verification process, the compatibility of different version combinations can be comprehensively evaluated to ensure the stable operation of the server.
[0055] The cross-verification method for the compatibility of the BMC and BIOS of a server provided by the present invention systematically verifies the compatibility between different versions of BMC and BIOS, ensures that the server can operate normally after the firmware is updated, and improves the stability and reliability of the server.
[0056] In addition, additional aspects and advantages of the present invention will be set forth in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 is a general flowchart of a cross-verification method of BMC and BIOS adaptability of a server provided by an embodiment of the present application;
[0058] Figure 2 is a detailed flowchart of step S100 in the cross-verification method of BMC and BIOS adaptability of a server provided by an embodiment of the present application;
[0059] Figure 3 This is a first detailed flow chart of a method for cross-verifying the compatibility of a server's BMC and BIOS provided in an embodiment of the present invention;
[0060] Figure 4 Detailed flowchart of step S200 of the cross-verification method for the compatibility of the BMC and BIOS of a server provided in an embodiment of the present invention;
[0061] Figure 5 This is a first detailed flow chart of step S300 of the method for cross-verifying the compatibility of the BMC and BIOS of a server provided by an embodiment of the present invention;
[0062] Figure 6 This is a second detailed flow chart of step S300 of the method for cross-verifying the compatibility of the BMC and BIOS of a server provided by an embodiment of the present invention;
[0063] Figure 7 This is a third detailed flow chart of step S300 of the method for cross-verifying the compatibility of the BMC and BIOS of a server provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0064] The following will provide a clear and complete description of the concept, specific structure and technical effects of the present invention in conjunction with the embodiments and drawings to fully understand the purpose, scheme and effects of the present invention.
[0065] It should be noted that, unless otherwise specified, when a feature is referred to as being "fixed" or "connected" to another feature, it may be directly fixed or connected to the other feature, or it may be indirectly fixed or connected to the other feature. The singular forms "a", "said" and "the" used herein are also intended to include the plural forms, unless the context clearly indicates otherwise. In addition, unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art. The terms used in this specification are only for describing specific embodiments and are not intended to limit the invention. The term "and / or" used herein includes any combination of one or more related listed items.
[0066] It should be understood that, although the present invention may adopt the terms first, second, third etc. to describe various elements, these elements should not be limited to these terms. These terms are only used to distinguish the elements of the same type from each other. For example, without departing from the scope of the present invention, the first element may also be referred to as the second element, and similarly, the second element may also be referred to as the first element. The use of any and all examples or exemplary language ("for example", "such as" etc.) provided herein is only intended to better illustrate embodiments of the present invention, and unless otherwise required, will not impose limitations on the scope of the present invention.
[0067] In the related art, the firmware update and verification process for many servers still relies on manual operations. This is not only inefficient but also prone to errors. Manual firmware updates require administrators to download and upload firmware files one by one to the server, then perform the update operation through the command line or management interface. Verifying firmware compatibility often requires manual checking of hardware information, BIOS version, and BMC version. This is not only time-consuming but also prone to missing critical information. Furthermore, existing firmware update and verification methods lack a systematic process. After the firmware is updated, there is typically no comprehensive verification mechanism to ensure BMC and BIOS compatibility. Even when verification is performed, it is often based on testing a single version and lacks systematic verification of multiple version combinations. After verifying the firmware update, comprehensive hardware information is often lacking. Existing methods often only check BIOS version information and ignore hardware verification. This can result in compatibility issues between hardware and firmware going undetected after the update, impacting server stability and performance.
[0068] The BMC web interface is an important tool for administrators to manage and monitor servers. However, existing verification methods often lack verification of the BMC web server's performance. This can cause the BMC web interface to malfunction after an update, affecting administrator management efficiency.
[0069] Based on this, the embodiments of the present invention provide a cross-verification method, device and storage medium for the compatibility of the BMC and BIOS of a server, which is conducive to systematically verifying the compatibility between different versions of BMC and BIOS, ensuring that the server can operate normally after the firmware is updated, and improving the stability and reliability of the server.
[0070] Reference Figure 1 As shown, Figure 1 This is a general flow chart of a cross-verification method for the compatibility of a server's BMC and BIOS provided by an embodiment of the present invention. The cross-verification method for the compatibility of a server's BMC and BIOS includes but is not limited to steps S100 to S500. Specifically,
[0071] S100: Build a firmware resource library and upload m versions of BMC and n versions of BIOS to be verified to the firmware resource library. The firmware resource library stores m*n versions of BMC and BIOS combinations.
[0072] S200: The server obtains a first version of a BMC and BIOS combination from a firmware resource library, and performs update operations on the first versions of the BMC and BIOS in sequence to obtain first updated versions of the BMC and BIOS.
[0073] S300: Obtaining and verifying version information of the first updated version of the BIOS through the serial port, obtaining and verifying hardware information of the server, verifying performance of the web server of the first updated version of the BMC through web self-starting, thereby verifying compatibility between the first updated version of the BMC and the BIOS, and recording a first adaptation result;
[0074] S400: traverse the m*n-1 versions of BMC and BIOS combinations stored in the firmware resource library, perform update operations on the m*n-1 versions of BMC and BIOS respectively, verify the compatibility of the m*n-1 updated versions of BMC and BIOS respectively, and record the m*n-1 adaptation results;
[0075] S500: Generate a BMC and BIOS version compatibility list according to the first adaptation result and m*n-1 adaptation results.
[0076] In some embodiments of the present application, the cross-verification method of the BMC and BIOS adaptability of the server comprises: first, a special firmware resource library is established for storing different versions of firmware files. The m versions of BMC and n versions of BIOS to be verified are uploaded to the firmware resource library, and all BMC and BIOS versions are centrally stored in the firmware resource library, which enables maintenance personnel to conveniently access and manage these important resources, improving work efficiency. The firmware resource library stores m*n versions of BMC and BIOS combinations, each combination corresponds to a BMC and BIOS combination, and the firmware files can be downloaded through network request. The controller can automatically parse all available BMC and BIOS versions from the firmware resource library and intelligently combine these versions, reducing the possibility of human error and ensuring the best compatibility between different components. When starting verification, the control end sends a command to the server, the server automatically pulls the first version of BMC and BIOS combination from the firmware resource library, and sequentially performs update operation on the first version of BMC and BIOS to obtain the first updated version of BMC and BIOS. The version information of the first updated version of BIOS is obtained through the serial port and verified; the hardware information of the server is obtained and verified to ensure the compatibility of the hardware and the updated BIOS. The performance of the web server of the first updated version of BMC is verified through web self-starting, thereby verifying the adaptability of the first updated version of BMC and BIOS. The three-layer verification mechanism ensures the stability and correctness of the firmware update. The risk caused by firmware mismatch or update failure is effectively reduced through multiple verification methods, improving the accuracy of the adaptability verification result of the first updated version of BMC and BIOS; the first adaptation result is recorded, including the verification result, the problems found in the verification process, the performance, and other key information, improving the visualization degree of the first adaptation result.
[0077] The m*n-1 versions of the BMC and BIOS combinations stored in the firmware resource library are traversed, and the m*n-1 versions of the BMC and BIOS are updated respectively, and the adaptability of the m*n-1 updated versions of the BMC and BIOS is verified respectively. For each combination, the BMC is updated first, and then the BIOS is updated by the BMC, and the adaptability of each updated version of the BMC and BIOS is verified, and the above steps of serial port information verification, hardware information verification, and BMC web server performance verification are repeated. The adaptation results of each combination are recorded, and various conditions in the verification process are recorded in detail, including the successfully adapted combinations and the combinations with compatibility problems and specific problems. According to the first adaptation result and the m*n-1 adaptation results, the adaptation of all verified BMC and BIOS version combinations is sorted and analyzed to form a BMC and BIOS version compatibility list, which clearly lists which versions of the BMC and BIOS combinations are compatible, which combinations have compatibility problems, and the specific manifestations and possible solutions of the compatibility problems, etc. The reference basis is provided for subsequent firmware update and maintenance. Through the system adaptation verification process, the compatibility of different version combinations can be comprehensively evaluated to provide protection for the stable operation of the server.
[0078] The cross-verification method of the BMC and BIOS adaptability of the server provided by the application systematically verifies the adaptability between different versions of the BMC and BIOS, ensures that the server can operate normally after updating the firmware, and improves the stability and reliability of the server.
[0079] It can be understood that after the server automatically pulls the first version of the BMC and BIOS combination from the firmware resource library, the BMC is updated first. Since the BMC inside the server has a self-service function, when the server pulls this set of BMC and BIOS, self-updating can be realized. After the BMC completes the updating, the BIOS is self-updated.
[0080] The server automatically pulls the first version of the BMC and BIOS combination from the firmware resource library. The BMC inside the server has a self-service function. When the server pulls this set of BMC and BIOS, the BMC first starts the self-updating process to automatically complete the updating operation of the BMC. The self-service function of the BMC ensures the stability and reliability of the updating process and reduces the risk of updating failure. After the BMC completes the updating, the BMC automatically triggers the updating process of the BIOS by using the self-service function to complete the self-updating operation of the BIOS. The entire updating process does not require manual intervention and is automatically completed by the BMC inside the server. Through this automated firmware updating and verification process, the efficiency and reliability of server firmware management can be effectively improved to ensure the stable operation of the server under different firmware versions.
[0081] In some embodiments of the present application, during the firmware automatic update process, an exception handling mechanism is set up to recover to the previous stable version of the firmware in time in case of update failure, and error information is recorded for subsequent troubleshooting.
[0082] Before starting the update, the stable version of the currently running BMC and BIOS is automatically backed up. The backup content includes firmware files, configuration files and the current running state. The backup file can be stored in the local storage device of the server or uploaded to a secure remote backup server to ensure that the backup file will not be lost due to local storage failure.
[0083] During the update process, the update progress and status are monitored in real time. The monitoring content includes:
[0084] Firmware file transmission status: Ensure that the firmware file is not interrupted or damaged during transmission from the resource library to the server.
[0085] Update command execution status: Monitor whether the update command of BMC and BIOS is successfully executed, and the return status code during execution.
[0086] Hardware response status: Detect the response of the hardware device during the update process to ensure that the hardware can normally respond to the update operation.
[0087] If the firmware file transmission process is interrupted or the file is damaged, the system detects the exception immediately. If the update command of BMC or BIOS fails to execute, the exception is detected through the return status code or log information. If the hardware device has an abnormal response during the update process, the exception is found through the hardware detection mechanism.
[0088] Once the exception is detected, the current update operation is interrupted immediately to prevent further errors. The BMC and BIOS are automatically recovered from the previous stable version from the backup to ensure that the server can quickly recover to the normal running state. The reasons for the update failure are recorded in detail, including: timestamp: record the specific time when the exception occurs; error code: record the error code returned by the system; log information: record the log information generated during the update process, including transmission log, execution log and hardware response log; backup version information: record the detailed information of the recovered backup version for subsequent comparison and analysis.
[0089] Through this detailed exception handling mechanism, the reliability of the firmware update process can be effectively guaranteed, the system downtime caused by update failure can be reduced, and strong support is provided for subsequent troubleshooting and repair.
[0090] In some embodiments of the present application, the step S300 in the cross verification method of the adaptability of the BMC and BIOS of the server includes but is not limited to steps S310-S320, specifically,
[0091] S310: When the version information verification of the first updated version of the BIOS succeeds, the hardware information verification succeeds, and the performance verification of the web server of the first updated version of the BMC succeeds, determining that the first updated version of the BMC and the BIOS are adapted, and recording the first adaptation result as the first updated version of the BMC and the BIOS being adapted;
[0092] S320: When any one of the version information verification, hardware information verification, and performance verification of the web server of the first updated version of the BIOS fails, it is determined that the first updated version of the BMC and the BIOS are incompatible, and the first adaptation result is recorded as the first updated version of the BMC and the BIOS are incompatible.
[0093] In some embodiments of the present invention, verification of the version information of the first updated version of the BIOS includes: obtaining the version information of the first updated version of the BIOS through a serial port, checking whether the obtained version information of the first updated version of the BIOS is consistent with the expected version, and ensuring that the version information is correct. If the version information verification is successful, "BIOS version information verification successful" is recorded. If the version information verification fails, "BIOS version information verification failed" is recorded, and it is directly determined that the first updated version of the BMC and the BIOS are incompatible, and the first adaptation result is recorded as "the first updated version of the BMC and the BIOS are incompatible", and subsequent verification steps are skipped.
[0094] Hardware information verification includes: obtaining the server's hardware information, including the model and status of key hardware such as the CPU, memory, hard disk, and network card; checking whether the hardware information is consistent with the expected hardware configuration, and ensuring the hardware is compatible with the updated BIOS. If the hardware information verification is successful, "Hardware information verification successful" is recorded. If the hardware information verification fails, "Hardware information verification failed" is recorded, and the first updated version of the BMC and BIOS are directly determined to be incompatible. The first adaptation result is recorded as "The first updated version of the BMC and BIOS are incompatible", and subsequent verification steps are skipped.
[0095] The BMC web server performance verification includes starting the first updated version of the BMC web server using the web auto-start function. The BMC web server is tested for key performance indicators, including response time, page load speed, and functional integrity. If the web server performance verification succeeds, the system records "BMC web server performance verification succeeded." If the web server performance verification fails, the system records "BMC web server performance verification failed," and directly determines that the first updated version of the BMC and BIOS are incompatible, recording the first adaptation result as "First updated version of the BMC and BIOS are incompatible."
[0096] If the BIOS version information verification, hardware information verification, and BMC web server performance verification are all successful, the first updated version of the BMC and BIOS are determined to be compatible, and the first adaptation result is recorded as "The first updated version of the BMC and BIOS are compatible." If any of the above three verifications fail, the first updated version of the BMC and BIOS are determined to be incompatible, and the first adaptation result is recorded as "The first updated version of the BMC and BIOS are incompatible."
[0097] Regardless of whether the compatibility verification is successful or not, every step and result of the verification process must be recorded in detail, including:
[0098] BIOS version information verification result: records the specific reason for verification success or failure.
[0099] Hardware information verification result: records the specific reasons for verification success or failure.
[0100] BMC web server performance verification results: Record the specific reasons for verification success or failure.
[0101] Comprehensive adaptation result: records the final adaptability judgment result, that is, "adaptable" or "unsuitable".
[0102] Storage Location: Record the adaptation results in a dedicated log file containing the aforementioned verification results for subsequent troubleshooting and analysis. Log files can be stored on the server's local storage device or uploaded to a secure remote log server to ensure that log files are not lost due to local storage failures.
[0103] Reference Figure 2 As shown, Figure 2 This is a detailed flow chart of step S100 in the cross-verification method for the adaptability of the BMC and BIOS of a server provided by an embodiment of the present invention. Step S100 includes but is not limited to steps S110 to S140. Specifically,
[0104] S110: Create a static folder for storing firmware version files, and copy the m versions of BMC version files and n versions of BIOS version files to be verified to the static folder;
[0105] S120: Use Flask to create a static resource server in the firmware resource library. The static resource server generates one-to-one corresponding hyperlinks for the m versions of BMC version files and the n versions of BIOS version files to be verified, and each hyperlink corresponds to an IP address.
[0106] S130: Determine a download list of the firmware version file by accessing the IP address, and download the BMC version file and the BIOS version file through the download list of the firmware version file;
[0107] S140: Directly download and pull the m versions of BMC version files and n versions of BIOS version files to be verified through a network request using the http protocol.
[0108] In some embodiments of the present invention, all versions of the BMC and BIOS are collected, and a folder named "static" is created in a directory on the server to store the BMC and BIOS version files. The m versions of the BMC and n versions of the BIOS files to be verified are copied to the "static" folder. A static resource server is created using Flask, and a web server is created using Flask to access and download the BMC and BIOS version files from the network. The Flask and OS modules are then imported. Flask is used to build web applications, while OS is used to interact with the operating system.
[0109] Create a Flask application and set the static file path to static. This allows direct access to files in the static folder via a URL. Add a route to the Flask application to generate a list of hyperlinks to the firmware version files. Define the route to allow users to download the corresponding firmware file by providing a file name. Use Flask to create a static resource server in the firmware repository. The static resource server generates one-to-one hyperlinks for the m versions of the BMC version files and the n versions of the BIOS version files to be verified, with each hyperlink corresponding to an IP address. Run the server and ensure that Flask is installed. If not, enter pip install flask in the command line. Start the Flask development server, listening on all IP addresses and setting port 80.
[0110] Open a browser and access the IP address of the static resource point of the server. Determine the download list of the firmware version file by accessing the IP address, and obtain a download list of the firmware version file, which lists all downloadable BMC and BIOS version firmware. Click on the download list of the firmware version file to download the BMC version file and the BIOS version file. You can also download the m versions of the BMC version file and the n versions of the BIOS version file to be verified through the HTTP protocol network request and pull the firmware.
[0111] Through the above steps, a static resource server can be successfully created and a hyperlink list of firmware version files can be generated. Users can download the required firmware files by clicking on the download list of firmware version files or through the HTTP protocol.
[0112] Reference Figure 3 As shown, Figure 3 This is a first detailed flow chart of a method for cross-verifying the compatibility of a server's BMC and BIOS provided by an embodiment of the present invention. The method for cross-verifying the compatibility of a server's BMC and BIOS further includes but is not limited to steps S101 to S106. Specifically,
[0113] S101: defining a preset data parsing function, the data parsing function is fetch_versions_from_url, where url represents the address of a target web page;
[0114] S102: Send an HTTP request to obtain the HTML document of the target web page, and use the BeautifulSoup library to parse the HTML document to obtain the firmware version information;
[0115] S103: Creating a first list and a second list, wherein the first list is used to store the parsed BMC version file names, and the second list is used to store the parsed BIOS version file names;
[0116] S104: Traverse all firmware version information in the HTML document Label, Tags represent hyperlinks;
[0117] S105: Obtain the target IP address corresponding to each hyperlink through the link.get('href') function, and extract the version file name from the target IP address;
[0118] S106: Determine whether the version file name belongs to the BMC version or the BIOS version based on the extracted version file name. If the current version file name contains "BMC" or "bmc", add the current version file name to the first list; if the current version file name contains "BIOS" or "bios", add the current version file name to the second list.
[0119] In some embodiments of the present invention, the cross-verification method for the compatibility of the server's BMC and BIOS further includes: defining a preset data parsing function, the data parsing function is fetch_versions_from_url, url represents the address of the target web page, and extracting the BMC version information and BIOS version information from the address of the target web page.
[0120] Use requests.get(url) to send an HTTP request to get the HTML content of the target web page; check if the response status code is 200. If the response status code is 200, ensure that the request is successful. If the response status code is not 200, print an error message and return two empty lists. Send an HTTP request to get the HTML document of the target web page, use the BeautifulSoup library to parse the HTML document to get the firmware version information; then create the first list and the second list, which are used to store different types of firmware version files; use soup.find_all('a') to get all the files in the document. Tags. Loop through all Tags, use link.get('href') to get the href attribute of each hyperlink. Extract the version file name from the href attribute. Assuming href is a complete path, use split(' / ')[-1] to extract the last part of the path as the file name. Check if the file name contains "BMC" or "bmc". If so, add the file name to the first list (bmc_versions). Check if the file name contains "BIOS" or "bios". If so, add the file name to the second list (bios_versions).
[0121] By parsing the firmware version information from the target web page and storing the firmware version file name in the first list and the second list respectively, it is convenient for subsequent processing and use; the server obtains the first version of BMC from the first list and the first version of BIOS from the second list to form the first version of BMC and BIOS combination.
[0122] In some embodiments of the present invention, for m versions of BMC version files and n versions of BIOS version files, there are m*n versions of BMC and BIOS combinations. The corresponding selection and implementation codes are as follows:
[0123] def process_all_combinations(product_name):
[0124] """Traverse all BMC and BIOS combinations and process them"""
[0125] for bmc in bmc_versions:
[0126] for bios in bios_versions:
[0127] if bmc != bios: # Ensure BMC and BIOS versions are different
[0128] print(f"Processing combination: BMC={bmc}, BIOS={bios}")
[0129] fetch_update(prudocut_name,bmc, bios)
[0130] else:
[0131] print(f"Skip same version: BMC={bmc}, BIOS={bios}")
[0132] Iterate over all BMC and BIOS combinations using nested for loops, iterating over the bmc_versions and bios_versions lists respectively. In each iteration, check whether the BMC and BIOS versions differ. If they do, call the fetch_update function to process that combination; if they do, skip that combination and print a skip message.
[0133] It's important to ensure that BMC and BIOS version file names are unique to distinguish between different versions. For example, the file name can include information such as the version number and date. During the update process, it's recommended to add exception handling logic to log error messages and handle any updates that fail.
[0134] The above code can systematically traverse all BMC and BIOS combinations and process each combination to ensure that all possible version combinations are verified and updated.
[0135] Reference Figure 4 As shown, Figure 4 This is a detailed flow chart of step S200 of the cross-verification method for the BMC and BIOS adaptability of a server provided by an embodiment of the present invention. Step S200 includes but is not limited to steps S210 to S250. Specifically,
[0136] S210: Send an update request to the server. The update request carries the type of firmware to be updated and the corresponding IP address. The firmware types include BMC and BIOS.
[0137] S220: Determine the target firmware to be updated according to the update request, and define the update configuration of the redfish interface using update parameters, where the update parameters include BMC update parameters and BIOS update parameters.
[0138] S230: performing an update operation on the target firmware based on the update request and update parameters through the redfish interface;
[0139] S240: querying the update progress information of the target firmware through an HTTP GET request, and generating an update progress bar according to the update progress information of the target firmware;
[0140] S250: Restart the server after the target firmware update operation is completed.
[0141] In some embodiments of the present invention, performing an update operation on the first version of the BMC or BIOS includes:
[0142] Send an update request, execute the update operation through the Redfish interface, query the update progress and generate a progress bar, and restart the server after the update is complete. Specifically, define a function, send_update_request, to send the update request to the server. The update request carries the firmware type (BMC or BIOS) and the corresponding IP address. The target firmware to be updated is determined based on the information carried in the update request. Then, the update configuration of the Redfish interface is defined using update parameters (BMC update parameters or BIOS update parameters). Define a function, execute_redfish_update, to execute the update operation on the target firmware through the Redfish interface based on the update request and update parameters. Define a function, query_update_progress, to query the target firmware's update progress information through an HTTP GET request and generate a progress bar, improving the visualization of the target firmware's update progress. Define a function, restart_server, to restart the server after the target firmware is updated to ensure the firmware update was successful.
[0143] Reference Figure 5 , Figure 5 This is a first detailed flow chart of step S300 of the cross-verification method for the BMC and BIOS adaptability of a server provided by an embodiment of the present invention. Step S300 includes but is not limited to steps S331 to S334. Specifically,
[0144] S331: Obtain serial port data information. When the server restarts, send a delete keyboard command to the server through the serial port to enable the server to enter the BIOS interface.
[0145] S332: define def read_from_serial_until function, which is used to read data information from the serial port to capture characters to determine the BIOS version information;
[0146] S333: Capture the BIOS Version field through the def read_from_serial_until function, and determine the current BIOS version information based on the BIOSVersion field;
[0147] S334: Verify the consistency between the current version information of the BIOS and the BIOS update parameters. When the current version information of the BIOS and the BIOS update parameters are consistent, it is determined that the BIOS update is successful.
[0148] In some embodiments of the present invention, a three-layer verification mechanism is used to ensure the compatibility between the BMC and BIOS that complete the update operation, wherein obtaining and verifying the version information of the first updated version of the BIOS through the serial port includes: obtaining the data information of the serial port and defining a function send_delete_command for sending a delete keyboard command through the serial port to allow the server to enter the BIOS interface; defining a function read_from_serial_until for reading the data information of the serial port until a specific character or field is captured, such as the BIOS Version field, to ensure that the format of the captured BIOS version information is consistent with the expected one. If the format is different, the target field in the read_from_serial_until function needs to be adjusted. A function verify_bios_update is defined to verify the consistency of the current version information of the BIOS and the BIOS update parameters. When the current version information of the BIOS and the BIOS update parameters are consistent, the BIOS update is determined to be successful. When the current version information of the BIOS and the BIOS update parameters are inconsistent, the BIOS update is determined to have failed, and exception handling is added to record the error information and perform corresponding processing.
[0149] Acquire data information through the serial port, send keyboard commands, read serial port data to capture BIOS version information, and verify whether the BIOS update is successful to ensure the accuracy and reliability of the BIOS update.
[0150] In one embodiment of the present invention, a request is sent to a server, which updates the firmware with parameters such as the IP address and firmware type (BMC or BIOS). To obtain a token, a function is defined to retrieve the token value from the corresponding request header by requesting redfish_session_url:str="https: / / {} / redfish / v1 / SessionService / Sessions". The code is as follows:
[0151] def get_session(ip: str, username: str, password: str, url: str =redfish_session_url) -> str:
[0152] headers = {
[0153] "Content-Type": "application / json"
[0154] }
[0155] json_data = {
[0156] "UserName": username,
[0157] "Password": password
[0158] }
[0159] response = _make_request(ip,"get session","POST", url.format(ip),headers, json=json_data, success_codes=[200, 201])
[0160] if response:
[0161] return response.headers.get("X-Auth-Token", ""),response.json()["Id"]
[0162] return "",""
[0163] Pass in the update parameters to define the specific configuration of Redfish update by configuring the updated parameters, where link is the static resource address;
[0164] json_data = {
[0165] "ImageURI": link,
[0166] "TransferProtocol": "HTTP",
[0167] "Oem": {
[0168] "Public": {
[0169] "ImageType":"BMC",
[0170] "PreserveConfig":save,
[0171] "Reboot": True}}}
[0172] Perform firmware update: Request the update interface to start updating the firmware.
[0173] def post_update_firmware(ip: str,firmware_type:str,token: str, url:str, json_data: dict)->str:
[0174] headers = {
[0175] "Content-Type": "application / json",
[0176] "X-Auth-Token": token
[0177] }
[0178] response = _make_request(ip,"Update firmware"+firmware_type,"POST",url.format(ip), headers, json=json_data, success_codes=[200, 201, 202, 204])
[0179] return response if response el
[0180] Query update progress: Request the data in the return value of the previous step to obtain the progress of the firmware update. Set the progress to be queried every 2 seconds until 100%, which means the firmware has been updated.
[0181] def get_process(ip:str,token:str,url:str) ->str:
[0182] headers = {
[0183] "Content-Type": "application / json",
[0184] "X-Auth-Token": token
[0185] }
[0186] process = 0
[0187] while True:
[0188] time.sleep(2)
[0189] response = _make_request(ip,"Query upgrade progress","GET", "https: / / "+ip+url, headers, success_codes=[200, 201, 202, 204])
[0190] if not response:
[0191] break
[0192] else:
[0193] process = int(response.json()["Oem"]["Public"]["TaskPercentage"][:-1])
[0194] if process == 100:
[0195] break
[0196] return process
[0197] Server restart: After the BMC update is completed, the service will automatically restart and put the main thread to sleep for about 300 seconds to ensure that the BMC has been successfully started before proceeding to the next step of updating the BIOS.
[0198] Reference Figure 6 , Figure 6 This is a second detailed flow chart of step S300 of the cross-verification method for the BMC and BIOS adaptability of a server provided by an embodiment of the present invention. Step S300 includes but is not limited to steps S341 to S346. Specifically,
[0199] S341: Use the paramiko library to create an SSH client and automatically add the host key;
[0200] S342: The SSH client connects to the server to establish an SSH connection. The server obtains hardware information using the lscpu command.
[0201] S343: If the lscpu command returns CPU information, a dictionary is formed with the lscpu command as a key and the CPU information returned by the lscpu command as a value;
[0202] S344: If the lscpu command returns an error message, a dictionary is formed with the lscpu command plus the error flag as a key and the error message returned by the lscpu command as a value;
[0203] S345: Returning a dictionary to display the execution result of the lscpu command. If the dictionary displays an error message, it is determined that the hardware information verification has failed.
[0204] S346: Close the SSH connection.
[0205] In some embodiments of the present invention, a three-layer verification mechanism is used to ensure the compatibility between the BMC and the BIOS that complete the update operation, wherein obtaining the server's hardware information and verifying the hardware information includes: using paramiko.SSHClient() to create an SSH client. Calling set_missing_host_key_policy(paramiko.AutoAddPolicy()) automatically adds the host key to avoid connection failures due to unknown host keys. The SSH client connects to the server to establish an SSH connection, passing in the host name, port number, user name, and password. The server obtains hardware information through the lscpu command, executes the lscpu command using exec_command('lscpu'), and obtains the standard output and standard error output of the command. If the lscpu command returns CPU information, indicating success, a dictionary is created with the lscpu command as the key and the CPU information returned by the lscpu command as the value, and the lscpu output is stored in the dictionary. If the lscpu command returns an error message, indicating failure, a dictionary is created with the lscpu command plus an error flag as the key and the error message returned by the lscpu command as the value, and the error message is stored in the dictionary. Finally, ssh_client.close() is called to close the SSH connection, ensuring that resources are properly released.
[0206] Use the Paramiko library to build an SSH client, automatically add a host key, connect to the server, and execute the lscpu command to obtain hardware information. The lscpu command retrieves hardware information and determines whether hardware verification is successful based on the command's return result. A dictionary is created based on the command's return result and returned. If an error message is returned, hardware verification has failed. Finally, the SSH connection is closed, completing the hardware verification process.
[0207] Reference Figure 7 , Figure 7 This is a third detailed flow chart of step S300 of the cross-verification method for the BMC and BIOS adaptability of a server provided by an embodiment of the present invention. Step S300 includes but is not limited to steps S351 to S355. Specifically,
[0208] S351: Get the current version information of BMC through the redfish interface;
[0209] S352: Verify the consistency between the current version information of the BMC and the BMC update parameters. If the current version information of the BMC and the BMC update parameters are consistent, it is determined that the BMC update is successful.
[0210] S353: Use Selenium to configure an environment that automatically calls the local Chrome browser to start, start Chrome, and automatically enter the BMC account and password;
[0211] S354: Obtaining the returned information within a preset time, and determining the BMC login status based on the returned information;
[0212] S355: When the returned information is a flag element indicating a successful login, it indicates that the BMC login is normal, and the performance of the BMC web server is determined to be normal. When the returned information is None or the returned information times out, it indicates that the BMC login is abnormal or the flag for successful login cannot be found, and the performance of the BMC web server is determined to be abnormal.
[0213] Since the traditional API interface method can only verify whether the BMC interface is normal, but cannot verify the status of the BMC web server, the present invention adds a web self-starting method to the interface verification step to verify whether the BMC web is normal (the BMC server basically interacts with the user through the web server).
[0214] In some embodiments of the present invention, the compatibility between the BMC and the BIOS after completing the update operation is ensured through a three-layer verification mechanism, wherein the performance of the web server of the BMC of the first updated version is verified through web self-starting, including:
[0215] Directly obtain the current version information of the BMC through the Redfish interface https: / / {} / redfish / v1 / Systems / 1. You will get an object with the key bmc_version. This way, you can get the current version information of the BMC, obtain the BMC update parameters, and determine the consistency between the current BMC version information and the BMC update parameters. When the current BMC version information and the BMC update parameters are consistent, the BMC update is determined to be successful.
[0216] An environment for automatically calling the local chrome browser is configured through selenium, chrome is started, and the account and password of the bmc are automatically input, the return information is obtained within a preset time, and the login state of the BMC is determined according to the return information;
[0217] The return value can be used to determine whether the login is normal, and the web server of the bmc can also be verified in reverse to determine whether the service is normal.
[0218] When the return information is the flag element of successful login, it indicates that the BMC login is normal, and it is determined that the web server performance of the BMC is normal; when the return information is None or the return information is timeout, it indicates that the BMC login is abnormal or the login success flag cannot be found, and it is determined that the web server performance of the BMC is abnormal.
[0219] The current version information of the BMC is obtained through the Redfish interface, it is verified whether the BMC update is successful, the web interface of the BMC is automatically logged in by using selenium, and the login state and the web server performance of the BMC are determined according to the return information.
[0220] In one embodiment of the present application, the method for verifying the performance of the web server of the BMC of the first update version through web self-starting comprises the following steps: verifying whether the web server of the BMC is normal, if normal, then a browser can be opened and logged in, otherwise not, and a return information (such as a boolean value, which is used to judge success or failure) is returned. Essentially, this program is the process of operating the browser to input the website and log in. The following is the explanation of the code:
[0221] Function parameters
[0222] ip_address: IP address of the target website.
[0223] login_url: URL path of the login page.
[0224] chromedriver_path: Path of the ChromeDriver executable file, used to start the Chrome browser.
[0225] username: Login username.
[0226] password: Login password.
[0227] success_indicator: Selector of the flag element after successful login (such as the selector of the user avatar), used to confirm whether the login is successful.
[0228] Detailed step-by-step instructions
[0229] Set up WebDriver: Use setup_chrome_options() to configure Chrome options. Create a Service object, specifying the path to the ChromeDriver. Use webdriver.Chrome(service=service,options=chrome_options) to create a Chrome WebDriver instance.
[0230] Visit the login page:
[0231] Use driver.get("https: / / "+ip_address+login_url) to construct a complete URL and access the login page. Call handle_certificate_error(driver) to handle any https certificate errors that may be encountered.
[0232] Enter your username and password and submit the form:
[0233] Use driver.find_element(By.ID, "usrname").send_keys(username) to find the username input box and enter the username.
[0234] Use driver.find_element(By.ID, "password").send_keys(password) to find the password input box and enter the password.
[0235] Use driver.find_element(By.ID, "btn-login").click() to find the login button and click it to submit the form.
[0236] Use time.sleep(2) to wait a few seconds for the page to load.
[0237] Verify login status:
[0238] Use WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.CSS_SELECTOR, success_indicator))) to wait for up to 10 seconds until the successful login indicator element appears.
[0239] If the flag element is found successfully, log "Login successful" and return the current WebDriver instance.
[0240] If the logo element is not found or times out, record an error message "Login failed or unable to find successful login logo" and return None.
[0241] Exception handling: Throughout the process, if any exception occurs (e.g. network problem, page element not found, etc.), an error log will be recorded, and the browser will be closed (by calling driver.quit()), and then return None.
[0242] The performance of the web server of the first updated version of the BMC is verified through web self-starting, the whole process is an automatic operation, thereby shortening the maintenance time and improving the overall operation efficiency and service quality of the server.
[0243] It should be appreciated that the method steps in the embodiments of the present application can be realized or implemented by computer hardware, a combination of hardware and software, or through computer instructions stored in a non-transitory computer readable memory. The method can use standard programming techniques. Each program can be implemented in a high-level procedural or object-oriented programming language to communicate with a computer system. However, if necessary, the program can be implemented in assembly or machine language. In any case, the language can be a compiled or interpreted language. Furthermore, for this purpose, the program can run on a programmed special integrated circuit.
[0244] In addition, the operations of the processes described herein can be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes described herein (or variations and / or combinations thereof) can be performed under the control of one or more computer systems configured with executable instructions (e.g., executable instructions, one or more computer programs or one or more applications) configured to perform the operations of the processes, by hardware or combinations thereof. The computer programs include a plurality of instructions executable by one or more processors.
[0245] Further, the methods can be implemented in any type of computing platform that is operably connected to a suitable computer, including but not limited to a personal computer, a minicomputer, a mainframe, a workstation, a network or distributed computing environment, a separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, etc. Various aspects of the present invention can be implemented as machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, an optical read and / or write storage medium, RAM, ROM, etc., so that it can be read by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the processes described herein. In addition, the machine-readable code, or portions thereof, can be transmitted over a wired or wireless network. When such media includes instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor, the invention described herein includes these and other different types of non-transitory computer-readable storage media. When programmed according to the methods and techniques of the present invention, the present invention can also include the computer itself.
[0246] The computer program can be applied to input data to perform the functions described herein, thereby converting the input data to generate output data that is stored in a non-volatile memory. The output information can also be applied to one or more output devices such as a display. In a preferred embodiment of the present invention, the converted data represents a physical and tangible object, including a specific visual depiction of the physical and tangible object produced on the display.
[0247] The above description is merely a preferred embodiment of the present invention. The present invention is not limited to the aforementioned embodiments. As long as the technical effects of the present invention are achieved by the same means, any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention. Within the scope of protection of the present invention, various modifications and variations of the technical solutions and / or implementation methods are possible.
Claims
1. A cross-verification method for the compatibility of a server's BMC and BIOS, characterized in that: include: S100: Build a firmware resource library, and upload m versions of BMC and n versions of BIOS to be verified to the firmware resource library, wherein the firmware resource library stores m*n versions of BMC and BIOS combinations; S200: The server obtains a first version of a BMC and BIOS combination from the firmware resource library, and performs update operations on the first versions of the BMC and BIOS in sequence to obtain first updated versions of the BMC and BIOS; S300: Obtaining and verifying version information of the first updated version of the BIOS through a serial port, obtaining hardware information of the server and verifying the hardware information, verifying performance of the web server of the first updated version of the BMC through web self-starting to verify compatibility between the first updated version of the BMC and the BIOS, and recording a first adaptation result; S400: Traversing m*n-1 versions of BMC and BIOS combinations stored in the firmware resource library, performing update operations on the m*n-1 versions of BMC and BIOS respectively, and verifying the adaptability of the m*n-1 updated versions of BMC and BIOS respectively, and recording the m*n-1 adaptation results; S5 00: Generate a BMC and BIOS version compatibility list based on the first adaptation result and the m*n-1 adaptation results; Wherein, the S300 includes: S310: When the version information verification of the first updated version of the BIOS succeeds, the hardware information verification succeeds, and the performance verification of the web server of the first updated version of the BMC succeeds, determining that the first updated version of the BMC and the BIOS are adapted, and recording a first adaptation result as the first updated version of the BMC and the BIOS being adapted; Wherein, the S100 includes: S110: Create a static folder for storing firmware version files, and copy the m versions of BMC version files and n versions of BIOS version files to be verified to the static folder; S120: Using Flask to create a static resource server in the firmware resource library, the static resource server generates one-to-one corresponding hyperlinks for the m versions of BMC version files and the n versions of BIOS version files to be verified, each hyperlink corresponding to an IP address; S130: Determine a download list of firmware version files by accessing the IP address, and download the BMC version file and the BIOS version file through the firmware version file download list; S140: Directly download and pull the m versions of BMC version files and n versions of BIOS version files to be verified through a network request using the http protocol.
2. The cross-verification method for the compatibility of the BMC and BIOS of a server according to claim 1, characterized in that: Step S300 also includes: S320: When any one of the version information verification of the first updated version of the BIOS, the hardware information verification, and the performance verification of the web server of the first updated version of the BMC fails, determine that the first updated version of the BMC and the BIOS are not compatible, and record a first adaptation result as the first updated version of the BMC and the BIOS are not compatible.
3. The cross-verification method for the compatibility of the BMC and BIOS of a server according to claim 1, characterized in that: The method further comprises: S101: defining a preset data parsing function, wherein the data parsing function is fetch_versions_from_url, and the url represents the address of a target web page; S102: Send an HTTP request to obtain the HTML document of the target webpage, and use the BeautifulSoup library to parse the HTML document to obtain firmware version information; S103: Creating a first list and a second list, wherein the first list is used to store the parsed BMC version file names, and the second list is used to store the parsed BIOS version file names; S104: Traverse all firmware version information in the HTML document Label, Tags represent hyperlinks; S105: Obtain the target IP address corresponding to each hyperlink through the link.get('href') function, and extract the version file name from the target IP address; S106: Determine, based on the extracted version file name, whether the version file name belongs to a BMC version or a BIOS version; if the current version file name contains "BMC" or "bmc", add the current version file name to the first list; if the current version file name contains "BIOS" or "bios", add the current version file name to the second list.
4. The cross-verification method for compatibility between the BMC and BIOS of a server according to claim 1, wherein: Step S200 includes: S210: Send an update request to the server, where the update request carries the type of firmware to be updated and the corresponding IP address, where the firmware types include BMC and BIOS. S220: Determine the target firmware for the update operation according to the update request, and define the update configuration of the redfish interface using update parameters, wherein the update parameters include BMC update parameters and BIOS update parameters; S230: performing an update operation on the target firmware based on the update request and the update parameters through the redfish interface; S240: querying the update progress information of the target firmware through an HTTP GET request, and generating an update progress bar according to the update progress information of the target firmware; S250: Restarting the server after the target firmware completes the update operation.
5. The cross-verification method for the compatibility of the BMC and BIOS of a server according to claim 1, characterized in that: Step S300 includes: S331: Acquire data information from the serial port, and when the server restarts, send a delete keyboard command to the server through the serial port to enable the server to enter the BIOS interface; S332: defining a def read_from_serial_until function, wherein the def read_from_serial_until function is used to read data information from the serial port to capture characters to determine BIOS version information; S333: Capture the BIOS Version field through the def read_from_serial_until function, and determine the current version information of the BIOS according to the BIOS Version field; S334: Verify the consistency between the current version information of the BIOS and the BIOS update parameters. When the current version information of the BIOS and the BIOS update parameters are consistent, determine that the BIOS update is successful.
6. The cross-verification method for compatibility between the BMC and BIOS of a server according to claim 1, characterized in that: Step S300 also includes: S341: Use the paramiko library to create an SSH client and automatically add the host key; S342: The SSH client connects to the server to establish an SSH connection, and the server obtains hardware information through the lscpu command; S343: If the lscpu command returns CPU information, forming a dictionary with the lscpu command as a key and the CPU information returned by the lscpu command as a value; S344: If the lscpu command returns error information, forming a dictionary with the lscpu command plus the error flag as a key and the error information returned by the lscpu command as a value; S345: Returning the dictionary to display the execution result of the lscpu command, and when the dictionary displays an error message, determining that the hardware information verification has failed; S346: Close the SSH connection.
7. The cross-verification method for compatibility between the BMC and BIOS of a server according to claim 1, characterized in that: Step S300 also includes: S351: Get the current version information of BMC through the redfish interface; S352: Verify the consistency between the current version information of the BMC and the BMC update parameters. If the current version information of the BMC and the BMC update parameters are consistent, determine that the BMC update is successful. S353: Use Selenium to configure an environment that automatically calls the local Chrome browser to start, start Chrome, and automatically enter the BMC account and password; S354: Obtaining return information within a preset time, and determining the login status of the BMC according to the return information; S355: When the returned information is a flag element indicating a successful login, it indicates that the BMC login is normal, and the performance of the BMC web server is determined to be normal. When the returned information is None or the returned information times out, it indicates that the BMC login is abnormal or the flag for successful login cannot be found, and the performance of the BMC web server is determined to be abnormal.
8. The cross-verification method for compatibility between the BMC and BIOS of a server according to claim 1, wherein: Also includes: S600: Before performing an update operation on the first version of the BMC and BIOS, automatically back up the currently running stable versions of the BMC and BIOS. The backup content includes the firmware file, configuration file, and current running status. The backup file is stored in a local storage device of the server or uploaded to a secure remote backup server. S610: During the automatic update process of the BMC and BIOS of the first version, an exception handling mechanism is set to promptly restore to the last stable version of the BMC and BIOS of the first version when the update fails, and record error information for subsequent investigation.
9. A computer device comprising a memory and a processor, characterized in that: The method according to any one of claims 1 to 8 is implemented when the processor executes the computer program stored in the memory.
10. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Version information acquisition method and device, server and storage medium
CN117407043A
Software and hardware combined anti-counterfeiting method, system and equipment and storage medium
CN117574352A