Network service switching method and system, server, electronic device and storage medium

Seamless switching of BMC network services is achieved through shared memory and signal interrupt mechanisms, solving the problem of network service anomalies during BMC firmware upgrades and ensuring real-time monitoring of upgrade and restart status and efficient resource utilization.

CN120567654BActive Publication Date: 2025-09-26INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511072642.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-31
Publication Date
2025-09-26
Estimated Expiration
2045-07-31

AI Technical Summary

Technical Problem

During the baseboard management controller (BMC) firmware upgrade process, the lack of intelligent failover capabilities when network service anomalies occurred prevented operations and maintenance personnel from monitoring the upgrade status in real time, and resulted in severe contention for CPU and memory resources.

Method used

The control unit obtains the BMC status information and uses shared memory and signal interrupt mechanisms to achieve seamless switching of network services. The control unit takes over the network port resources and starts the first network service process, providing real-time status feedback. After the BMC restarts, it releases resources through an interrupt signal and restores communication with the second network service process.

Benefits of technology

This ensures the continuity and stability of network services during BMC firmware upgrades, avoids hardware restart dependency, and ensures that operations and maintenance personnel can monitor upgrade and restart status in real time, reducing resource conflicts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120567654B_ABST
    Figure CN120567654B_ABST
Patent Text Reader

Abstract

The present disclosure provides a network service switching method and system, server, electronic device, and storage medium, wherein a control unit obtains status information of a baseboard management controller; in response to the baseboard management controller entering an upgrade mode or a restart state, the control unit reads the upgrade status information or restart status information of the baseboard management controller, and provides the upgrade status information or restart status information to an external request unit through a first network service process of the control unit; when the baseboard management controller restarts, the baseboard management controller initializes a second network service process and sends control information to the control unit; in response to the control information, the control unit terminates the first network service process and releases network port resources, and the baseboard management controller resumes network communication with the external request unit through the second network service process. Compared with related technologies, the present disclosure can realize that when the baseboard management controller fails, the control unit replaces the execution of the network service process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of server technology, and in particular to a network service switching method and system, a server, an electronic device, and a storage medium. Background Art

[0002] Currently, when performing a firmware upgrade on a Baseboard Management Controller (BMC), it is necessary to enter a dedicated upgrade mode and load a memory file system to run a customized Web service to provide feedback on the upgrade progress. During the restart phase after the upgrade is complete (usually lasting 3-5 minutes), the BMC needs to shut down a temporary Web service for initialization, during which time no status information can be obtained from the outside. Operations and maintenance personnel can only passively wait for the BMC to resume service and cannot distinguish between upgrade failures or restart delays. In addition, the BMC simultaneously executes firmware flashing and Web responses in a memory file system environment, resulting in contention for CPU and memory resources. In related technologies, when the BMC network service is abnormal, it relies on hardware restart recovery and lacks intelligent fault switching capabilities. Therefore, how to address the above-mentioned defects of the BMC during the firmware upgrade process is a technical problem that needs to be solved urgently. Summary of the Invention

[0003] The present disclosure provides a network service switching method and system, a server, an electronic device, and a storage medium, which are mainly intended to solve the problem that when a BMC firmware upgrade is performed, network service anomalies occur and the only option is to restart the hardware.

[0004] According to a first aspect of the present disclosure, a network service switching method is provided, comprising:

[0005] The control unit obtains status information of the baseboard management controller, the status information including upgrade status information and restart status information;

[0006] The control unit reads upgrade status information or restart status information of the baseboard management controller in response to the baseboard management controller entering the upgrade mode or restart state, and provides the upgrade status information or restart status information to the external request unit through the first network service process of the control unit;

[0007] When the baseboard management controller is restarted, it initializes the second network service process and sends control information to the control unit;

[0008] The control unit responds to the control information, ends the first network service process and releases the network port resources, and the baseboard management controller resumes network communication with the external demand unit through the second network service process.

[0009] Optionally, the control unit obtains status information of the baseboard management controller, including:

[0010] The control unit creates a shared memory after startup, the baseboard management controller writes status information to the shared memory, and the control unit obtains the status information through the shared memory;

[0011] And / or, the control unit configures a signal interrupt mechanism to monitor the status information sent by the baseboard management controller in real time based on the interrupt signal.

[0012] Optionally, the network service switching method further includes:

[0013] After the baseboard management controller enters the upgrade mode, the control unit initializes the first network service process.

[0014] Optionally, initializing the first network service process includes:

[0015] The control unit takes over the network port resources of the baseboard management controller;

[0016] The control unit creates an upgrade progress query thread to provide upgrade status information to the external request unit when the baseboard management controller enters the upgrade mode.

[0017] Optionally, reading the upgrade status information or the restart status information of the baseboard management controller, and providing the upgrade status information or the restart status information to the external request unit through the first network service process of the control unit includes:

[0018] The control unit obtains the upgrade status information through the shared memory and transmits the information to the external demand unit using the first network service process;

[0019] The control unit determines whether the baseboard management controller upgrade is completed based on the upgrade status information;

[0020] After the baseboard management controller upgrade is completed, the control unit sends the restart status information to the external demand unit through the first network service process.

[0021] Optionally, the control unit receives an interrupt signal sent by the baseboard management controller when entering the upgrade mode;

[0022] The control unit initializes the first network service process within a preset time period in response to the interrupt signal.

[0023] Optionally, the status information also includes: a heartbeat signal;

[0024] A heartbeat signal is maintained between the control unit and the baseboard management controller, and the control unit monitors the operating status of the baseboard management controller based on the heartbeat signal.

[0025] Optionally, the control unit determines whether the baseboard management controller is in a fault state based on the heartbeat signal;

[0026] If it is in a fault state, the control unit activates the first network service process to provide network services to the external demand unit.

[0027] Optionally, the heartbeat signal includes a system heartbeat signal and a network service heartbeat signal;

[0028] The control unit monitors the operating system status of the baseboard management controller through the system heartbeat signal;

[0029] The control unit monitors the network service status of the second network service process through the network service heartbeat signal.

[0030] Optionally, the network service switching method further includes:

[0031] The control unit monitors whether the network service heartbeat signal is normal;

[0032] When the network service heartbeat signal is abnormal, the control unit activates the first network service process to provide network services to the external demand unit.

[0033] Optionally, the network service switching method further includes:

[0034] The control unit detects a restart target corresponding to the restart control instruction in response to the restart control instruction, where the restart target is a baseboard management controller or a second network service process;

[0035] When it is determined that the network service heartbeat signal is normal, the control unit ends the first network service process and releases the network port resources.

[0036] Optionally, after the control unit fails to detect the system heartbeat signal and the network service heartbeat signal, the control unit performs network communication with the external demand unit through the first network service process.

[0037] According to a second aspect of the present disclosure, there is provided a network service switching system, comprising: a baseboard management controller, a control unit, and an information interaction module;

[0038] The control unit exchanges status information with the baseboard management controller through the information interaction module. The status information includes upgrade status information and restart status information.

[0039] The control unit is configured to, in response to the baseboard management controller entering an upgrade mode or a restart state, read status information and provide information transmission to the external demand unit through the first network service process; after the baseboard management controller completes the restart, the control unit receives control information sent by the baseboard management controller to terminate the first network service process and release network port resources;

[0040] The baseboard management controller is configured to execute the second network service process, generate status information, and write the status information into the information interaction module.

[0041] Optionally, the information interaction module includes: a shared memory, a signal bus connected between the control unit and the baseboard management controller;

[0042] The signal bus transmits status information through the signal interrupt mechanism.

[0043] Optionally, a heartbeat signal is maintained between the control unit and the baseboard management controller; the heartbeat signal includes a system heartbeat signal and a network service heartbeat signal;

[0044] The control unit monitors the operating system status of the baseboard management controller through the system heartbeat signal;

[0045] The control unit monitors the network service status of the second network service process through the network service heartbeat signal.

[0046] Optionally, the network service switching system further includes: a fault detection module;

[0047] The fault detection module is configured to determine that the baseboard management controller is faulty when the system heartbeat signal and the network service heartbeat signal are continuously lost for more than a preset time.

[0048] According to a third aspect of the present disclosure, a server is provided, wherein the server includes the network service switching system described in the second aspect.

[0049] According to a fourth aspect of the present disclosure, there is provided an electronic device, including:

[0050] at least one processor; and

[0051] a memory communicatively connected to the at least one processor; wherein,

[0052] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the network service switching method described in the first aspect.

[0053] According to a fifth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the network service switching method described in the first aspect.

[0054] According to a sixth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the network service switching method as described in the first aspect is implemented.

[0055] The present disclosure provides a network service switching method and system, a server, an electronic device and a storage medium, and relates to the field of server technology. Compared with the related art, the present disclosure transmits status information to the control unit through shared memory and signal interrupt mechanism when the baseboard management controller enters the upgrade mode or actively restarts. The control unit immediately takes over the network port resources and starts the first network service process, reads the upgrade progress in the shared memory, and provides real-time status feedback to the outside through the first network service of the control unit; after the baseboard management controller completes the restart, it notifies the control unit through an interrupt signal, triggering the exit of the first network service process and the release of the network port resources, so that the second network service process of the baseboard management controller seamlessly resumes external communication.

[0056] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.

[0058] Figure 1 A flowchart of a network service switching method provided by an embodiment of the present disclosure;

[0059] Figure 2 A schematic diagram of the structure of a network service switching system provided by an embodiment of the present disclosure;

[0060] Figure 3 A schematic diagram of the structure of another network service switching system provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0061] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0062] The following describes the network service switching method and system, server, electronic device, and storage medium according to embodiments of the present disclosure with reference to the accompanying drawings.

[0063] Figure 1 A flowchart of a network service switching method provided by an embodiment of the present disclosure is provided.

[0064] like Figure 1 As shown, the method comprises the following steps:

[0065] Step 101: A control unit obtains status information of a baseboard management controller, where the status information includes upgrade status information and restart status information.

[0066] In the embodiments of the present disclosure, the control unit is a microcontroller unit (MCU), a single-chip computer that integrates a processor core, memory (RAM / ROM), and peripheral interfaces (such as GPIO, SPI, and I2C). It is often used in embedded systems to perform specific control tasks. The baseboard management controller (BMC) is a core component responsible for remote management and monitoring of devices such as servers, and performs important functions such as firmware upgrades and status monitoring. In this method, the control unit (MCU) needs to obtain status information from the baseboard management controller (BMC), where this status information specifically includes upgrade status information and restart status information. To achieve this, after startup, the MCU first runs a logic program or real-time operating system (RTOS) and creates shared memory for data exchange with the BMC. This shared memory, as the core area for data exchange between the two, is divided into specific memory areas with clear parameters such as size, starting address, and access rights. The corresponding data storage format is also set to avoid conflicts when reading and writing simultaneously, ensuring data integrity and accuracy, and laying the foundation for the BMC to write status information and the MCU to read status information. The MCU also initializes interrupt processing and configures General Purpose Input / Output (GPIO) interrupts, enabling it to receive real-time status information from the BMC. This includes interrupt signals sent when the BMC enters upgrade mode and after a reboot completes. This real-time sensing mechanism ensures the MCU accurately understands the BMC status. Specifically, for upgrade status information, after entering upgrade mode, the BMC writes relevant information (such as whether it has entered upgrade mode, the current upgrade progress (including firmware write progress, verification progress, and whether the upgrade has completed (i.e., reached 100%)) to shared memory in real time. The MCU periodically reads the corresponding areas of shared memory to obtain this upgrade status information. For reboot status information, when the BMC performs a reboot, it writes the reboot start signal, the initialization status during the reboot process (such as hardware initialization and driver loading), a flag indicating whether the reboot is complete, and any reboot exceptions (such as critical driver loading failure) to the MCU via GPIO interrupt signals. The MCU obtains the BMC's reboot status information by reading shared memory or responding to interrupt signals. Through the above-mentioned shared memory data interaction and real-time response to interrupt signals, the control unit (MCU) can accurately and timely obtain the BMC upgrade status information and restart status information, laying the foundation for subsequent uninterrupted network services based on this status information.

[0067] Step 102 : In response to the baseboard management controller entering the upgrade mode or restart state, the control unit reads the upgrade state information or restart state information of the baseboard management controller, and provides the upgrade state information or restart state information to the external request unit through the first network service process of the control unit.

[0068] In the disclosed embodiments, the baseboard management controller (BMC) is the core component responsible for remote server management and monitoring. Its upgrade mode refers to the specific operating state the BMC enters to perform firmware upgrades. In this state, the BMC stops some non-essential services and loads a lightweight file system (such as RAMFS) to focus on the upgrade task. The reboot state refers to the process by which the BMC reboots after completing a firmware upgrade or other operation to implement the new configuration. When the BMC enters upgrade mode or reboot state, the control unit (MCU) responds to this state change through a pre-defined mechanism, reads the corresponding status information, and provides this information to external requesting units (such as remote management terminals and monitoring systems) through its own first network service process. Specifically, efficient communication is achieved between the MCU and BMC through shared memory and interrupt handling mechanisms: shared memory, as the core area for data interaction between the two, has been divided into specific areas and access permissions and data formats set during initialization to ensure that the BMC can stably write upgrade status information (such as upgrade progress, firmware writing stage, verification results, etc.) and restart status information (such as restart start flag, initialization link status, whether an abnormality occurs, etc.); at the same time, the MCU will be configured with a general input and output (GPIO) interrupt function. When the BMC enters upgrade mode or starts to restart, it will notify the MCU through a hardware interrupt signal or a specific flag bit in the shared memory, triggering the MCU's response mechanism. Upon receiving a signal indicating that the BMC has entered upgrade mode, the MCU immediately launches the first network service process—a web service running on the MCU that supports communication with external request units via standard web interfaces (such as RESTful APIs). The MCU periodically reads upgrade status information written by the BMC from shared memory, parses it, and then reports it to the external request unit through the first network service process. For example, if the upgrade progress is less than 100%, the MCU reports "Upgrade in progress" along with the progress details. When the upgrade progress reaches 100%, the MCU reports "Upgrade completed, system restarting." While the BMC is in the rebooting state, the MCU also continuously retrieves reboot status information from shared memory, such as whether hardware initialization is complete and driver loading is successful. This information is then fed back to the external request unit in real time through the first network service process, ensuring that the external request unit has real-time information on the BMC reboot progress. This approach, in which the control unit responds to status changes and proactively provides status information, avoids the network service interruption associated with traditional BMC upgrades or reboots, ensuring continuous BMC status monitoring by the external request unit.

[0069] Step 103 : When the baseboard management controller is restarted, it initializes the second network service process and sends control information to the control unit.

[0070] In the embodiments of the present disclosure, the second network service process of the baseboard management controller (BMC) refers to the service process used by the BMC itself for external network communication. It is responsible for functions such as receiving external management commands and providing feedback on device status. When the BMC restarts, the second network service process needs to be initialized to quickly restore external network communication after the restart. This initialization process follows a specific startup sequence and covers several key steps: first, hardware initialization to ensure that network-related hardware (such as the network interface card) is functioning properly; then, driver loading is performed to load the drivers required by the network devices, providing underlying support for network services; then, network interface parameters are configured, including the IP address, subnet mask, and gateway. These parameters are the basis for establishing a connection between the BMC and the external network; finally, the network protocol stack (such as the TCP / IP protocol stack) is started, enabling the BMC to follow network communication rules for data transmission. Through this series of initialization operations, the second network service process is able to operate normally and prepare for the restoration of network services after the BMC restarts.

[0071] During the initialization process for the second network service process, the BMC also sends control information to the control unit (MCU). This control information is primarily used to coordinate resource usage between the BMC and MCU, ensuring a smooth transition of network services. During the BMC restart, the MCU's first network service process may temporarily take over network port resources to provide network services. When the BMC's second network service process is about to complete initialization and be put into operation, the BMC needs to send control information to the MCU through a preset communication mechanism (such as a GPIO interrupt signal or a specific flag in shared memory) to notify the MCU to release the network port resources. This allows the network port resources to return from the temporary MCU takeover state to normal shared mode, avoiding resource conflicts and ensuring that the BMC's second network service process can smoothly communicate with the external network after startup, achieving seamless network service switching.

[0072] Step 104 : The control unit responds to the control information, ends the first network service process and releases the network port resources, and the baseboard management controller resumes network communication with the external demand unit through the second network service process.

[0073] In an embodiment of the present disclosure, after the BMC completes the initialization processing of the second network service process during the restart process, it will send control information to the control unit (MCU) - this control information can be transmitted through a hardware interrupt signal (such as a GPIO interrupt) or a specific flag bit in the shared memory. Its core purpose is to notify the MCU: the BMC has the ability to restore network communication, and the MCU needs to end the temporarily provided network service and release related resources. After receiving the above control information, the control unit (MCU) will immediately respond and perform corresponding operations. First, the MCU will terminate the first network service process running on itself - this process is a temporary Web service started by the MCU when the BMC enters the upgrade mode or restart state, and is used to provide the upgrade status information or restart status information of the BMC to the external demand unit. Its termination process will orderly close the network connection, release the memory occupied by the process and other resources to ensure the smooth termination of the service. Secondly, the MCU will release network port resources: Network port resources are network interface resources shared by the MCU and BMC. During a BMC upgrade or restart, to ensure that the MCU can communicate with the outside world through the first network service process, network port resources will be tilted towards the MCU (for example, by allocating more time slices through scheduling strategies such as time division multiplexing). When the MCU responds to control information, it will return the scheduling authority of the network port resources to the BMC, restoring the network port to normal sharing mode, avoiding resource conflicts, and ensuring that the BMC can successfully use the network port for network communication. After the control unit (MCU) completes the termination of the first network service process and releases the network port resources, the baseboard management controller (BMC) resumes network communication with the external request unit through the initialized second network service process. At this time, the BMC's second network service process will re-establish the connection with the external demand unit based on the configured network interface parameters (such as IP address, subnet mask, gateway, etc.) and the started network protocol stack (such as TCP / IP protocol stack), receive and process external management instructions, and feedback the real-time status of the server, thereby realizing seamless switching of network services from temporary takeover of the MCU to normal operation of the BMC, ensuring the continuity and stability of the entire system's network services.

[0074] The present disclosure provides a network service switching method. Compared to related technologies, the present disclosure transmits status information to a control unit via shared memory and a signal interrupt mechanism when a baseboard management controller enters upgrade mode or actively restarts. The control unit immediately takes over network port resources and starts a first network service process, reads the upgrade progress from shared memory, and provides real-time status feedback to the outside world through the control unit's first network service. After the baseboard management controller completes the restart, it notifies the control unit via an interrupt signal, triggering the exit of the first network service process and the release of network port resources, allowing the baseboard management controller's second network service process to seamlessly resume external communications.

[0075] As an implementable method of this embodiment, "the control unit obtains the status information of the baseboard management controller" includes but is not limited to the following methods: the control unit creates a shared memory after startup, the baseboard management controller writes status information to the shared memory, and the control unit obtains the status information through the shared memory; and / or, the control unit configures a signal interrupt mechanism and monitors the status information sent by the baseboard management controller in real time based on the interrupt signal.

[0076] Specifically, as a feasible method for obtaining BMC status information, the control unit (MCU) can use shared memory. Specifically, after startup, the MCU runs a logic program or a real-time operating system (RTOS) and creates shared memory for data exchange with the BMC. This shared memory, the core area for data exchange between the two, is initially partitioned into specific memory areas with specified parameters such as size, starting address, and access permissions. The corresponding data storage format is also configured. This process effectively prevents conflicts when the MCU and BMC read and write data simultaneously, ensuring the integrity and accuracy of status information. When the BMC status changes (such as entering upgrade mode or starting a reboot), the BMC writes the corresponding status information (such as upgrade progress and reboot stage) to the designated area of ​​shared memory in real time. The MCU then obtains the BMC status information by reading the corresponding area of ​​shared memory. This approach leverages the efficiency of memory read and write operations and ensures the timely transmission of status information.

[0077] The control unit (MCU) can also obtain BMC status information by configuring a signal interrupt mechanism. The MCU initializes interrupt processing, specifically configuring the General Purpose Input / Output (GPIO) interrupt function, enabling it to receive real-time status information from the BMC. When the BMC enters upgrade mode, completes a reboot, or undergoes other critical status changes, it sends specific interrupt signals to the MCU. For example, entering upgrade mode triggers a GPIO interrupt, and completing a reboot triggers another specific GPIO interrupt. Upon receiving these interrupt signals, the MCU immediately suspends non-critical tasks, prioritizes responding to the interrupt, and processes related operations, thereby monitoring and obtaining status information from the BMC in real time. This mechanism enables the MCU to quickly detect BMC status changes, further improving the real-time nature of status information acquisition. It is worth noting that these two methods can be used independently or in combination. When combined, shared memory stores detailed status information, while the signal interrupt mechanism triggers the MCU to read this information. This collaborative approach enables the control unit to more efficiently and accurately obtain BMC status information, laying a solid foundation for providing uninterrupted network services based on this status information.

[0078] As an implementation method of this embodiment, in order to enable the control unit to better perform external network services, the following method can be adopted but not limited to: "The control unit initializes the first network service process after the baseboard management controller enters the upgrade mode."

[0079] In a further implementation manner, "initializing the first network service process" includes but is not limited to: the control unit takes over the network port resources of the baseboard management controller; the control unit creates an upgrade progress query thread to provide upgrade status information to the external demand unit when the baseboard management controller enters the upgrade mode.

[0080] In a further implementation, when initializing the first network service process, it can be adopted but not limited to: "the control unit receives the interrupt signal sent by the baseboard management controller to enter the upgrade mode; the control unit responds to the interrupt signal within a preset time length and initializes the first network service process."

[0081] Specifically, initializing the first network service process involves the control unit taking over the BMC's network port resources. Network port resources are shared by the MCU and BMC. During normal BMC operation, these resources are primarily used by the BMC's second network service process. However, when the BMC enters upgrade mode, the MCU takes over network port resources to ensure smooth external communication between the MCU's first network service process. This can be achieved through specific scheduling strategies (such as time-division multiplexing and priority scheduling). For example, more network port time slices are allocated to the MCU to prioritize network data transmission, avoid resource conflicts, and provide a network foundation for the operation of the first network service process. The control unit also creates an upgrade progress query thread, specifically dedicated to processing external request units' requests for BMC upgrade status information when the BMC enters upgrade mode. Once created, this thread periodically reads upgrade status information written by the BMC (such as firmware write progress and verification progress) from the shared memory between the MCU and BMC and feeds this information back to the external request unit through the first network service process, ensuring real-time updates of the upgrade status.

[0082] In a more specific embodiment, the initialization of the first network service process depends on the control unit's response to the BMC interrupt signal. When the BMC enters upgrade mode, it sends a specific interrupt signal to the MCU via the general-purpose input / output (GPIO). This signal serves as a real-time notification of the BMC status change. Upon receiving this interrupt signal, the MCU immediately triggers a response mechanism and completes the initialization of the first network service process within a preset duration. This preset duration is based on the characteristics of the real-time operating system (RTOS) and ensures that the MCU can quickly complete service preparation before the BMC suspends its own network services due to upgrade mode, achieving seamless network service integration, avoiding management interruptions caused by service switching delays, and ensuring that external demand units can continuously monitor the BMC upgrade status.

[0083] As an implementation method of this embodiment, "reading the upgrade status information or restart status information of the baseboard management controller, and providing the upgrade status information or restart status information to the external demand unit through the first network service process of the control unit" includes but is not limited to: the control unit obtains the upgrade status information through the shared memory, and transmits it to the external demand unit using the first network service process; the control unit determines whether the upgrade of the baseboard management controller is completed based on the upgrade status information; after the upgrade of the baseboard management controller is completed, the control unit sends the restart status information to the external demand unit through the first network service process.

[0084] Specifically, the control unit (MCU) first obtains the BMC's upgrade status information through shared memory. Shared memory is the core area for data exchange between the MCU and BMC. It is initialized upon MCU startup. This involves dividing specific memory areas, defining the size, starting address, and access permissions, and setting the data storage format to avoid read-write conflicts and ensure information integrity and accuracy. When the BMC enters upgrade mode, it continuously writes real-time upgrade status information (such as firmware write progress, verification progress, and whether write errors have occurred) to a designated area of ​​shared memory. The MCU periodically reads this area to accurately obtain this upgrade status information and immediately transmits it to the external request unit using the first network service process, allowing the external unit to obtain real-time information on the BMC's upgrade status. For example, when the upgrade progress reaches 30%, the first network service process will provide external feedback, saying "Upgrade in progress, current progress 30%."

[0085] On this basis, the control unit (MCU) will determine whether the BMC upgrade is complete based on the obtained upgrade status information. The judgment is mainly based on whether the upgrade progress has reached 100%. If the upgrade progress is displayed as 100% and there is no error information, the BMC upgrade is considered complete. After confirming that the BMC upgrade is complete, since the BMC will enter the restart state to allow the upgraded firmware to take effect, the control unit (MCU) will continue to obtain the BMC restart status information (such as whether the restart has started, the hardware initialization status during the restart process, whether the driver loading is normal, and whether there are any restart abnormalities) through shared memory or interrupt signals. This restart status information is promptly sent to the external demand unit through the first network service process, such as feedback "The upgrade is complete, the system is restarting, and it is currently in the hardware initialization stage." This ensures that the external demand unit can fully track the entire process of the BMC from upgrade completion to restart effectiveness, avoiding management misjudgments due to information gaps.

[0086] As an implementation of this embodiment, the status information further includes: a heartbeat signal; the heartbeat signal is maintained between the control unit and the baseboard management controller, and the control unit monitors the operating status of the baseboard management controller based on the heartbeat signal.

[0087] In a further embodiment, "the control unit determines whether the baseboard management controller is in a fault state based on the heartbeat signal; if it is in a fault state, the control unit enables the first network service process to provide network services to the external demand unit."

[0088] In a further embodiment, the heartbeat signal includes a system heartbeat signal and a network service heartbeat signal; the control unit monitors the operating system status of the baseboard management controller through the system heartbeat signal; the control unit monitors the network service status of the second network service process through the network service heartbeat signal.

[0089] Specifically, the heartbeat signal contained in the status information is an important signal for maintaining real-time communication and monitoring each other's status between the control unit and the baseboard management controller (BMC). The MCU, a single-chip computer that integrates a processor core, memory (RAM / ROM), and peripheral interfaces (such as GPIO, SPI, etc.), is responsible for temporarily taking over network services in specific scenarios; the BMC is a core component for remote management and monitoring of servers, and its normal operation depends on a stable operating system and network services. In this embodiment, a heartbeat signal is continuously maintained between the control unit (MCU) and the baseboard management controller (BMC). Through this periodic signal interaction, the MCU can monitor the operating status of the BMC in real time, ensuring timely response when an anomaly occurs in the BMC.

[0090] Furthermore, heartbeat signals specifically include system heartbeat signals and network service heartbeat signals. The system heartbeat signal primarily reflects the status of the BMC's operating system (OS). The BMC's OS is responsible for coordinating hardware resources and running various services, and its stable operation is essential for the BMC's functionality. By receiving and monitoring the system heartbeat signal, the control unit (MCU) can determine whether the BMC's OS is operating normally. If the system heartbeat signal is transmitted periodically and stably, the OS is operating normally; if the signal is interrupted or abnormal, it may indicate an OS failure. The network service heartbeat signal is related to the BMC's second network service process. This second network service process is the BMC's own service process for network communication with external request units (such as remote management terminals and monitoring systems). It is responsible for receiving commands and providing status feedback. By monitoring the network service heartbeat signal, the control unit (MCU) can monitor the operating status of the second network service process in real time. A normal signal indicates stable network service operation, while an abnormal signal indicates a possible network service interruption or failure.

[0091] On this basis, the control unit (MCU) will determine whether the baseboard management controller (BMC) is in a faulty state based on the aforementioned heartbeat signal. When the MCU detects an abnormal system heartbeat signal (such as not being received for a long time) or an interruption in the network service heartbeat signal, it determines that the BMC is in a faulty state - this may be due to a crash of the BMC's operating system or a failure of the second network service process. At this time, to ensure that the external demand unit can still obtain server-related information and perform basic management, the control unit (MCU) will immediately activate its own first network service process. This process is a temporary web service pre-configured by the MCU and can provide basic network services to the external demand unit through a standard network interface (such as a RESTful API), including BMC fault status information and the basic hardware status of the server. This avoids complete interruption of network services due to BMC failure and ensures the continuity and stability of server management.

[0092] As an implementation of this embodiment, the control unit monitors whether the network service heartbeat signal is normal; when the network service heartbeat signal is abnormal, the control unit enables the first network service process to provide network services to the external demand unit.

[0093] In a further embodiment, the control unit responds to the restart control instruction and detects the restart target corresponding to the restart control instruction, where the restart target is the baseboard management controller or the second network service process; when it is determined that the network service heartbeat signal is normal, the control unit ends the first network service process and releases the network port resources.

[0094] In a further embodiment, after the control unit fails to detect the system heartbeat signal and the network service heartbeat signal, the control unit performs network communication with the external demand unit through the first network service process.

[0095] Specifically, the control unit, working in conjunction with the baseboard management controller, continuously monitors the network service heartbeat signal—a status signal periodically transmitted by the BMC's second network service process (the BMC's own network service process for communicating with external requesting units). This signal provides feedback on the operating status of the second network service process. The MCU uses a pre-defined monitoring mechanism (such as interrupt response or timed polling) to determine in real time whether the network service heartbeat signal is normal. If the signal is transmitted periodically and stably, the second network service process is operating normally. If the signal is interrupted, has an abnormal interval, or is not transmitted as expected, it is considered an anomaly. In the event of an anomaly in the network service heartbeat signal, to prevent network communication between external requesting units (such as remote management terminals and monitoring systems) and the server from being interrupted, the control unit (MCU) immediately activates its own first network service process. This process is a temporary web service pre-configured by the MCU and provides basic network services to external requesting units via standard network interfaces (such as RESTful APIs). This process provides feedback on abnormal BMC network service status and basic server hardware information, ensuring that external units can still perform basic management and monitoring of the server.

[0096] Furthermore, when the control unit (MCU) receives a restart control command from an external request unit via the first network service process, it first parses the command and detects the target for the restart control command. The target could be the entire baseboard management controller (BMC) or the BMC's second network service process (only in the event of a network service anomaly). If the restart target is the second network service process, the MCU sends a restart command to the BMC via shared memory or an interrupt signal, prompting the BMC to reinitialize the second network service process. If the restart target is the BMC itself, the command triggers the BMC to perform a full restart. After the restart operation is executed, the control unit (MCU) continuously monitors the network service heartbeat signal. When it determines that the network service heartbeat signal has returned to normal (i.e., the second network service process has resumed stable operation), the MCU terminates the first network service process in an orderly manner (closing the network connection and releasing the memory resources occupied by the process) and releases the network port resources previously taken over. The network port resources return to normal sharing mode, ensuring that the BMC's second network service process can smoothly communicate with the external request unit using the network port, achieving seamless network service handover.

[0097] Furthermore, if the MCU cannot detect both the system heartbeat and network service heartbeat signals, this indicates a possible serious fault in the baseboard management controller (BMC), such as an operating system crash or hardware anomaly. The MCU immediately communicates with the external request unit through the enabled first network service process, providing feedback on the BMC's fault status (e.g., "No system heartbeat or network service heartbeat detected, BMC may be faulty"), BMC status information recorded before the fault (e.g., the last normal upgrade progress, reboot phase, etc.), and basic server hardware status (e.g., historical data such as CPU temperature and memory voltage obtained through shared memory). This provides key information for the external request unit to determine the cause of the fault and take recovery measures (e.g., remotely triggering a BMC hard reboot or switching to a backup image), thus preventing the server from becoming unmanageable due to complete BMC failure.

[0098] It should be noted that the embodiments of the present disclosure may include multiple steps. For the convenience of description, these steps are numbered, but these numbers do not limit the execution time slots or execution order between the steps; these steps can be implemented in any order, and the embodiments of the present disclosure do not limit this.

[0099] Corresponding to the above-mentioned network service switching method, the present disclosure also proposes a network service switching system. Since the system embodiment of the present disclosure corresponds to the above-mentioned method embodiment, details not disclosed in the system embodiment can be referred to the above-mentioned method embodiment and will not be repeated in this disclosure.

[0100] Figure 2 A schematic diagram of a system embodiment provided in the present disclosure is shown in FIG. Figure 2 As shown, it includes: a baseboard management controller 21, a control unit 22, and an information interaction module 23;

[0101] The control unit 22 exchanges status information with the baseboard management controller 21 through the information interaction module 23. The status information includes upgrade status information and restart status information.

[0102] The control unit 22 is configured to, in response to the baseboard management controller 21 entering the upgrade mode or restart state, read the status information and provide information transmission to the external demand unit through the first network service process; after the baseboard management controller 21 completes the restart, the control unit 22 receives the control information sent by the baseboard management controller 21 to terminate the first network service process and release the network port resources;

[0103] The baseboard management controller 21 is configured to execute the second network service process, generate status information, and write the status information into the information interaction module 23 .

[0104] The present disclosure provides a network service switching system. Compared to related technologies, the present disclosure transmits status information to a control unit via shared memory and a signal interrupt mechanism when a baseboard management controller enters upgrade mode or actively restarts. The control unit immediately takes over network port resources and starts a first network service process, reads the upgrade progress from shared memory, and provides real-time status feedback to the outside world through the control unit's first network service. After the baseboard management controller completes the restart, it notifies the control unit via an interrupt signal, triggering the exit of the first network service process and the release of network port resources, allowing the baseboard management controller's second network service process to seamlessly resume external communications.

[0105] Furthermore, in a possible implementation of this embodiment, as Figure 3 As shown, the information interaction module 23 includes: a shared memory, a signal bus connecting the control unit 22 and the baseboard management controller 21;

[0106] The signal bus transmits status information through the signal interrupt mechanism.

[0107] Furthermore, in a possible implementation of this embodiment, as Figure 3 As shown, a heartbeat signal is maintained between the control unit 22 and the baseboard management controller 21; the heartbeat signal includes a system heartbeat signal and a network service heartbeat signal;

[0108] The control unit 22 monitors the operating system status of the baseboard management controller 21 through the system heartbeat signal;

[0109] The control unit 22 monitors the network service status of the second network service process through the network service heartbeat signal.

[0110] Furthermore, in a possible implementation of this embodiment, as Figure 3 As shown, the network service switching system further includes: a fault detection module 24;

[0111] The fault detection module 24 is configured to determine that the baseboard management controller 21 is faulty when the system heartbeat signal and the network service heartbeat signal are continuously lost for more than a preset time period.

[0112] It should be noted that the above explanation of the method embodiment is also applicable to the system of this embodiment, and the principles are the same, which is no longer limited in this embodiment.

[0113] For the description of the features in the embodiment corresponding to the network service switching system, reference can be made to the relevant description of the embodiment corresponding to the network service switching method, which will not be repeated here.

[0114] An embodiment of the present application further provides a server. The server provided by the present application includes the features of the aforementioned network service switching system embodiment. Please refer to the relevant description of the embodiment corresponding to the network service switching method, and no further details will be given here.

[0115] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above network service switching method embodiments.

[0116] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above-mentioned network service switching method embodiments when running.

[0117] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0118] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above-mentioned network service switching method embodiments are implemented.

[0119] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned network service switching method embodiments are implemented.

[0120] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0121] The above is a detailed introduction to a network service switching method and system, server, electronic device and storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.

Claims

1. A network service switching method, characterized in that: include: The control unit obtains status information of the baseboard management controller, wherein the status information includes upgrade status information and restart status information; The control unit reads upgrade status information or restart status information of the baseboard management controller in response to the baseboard management controller entering the upgrade mode or restart state, and provides the upgrade status information or the restart status information to the external demand unit through the first network service process of the control unit; When the baseboard management controller is restarted, the baseboard management controller initializes the second network service process and sends control information to the control unit; The control unit responds to the control information, ends the first network service process and releases network port resources, and the baseboard management controller resumes network communication with the external demand unit through the second network service process.

2. The network service switching method according to claim 1, wherein: The control unit obtains status information of the baseboard management controller, including: The control unit creates a shared memory after startup, the baseboard management controller writes the status information into the shared memory, and the control unit obtains the status information through the shared memory; And / or, the control unit is configured with a signal interrupt mechanism to monitor the status information sent by the baseboard management controller in real time based on an interrupt signal.

3. The network service switching method according to claim 1, wherein: The method further comprises: The control unit initializes the first network service process after the baseboard management controller enters the upgrade mode.

4. The network service switching method according to claim 3, wherein: The initializing the first network service process includes: The control unit takes over the network port resources of the baseboard management controller; The control unit creates an upgrade progress query thread to provide upgrade status information to the external request unit when the baseboard management controller enters the upgrade mode.

5. The network service switching method according to claim 1, wherein: The reading of the upgrade status information or the restart status information of the baseboard management controller and providing the upgrade status information or the restart status information to the external demand unit through the first network service process of the control unit includes: The control unit obtains the upgrade status information through the shared memory, and transmits the information to the external demand unit using the first network service process; The control unit determines whether the baseboard management controller is upgraded based on the upgrade status information; After the baseboard management controller upgrade is completed, the control unit sends the restart status information to the external demand unit through the first network service process.

6. The network service switching method according to claim 4, wherein: The control unit receives an interrupt signal sent by the baseboard management controller when entering an upgrade mode; The control unit initializes the first network service process within a preset time period in response to the interrupt signal.

7. The network service switching method according to claim 1, wherein: The status information also includes: a heartbeat signal; A heartbeat signal is maintained between the control unit and the baseboard management controller, and the control unit monitors the operating status of the baseboard management controller based on the heartbeat signal.

8. The network service switching method according to claim 7, wherein: The control unit determines whether the baseboard management controller is in a fault state based on the heartbeat signal; If it is in a fault state, the control unit enables the first network service process to provide network services to the external demand unit.

9. The network service switching method according to claim 8, characterized in that: The heartbeat signal includes a system heartbeat signal and a network service heartbeat signal; The control unit monitors the operating system status of the baseboard management controller through the system heartbeat signal; The control unit monitors the network service status of the second network service process through the network service heartbeat signal.

10. The network service switching method according to claim 9, characterized in that: The method further comprises: The control unit monitors whether the network service heartbeat signal is normal; When the network service heartbeat signal is abnormal, the control unit enables the first network service process to provide network services to the external demand unit.

11. The network service switching method according to claim 10, wherein: The method further comprises: The control unit detects, in response to the restart control instruction, a restart target corresponding to the restart control instruction, where the restart target is the baseboard management controller or the second network service process; When it is determined that the network service heartbeat signal is normal, the control unit ends the first network service process and releases network port resources.

12. The network service switching method according to claim 9, wherein: After the control unit fails to detect the system heartbeat signal and the network service heartbeat signal, the control unit performs network communication with the external demand unit through the first network service process.

13. A network service switching system, characterized in that: include: Baseboard management controller, control unit, information interaction module; The control unit exchanges status information with the baseboard management controller through the information interaction module, wherein the status information includes upgrade status information and restart status information; The control unit is configured to, in response to the baseboard management controller entering an upgrade mode or a restart state, read the status information and provide information transmission to the external demand unit through the first network service process; after the baseboard management controller is restarted, the control unit receives control information sent by the baseboard management controller to end the first network service process and release network port resources; The baseboard management controller is configured to execute a second network service process, generate the status information, and write the status information into the information interaction module.

14. The network service switching system according to claim 13, wherein: The information interaction module includes: a shared memory, a signal bus connected between the control unit and the baseboard management controller; The signal bus transmits the status information through a signal interrupt mechanism.

15. The network service switching system according to claim 13, wherein: A heartbeat signal is maintained between the control unit and the baseboard management controller; the heartbeat signal includes a system heartbeat signal and a network service heartbeat signal; The control unit monitors the operating system status of the baseboard management controller through the system heartbeat signal; The control unit monitors the network service status of the second network service process through the network service heartbeat signal.

16. The network service switching system according to claim 15, wherein: The system further comprises: a fault detection module; The fault detection module is configured to determine that the baseboard management controller is faulty when the system heartbeat signal and the network service heartbeat signal are continuously lost for more than a preset time period.

17. A server, characterized in that: The server includes the network service switching system according to any one of claims 13 to 16.

18. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to execute the network service switching method according to any one of claims 1 to 12.

19. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable the computer to execute the network service switching method according to any one of claims 1 to 12.

20. A computer program product, characterized in that The invention comprises a computer program, which implements the network service switching method according to any one of claims 1 to 12 when being executed by a processor.

Citation Information

Patent Citations

  • Network service recovery method, device and equipment and readable storage medium

    CN111865685A

  • Address configuration method and device, storage medium and program product

    CN119383170A