Power supply control method and device of double-node server, computer equipment and medium

By adopting a power control method with a single baseboard management controller in a dual-node server and leveraging network virtualization technology to achieve physical isolation and enhanced security, the problems of uneven hardware resource allocation and inefficient management in traditional solutions are solved, reducing costs and improving security.

CN120762514AActive Publication Date: 2025-10-10INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202511279554.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-09
Publication Date
2025-10-10
Estimated Expiration
2045-09-09

AI Technical Summary

Technical Problem

The baseboard management controller of traditional dual-node servers suffers from uneven hardware resource allocation and inefficient management, leading to high material costs, complex deployment, and security risks.

Method used

A single baseboard management controller is used to receive power control requests through the target network interface, direct them to the virtual network interface bound to the target IP address, determine the target node identification and operation type, generate power control instructions, and control the power status of the target node through an independent data interface, using network virtualization technology to achieve physical isolation and security enhancement.

Benefits of technology

It reduces material costs, simplifies deployment operations, improves security, avoids resource contention and security risks, and achieves efficient management of dual-node servers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120762514A_ABST
    Figure CN120762514A_ABST
Patent Text Reader

Abstract

The invention relates to a power supply control method and device of a double-node server, computer equipment and a medium. The method comprises the following steps: receiving a power supply control request pointing to a target IP address through a target network interface; orienting the power supply control request to a target virtual network interface bound with the target IP address, and sending the power supply control request to a target network namespace where the target virtual network interface is located through the target virtual network interface; in the target network namespace, determining a target node identifier and a target operation type related to the power supply control request; generating a power supply control instruction according to the target node identifier and the target operation type; and sending a power supply control instruction to a target node corresponding to the target node identifier through a data interface corresponding to the target node identifier so as to control the target node to execute a power supply control operation corresponding to the power supply control instruction. According to the method, the material cost can be reduced, the deployment operation becomes simple, and the safety is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of server, and particularly relate to a power control method and device of a dual-node server, a computer device and a medium. BACKGROUND

[0002] With the rapid development of cloud computing, edge computing and high-performance computing, dual-node server architecture has gradually become the mainstream form in data centers and edge scenarios due to its high density, low power consumption and resource intensification advantages.

[0003] Traditional baseboard management controller technology mainly faces single-node design, and when extended to dual-node, it will face the problems of competition and uneven distribution of hardware resources (such as network interfaces and power control channels), thereby leading to low management efficiency of the baseboard management controller and being unable to independently control the dual-node. In order to improve the management efficiency of the baseboard management controller for the dual-node and enable the baseboard management controller to independently control the dual-node, the traditional scheme usually configures independent baseboard management controllers for each node, or introduces a complex expansion board such as a PCIe exchange chip, however, this scheme will cause a significant increase in material costs.

[0004] In addition, the traditional scheme usually divides multiple VLANs on a single physical network interface of the baseboard management controller, each VLAN corresponds to a node (such as node Node1 corresponding to VLAN 100 and node Node2 corresponding to VLAN 200), and multiple virtual IP addresses (such as IP1 and IP2) are configured, and each virtual IP address is bound to a virtual interface of a different VLAN (such as eth0.100 and eth0.200), so as to realize management traffic isolation of the dual-node. In the control logic, the baseboard management controller will specifically distinguish the target node according to the VLAN ID, and control the power state (such as on, off, reset) of each node in a time-division multiplexing manner through the GPIO pin shared by the dual-node. However, this dual-node management method must rely on a switch supporting VLAN to mark (Tagging) and isolate the management traffic, which is more complex to deploy and needs to be configured across devices, and also increases the operation and maintenance cost. Moreover, all VLAN interfaces will share the same network namespace, which will lead to global visibility of the routing table, firewall rules, socket resources (such as port numbers), etc., and there is a security risk (such as routing table conflict or leakage, firewall rule conflict, socket resource contention, etc.). SUMMARY

[0005] The present application provides a power control method and device of a dual-node server, a computer device and a medium to address the above-mentioned deficiencies or shortcomings. The method can reduce material costs, make deployment operations simple, and improve security.

[0006] According to a first aspect, the present application provides a power control method for a dual-node server, the method comprising: receiving a power control request directed to a target IP address through a target network interface; directing the power control request to a target virtual network interface bound to the target IP address, and sending the power control request to a target network namespace where the target virtual network interface is located through the target virtual network interface; determining a target node identifier and a target operation type related to the power control request in the target network namespace; generating a power control instruction according to the target node identifier and the target operation type; and sending the power control instruction to a target node corresponding to the target node identifier through a data interface corresponding to the target node identifier, so as to control the target node to execute the power control operation corresponding to the power control instruction.

[0007] In some embodiments, determining a target node identifier and a target operation type related to a power control request includes: when the power control request is an IPMI request, determining the node identifier corresponding to the target network namespace as the target node identifier, and determining the target operation type according to the request content of the power control request; when the power control request is a Redfish request, determining the target node identifier according to the request path of the power control request, and determining the target operation type according to the request content of the power control request.

[0008] In some embodiments, the method is applied to a baseboard management controller; a dual-node server includes a first node and a second node; the baseboard management controller includes a first group of general-purpose input / output ports assigned to the first node and a second group of general-purpose input / output ports assigned to the second node; each group of general-purpose input / output ports includes multiple general-purpose input / output ports corresponding to different operation types; generating a power control instruction based on a target node identifier and a target operation type includes: determining a target general-purpose input / output port based on the target node identifier and the target operation type; and generating a power control instruction through the target general-purpose input / output port.

[0009] In some embodiments, the method further includes: when there are multiple power control requests to be processed, obtaining associated information of each power control request, the associated information including at least one of a timestamp, a node health status, and a user role, determining the priority information of each power control request based on the associated information of each power control request, determining the processing order of each power control request based on the priority information of each power control request, and processing each power control request according to the processing order of each power control request.

[0010] In some embodiments, the memory of the baseboard management controller comprises a first shared area and a second shared area; the first shared area is used to store the node state of a first node in the dual-node server, the power control instruction to be executed or being executed; the second shared area is used to store the node state of a second node in the dual-node server, the power control instruction to be executed or being executed; the first shared area and the second shared area each have a corresponding mutex; sending the power control instruction to the target node corresponding to the target node identifier through the data interface corresponding to the target node identifier comprises: detecting whether the mutex of the target shared area corresponding to the target node identifier is in an unlocked state; when the mutex of the target shared area is in the unlocked state, writing the power control instruction into the target shared area, setting the mutex of the target shared area to a locked state, and sending the power control instruction to the target node corresponding to the target node identifier through the data interface corresponding to the target node identifier. The method further comprises: after sending the power control instruction, setting the mutex of the target shared area to the unlocked state.

[0011] In some embodiments, after determining the target node identifier according to the request path of the power control request and determining the target operation type according to the request content of the power control request when the power control request belongs to a Redfish request, the method further comprises: detecting whether the target node identifier is a node identifier corresponding to a target network namespace; if not, generating internal control information according to the target node identifier and the target operation type, and forwarding the internal control information to other network namespaces through a Unix domain socket; when the target network namespace is a first network namespace, the other network namespaces are second network namespaces; when the target network namespace is a second network namespace, the other network namespaces are first network namespaces.

[0012] In some embodiments, the priority information is a weight value; when the weight values of any two power control requests are different, the processing order corresponding to the power control request with the higher weight value is earlier; when the weight values of any two power control requests are the same, the processing order corresponding to the power control request with the earlier timestamp is earlier.

[0013] According to the second aspect, the application provides a power control device of a dual-node server, which comprises: a request receiving module, configured to receive a power control request directed to a target IP address through a target network interface; a namespace determining module, configured to direct the power control request to a target virtual network interface bound to the target IP address, and send the power control request to a target network namespace in which the target virtual network interface is located through the target virtual network interface; and a power control module, configured to determine a target node identifier and a target operation type related to the power control request in the target network namespace, generate a power control instruction according to the target node identifier and the target operation type, and send the power control instruction to a target node corresponding to the target node identifier through a data interface corresponding to the target node identifier, so as to control the target node to perform a power control operation corresponding to the power control instruction.

[0014] According to the third aspect, the application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the power control method of the dual-node server according to any one of the above-mentioned embodiments.

[0015] According to the fourth aspect, the application provides a computer device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor is executed to implement the steps of the power control method of the dual-node server according to any one of the above-mentioned embodiments.

[0016] The power control method of the dual-node server can be applied to a baseboard management controller in a dual-node server, and the dual-node server comprises the baseboard management controller and two server nodes, i.e., a first node and a second node. Since only a single baseboard management controller is used, the material cost is cheaper. The method receives a power control request directed to a target IP address (which can be a first IP address or a second IP address) through a target network interface, then directs the power control request to a target virtual network interface bound to the target IP address, sends the power control request to a target network namespace in which the target virtual network interface is located through the target virtual network interface, finally determines a target node identifier and a target operation type related to the power control request in the target network namespace, generates a power control instruction according to the target node identifier and the target operation type, and sends the power control instruction to a target node corresponding to the target node identifier through a data interface corresponding to the target node identifier, so as to control the target node to perform a power control operation corresponding to the power control instruction.

[0017] The above method independently connects the power management units of two nodes via the baseboard management controller's dual-host hardware channel, achieving physical isolation of functions such as power control and sensor acquisition, thereby avoiding resource contention. Furthermore, through the aforementioned network virtualization operations (including setting up two independent virtual network interfaces, two independent network namespaces, configuring independent IP addresses for different virtual network interfaces, and moving the two virtual network interfaces into different network namespaces), the dual-host hardware architecture of a single baseboard management controller is deeply integrated with virtualized network technologies (such as MAC VLAN) and network namespaces. This allows external management terminals to perform operations such as power control on the first or second node separately, as if they were dealing with two independent baseboard management controllers. Furthermore, the baseboard management controller does not rely on VLAN-enabled switches to tag and isolate management traffic, resulting in simpler deployment and lower maintenance costs. Furthermore, since different virtual networks have independent network namespaces, security is enhanced, eliminating issues such as routing table conflicts or leaks, firewall rule conflicts, and socket resource contention. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 This is a flow chart of a power control method for a dual-node server based on a single baseboard management controller in one or more embodiments of the present application; Figure 2 A schematic diagram of the hardware architecture in one or more embodiments of the present application; Figure 3 A schematic diagram of the system architecture in one or more embodiments of the present application; Figure 4 This is a schematic structural diagram of a power control device for a dual-node server based on a single baseboard management controller in one or more embodiments of the present application; Figure 5 This is a schematic diagram of the internal structure of a computer device in one or more embodiments of the present application. DETAILED DESCRIPTION

[0019] To make the purpose, technical solutions, and advantages of this application more clear, the embodiments of this application will be further described in detail below with reference to the accompanying drawings. It should be understood that the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0020] When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application.

[0021] In the description of this application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to the specific circumstances. In addition, in the description of this application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship.

[0022] In response to the shortcomings or defects of the related art, the present application provides a power control method for a dual-node server based on a single baseboard management controller. The method is described in detail below through some examples.

[0023] In some embodiments, the architecture of a dual-node server using the power control method described above is described as follows: The dual-node server includes a single baseboard management controller (BMC) and two server nodes (also called host nodes), namely, a first node (which may be marked as node1) and a second node (which may be marked as node2).

[0024] The baseboard management controller needs to have a dual-host hardware channel, which includes two data interfaces, namely the first data interface and the second data interface. When the baseboard management controller uses the ASPEED 2750 chip, the dual-host hardware channel is specifically a dual LTPI (Low Speed ​​Tunneled Protocol Interface) interface, which can be represented as LTPI Channel 0 and LTPI Channel 1.

[0025] The baseboard management controller (BMC) needs to connect to the power management units (PMUs) of the first and second nodes in a dual-node server via first and second data interfaces, respectively. Specifically, the first data interface connects to the PMU of the first node, and the second data interface connects to the PMU of the second node. Based on this, the first data interface can independently control the power state of the first node, namely power on, power off, and reset, while the second data interface can independently control the power state of the second node. Furthermore, the BMC can allocate two sets of general-purpose input / output (GPIO) pins (also known as GPIOs) in hardware: one set for generating power control commands (including power on, power off, and reset commands) for the first node, and the other set for generating power control commands for the second node. Typically, each set of GPIO pins includes three GPIO pins, with different pins used to generate different power control commands. For example, the GPIO pins corresponding to the first node are GPIO12 (power on), GPIO13 (power off), and GPIO14 (reset), while the GPIO pins corresponding to the second node are GPIO16 (power on), GPIO17 (power off), and GPIO18 (reset). This completely isolates the power control instructions for the first and second nodes at the physical layer, preventing a single line from controlling both nodes. Furthermore, dual-host hardware channels can be enabled in the baseboard management controller firmware configuration, with independent interrupt controllers (IRQs) and DMA (Direct Memory Access) buffers allocated to each node.

[0026] A first virtual network interface and a second virtual network interface are created on a target network interface of the baseboard management controller. The target network interface is a physical network interface on the baseboard management controller. Two virtual network interfaces, represented as a first MACVLAN interface and a second MACVLAN interface, can be created on the target network interface using MAC (Media Access Control)-VLAN technology.

[0027] The baseboard management controller is also configured with a first network namespace and a second network namespace corresponding to the first node and the second node, respectively. The first network namespace (which may be labeled ns1) and the second network namespace (which may be labeled ns2) are two different network namespaces. A network namespace is a mechanism used in Linux systems to isolate network stack resources such as network devices, IP (Internet Protocol) addresses, routing tables, port numbers, and so on. Each network namespace has its own independent network configuration, acting as an independent network environment. This isolation enables different processes, containers, or virtual machines to have completely independent network views without interfering with each other, avoiding problems that often occur when multiple virtual networks share the same network namespace, such as routing table conflicts or leaks, firewall rule conflicts, and socket resource contention.

[0028] The first virtual network interface and the second virtual network interface are configured in the first network namespace and the second network namespace, respectively. The first and second virtual network interfaces are bound to a first IP address and a second IP address, respectively. The first and second IP addresses are independent IP addresses. The first virtual network interface is bound to the first IP address, and the second virtual network interface is bound to the second IP address. Furthermore, the first virtual network interface is bound to a first MAC address, and the second virtual network interface is bound to a second MAC address. The first and second MAC addresses are independent MAC addresses. A MAC address (Media Access Control Address) is commonly referred to as a media access control address, local area network address, or hardware address.

[0029] In the aforementioned dual-node server architecture, the BMC's dual-homed hardware channel independently connects the power management units of the two nodes, achieving physical isolation of functions such as power control and sensor acquisition, thus avoiding resource contention. Furthermore, through specific network virtualization operations (including setting up two independent virtual network interfaces, two independent network namespaces, configuring independent IP addresses for each virtual network interface, and moving the two virtual network interfaces into different network namespaces), the single BMC dual-homed hardware architecture is deeply integrated with virtualized network technologies (such as MAC-VLAN) and network namespaces. This allows external management to perform operations such as power control on the first or second node as if they were operating from two independent BMCs. Furthermore, the BMC does not rely on VLAN-enabled switches to tag and isolate management traffic, resulting in simpler deployment and lower maintenance costs. Furthermore, each virtual network has its own independent network namespace, enhancing security and preventing issues such as routing table conflicts or leaks, firewall rule conflicts, and socket resource contention.

[0030] See Figure 1 The method includes steps S110 to S130. The following takes the method applied to the baseboard management controller as an example. Figure 2 The hardware architecture diagram shown and Figure 3 The system architecture diagram shown is used for explanation.

[0031] S110: Receive a power control request directed to a target Internet Protocol address through a target network interface.

[0032] After the baseboard management controller is powered on, the firmware will perform a series of initialization operations, including allocating data interfaces to the first node and the second node, and allocating corresponding GPIO pins to the first node and the second node.

[0033] After completing initialization, the BMC's Linux kernel loads the network virtualization module (MACVLAN module) and the network namespace module. The network virtualization module creates two virtual network interfaces on the BMC's physical network interface (e.g., eth0): virtual LAN interface 0 (identified as macvlan0) and virtual LAN interface 1 (identified as macvlan1). These interfaces can be in bridge mode. The network namespace module creates two independent network namespaces: the first network namespace (identified as ns1) and the second network namespace (identified as ns2). It then moves different virtual network interfaces into different network namespaces to achieve network namespace isolation. Furthermore, the BMC configures a unique MAC address (e.g., mac1 and mac2) for each virtual network interface and assigns a unique IP address (e.g., the first address (identified as ip1, or the first IP address) and the second address (identified as ip2, or the second IP address)) to each virtual network interface through DHCP.

[0034] A power control request is a request sent by an external management terminal to control the power status of a first or second node. The target IP address is the IP address to which the power control request is sent, which can be the first or second IP address. Bindings can be pre-set between IP addresses, network namespaces, and nodes. For example, a first IP address corresponds to a first network namespace, which corresponds to the first node, and a second IP address corresponds to a second network namespace, which corresponds to the second node.

[0035] Power control requests can be sent by an external management client via a specific protocol, such as the IPMI (Intelligent Platform Management Interface) protocol or the Redfish protocol. The Redfish protocol is an open industry standard protocol based on a RESTful API (Application Programming Interface) and is specifically designed for out-of-band management of hardware devices such as servers, storage devices, and network equipment.

[0036] S120: Direct the power control request to the target virtual network interface bound to the target IP address, and send the power control request to the target network namespace where the target virtual network interface is located through the target virtual network interface.

[0037] The kernel is pre-configured with traffic direction rules based on the destination IP address, for example, "traffic with destination IP address ip1 is transmitted through macvlan0, and traffic with destination IP address ip2 is transmitted through macvlan1."

[0038] After receiving a power control request, the power control request is directed to the target virtual network interface based on the traffic steering rule. The target virtual network interface can be the first virtual network interface or the second virtual network interface. It is determined by the target IP address. When the target IP address is the first IP address, it is the first virtual network interface; when the target IP address is the second IP address, it is the second virtual network interface.

[0039] After receiving the power control request, the target virtual network interface sends it to the target network namespace. The target network namespace refers to the network namespace where the target virtual network interface resides. If the target virtual network interface is the first virtual network interface, the target network namespace is the first network namespace; if the target virtual network interface is the second virtual network interface, the target network namespace is the second network namespace.

[0040] S130: In the target network namespace, determine the target node identifier and target operation type related to the power control request; generate a power control instruction based on the target node identifier and the target operation type; send the power control instruction to the target node corresponding to the target node identifier through the data interface corresponding to the target node identifier to control the target node to execute the power control operation corresponding to the power control instruction.

[0041] Each node has a unique node identifier. The target node identifier is the node identifier of the target node. For example, the node identifier of node 1 can be node1, and the node identifier of node 2 can be node2. The target operation type is the power control operation that the external management end wants to perform on the target node, such as power on, power off, or reset.

[0042] The external management terminal can use multiple protocols to send the power control request. Therefore, the baseboard management controller will determine the target node identifier and target operation type related to the power control request according to the protocol type used by the power control request.

[0043] When the power control request is an IPMI request (i.e., the protocol used by the power control request is the IPMI protocol), the node identifier corresponding to the target network namespace is determined as the target node identifier, and the target operation type is determined based on the request content of the power control request. Determining the target operation type based on the request content of the power control request may include extracting relevant information about the operation type from the request content and using that information as the target operation type.

[0044] When the power control request is a Redfish request (i.e., the protocol used by the power control request is the Redfish protocol), the target node identifier is determined based on the request path of the power control request, and the target operation type is determined based on the request content of the power control request. Determining the target node identifier based on the request path of the power control request can be done by extracting the request path from the power control request and then using the node identifier carried in the request path as the target node identifier. For example, if the node identifier of the first node is CPU1, and the request path in the power control request is / redfish / v1 / Systems / CPU1, the information "CPU1" can be extracted to determine that the target node identifier is the first node. Determining the target operation type based on the request content of the power control request can also be done by extracting relevant information about the operation type from the request content and using it as the target operation type.

[0045] Regarding the operation of generating a power control instruction according to a target node identifier and a target operation type, it is used to determine a target general input and output port and generate a power control instruction using the port.

[0046] In some embodiments, the baseboard management controller includes a first group of general-purpose input / output ports assigned to the first node and a second group of general-purpose input / output ports assigned to the second node; each group of general-purpose input / output ports includes multiple general-purpose input / output ports corresponding to different operation types. Based on this, the operation of generating a power control instruction based on the target node identifier and the target operation type includes: (1) Determine the target general-purpose input / output port according to the target node identifier and the target operation type; for example, the GPIO pins corresponding to the first node are GPIO12 (power on), GPIO13 (power off), and GPIO14 (reset), and the GPIO pins corresponding to the second node are GPIO16 (power on), GPIO17 (power off), and GPIO18 (reset). Assuming that the target node identifier is the identifier of the first node and the target operation type is power on, it can be determined that the target general-purpose input / output port is GPIO12 (power on).

[0047] (2) Generate a power control instruction through the target general-purpose input / output port. After determining the target general-purpose input / output port, the target general-purpose input / output port can be controlled to generate a power control instruction, which can be a level pulse.

[0048] In some embodiments, two types of instances are deployed in each network namespace, namely, an instance using the IPMI protocol, which may be referred to as an IPMI service instance, and an instance using the Redfish protocol, which may be referred to as a Redfish service instance.

[0049] Among them, IPMI service instances are respectively run in the first network namespace and the second network namespace, which are responsible for monitoring port 623. When they receive a power control request, they will determine the target node (such as CPU1 or CPU2) according to the target IP address (ip1 or ip2) pointed to by the request. After determining the target node, the target node identifier and target operation type will be determined according to the operations of the above embodiment, and then this information will be passed to the LTPI control module of the target node through shared memory, and the LTPI control module will control the target general input and output port to generate a power control signal.

[0050] A Redfish service instance runs in the first network namespace and the second network namespace, listening on port 443 and supporting a RESTful API. When the Redfish service instance receives a power control request, it parses the request path (e.g., / redfish / v1 / Systems / CPU1) to determine the target node ID, and then processes the power control request in the target network namespace (e.g., the first network namespace).

[0051] This embodiment can deploy dual IPMI / Redfish protocol stack instances in independent network namespaces (ns1 or ns2), and can use a lock-free queue (Ring Buffer) to isolate resources.

[0052] In some embodiments, the method further includes: when there are multiple power control requests to be processed, obtaining associated information of each power control request, the associated information including at least one of a timestamp, a node health status, and a user role, determining the priority information of each power control request based on the associated information of each power control request, determining the processing order of each power control request based on the priority information of each power control request, and processing each power control request according to the processing order of each power control request.

[0053] When the weight values ​​of any two power control requests are different, the one with a higher weight value is processed earlier, while if their weight values ​​are the same, the one with an earlier timestamp is processed earlier.

[0054] This embodiment can avoid conflicts in processing power control requests by setting a priority calculation strategy.

[0055] The timestamp is the timestamp carried by the power control request, and the node health status can be the health status of the node corresponding to the target node identifier related to the power control request. The BMC can collect the power status and health status (such as healthy, good, and poor) of each node through the data interface. The user role is carried in the power control request itself, or is information determined by the baseboard management controller based on the user identifier in the power control request (such as position). Take the example of the associated information including the timestamp, node health status, and user role. The priority information of the power control request can be calculated using these three pieces of information. The priority information can be a weight value. The weight value can be calculated using the following formula: ; First, the timestamp (T cmd ), node health status (H node ) and user role (R) are converted into numerical values ​​according to the preset rules. Then, they are substituted into the formula to obtain the weight value (i.e. W). current The value 0.5, 0.3, and 0.2 in the formula are the coefficients corresponding to the timestamp, node health status, and user role, respectively. The sum of these three coefficients is 1. The values ​​of these coefficients can be adjusted according to actual needs. For example, the coefficients can be set based on the importance of the timestamp, node health status, and user role. The higher the importance, the higher the coefficient.

[0056] In some embodiments, a shared memory block (e.g., / dev / shm / node_control) is pre-allocated in the memory of the baseboard management controller. This shared memory block includes two areas, namely, a first shared area and a second shared area. The first shared area is used to store the node status of the first node and power control instructions to be executed or being executed; the second shared area is used to store the node status of the second node and power control instructions to be executed or being executed. The first shared area and the second shared area each have a corresponding mutex lock. Based on this, the operation of sending the power control instruction to the target node corresponding to the target node identifier via the data interface corresponding to the target node identifier includes: detecting whether the mutex lock of the target shared area corresponding to the target node identifier is in an unlocked state; when the mutex lock of the target shared area is in an unlocked state, writing the power control instruction to the target shared area, setting the mutex lock of the target shared area to a locked state, and sending the power control instruction to the target node corresponding to the target node identifier via the data interface corresponding to the target node identifier. Accordingly, the method further includes: setting the mutex lock of the target shared area to an unlocked state after sending the power control instruction.

[0057] By setting a mutex for the corresponding shared area of ​​each node, atomic operations can be ensured.

[0058] In some embodiments, when the power control request is a Redfish request, after determining the target node identifier according to the request path of the power control request and determining the target operation type according to the request content of the power control request, the method further includes: detecting whether the target node identifier is the node identifier corresponding to the target network namespace; if not, generating internal control information according to the target node identifier and the target operation type, and forwarding the internal control information to other network namespaces through a Unix domain socket; when the target network namespace is the first network namespace, the other network namespace is the second network namespace, and when the target network namespace is the second network namespace, the other network namespace is the first network namespace.

[0059] Internal control information includes the target node ID and the target operation type. If the target node ID does not correspond to the node ID in the target network namespace, information can be transferred across network namespaces using Unix domain sockets. Unix domain sockets provide a bidirectional communication channel (such as / var / run / node_comm.sock) with lower latency, typically less than or equal to 50 microseconds.

[0060] It should be noted that, with respect to the various steps included in the power control method for a dual-node server based on a single baseboard management controller provided in any of the above embodiments, unless otherwise expressly stated herein, there is no strict order restriction on the execution of these steps, and these steps may be executed in other orders. Furthermore, at least a portion of these steps may include multiple sub-steps or multiple stages, and these sub-steps or stages do not necessarily need to be completed at the same time, but may be executed at different times. These sub-steps or stages do not necessarily need to be executed sequentially, but may be executed in rotation or alternation with other steps or at least a portion of the sub-steps or stages of other steps.

[0061] Based on the same inventive concept, the present application also provides a power control device for a dual-node server based on a single substrate management controller. In some embodiments, Figure 4 As shown, the device includes the following modules: The request receiving module 110 is configured to receive a power control request directed to a target IP address through a target network interface; the target IP address is the first IP address or the second IP address; a namespace determination module 120 for directing the power control request to a target virtual network interface bound to a target IP address, and sending the power control request to a target network namespace where the target virtual network interface is located through the target virtual network interface; The power control module 130 is used to determine the target node identifier and target operation type related to the power control request in the target network namespace; generate a power control instruction based on the target node identifier and the target operation type; and send the power control instruction to the target node corresponding to the target node identifier through the data interface corresponding to the target node identifier to control the target node to execute the power control operation corresponding to the power control instruction.

[0062] In some embodiments, the power control module 130 determines the target node identifier and target operation type related to the power control request, including: when the power control request is an IPMI request, determining the node identifier corresponding to the target network namespace as the target node identifier, and determining the target operation type according to the request content of the power control request; when the power control request is a Redfish request, determining the target node identifier according to the request path of the power control request, and determining the target operation type according to the request content of the power control request.

[0063] In some embodiments, the baseboard management controller includes a first group of general-purpose input / output ports assigned to the first node and a second group of general-purpose input / output ports assigned to the second node; each group of general-purpose input / output ports includes multiple general-purpose input / output ports corresponding to different operation types; accordingly, the power control module 130 generates a power control instruction according to the target node identifier and the target operation type, including: determining the target general-purpose input / output port according to the target node identifier and the target operation type; and generating a power control instruction through the target general-purpose input / output port.

[0064] In some embodiments, the apparatus further includes a priority calculation module. The priority calculation module is configured to: when there are multiple power control requests to be processed, obtain associated information of each power control request, the associated information including at least one of a timestamp, a node health status, and a user role; determine priority information of each power control request based on the associated information of each power control request; determine a processing order of each power control request based on the priority information of each power control request; and process each power control request based on the processing order of each power control request.

[0065] In some embodiments, the memory of the baseboard management controller includes a first shared area and a second shared area; the first shared area is used to store the node status of the first node, and the power control instructions to be executed or being executed; the second shared area is used to store the node status of the second node, and the power control instructions to be executed or being executed; the first shared area and the second shared area both have corresponding mutex locks; accordingly, the power control module 130 sends the power control instruction to the target node corresponding to the target node identifier through the data interface corresponding to the target node identifier, including: detecting whether the mutex lock of the target shared area corresponding to the target node identifier is in an unlocked state; when the mutex lock of the target shared area is in an unlocked state, writing the power control instruction to the target shared area, setting the mutex lock of the target shared area to a locked state, and sending the power control instruction to the target node corresponding to the target node identifier through the data interface corresponding to the target node identifier.

[0066] The power control module 130 is further configured to set the mutex lock of the target shared area to an unlocked state after sending the power control instruction.

[0067] In some embodiments, when the power control request is a Redfish request, after determining the target node identifier according to the request path of the power control request and determining the target operation type according to the request content of the power control request, the power control module 130 is used to: detect whether the target node identifier is the node identifier corresponding to the target network namespace; if not, generate internal control information according to the target node identifier and the target operation type, and forward the internal control information to other network namespaces through a Unix domain socket; when the target network namespace is the first network namespace, the other network namespace is the second network namespace, and when the target network namespace is the second network namespace, the other network namespace is the first network namespace.

[0068] In some embodiments, the priority information is a weight value; when the weight values ​​of any two power control requests are different, the power control request with a higher weight value has an earlier processing order; when the weight values ​​of any two power control requests are the same, the power control request with an earlier timestamp has an earlier processing order.

[0069] Regarding the specific definition of the power control device for a dual-node server based on a single baseboard management controller, please refer to the definition of the power control method for a dual-node server based on a single baseboard management controller above, which will not be repeated here. Each module in the power control device for a dual-node server based on a single baseboard management controller can be implemented in whole or in part through software, hardware, and a combination thereof. Each of the above modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.

[0070] The present application also provides a computer device. In some embodiments, the computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the power control method for a dual-node server based on a single substrate management controller provided in any of the above embodiments can be implemented.

[0071] In some embodiments, the internal structure diagram of the computer device can be as follows: Figure 5 As shown. The computer device includes a processor, a memory and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as sorting task information corresponding to the package. The specific stored data can also be found in the definitions in the above method embodiments. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a power control method for a dual-node server based on a single substrate management controller is implemented.

[0072] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0073] The present application also provides a computer-readable storage medium. In some embodiments, a computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the steps of the power control method for a dual-node server based on a single baseboard management controller provided in any of the above embodiments are implemented.

[0074] In the above-described embodiments of the present application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0075] Those skilled in the art can understand that all or part of the processes in the above-mentioned method embodiments can be implemented by a computer program instructing the relevant hardware, and the computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments of the method. Any reference to memory, storage, database or other medium used in each embodiment provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink), DRAM (SLDRAM), memory bus (Rambus), direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0076] Each technical feature of the above embodiments can be combined arbitrarily. In order to make the description simple, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist, they should be considered as the scope of the present application.

[0077] The above-described embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, some modifications and improvements can be made, which are within the scope of the present application.

Claims

1. A power control method for a dual-node server based on a single baseboard management controller, characterized in that: The method comprises: receiving a power control request directed to a target IP address via a target network interface; Directing the power control request to the target virtual network interface bound to the target IP address, and sending the power control request to the target network namespace where the target virtual network interface is located through the target virtual network interface; In the target network namespace, determine the target node identifier and target operation type related to the power control request; generate a power control instruction based on the target node identifier and the target operation type; and send the power control instruction to the target node corresponding to the target node identifier through the data interface corresponding to the target node identifier to control the target node to execute the power control operation corresponding to the power control instruction.

2. The method according to claim 1, characterized in that Determining a target node identifier and a target operation type related to the power control request includes: When the power control request is an IPMI request, determining the node identifier corresponding to the target network namespace as the target node identifier, and determining the target operation type according to the request content of the power control request; When the power control request is a Redfish request, the target node identifier is determined according to the request path of the power control request, and the target operation type is determined according to the request content of the power control request.

3. The method according to claim 1, characterized in that The method is applied to a baseboard management controller; the dual-node server includes a first node and a second node; the baseboard management controller includes a first group of general input and output ports allocated to the first node and a second group of general input and output ports allocated to the second node; Each group of the general purpose input and output ports includes a plurality of general purpose input and output ports corresponding to different operation types; Generating a power control instruction according to the target node identifier and the target operation type includes: Determine a target general input and output port according to the target node identifier and the target operation type; A power control instruction is generated through the target general purpose input / output port.

4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: When there are multiple power control requests to be processed, obtain associated information of each power control request, where the associated information includes at least one of a timestamp, a node health status, and a user role. Determine the priority information of each power control request based on the associated information of each power control request. Determine the processing order of each power control request based on the priority information of each power control request. Process each power control request according to the processing order of each power control request.

5. The method according to claim 4, characterized in that The memory of the baseboard management controller includes a first shared area and a second shared area; the first shared area is used to store the node status of the first node in the dual-node server and the power control instructions to be executed or being executed; the second shared area is used to store the node status of the second node in the dual-node server and the power control instructions to be executed or being executed; the first shared area and the second shared area each have a corresponding mutex lock; Sending the power control instruction to the target node corresponding to the target node identifier through the data interface corresponding to the target node identifier includes: Detecting whether the mutex lock of the target shared area corresponding to the target node identifier is in an unlocked state; When the mutex lock of the target shared area is in an unlocked state, writing the power control instruction into the target shared area, setting the mutex lock of the target shared area to a locked state, and sending the power control instruction to the target node corresponding to the target node identifier through the data interface corresponding to the target node identifier; The method further comprises: After sending the power control instruction, the mutex lock of the target shared area is set to an unlocked state.

6. The method according to claim 2, characterized in that When the power control request is a Redfish request, after determining the target node identifier according to the request path of the power control request and determining the target operation type according to the request content of the power control request, the method further includes: Detecting whether the target node identifier is a node identifier corresponding to the target network namespace; If not, internal control information is generated according to the target node identifier and the target operation type, and the internal control information is forwarded to other network namespaces through a Unix domain socket; when the target network namespace is the first network namespace, the other network namespace is the second network namespace; when the target network namespace is the second network namespace, the other network namespace is the first network namespace.

7. The method according to claim 4, characterized in that The priority information is a weight value; when the weight values ​​of any two power control requests are different, the power control request with a higher weight value has an earlier processing order; when the weight values ​​of any two power control requests are the same, the power control request with an earlier timestamp has an earlier processing order.

8. A power control device for a dual-node server based on a single baseboard management controller, characterized in that: The device comprises: a request receiving module, configured to receive a power control request directed to a target IP address through a target network interface; a namespace determination module, configured to direct the power control request to a target virtual network interface bound to the target IP address, and send the power control request to a target network namespace where the target virtual network interface is located through the target virtual network interface; A power control module is used to determine the target node identifier and target operation type related to the power control request in the target network namespace; generate a power control instruction based on the target node identifier and the target operation type; and send the power control instruction to the target node corresponding to the target node identifier through the data interface corresponding to the target node identifier to control the target node to execute the power control operation corresponding to the power control instruction.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Power source control system and method for multi-node server

    CN108919933A

  • Information processing method and device, equipment and medium

    CN116521416A

  • Port forwarding method and device, computer equipment and storage medium

    CN117749702A

  • Server management method, baseboard management controller and server

    CN119862086A

  • Power management method, electronic equipment and storage medium

    CN120122795A