Cross validation method and device for BMC and BIOS suitability of server and storage medium
By building a firmware resource library and multi-layer verification mechanism, the BMC and BIOS versions are automatically managed, and the problem of inefficient manual operation in the existing technology is solved, ensuring that the server runs stably after firmware updates, and improving the efficiency and accuracy of adaptability verification of BMC and BIOS.
Patent Information
- Application Number
- CN202510725036.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2045-06-03
AI Technical Summary
The existing server firmware update and verification process relies on manual operations, is inefficient and error-prone, lacks systematic processes, cannot fully verify the compatibility of BMC and BIOS, affects server stability and performance, and lacks verification of BMC web server performance.
Build a firmware resource library, automatically manage BMC and BIOS versions, and ensure the adaptability of BMC and BIOS through multi-layer verification mechanisms such as serial port, hardware information verification and web self-start to form a compatibility list.
Improves the efficiency and accuracy of BMC and BIOS adaptability verification, ensures that the server runs stably after firmware updates, reduces the risk of mismatch or update failures, and provides detailed compatibility analysis.
Smart Images

Figure CN120234037A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and particularly to a cross-verification method, device and storage medium for the adaptability between the BMC and BIOS of a server. Background Art
[0002] In modern server systems, BMC (Baseboard Management Controller) and BIOS (Basic Input / Output System) are two key firmware components, which play a crucial role in the normal operation and management of servers. The BMC is responsible for the management and monitoring of hardware, while the BIOS is responsible for initializing the hardware and booting the operating system. With the continuous development of server technology, the version updates of BMC and BIOS become more and more frequent, which increases the risk of compatibility problems between different versions.
[0003] In related technologies, the firmware update and verification processes of many servers still rely on manual operations. This is not only inefficient but also error-prone. When manually updating the firmware, the administrator needs to download the firmware files one by one and upload them to the server, and then perform the update operation through the command line or management interface. When verifying the compatibility of the firmware version, it is usually necessary to manually check the hardware information, BIOS version and BMC version, which is not only time-consuming but also prone to missing key information. Moreover, the existing firmware update and verification methods lack a systematic process. After updating the firmware, there is usually no comprehensive verification mechanism to ensure the compatibility between the BMC and BIOS. Even if verification is performed, it is often based on tests of a single version, lacking systematic verification of multiple version combinations. After verifying the firmware update, there is usually a lack of comprehensive verification of the hardware information. The existing methods often only check the BIOS version information while ignoring the verification of the hardware information. This may lead to the failure to timely detect compatibility problems between the hardware and the firmware after the update, thus affecting the stability and performance of the server.
[0004] In addition, the web interface of the BMC is an important tool for administrators to manage and monitor servers. However, the existing verification methods usually lack verification of the performance of the BMC web server, which may cause the web interface of the BMC to malfunction after the update, affecting the management efficiency of administrators. Summary of the Invention
[0005] The present invention provides a cross-verification method, device and storage medium for the adaptability between the 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 adaptability of the BMC and BIOS of a server, which includes the following steps: S100: Construct 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 combinations of BMC and BIOS versions; S200: The server obtains the first - version combination of BMC and BIOS from the firmware resource library, and sequentially performs update operations on the first - version BMC and BIOS to obtain the first - updated - version BMC and BIOS; S300: Obtain and verify the version information of the first - updated - version BIOS through the serial port, obtain the hardware information of the server and perform verification processing on the hardware information, and verify the performance of the web server of the first - updated - version BMC through web self - startup to verify the adaptability of the first - updated - version BMC and BIOS, and record the first adaptation result; S400: Traverse the m * n - 1 combinations of BMC and BIOS versions stored in the firmware resource library, respectively perform update operations on the m * n - 1 versions of BMC and BIOS, and respectively verify the adaptability of the m * n - 1 updated - version BMC and BIOS, and record the m * n - 1 adaptation results; S500: Form a BMC and BIOS version compatibility list according to the first adaptation result and the m * n - 1 adaptation results.
[0007] According to some embodiments of the present invention, the step S300 includes: S310: When the version information verification of the first - updated - version BIOS is successful, the hardware information verification is successful, and the performance verification of the web server of the first - updated - version BMC is successful, determine that the first - updated - version BMC and BIOS are adapted, and record the first adaptation result as the first - updated - version BMC and BIOS are adapted; S320: When any one of the version information verification of the first - updated - version BIOS, the hardware information verification, and the performance verification of the web server of the first - updated - version BMC fails, determine that the first - updated - version BMC and BIOS are not adapted, and record the first adaptation result as the first - updated - version BMC and BIOS are not adapted.
[0008] According to some embodiments of the present invention, the step S100 includes: S110: Create a static folder to store firmware version files, and copy the version files of the BMC in m versions to be verified and the version files of the BIOS in n versions to the static folder; 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 version files of the BMC in m versions to be verified and the version files of the BIOS in n versions respectively, and each hyperlink corresponds to an IP address; S130: Determine the download list of firmware version files by accessing the IP address, and download the version files of the BMC and the BIOS through the download list of the firmware version files; S140: Directly download and fetch the version files of the BMC in m versions to be verified and the version files of the BIOS in n versions through network requests using the http protocol.
[0009] According to some embodiments of the present invention, the method further includes: S101: Define a preset data parsing function, the data parsing function is fetch_versions_from_url, and the url represents the address of the target web page; 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 firmware version information; S103: Create a first list and a second list. The first list is used to store the parsed version file names of the BMC, and the second list is used to store the parsed version file names of the BIOS; S104: Traverse all label, the The label represents a hyperlink; S105: Obtain the target IP address corresponding to each of the hyperlinks through the link.get('href') function, and extract the version file name from the target IP address; S106: Determine whether the extracted version file name belongs to the BMC version or the BIOS version according to 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.
[0010] According to some embodiments of the present invention, the step S200 includes: S210: Send an update request to the server. The update request carries the firmware type that needs to perform the update operation and the corresponding IP address. The firmware type includes BMC and BIOS; S220: Determine the target firmware that needs to perform the update operation according to the update request, and use update parameters to define the update configuration of the redfish interface. The update parameters include BMC update parameters and BIOS update parameters; S230: Perform an update operation on the target firmware through the redfish interface based on the update request and the update parameters; S240: Query the update progress information of the target firmware through an HTTP GET request, and generate an update progress bar according to the update progress information of the target firmware; S250: Restart the server after the target firmware completes the update operation.
[0011] According to some embodiments of the present invention, the step S300 includes: S331: Obtain the data information of the serial port. When the server restarts, send a delete keyboard command to the server through the serial port to make the server enter the BIOS interface; S332: Define the def read_from_serial_until function, and the def read_from_serial_until function is used to read the data information of the serial port to capture characters to determine the version information of the BIOS; 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 is consistent with the BIOS update parameters, it is determined that the BIOS update is successful.
[0012] According to some embodiments of the present invention, the step S300 further includes: S341: Create an SSH client using the paramiko library 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, form a dictionary with the lscpu command as the key and the CPU information returned by the lscpu command as the value; S344: If the lscpu command returns error information, form a dictionary with the lscpu command plus the error flag as the key and the error information returned by the lscpu command as the value; S345: Return the dictionary to display the execution result of the lscpu command. When the dictionary shows error information, it is determined that the verification of the hardware information fails; S346: Close the SSH connection.
[0013] According to some embodiments of the present invention, the step S300 further includes: S351: Obtain the current version information of the BMC through the redfish interface; S352: Verify the consistency between the current version information of the BMC and the BMC update parameters. When the current version information of the BMC is consistent with the BMC update parameters, it is determined that the BMC update is successful; S353: Configure an environment for automatically starting the local chrome browser through selenium, start chrome and automatically input the account and password of the BMC; S354: Obtain the return information within a preset time and determine the login status of the BMC according to the return information; S355: 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 times 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.
[0014] The technical solution of the present invention further relates to a computer device, including a memory and a processor, and when the processor executes the computer program stored in the memory, the above method is implemented.
[0015] The technical solution of the present invention further relates to a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above method is implemented.
[0016] The cross-verification method, device and storage medium for the BMC and BIOS adaptability of the server provided by the embodiments of the present invention at least have one of the following advantages or beneficial effects: establishing a firmware resource library for storing firmware files of different versions, uploading the m versions of BMC and n versions of BIOS to be verified to the firmware resource library, enabling maintenance personnel to conveniently access and manage important resources, and improving work efficiency. The firmware resource library stores m*n combinations of BMC and BIOS versions. The controller can automatically parse out all available BMC and BIOS versions from the firmware resource library, and each combination corresponds to a BMC and BIOS pairing. The automated processing reduces the possibility of human errors and ensures the best compatibility between different components. The server automatically pulls the first combination of BMC and BIOS versions from the firmware resource library, and sequentially performs update operations on the first version of BMC and BIOS to obtain the first updated versions of BMC and BIOS. Obtain the version information of the first updated version of BIOS through the serial port and verify it; obtain the hardware information of the server and perform verification processing on the hardware information to ensure that the hardware is compatible with the updated BIOS. Verify the performance of the web server of the first updated version of BMC through web self-booting, 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 after firmware update. Verifying through multiple methods effectively reduces the risks caused by firmware mismatch or update failure, and improves the accuracy of the adaptability verification results of the first updated versions of BMC and BIOS; record the first adaptation result, including key information such as verification results, problems found during the verification process, and performance performance, improving the visualization degree of the first adaptation result.
[0017] Traverse the m*n - 1 versions of BMC and BIOS combinations stored in the firmware repository, 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 update of the BIOS 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 detail various situations during the verification process, including combinations with successful adaptation and combinations with compatibility issues and their specific problems. Based on the first adaptation result and the m*n - 1 adaptation results, sort out and analyze the adaptation situations of all verified BMC and BIOS version combinations to form a BMC and BIOS version compatibility list, clearly listing which versions of BMC and BIOS combinations are compatible, which combinations have compatibility issues, and information such as the specific manifestations of the compatibility issues and possible solutions, providing a reference basis for subsequent firmware updates and maintenance. Through the systematic adaptation verification process, the compatibility of different version combinations can be comprehensively evaluated, providing guarantee for the stable operation of the server.
[0018] The cross - verification method for the BMC and BIOS adaptability of the server provided by the present invention systematically verifies the adaptability between different versions of BMC and BIOS, ensures that the server can operate normally after firmware update, and improves the stability and reliability of the server.
[0019] In addition, additional aspects and advantages of the present invention will be given in part in the following description, become apparent in part from the following description, or be understood through the practice of the present invention. Brief Description of the Drawings
[0020] Figure 1 is the overall flowchart of a cross-verification method for the BMC and BIOS compatibility of a server provided by an embodiment of the present invention; Figure 2 is the detailed flowchart of step S100 in the cross-verification method for the BMC and BIOS compatibility of the server provided by an embodiment of the present invention; Figure 3 is the first detailed flowchart of the cross-verification method for the BMC and BIOS compatibility of the server provided by an embodiment of the present invention; Figure 4 is the detailed flowchart of step S200 in the cross-verification method for the BMC and BIOS compatibility of the server provided by an embodiment of the present invention; Figure 5It is the first detailed flowchart of step S300 of the cross-verification method for the BMC and BIOS compatibility of the server provided by the embodiment of the present invention; Figure 6 It is the second detailed flowchart of step S300 of the cross-verification method for the BMC and BIOS compatibility of the server provided by the embodiment of the present invention; Figure 7 It is the third detailed flowchart of step S300 of the cross-verification method for the BMC and BIOS compatibility of the server provided by the embodiment of the present invention. Detailed implementation manners
[0021] The concept, specific structure and technical effects of the present invention will be clearly and completely described below in conjunction with the embodiments and the drawings to fully understand the purpose, solution and effects of the present invention.
[0022] It should be noted that, unless otherwise specified, when a certain feature is referred to as "fixed" or "connected" to another feature, it can be directly fixed or connected to the other feature, or indirectly fixed or connected to the other feature. As used herein, the singular forms "a", "the" and "said" 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 technical field to which this application belongs. The terms used in the description of this specification herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0023] It should be understood that although the terms first, second, third, etc. may be used in the present invention to describe various elements, these elements should not be limited to these terms. These terms are only used to distinguish 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 languages (such as "for example", "such as", etc.) provided herein is only intended to better illustrate the embodiments of the present invention and will not impose a limitation on the scope of the present invention unless otherwise required.
[0024] In the related art, the firmware update and verification processes of many servers still rely on manual operations. This is not only inefficient but also error-prone. When manually updating the firmware, the administrator needs to download the firmware files one by one and upload them to the server, and then perform the update operation through the command line or the management interface. When verifying the compatibility of the firmware version, it is usually necessary to manually check the hardware information, BIOS version, and BMC version, which is not only time-consuming but also prone to missing key information. Moreover, the existing firmware update and verification methods lack a systematic process. After updating the firmware, there is usually no comprehensive verification mechanism to ensure the compatibility between the BMC and the BIOS. Even if verification is performed, it is often based on tests of a single version, lacking systematic verification of multiple version combinations. After verifying the firmware update, there is usually a lack of comprehensive verification of the hardware information. The existing methods often only check the BIOS version information while ignoring the verification of the hardware information. This may lead to the failure to promptly detect compatibility issues between the hardware and the firmware after the update, thus affecting the stability and performance of the server.
[0025] In addition, the BMC's web interface is an important tool for administrators to manage and monitor the server. However, the existing verification methods usually lack verification of the performance of the BMC web server, which may result in the inability of the BMC's web interface to work properly after the update, affecting the management efficiency of the administrator.
[0026] Based on this, the embodiments of the present invention provide a cross-verification method, device, and storage medium for the adaptability between the BMC and the BIOS of a server, which is conducive to systematically verifying the adaptability between different versions of the BMC and the BIOS, ensuring the normal operation of the server after the firmware is updated, and improving the stability and reliability of the server.
[0027] Refer to Figure 1 as shown in Figure 1 is the overall flowchart of a cross-verification method for the adaptability between the BMC and the BIOS of a server provided by the embodiments of the present invention. The cross-verification method for the adaptability between the BMC and the BIOS of a server includes but is not limited to steps S100 to S500. Specifically, S100: Construct a firmware resource library, and upload m versions of the BMC and n versions of the BIOS to be verified to the firmware resource library. The firmware resource library stores m*n combinations of the BMC and the BIOS versions. S200: The server obtains the first combination of the BMC and the BIOS version from the firmware resource library, and sequentially performs update operations on the first version of the BMC and the BIOS to obtain the first updated versions of the BMC and the BIOS. S300: Obtain and verify the version information of the BIOS of the first updated version through the serial port, obtain the hardware information of the server and perform verification processing on the hardware information, and verify the performance of the web server of the BMC of the first updated version through web self-booting, so as to verify the compatibility between the BMC and BIOS of the first updated version, and record the first adaptation result; S400: Traverse the m*n - 1 combinations of BMC and BIOS versions stored in the firmware repository, 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, and record the m*n - 1 adaptation results; S500: Form a BMC and BIOS version compatibility list according to the first adaptation result and the m*n - 1 adaptation results.
[0028] In some embodiments of the present invention, the cross-verification method for the compatibility between the BMC and BIOS of the server includes: First, establish a dedicated firmware repository for storing firmware files of different versions. Upload the m versions of BMC and n versions of BIOS to be verified to the firmware repository. All BMC and BIOS versions are centrally stored in the firmware repository, which enables maintenance personnel to conveniently access and manage these important resources and improves work efficiency. The firmware repository stores m*n combinations of BMC and BIOS versions, and each combination corresponds to a BMC and BIOS pairing. The firmware files can be downloaded through network requests. The controller can automatically parse all available BMC and BIOS versions from the firmware repository and perform intelligent combination on these versions. The automated processing reduces the possibility of human errors and ensures the best compatibility between different components. When starting the verification, the control end sends a command to the server, and the server automatically pulls the first combination of BMC and BIOS versions from the firmware repository, and sequentially performs update operations on the first versions of BMC and BIOS to obtain the first updated versions of BMC and BIOS. Obtain the version information of the BIOS of the first updated version through the serial port and verify it; obtain the hardware information of the server and perform verification processing on the hardware information to ensure the compatibility between the hardware and the updated BIOS. Verify the performance of the web server of the first updated version of BMC through web self-booting, so as to verify the compatibility between the first updated versions of BMC and BIOS. The three-layer verification mechanism ensures the stability and correctness after the firmware update. Verifying through multiple methods effectively reduces the risks caused by firmware mismatch or update failure and improves the accuracy of the verification results of the compatibility between the first updated versions of BMC and BIOS; record the first adaptation result, including key information such as verification results, problems found during the verification process, and performance performance, which improves the visualization degree of the first adaptation result.
[0029] Traverse the m*n - 1 versions of BMC and BIOS combinations stored in the firmware repository, 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 update of the BIOS 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 in the verification process in detail, including the combinations that are successfully adapted and the combinations with compatibility problems and their specific problems. According to the first adaptation result and the m*n - 1 adaptation results, organize and analyze the adaptation situations of all verified BMC and BIOS version combinations to form a BMC and BIOS version compatibility list, clearly listing which versions of BMC and BIOS combinations are compatible, which combinations have compatibility problems, and the specific manifestations and possible solutions of the compatibility problems, etc., to provide a reference basis for subsequent firmware updates and maintenance. Through the systematic adaptation verification process, the compatibility of different version combinations can be comprehensively evaluated, providing guarantee for the stable operation of the server.
[0030] The cross - verification method for the adaptability of the BMC and BIOS of the server provided by the present invention systematically verifies the adaptability between different versions of BMC and BIOS, ensures that the server can operate normally after firmware update, and improves the stability and reliability of the server.
[0031] It can be understood that after the server automatically pulls the first version of the BMC and BIOS combination from the firmware repository, it first updates the BMC. Since the BMC inside the server has a self - service function, when the server finishes pulling this set of BMC and BIOS, it can achieve self - update; after the BMC finishes the update, it then self - updates the BIOS.
[0032] The server automatically pulls the first version of the BMC and BIOS combination from the firmware repository, and the BMC inside the server has a self - service function. When the server finishes pulling this set of BMC and BIOS, the BMC first starts the self - update process and automatically completes the update operation of the BMC. The self - service function of the BMC ensures the stability and reliability of the update process and reduces the risk of update failure; after the BMC finishes the update, the BMC uses its self - service function to automatically trigger the update process of the BIOS and complete the self - update operation of the BIOS. The entire update process requires no manual intervention and is automatically completed by the BMC inside the server. Through this automated firmware update and verification process, the efficiency and reliability of server firmware management can be effectively improved, ensuring the stable operation of the server under different firmware versions.
[0033] In some embodiments of the present invention, during the firmware automatic update process, an exception handling mechanism is set up so that in case of update failure, it can be promptly restored to the previous stable version of the firmware, and error information is recorded for subsequent troubleshooting.
[0034] Before starting the update, automatically back up the stable versions of the currently running BMC and BIOS. The backup content includes firmware files, configuration files, and the current running status. The backup files can be stored in the local storage device of the server or uploaded to a secure remote backup server to ensure that the backup files will not be lost due to local storage failures.
[0035] During the update process, monitor the update progress and status in real time. The monitored content includes: Firmware file transfer status: Ensure that there is no interruption or corruption during the transfer of the firmware file from the repository to the server.
[0036] Update command execution status: Monitor whether the update commands for the BMC and BIOS are successfully executed and the return status codes during the execution process.
[0037] Hardware response status: Detect the response of the hardware device during the update process to ensure that the hardware can respond normally to the update operation.
[0038] If an interruption or file corruption occurs during the firmware file transfer process, the system immediately detects the anomaly. If the update commands for the BMC or BIOS fail to execute, the anomaly is detected through the return status code or log information. If the hardware device exhibits an abnormal response during the update process, the anomaly is discovered through the hardware detection mechanism.
[0039] Once an anomaly is detected, immediately interrupt the current update operation to prevent further errors from occurring. Automatically restore from the backup to the previous stable versions of the BMC and BIOS to ensure that the server can quickly resume normal operation. Record in detail the reasons for the update failure, including: Timestamp: Record the specific time when the anomaly occurred; Error code: Record the error code returned by the system; Log information: Record the log information generated during the update process, including transfer logs, execution logs, and hardware response logs; Backup version information: Record the detailed information of the restored backup version for subsequent comparison and analysis.
[0040] Through this detailed exception handling mechanism, the reliability of the firmware update process can be effectively guaranteed, the system downtime caused by update failures can be reduced, and strong support can be provided for subsequent troubleshooting and repair.
[0041] In some embodiments of the present invention, step S300 in the cross - verification method for the BMC and BIOS adaptability of the server includes but is not limited to steps S310 to S320. Specifically, S310: When the version information verification of the first updated version of the BIOS is successful, the hardware information verification is successful, and the performance verification of the web server of the first updated version of the BMC is successful, it is determined that the first updated version of the BMC and the BIOS are adapted, and the first adaptation result is recorded as the first updated version of the BMC and the BIOS being adapted; 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 not adapted, and the first adaptation result is recorded as the first updated version of the BMC and the BIOS not being adapted.
[0042] In some embodiments of the present invention, the version information verification of the first updated version of the BIOS includes: obtaining the version information of the first updated version of the BIOS through the serial port, checking whether the obtained version information of the first updated version of the BIOS is consistent with the expected version to ensure that the version information is correct. If the version information verification is successful, record "BIOS version information verification successful". If the version information verification fails, record "BIOS version information verification failed", and directly determine that the first updated version of the BMC and the BIOS are not adapted, record the first adaptation result as "the first updated version of the BMC and the BIOS are not adapted", and skip the subsequent verification steps.
[0043] The hardware information verification includes: obtaining the hardware information of the server, including the models and statuses 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 to ensure that the hardware is compatible with the updated BIOS. If the hardware information verification is successful, record "hardware information verification successful". If the hardware information verification fails, record "hardware information verification failed", and directly determine that the first updated version of the BMC and the BIOS are not adapted, record the first adaptation result as "the first updated version of the BMC and the BIOS are not adapted", and skip the subsequent verification steps.
[0044] The performance verification of the BMC's web server includes: starting the web server of the first updated version of the BMC through the web self-start function. Conduct performance tests on the BMC's web server, including key performance indicators such as response time, page loading speed, and functional integrity. If the web server performance verification is successful, record "BMC's web server performance verification successful". If the web server performance verification fails, record "BMC's web server performance verification failed", and directly determine that the first updated version of the BMC and the BIOS are not adapted, record the first adaptation result as "the first updated version of the BMC and the BIOS are not adapted".
[0045] If the BIOS version information verification is successful, the hardware information verification is successful, and the BMC web server performance verification is successful, it is comprehensively determined that the BMC and BIOS of the first update version are compatible, and the first adaptation result is recorded as "the BMC and BIOS of the first update version are compatible". If any one of the above three verifications fails, it is comprehensively determined that the BMC and BIOS of the first update version are not compatible, and the first adaptation result is recorded as "the BMC and BIOS of the first update version are not compatible".
[0046] Regardless of whether the adaptability verification is successful or not, it is necessary to record in detail each step of the operation and result during the verification, including: BIOS version information verification result: Record the specific reason for successful or failed verification.
[0047] Hardware information verification result: Record the specific reason for successful or failed verification.
[0048] BMC web server performance verification result: Record the specific reason for successful or failed verification.
[0049] Comprehensive adaptation result: Record the final adaptability determination result, that is, "compatible" or "not compatible".
[0050] Storage location: Record the adaptation result in a dedicated log file. The log file contains the above verification results for subsequent troubleshooting and analysis. The log file can be stored in the local storage device of the server or uploaded to a secure remote log server to ensure that the log file will not be lost due to local storage failure.
[0051] Refer to Figure 2 as shown Figure 2 is the detailed flowchart of step S100 in the cross-verification method for BMC and BIOS adaptability of the server provided by the embodiment of the present invention. Step S100 includes but is not limited to steps S110 to S140. Specifically, S110: Create a static folder to store the firmware version files, and copy the version files of the BMC of m versions to be verified and the version files of the BIOS of n versions to the static folder; 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 version files of the BMC of m versions to be verified and the version files of the BIOS of n versions, and each hyperlink corresponds to an IP address; S130: Determine the download list of the firmware version files by accessing the IP address, and download the version files of the BMC and the BIOS through the download list of the firmware version files; S140: Directly download and pull the version files of the BMC in m versions to be verified and the version files of the BIOS in n versions through network requests using the http protocol.
[0052] In some embodiments of the present invention, collect all versions of the BMC and BIOS, create a folder named static in a certain directory of the server to store the version files of the BMC and the version files of the BIOS; copy the version files of the BMC in m versions to be verified and the version files of the BIOS in n versions to the static folder. Use Flask to create a static resource server, create a web server through Flask so that the version files of the BMC and the version files of the BIOS can be accessed and downloaded from the network, and import the Flask and os modules. Flask is used to build web applications, and os is used to interact with the operating system.
[0053] Create a Flask application and set the static file path to static, so that files in the static folder can be directly accessed through the URL. Add a route in the Flask application to generate a hyperlink list of firmware version files, define the route to allow users to download the corresponding firmware files by providing the file name. Use Flask to create a static resource server in the firmware repository. The static resource server generates one-to-one corresponding hyperlinks for the version files of the BMC in m versions to be verified and the version files of the BIOS in n versions, and each hyperlink corresponds to an IP address; run the server, ensure that Flask is installed, if not, enter pip install flask in the command line. Start the Flask development server, listen on all IP addresses, and set the port to 80.
[0054] Open the browser and access the IP address of the static resource point of the server. Determine the download list of firmware version files by accessing the IP address, and obtain a download list of firmware version files, which lists all downloadable BMC and BIOS version firmware. Download the version files of the BMC and the version files of the BIOS by clicking on the download list of the firmware version files, or download the version files of the BMC in m versions to be verified and the version files of the BIOS in n versions and pull the firmware through network requests using the http protocol.
[0055] 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 the firmware version files or through the HTTP protocol.
[0056] Refer to Figure 3 as shown Figure 3This is the first detailed flowchart of the cross - verification method for the BMC and BIOS adaptability of the server provided by the embodiments of the present invention. The cross - verification method for the BMC and BIOS adaptability of the server also includes, but is not limited to, steps S101 to S106. Specifically, S101: Define a preset data parsing function. The data parsing function is fetch_versions_from_url, and url represents the address of the target web page; 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; S103: Create a first list and a second list. The first list is used to store the version file names of the parsed BMC, and the second list is used to store the version file names of the parsed BIOS; S104: Traverse all label, The label represents a hyperlink; 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 whether the version file name belongs to the BMC version or the BIOS version according to 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.
[0057] In some embodiments of the present invention, the cross - verification method for the BMC and BIOS compatibility of the server further includes: defining a preset data parsing function, the data parsing function is fetch_versions_from_url, where url represents the address of the target web page, and extracting the version information of the BMC and the version information of the BIOS from the address of the target web page.
[0058] Send an HTTP request using requests.get(url) to obtain the HTML content of the target web page; check whether 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 obtain the HTML document of the target web page, use the BeautifulSoup library to parse the HTML document to obtain the firmware version information; then, create a first list and a second list, and the first list and the second list are used to store different types of firmware version files; obtain all the label. Traverse all For each hyperlink, use link.get('href') to obtain the href attribute. Extract the version file name from the href attribute. Assuming the 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 it does, add the file name to the first list (the bmc_versions list). Check if the file name contains "BIOS" or "bios". If it does, add the file name to the second list (the bios_versions list).
[0059] By parsing the firmware version information from the target web page and storing the version file names of the firmware 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 a combination of the first version of BMC and BIOS.
[0060] In some embodiments of the present invention, for the version files of m versions of BMC and the version files of n versions of BIOS, there are m*n combinations of BMC and BIOS versions. The corresponding selection and implementation code is as follows: def process_all_combinations(product_name): """Traverse all combinations of BMC and BIOS and process them""" for bmc in bmc_versions: for bios in bios_versions: if bmc != bios: # Ensure that the BMC and BIOS versions are different print(f"Processing combination: BMC={bmc}, BIOS={bios}") fetch_update(prudocut_name,bmc, bios) else: print(f"Skipping same version: BMC={bmc}, BIOS={bios}") Traverse all combinations of BMC and BIOS using nested for loops to iterate through the bmc_versions and bios_versions lists respectively. In each loop, check if the BMC and BIOS versions are different. If they are different, call the fetch_update function to process the combination; if they are the same, skip the combination and print a skip message.
[0061] It should be noted that it is necessary to ensure the uniqueness of the version file names of BMC and BIOS in order to correctly distinguish different versions. For example, the file name can contain information such as version number and date. During the update process, it is recommended to add exception handling logic to record error information and perform corresponding processing in case of update failure.
[0062] Through the above code, all combinations of BMC and BIOS can be systematically traversed and each combination can be processed to ensure that all possible version combinations are verified and updated.
[0063] Refer to Figure 4 as shown; Figure 4 This is the detailed flowchart of step S200 of the cross - verification method for the BMC and BIOS adaptability of the server provided by the embodiments of the present invention. Step S200 includes, but is not limited to, steps S210 to S250. Specifically, S210: Send an update request to the server. The update request carries the firmware type that needs to perform the update operation and the corresponding IP address. The firmware types include BMC and BIOS; S220: Determine the target firmware that needs to perform the update operation according to the update request, and use the update parameters to define the update configuration of the redfish interface. The update parameters include BMC update parameters and BIOS update parameters; S230: Perform an update operation on the target firmware through the redfish interface based on the update request and the update parameters; S240: Query the update progress information of the target firmware through an HTTP GET request, and generate an update progress bar according to the update progress information of the target firmware; S250: Restart the server after the target firmware completes the update operation.
[0064] In some embodiments of the present invention, performing an update operation on the first - version BMC and BIOS includes: Send an update request, perform an update operation through the Redfish interface, query the update progress and generate a progress bar, and restart the server after the update is completed. Specifically, define a function send_update_request to send an update request to the server. The update request carries the firmware type (BMC or BIOS) and the corresponding IP address. Determine the target firmware for the update operation to be performed based on the information carried in the update request. Then, define the update configuration of the Redfish interface using the update parameters (BMC update parameters or BIOS update parameters); define a function execute_redfish_update to perform an update operation on the target firmware through the Redfish interface based on the update request and the update parameters. Define a function query_update_progress to query the update progress information of the target firmware through an HTTP GET request and generate a progress bar, improving the visualization of the update progress of the target firmware. Define a function restart_server to restart the server after the update operation of the target firmware is completed to ensure the successful execution of the firmware update operation.
[0065] Refer to Figure 5 , Figure 5 is the first detailed flowchart of step S300 of the cross-verification method for the BMC and BIOS adaptability of the server provided by the embodiment of the present invention. Step S300 includes but is not limited to steps S331 to S334. Specifically, S331: Obtain the data information of the serial port. When the server restarts, send a delete keyboard command to the server through the serial port to make the server enter the BIOS interface; S332: Define a function def read_from_serial_until. The function is used to read the data information of the serial port to capture characters to determine the 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 BIOSVersion 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, it is determined that the BIOS update is successful.
[0066] In some embodiments of the present invention, a three - layer verification mechanism is adopted to ensure the compatibility between the BMC and the BIOS after the update operation is completed. Among them, obtaining and verifying the version information of the BIOS of the first update version through the serial port includes: obtaining the data information of the serial port, and defining a function send_delete_command for sending the delete keyboard command through the serial port to make the server 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 expectation. If the format is different, the target field in the read_from_serial_until function needs to be adjusted. Define a function verify_bios_update for verifying 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. When the current version information of the BIOS and the BIOS update parameters are inconsistent, it is determined that the BIOS update fails, add exception handling, record the error information and perform corresponding processing.
[0067] Obtain 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.
[0068] In an embodiment of the present invention, a request is sent to the server to update parameters such as the IP address of the firmware and the firmware type (BMC or BIOS). Obtain the token, and define a function to obtain the value of the token from the corresponding request header through the request redfish_session_url: str = "https: / / {} / redfish / v1 / SessionService / Sessions", and the code is as follows: def get_session(ip: str, username: str, password: str, url: str =redfish_session_url) -> str: headers = { "Content - Type": "application / json" } json_data = { "UserName": username, "Password": password} response = _make_request(ip, "Get session", "POST", url.format(ip), headers, json=json_data, success_codes=[200, 201]) if response: return response.headers.get("X-Auth-Token", ""), response.json()["Id"] return "", "" Pass in the update parameters, and define the specific update configuration of Redfish by configuring the updated parameters, where link is the static resource address; json_data = { "ImageURI": link, "TransferProtocol": "HTTP", "Oem": { "Public": { "ImageType": "BMC", "PreserveConfig": save, "Reboot": True}}} Execute firmware update: Request the update interface to start updating the firmware.
[0069] def post_update_firmware(ip: str, firmware_type: str, token: str, url: str, json_data: dict) -> str: headers = { "Content-Type": "application / json", "X-Auth-Token": token } response = _make_request(ip, "Update firmware" + firmware_type, "POST", url.format(ip), headers, json=json_data, success_codes=[200, 201, 202, 204]) return response if response el Query the update progress: Request the data in the return value of the previous step to obtain the progress of the firmware update. Set to query the progress every 2s until it reaches 100%, which means the firmware update is completed.
[0070] def get_process(ip:str,token:str,url:str) ->str: headers = { "Content-Type": "application / json", "X-Auth-Token": token } process = 0 while True: time.sleep(2) response = _make_request(ip,"Query upgrade progress","GET", "https: / / "+ip+url, headers, success_codes=[200, 201, 202, 204]) if not response: break else: process = int(response.json()["Oem"]["Public"]["TaskPercentage"][:-1]) if process == 100: break return process Server restart: After the BMC is updated, the service will be automatically restarted. Let the main thread sleep for about 300 seconds to ensure that the BMC has been successfully started, and then perform the next step of updating the BIOS.
[0071] Refer to Figure 6 , Figure 6 is the second detailed flowchart of step S300 of the cross-verification method for the BMC and BIOS adaptability of the server provided by the embodiments of the present invention. Step S300 includes but is not limited to steps S341 to S346. Specifically, 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, a dictionary is formed with the lscpu command as the key and the CPU information returned by the lscpu command as the value; S344: If the lscpu command returns error information, a dictionary is formed with the lscpu command plus an error flag as the key and the error information returned by the lscpu command as the value; S345: The returned dictionary is used to display the execution result of the lscpu command. When the dictionary shows error information, it is determined that the verification of the hardware information fails; S346: Close the SSH connection.
[0072] In some embodiments of the present invention, the adaptability between the BMC and the BIOS that have completed the update operation is ensured through a three-layer verification mechanism. Among them, obtaining the hardware information of the server and performing verification processing on the hardware information includes: creating an SSH client using paramiko.SSHClient(). Calling set_missing_host_key_policy(paramiko.AutoAddPolicy()) to automatically add the host key to avoid connection failure due to an unknown host key. 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, and executes the lscpu command using exec_command('lscpu') to obtain the standard output and standard error output of the command. If the lscpu command returns CPU information, indicating that the command execution is successful, a dictionary is formed with the lscpu command as the key and the CPU information returned by the lscpu command as the value, and the output of lscpu is stored in the dictionary; if the lscpu command returns error information, indicating that the command execution fails, a dictionary is formed with the lscpu command plus an error flag as the key and the error information returned by the lscpu command as the value, and the error information is stored in the dictionary. Finally, call ssh_client.close() to close the SSH connection to ensure that resources are correctly released.
[0073] Use the paramiko library to establish an SSH client, automatically add the host key, connect to the server, and execute the lscpu command to obtain hardware information. Execute the lscpu command to obtain hardware information, and determine whether the verification of the hardware information is successful according to the return result of the command. According to the return result of the command, a dictionary is formed and the execution result is returned. If error information is returned, it is determined that the verification of the hardware information fails. Finally, close the SSH connection to implement the verification processing of the hardware information.
[0074] Reference Figure 7 , Figure 7 is the third detailed flowchart of step S300 of the cross - verification method for the adaptability between BMC and BIOS of the server provided by the embodiments of the present invention. Step S300 includes but is not limited to steps S351 to S355. Specifically, S351: Obtain the current version information of the BMC through the redfish interface; S352: Verify the consistency between the current version information of the BMC and the BMC update parameters. When the current version information of the BMC is consistent with the BMC update parameters, it is determined that the BMC update is successful; S353: Configure an environment for automatically starting the local chrome browser through selenium, start chrome and automatically input the account and password of the BMC; S354: Obtain the return information within a preset time and determine the login status of the BMC according to the return information; S355: 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 times 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.
[0075] 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 - start method in the interface verification step to verify whether the BMC web is normal (the servers of the BMC basically interact with users through the web server).
[0076] In some embodiments of the present invention, a three - layer verification mechanism is used to ensure the adaptability between the updated BMC and BIOS. Among them, verifying the performance of the web server of the first updated version of the BMC through web self - start includes: Directly obtain the current version information of the BMC through the redfish interface https: / / {} / redfish / v1 / Systems / 1. An object with the key of bmc_version will be obtained, so that the current version information of the BMC can be obtained. Obtain the BMC update parameters and judge the consistency between the current version information of the BMC and the BMC update parameters. When the current version information of the BMC is consistent with the BMC update parameters, it is determined that the BMC update is successful; Configure an environment for automatically launching the local Chrome browser through Selenium, launch Chrome and automatically enter the BMC account and password, obtain the return information within a preset time, and determine the BMC login status based on the return information; Whether the login is successful can be determined by the return value, and in turn, it can also be verified whether the BMC web server is providing services normally.
[0077] When the return information is the flag element for successful login, it indicates that the BMC login is normal and the performance of the BMC web server is normal; when the return information is None or the return 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 abnormal.
[0078] Obtain the current version information of the BMC through the Redfish interface, verify whether the BMC update is successful, use Selenium to automatically log in to the BMC's Web interface, and determine the BMC login status and Web server performance based on the return information.
[0079] In an embodiment of the present invention, the method for verifying the performance of the web server of the first updated version of the BMC through web self-start includes: verifying whether the BMC web server is normal. If it is normal, the browser can be opened and logged in; otherwise, it cannot. 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 enter the website address and log in. The following is an explanation of the code: Function parameters ip_address: The IP address of the target website.
[0080] login_url: The URL path of the login page.
[0081] chromedriver_path: The path of the ChromeDriver executable file, which is used to launch the Chrome browser.
[0082] username: The login username.
[0083] password: The login password.
[0084] success_indicator: The selector of the flag element after successful login (such as the selector of the user avatar), which is used to confirm whether the login is successful.
[0085] Detailed step description Set up WebDriver: Configure Chrome options using setup_chrome_options(). Create a Service object and specify the path to ChromeDriver. Create a Chrome WebDriver instance using webdriver.Chrome(service=service,options=chrome_options).
[0086] Access the login page: Construct the full URL using driver.get("https: / / "+ip_address + login_url) and access the login page. Call handle_certificate_error(driver) to handle possible https certificate errors.
[0087] Enter username and password and submit the form: Locate the username input box using driver.find_element(By.ID, "usrname").send_keys(username) and enter the username.
[0088] Locate the password input box using driver.find_element(By.ID, "password").send_keys(password) and enter the password.
[0089] Locate the login button using driver.find_element(By.ID, "btn-login").click() and click to submit the form.
[0090] Use time.sleep(2) to wait for a few seconds for the page to finish loading.
[0091] Verify the login status: Use WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.CSS_SELECTOR, success_indicator))) to wait up to 10 seconds until the success login indicator element appears.
[0092] If the indicator element is successfully found, log "Login successful" and return the current WebDriver instance.
[0093] If the flag element cannot be found or a timeout occurs, record the error message "Login failed or the flag indicating successful login was not found", and return None.
[0094] Exception handling: During the whole process, if any exception occurs (such as network problems, page elements not found, etc.), record the error log, ensure that the browser is closed (by calling driver.quit()), and then return None.
[0095] Verify the performance of the web server of the first updated version of BMC through web self - startup. The whole process is an automated operation, thus shortening the maintenance time and improving the overall operation efficiency and service quality of the server.
[0096] It should be recognized that the method steps in the embodiments of the present invention can be implemented or carried out by computer hardware, a combination of hardware and software, or 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 the 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. In addition, for this purpose, the program can run on a dedicated integrated circuit programmed for this purpose.
[0097] 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 the context. The processes described herein (or variations and / or combinations thereof) can be executed under the control of one or more computer systems configured with executable instructions and can be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) executed commonly on one or more processors, by hardware, or a combination thereof. The computer program includes a plurality of instructions executable by one or more processors.
[0098] Further, the method can be implemented in any type of computing platform operatively connected to a suitable one, including but not limited to personal computers, minicomputers, mainframes, workstations, network or distributed computing environments, separate or integrated computer platforms, or communicating with charged particle tools or other imaging devices, etc. Aspects of the present invention can be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into the computing platform, such as a hard disk, optical read and / or write storage medium, RAM, ROM, etc., such that it can be read by a programmable computer and, when read by the storage medium or device, can be used to configure and operate the computer to perform the processes described herein. Additionally, the machine-readable code, or portions thereof, can be transmitted via a wired or wireless network. When such media includes instructions or programs that implement the above-described steps 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.
[0099] A computer program can be applied to input data to perform the functions described herein, thereby transforming the input data to generate output data stored in 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 transformed data represents physical and tangible objects, including a specific visual depiction of the physical and tangible objects generated on a display.
[0100] As described above, these are only the preferred embodiments of the present invention, and the present invention is not limited to the above-described embodiments. As long as the same means are used to achieve the technical effects of the present invention, 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, there can be various different modifications and variations to its technical solutions and / or implementation manners.
Claims
1. Cross - verification method for the adaptability of the BMC and BIOS of a server, characterized in that, Including: 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, where the firmware resource library stores m*n combinations of BMC and BIOS versions; S200: The server obtains the first version of the BMC and BIOS combination from the firmware resource library, and sequentially performs update operations on the first version of the BMC and BIOS to obtain the first updated version of the BMC and BIOS; S300: Obtain and verify the version information of the first updated version of the BIOS through the serial port, obtain the hardware information of the server and perform verification processing on the hardware information, and verify the performance of the web server of the first updated version of the BMC through web self-starting to verify the compatibility of the first updated version of the BMC and BIOS, and record the first adaptation result; S400: Traverse the m*n-1 combinations of BMC and BIOS versions stored in the firmware resource library, respectively perform update operations on the m*n-1 versions of BMC and BIOS, and respectively verify the compatibility of the m*n-1 updated versions of BMC and BIOS, and record the m*n-1 adaptation results; S500: Form a BMC and BIOS version compatibility list according to the first adaptation result and the m*n-1 adaptation results.
2. The cross-verification method for the BMC and BIOS adaptability of the server according to claim 1, wherein The step S300 includes: S310: When the version information verification of the first updated version of the BIOS is successful, the hardware information verification is successful, and the performance verification of the web server of the first updated version of the BMC is successful, determine that the first updated version of the BMC and BIOS are compatible, and record the first adaptation result as the first updated version of the BMC and BIOS are compatible; 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 BIOS are not compatible, and record the first adaptation result as the first updated version of the BMC and BIOS are not compatible.
3. The cross-validation method for the BMC and BIOS adaptability of the server according to claim 1, characterized in that, The step S100 includes: S110: Create a static folder to store firmware version files, and copy the version files of m versions of BMC and the version files of n versions of BIOS to be verified to the static folder; 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 version files of m versions of BMC and the version files of n versions of BIOS to be verified, and each hyperlink corresponds to an IP address; S130: Determine the download list of firmware version files by accessing the IP address, and download the version files of BMC and BIOS through the download list of firmware version files; S140: Directly download and pull the version files of m versions of BMC and the version files of n versions of BIOS to be verified through network requests using the http protocol.
4. The cross-verification method for the BMC and BIOS adaptability of the server according to claim 3, characterized in that The method further includes: S101: Define a preset data parsing function, the data parsing function is fetch_versions_from_url, and the url represents the address of the target web page; 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 firmware version information; S103: Create a first list and a second list, the first list is used to store the parsed version file names of BMC, and the second list is used to store the parsed version file names of BIOS; S104: Traverse all in the firmware version information in the HTML document tag, the tag represents a hyperlink; 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 whether the version file name belongs to the BMC version or the BIOS version according to 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.
5. The cross - verification method for the adaptability between the BMC and BIOS of the server according to claim 1, wherein The step S200 includes: S210: Send an update request to the server, the update request carries the firmware type that needs to perform the update operation and the corresponding IP address, and the firmware type includes BMC and BIOS; S220: Determine the target firmware that needs to perform the update operation according to the update request, and use update parameters to define the update configuration of the redfish interface, and the update parameters include BMC update parameters and BIOS update parameters; S230: Perform an update operation on the target firmware through the redfish interface based on the update request and the update parameters; S240: Query the update progress information of the target firmware through an HTTP GET request, and generate an update progress bar according to the update progress information of the target firmware; S250: Restart the server after the target firmware completes the update operation.
6. The cross-validation method for the BMC and BIOS adaptability of the server according to claim 5, wherein The step S300 includes: S331: Obtain the data information of the serial port. When the server restarts, send a delete keyboard command to the server through the serial port to make the server enter the BIOS interface; S332: Define the def read_from_serial_until function, and the def read_from_serial_until function is used to read the data information of the serial port to capture characters to determine the BIOS version information; S333: Grab the BIOS Version field through the said 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 is consistent with the BIOS update parameters, it is determined that the BIOS update is successful.
7. The cross - verification method for the BMC and BIOS adaptability of the server according to claim 5, characterized in that, The step S300 further 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, form a dictionary with the lscpu command as the key and the CPU information returned by the lscpu command as the value; S344: If the lscpu command returns error information, form a dictionary with the lscpu command plus the error flag as the key and the error information returned by the lscpu command as the value; S345: Return the dictionary to display the execution result of the lscpu command. When the dictionary displays error information, it is determined that the hardware information verification fails; S346: Close the SSH connection.
8. The cross - verification method for the BMC and BIOS adaptability of the server according to claim 5, characterized in that, The step S300 further includes: S351: Obtain the current version information of the BMC through the redfish interface; S352: Verify the consistency between the current version information of the BMC and the BMC update parameters. When the current version information of the BMC is consistent with the BMC update parameters, it is determined that the BMC update is successful; S353: Configure an environment for automatically invoking the local chrome browser to start through selenium, start chrome and automatically input the account and password of the BMC; S354: Obtain the return information within a preset time and determine the login status of the BMC according to the return information; S355: 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 times 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.
9. A computer device, comprising a memory and a processor, characterized in that, When the processor executes the computer program stored in the memory, it implements the method according to any one of claims 1 to 8.
10. A computer-readable storage medium storing program instructions thereon, characterized in that, When the program instructions are executed by the processor, it implements the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Server starting method and device, equipment and storage medium
CN114428963A
Verification method and device for server
CN115618366A
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
Method for safely updating BIOS firmware of server by BMC (Baseboard Management Controller)
CN118733091A
Cited By
Firmware updating method and device of IOS system and storage medium
CN121635937A