Hot plug method, apparatus, device and storage medium of a device
By analyzing and reporting the presence signal through logic devices, the complexity of server boards caused by the separate signal output of the CPU is solved, and the hot-swappable function is simplified and unified.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INSPUR (SHANDONG) COMPUTER TECH CO LTD
- Filing Date
- 2025-10-13
- Publication Date
- 2026-07-31
AI Technical Summary
In existing technologies, the CPU needs to separately bring out the in-situ signal to the GPIO pin for each PCIe device or NVMe hard drive, which leads to complex server board layout design and internal wiring of the chassis, making it difficult to achieve hot-swapping functionality. Furthermore, the different splitting methods of different PCIe RCs increase the demand for dedicated cables.
The logic device is used as the data processing center. The interface component of the processing component is obtained through the logic device, the device's presence signal is parsed, and the target presence signal is reported to the processing component to realize the hot-plug procedure.
It significantly reduces the number of cables used, lowers the design complexity of server boards, avoids the need for custom-made dedicated cables, and simplifies the layout design of server systems.
Smart Images

Figure CN121455876B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a hot-plugging method and apparatus for a device, an electronic device, and a storage medium. Background Technology
[0002] The CPU (Central Processing Unit) supports hot-swapping of PCIe (a high-speed serial computer expansion bus standard) devices and NVMe (Non-Volatile Memory Express) hard drives. Taking NVMe hard drives as an example, in related technologies, the presence signal of each NVMe hard drive is transmitted to the CPU on the server board via GPIO (General-Purpose Input / Output) ports. The CPU monitors the status of these GPIOs to determine which NVMe hard drive has been hot-swapped, thereby triggering the corresponding internal driver and event handling processes.
[0003] While this design meets the basic requirements for hot-swapping, it faces significant challenges in practical server applications. First, the CPU needs to provide a separate presence signal to each connected PCIe device or NVMe drive's GPIO pin. This requirement places enormous pressure on the server board layout and internal wiring, making it difficult to implement in a server system. Second, because the splitting methods of the various PCIe RC (Root Complex) within the CPU differ, their corresponding presence signal GPIOs also differ. Therefore, custom-designed cables are required for different RC splitting configurations, further increasing system complexity and implementation difficulty.
[0004] Therefore, how to meet the hot-swappable requirements of different devices while reducing the design complexity of server boards is an urgent problem to be solved in this field. Summary of the Invention
[0005] This application provides a hot-swappable device method to address the problem of meeting the hot-swappable requirements of different devices while reducing the design complexity of server boards.
[0006] Accordingly, embodiments of this application also provide a hot-swap device, an electronic device, and a storage medium to ensure the implementation and application of the above methods.
[0007] To address the aforementioned problems, this application discloses a hot-plugging method for a device applied to a logic device. The device is connected to the logic device, and the logic device is connected to an interface component of a processing component. The method includes: Obtain the splitting method of the interface component; Determine the presence signal of the device; The in-situ signal is parsed according to the described splitting method to obtain the target in-situ signal; The target presence signal is reported to the processing component so that the processing component executes the corresponding hot-plug procedure based on the target presence signal.
[0008] In an optional embodiment of this application, the logic device and the interface component are connected via a first serial bus, the splitting method has corresponding port combinations, the port combination includes at least one port on the interface component, and obtaining the splitting method of the interface component includes: During the startup of the processing component, the splitting information sent by the processing component is received through the first serial bus. The splitting information is used to divide the port into valid ports and invalid ports. The splitting method of the interface component is determined based on the splitting information; Based on the port combination corresponding to the splitting method, a port number is assigned to the valid port, and the valid port has a corresponding device; The port number is then sent to the device. The splitting methods include: The port component can be split into one valid port and three invalid ports, or into two valid ports and two invalid ports, or into three valid ports and one invalid port, or into four valid ports.
[0009] In an optional embodiment of this application, the device corresponding to the valid port has a corresponding port presence signal, and determining the presence signal of the device includes: Scan the device according to the port number; When the port number matches the target port number, the target port presence signal of the target device corresponding to the target port number is obtained; The target port presence signal is determined as the device presence signal.
[0010] In one optional embodiment of this application, the device is a backplane, a hard disk is connected to the backplane, and the logic device is connected to the backplane via a second serial bus. Scanning the device according to the port number includes: When the hard drive is hot-swapped, the interrupt notification signal reported by the backplane is received via the second serial bus; Based on the interrupt notification signal, perform a scan of the device according to the port number.
[0011] In one optional embodiment of this application, the step of parsing the in-situ signal according to the splitting method to obtain the target in-situ signal includes: Get the table corresponding to the splitting method; The target presence signal corresponding to the device's presence signal is determined according to the splitting method correspondence table. The target presence signal includes device presence and device absence.
[0012] In an optional embodiment of this application, the invalid port has a corresponding port presence signal, and the method includes: Set the port presence signal of the invalid port to indicate that the device is not present.
[0013] In an optional embodiment of this application, the processing component has a corresponding operating system, and the step of reporting the target presence signal to the processing component so that the processing component executes a corresponding hot-plugging procedure according to the target presence signal includes: The target presence signal is reported to the processing component, so that the processing component reports the target presence signal to the operating system, and the operating system executes a device loader or a device uninstaller based on the target presence signal.
[0014] This application also discloses a hot-swap device for a logic device, wherein the device is connected to the logic device, and the logic device is connected to an interface component of a processing component. The device includes: The splitting method determination module is used to obtain the splitting method of the interface component; The in-situ signal acquisition module is used to determine the in-situ signal of the device; The in-situ signal determination module is used to parse the in-situ signal according to the splitting method to obtain the target in-situ signal; The in-situ signal reporting module is used to report the target in-situ signal to the processing component, so that the processing component can execute the corresponding hot-plug procedure according to the target in-situ signal.
[0015] This application also discloses an electronic device, including: a processor; and a memory storing executable code thereon, which, when executed, causes the processor to perform a hot-plugging method of one or more devices as described in this application.
[0016] This application also discloses one or more machine-readable media storing executable code thereon, which, when executed, causes a processor to perform a hot-plugging method for one or more devices as described in this application.
[0017] Compared with the prior art, the embodiments of this application have the following advantages: In this embodiment, the device is connected to a logic device, and the logic device is connected to an interface component of the processing component. The splitting method of the interface component is obtained; the device's presence signal is determined; the presence signal is parsed according to the splitting method to obtain a target presence signal; and the target presence signal is reported to the processing component so that the processing component executes the corresponding hot-plug procedure based on the target presence signal. This embodiment uses a logic device as the data processing center. The logic device obtains the splitting method of the interface component of the processing component. Since the device is connected to the logic device, the presence signals of all devices connected to the processing component must first be transmitted to the logic device. The logic device parses the device's presence signal according to the obtained interface component splitting method to obtain the target presence signal corresponding to the device, and reports it to the processing component so that the processing component executes the corresponding hot-plug procedure. This significantly reduces the number of cables used and avoids the need to customize dedicated cables to adapt to different interface component splitting methods, thus reducing the design complexity of the server board. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating the steps of an embodiment of a hot-plugging method for a device according to this application; Figure 2 This is a schematic diagram showing the disassembly of an embodiment of a hot-plugging method for a device according to this application; Figure 3 This is a schematic diagram of the system structure of an embodiment of a hot-plugging method for a device according to this application; Figure 4 This is a structural block diagram of an embodiment of a hot-swap device for a device according to this application; Figure 5 This is a flowchart illustrating the steps of another embodiment of the hot-plugging method for a device according to this application; Figure 6 This is a schematic diagram of the structure of a device provided in an embodiment of this application. Detailed Implementation
[0019] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0020] The CPU supports hot-swapping of PCIe devices and NVMe hard drives. Taking NVMe hard drives as an example, in related technologies, the presence signal of each NVMe hard drive is transmitted to the CPU on the server board via GPIO. The CPU monitors the status of these GPIOs to determine which NVMe hard drive has been hot-swapped, thereby triggering the corresponding internal driver and event handling process. In other words, existing technology relies on the CPU reading the level changes of the presence signal of the PCIe device or NVMe hard drive to initiate the corresponding hot-swapping procedure.
[0021] While this design meets the basic requirements for hot-swapping, it faces significant challenges in practical server applications. First, the CPU needs to route a separate presence signal to each connected PCIe device or NVMe drive's GPIO pin. This requirement places enormous pressure on the server board layout and internal chassis wiring, making it difficult to implement in a server system. For example, a single-socket CPU with 64 PCIe lanes can support a maximum of 16 NVMe drives, requiring 16 independent presence signals to the CPU; a dual-socket CPU can support a maximum of 32 NVMe drives, increasing the required presence signal count to 32.
[0022] Secondly, since the splitting methods of each PCIe RC in the CPU are different, the corresponding in-situ signals GPIO are also different. Therefore, it is necessary to customize dedicated cables for different RC splitting configurations. This situation makes it difficult to achieve signal connection through a unified hardware direct connection method, further increasing the system complexity and implementation difficulty.
[0023] Therefore, how to meet the hot-swapping requirements of different devices while reducing the design complexity of server boards is a problem that urgently needs to be solved in this field. To address this, embodiments of this application propose a hot-swapping method for devices, which solves or at least partially solves the above-mentioned technical problems by using logic devices as the data processing center.
[0024] Reference Figure 1 This is a flowchart illustrating the steps of an embodiment of a hot-plugging method for a device according to this application, including the following steps: Step 101: Obtain the splitting method of the interface component.
[0025] This application provides a method for hot-plugging a device applied to a logic device, which can be a CPLD (Complex Programmable Logic Device). Compared to related technologies where the device is directly connected to the processing component during hot-plugging, in this embodiment, the device is connected to the logic device, which is then connected to the interface component of the processing component on the server board.
[0026] The processing component is the CPU, and the interface component of the processing component is the PCIe RC. Devices that can be hot-swapped on the CPU include PCIe devices, NVMe hard drives, CPLD backplanes (in this case, the CPLD on the server board is the motherboard), E1.S (a form factor for solid-state drives), and OCP cards (Open Compute Project, a network adapter). The above devices are merely examples, and the application scope of this application is not limited to the hot-swapping of the specific devices on the CPU described above.
[0027] In this embodiment, the method of splitting the interface component from which the logic device obtains the processing component is used to subsequently determine the device's presence signal. In one example, a CPU with 64 PCIe lanes has 4 PCIe RC groups, each PCIe RC group supporting the following... Figure 2 The splitting method is shown. (Refer to...) Figure 2 This is a schematic diagram showing the disassembly of an embodiment of a hot-plugging method for a device according to this application.
[0028] Bif-mode means that each PCIe RC group has 4 pins. The CPU uses these pins to identify the initial split configuration of the PCIe RC, which means that each PCIe RC group supports four splitting methods. Each PCIe RC group has 16 PCIe lanes, numbered 0 to 15.
[0029] Bif-mode uses binary combinations to represent different pins. Bif-mode=000 (decimal 0) represents the first splitting method, dividing the 16 PCIe lanes into x16 forms, i.e., a PCIe port composed of 16 PCIe lanes, which can be labeled C0; Bif-mode=001 (decimal 1) represents the second splitting method, dividing the 16 PCIe lanes into x8 and x8 forms, i.e., two PCIe ports composed of 8 PCIe lanes each, which can be labeled C0 and C1 respectively; Bif-mode=010 (decimal 2) represents the third splitting method, dividing the 16 PCIe lanes into x8, x4, and x4 forms, i.e., three PCIe ports composed of 8, 4, and 4 PCIe lanes respectively. These three ports can be labeled C0, C1, and C2 respectively. Bif-mode=011 (decimal 3) represents the fourth splitting method, dividing the 16 PCIe lanes into x4, x4, x4, and x4 configurations, resulting in four PCIe ports composed of four PCIe lanes each. These four ports can be labeled C0, C1, C2, and C3 respectively. The number of ports represents the number of devices the CPU can connect to.
[0030] Step 102: Determine the presence signal of the device.
[0031] In this embodiment, the processing component does not directly receive the in-situ signal of the device. After the in-situ signal of all devices connected to the logic device is compressed, it is first sent to the logic device for parsing.
[0032] Step 103: Analyze the in-situ signal according to the splitting method to obtain the target in-situ signal.
[0033] After receiving the compressed presence signal, the logic device parses the presence signal according to the splitting method of the interface component obtained from the processing component, thereby determining the target presence signal corresponding to each device, that is, determining whether each device is in place.
[0034] Step 104: Report the target presence signal to the processing component so that the processing component executes the corresponding hot-plug procedure based on the target presence signal.
[0035] The logic device reports the parsed target presence signals of each device to the processing component to enable the target presence signals and complete the target presence signal notification for the corresponding port. The processing component determines whether the target presence signal of each device has changed compared to the previously received target presence signal and executes the corresponding hot-plug procedure. If the target presence signal of a device was not present in the previous instance, but is present in the current instance, it is determined that a device loading procedure needs to be executed for that device; if the target presence signal of a device was present in the previous instance, but is not present in the current instance, it is determined that a device unloading procedure needs to be executed for that device.
[0036] This application embodiment uses a logic device as the data processing center. The logic device obtains the splitting method of the interface components of the processing component. Since the devices are connected to the logic device, the presence signals of all devices connected to the processing component must first be transmitted to the logic device. The logic device parses the presence signals of the devices according to the obtained interface component splitting method to obtain the target presence signal corresponding to the device, and reports it to the processing component so that the processing component can perform the corresponding hot-plugging process. This significantly reduces the number of cables used and avoids the need to customize special cables to adapt to different interface component splitting methods, thereby reducing the design complexity of the server board.
[0037] In an optional embodiment of this application, the logic device and the interface component are connected via a first serial bus, the splitting method has corresponding port combinations, the port combination includes at least one port on the interface component, and step 101 includes: During the startup of the processing component, the splitting information sent by the processing component is received through the first serial bus. The splitting information is used to divide the port into valid ports and invalid ports. The splitting method of the interface component is determined based on the splitting information; Based on the port combination corresponding to the splitting method, a port number is assigned to the valid port, and the valid port has a corresponding device; The port number is then sent to the device. The splitting methods include: The port component can be split into one valid port and three invalid ports, or into two valid ports and two invalid ports, or into three valid ports and one invalid port, or into four valid ports.
[0038] In this embodiment, the logic device and the interface component are connected via a first serial bus, which can be an I2C bus (a simple, bidirectional two-wire synchronous serial bus). During the startup of the processing component, the processing component sends splitting information to the logic device via the first serial bus through the corresponding BIOS (Basic Input / Output System). Different splitting information corresponds to different splitting methods. In one embodiment, the splitting information is a CPU controller splitting code, and different CPU controller splitting codes correspond to different splitting methods.
[0039] Different splitting methods result in different port combinations. In one example, different port combinations can be as follows: Figure 2 As shown, each port combination includes at least one valid port on an interface component. Based on the maximum number of ports that can be partitioned from the interface component, the ports other than the valid ports within that maximum number of ports can be set as invalid ports. (Refer to...) Figure 2 The splitting methods include: splitting the port component into one valid port and three invalid ports (i.e., when Bif-mode=000, one port is obtained, which is the valid port C0; the other ports C1, C2, and C3 not obtained in the splitting are set as invalid ports; the other splitting methods described below are similar); splitting the port component into two valid ports and two invalid ports (i.e., Bif-mode=001); splitting the port component into three valid ports and one invalid port (i.e., Bif-mode=010); or splitting the port component into four valid ports (i.e., Bif-mode=011). Based on the splitting information, the logic device can classify different ports into valid ports and invalid ports, so that the on-state signal of the valid port is in a valid state.
[0040] After determining the valid ports, port numbers are assigned to them. For example, one valid port can be assigned C0, two valid ports can be assigned C0 and C1, three valid ports can be assigned C0, C1, and C2, and four valid ports can be assigned C0, C1, C2, and C3. Since each valid port can connect to one device, the port numbers are sent to the corresponding devices for subsequent reporting of presence signals from the devices to the logic devices.
[0041] In this embodiment, during the startup process of the processing component, the splitting information of the interface component is sent to the logic device via the first serial bus. The logic device assigns a port number to the device accordingly. Subsequently, the presence signal of different devices can be matched and received according to the port number, which simplifies the cables on the server board. At the same time, it can be compatible with more interface component splitting logic without the need to customize special cables to adapt to different interface component splitting methods.
[0042] In an optional embodiment of this application, the device corresponding to the valid port has a corresponding port presence signal, and step 102 includes: Scan the device according to the port number; When the port number matches the target port number, the target port presence signal of the target device corresponding to the target port number is obtained; The target port presence signal is determined as the device presence signal.
[0043] In this embodiment, since each valid port has been assigned a port number (such as C0), each device connected to a logic device on a valid port can report the corresponding port presence signal to the logic device. When transmitting the presence signal, the logic device scans the devices connected to each valid port in the order of the port numbers. After the target device matches the corresponding target port number, it reports the corresponding target port presence signal to the logic device as the presence signal of the target device.
[0044] In this embodiment, the logic device scans and obtains the target port presence signal of each target device, then parses it and reports it to the processing component so that the processing component can execute the corresponding hot-plugging process, thereby significantly reducing the number of cables used.
[0045] In one optional embodiment of this application, the device is a backplane, a hard disk is connected to the backplane, and the logic device is connected to the backplane via a second serial bus. Scanning the device according to the port number includes: When the hard drive is hot-swapped, the interrupt notification signal reported by the backplane is received via the second serial bus; Based on the interrupt notification signal, perform a scan of the device according to the port number.
[0046] In one embodiment, the logic device is a motherboard CPLD, which is connected to a backplane CPLD via a second serial bus, which can be an I2C bus. In another embodiment, devices such as NVMe hard drives can also be connected to the backplane CPLD.
[0047] As a data conversion and collection processing center, the motherboard CPLD triggers an interrupt notification signal to the motherboard CPLD when a hot-plugging action of an NVMe hard drive occurs on the backplane CPLD. This interrupt notification signal is compressed into I2C data and transmitted to the motherboard CPLD via the second serial bus. The motherboard CPLD then acts as the master of the I2C bus and scans the backplane CPLD according to the port number to determine which backplane CPLD the hard drive on has been hot-plugged.
[0048] In this embodiment of the application, after a hard drive is hot-swapped, the motherboard CPLD scans and determines which backplane CPLD the hard drive on which the hot-swapping action occurred, so that the processing component can execute the corresponding hot-swapping process, thereby significantly reducing the number of cables used.
[0049] In one optional embodiment of this application, step 103 includes: Get the table corresponding to the splitting method; The target presence signal corresponding to the device's presence signal is determined according to the splitting method correspondence table. The target presence signal includes device presence and device absence.
[0050] In this embodiment, the target presence signal of the device can be determined as either device presence or device absence based on the device's presence signal by looking up a splitting method mapping table. In one example, a splitting method mapping table for an interface component includes the correspondence between data such as Bif-mode, splitting method, CPU controller splitting code (i.e., splitting information), presence signal, and the target presence signal corresponding to the presence signal.
[0051] In this embodiment, the logic device can parse the in-situ signal of the device according to the splitting method correspondence table, obtain the target in-situ signal corresponding to the device, and report it to the processing component so that the processing component can execute the corresponding hot-plugging process, thereby significantly reducing the number of cables used.
[0052] In an optional embodiment of this application, the invalid port has a corresponding port presence signal, and the method includes: Set the port presence signal of the invalid port to indicate that the device is not present.
[0053] In the splitting method correspondence table, to facilitate the logic device's processing of port presence signals and reporting of target presence signals, the port presence signal of an invalid port can be set to "device not present". That is, when the logic device scans an invalid port, it can directly default the port presence signal of the invalid port to "device not present".
[0054] In the embodiments of this application, when an invalid port is detected, the logic device can directly assume that the port presence signal of the invalid port is not present, thereby facilitating the logic device to subsequently report the target presence signal of the invalid port to the processing component.
[0055] In an optional embodiment of this application, the processing component has a corresponding operating system, and step 104 includes: The target presence signal is reported to the processing component, so that the processing component reports the target presence signal to the operating system, and the operating system executes a device loader or a device uninstaller based on the target presence signal.
[0056] The logic device reports the parsed target presence signals of each device to the processing component. The processing component then reports these signals to the OS (Operating System). The OS determines whether the target presence signal of each device has changed compared to the previously received target presence signal and executes the corresponding hot-plug procedure. In one example, if the previous target presence signal for a device was "device not present," and the current target presence signal is "device present," then it is determined that a device loading procedure needs to be executed for that device. Conversely, if the previous target presence signal for a device was "device present," and the current target presence signal is "device not present," then it is determined that a device unloading procedure needs to be executed for that device.
[0057] In this embodiment, the processing component receives the target presence signal from each device through logic devices, and the operating system determines and executes the corresponding hot-plug procedure, eliminating the need for each device to transmit the presence signal through its own corresponding cable, thus significantly reducing the number of cables used.
[0058] The following is passed Figure 3 This application provides an example of the system architecture of a hot-plugging method for a device according to an embodiment of the present application, so as to enable those skilled in the art to better understand the system architecture of the embodiments of the present application.
[0059] Reference Figure 3 This is a schematic diagram of the system structure of an embodiment of a hot-plugging method for a device according to this application.
[0060] like Figure 3 As shown, the server board (i.e., the motherboard) has two CPUs, namely CPU0 and CPU1. CPU0 has four RCs: CPU0_D0_RC, CPU0_D1_RC, CPU0_D2_RC and CPU0_D3_RC; CPU1 has four RCs: CPU1_D0_RC, CPU1_D1_RC, CPU1_D2_RC and CPU1_D3_RC.
[0061] Reference Figure 2Each RC has the following four splitting methods: (1) If Bif-mode=0, then only bit signal 1 is valid, and the CPU internal C0 corresponds to bit signal 1; (2) If Bif-mode=1, then in-situ signal 1 and in-situ signal 2 are valid. The CPU internally corresponds to in-situ signal 1 with C0 and in-situ signal 2 with C1. (3) If Bif-mode=2, then the in-bit signals 1, 2 and 3 are valid. The CPU internally matches in-bit signal 1 with C0, in-bit signal 2 with C1, and in-bit signal 3 with C2. (4) If BIF-mode=3, then the in-bit signals 1, 2, 3 and 4 are valid. The CPU internally matches in-bit signal 1 with C0, in-bit signal 3 with C1, in-bit signal 4 with C2 and in-bit signal 2 with C3.
[0062] Taking CPU0_D0_RC as an example, the table of splitting methods for each RC is shown in Table 1. The table includes the internal Bif-mode correspondence of CPU0 (i.e., the allocated port number), the RC controller PCIE lane splitting method, the current CPU controller splitting code (i.e., splitting information) transmitted by the CPU to the motherboard CPLD, and the presence signal (i.e., the target presence signal) notified by the motherboard CPLD to the CPU. Specifically, in the presence signal notified by the motherboard CPLD to the CPU, taking the X16 splitting method as an example, "CPU0_D0_C0 controller: present = 0; absent = 1" indicates that C0 is a valid port. When the device corresponding to C0 is present, the target presence signal is 0; when the device corresponding to C0 is absent, the target presence signal is 1. "CPU0_D0_C1 controller present = 1: absent" indicates that C1 is an invalid port, and by default, the device corresponding to this port is absent. The presence signals notified by the motherboard CPLD to the CPU for the remaining ports can be deduced similarly and will not be elaborated further here.
[0063] Table 1. Correspondence Table of CPU0_D0_RC Splitting Methods
[0064]
[0065]
[0066] The server board also features a motherboard CPLD (Logic Component Locking Device), which can be an OCP card. The motherboard CPLD connects to the backplane CPLD (device) via a T2C bus. Figure 3Only backplane 1 and backplane 2 are shown. The actual number of devices that the motherboard CPLD can connect to is determined by the way the CPU's various RCs are split. Each backplane CPLD can connect to n NVME hard drives, where n is an integer.
[0067] The presence signal of each NVMe hard drive is transmitted to the backplane CPLD. When an NVMe hard drive is hot-swapped, the backplane CPLD, acting as an I2C slave, triggers an interrupt notification signal to the motherboard CPLD via the HP_INT# signal. The motherboard CPLD, acting as an I2C master, receives the interrupt notification signal and parses the presence signal transmitted from the backplane using a lookup table to obtain the target presence signal. The motherboard CPLD then transmits this target presence signal to the corresponding CPU to trigger the hot-swap procedure.
[0068] In one embodiment, in some systems with high real-time requirements, high-speed buses such as PCIe can be used to replace the I2C bus. By compressing data on high-speed buses such as PCIe for in-situ signal transmission, the real-time performance of data transmission and parsing can be improved, and the hot-plug response efficiency can be greatly enhanced.
[0069] In this embodiment, the device is connected to a logic device, and the logic device is connected to an interface component of the processing component. The splitting method of the interface component is obtained; the device's presence signal is determined; the presence signal is parsed according to the splitting method to obtain a target presence signal; and the target presence signal is reported to the processing component so that the processing component executes the corresponding hot-plug procedure based on the target presence signal. This embodiment uses a logic device as the data processing center. The logic device obtains the splitting method of the interface component of the processing component. Since the device is connected to the logic device, the presence signals of all devices connected to the processing component must first be transmitted to the logic device. The logic device parses the device's presence signal according to the obtained interface component splitting method to obtain the target presence signal corresponding to the device, and reports it to the processing component so that the processing component executes the corresponding hot-plug procedure. This significantly reduces the number of cables used and avoids the need to customize dedicated cables to adapt to different interface component splitting methods, thus reducing the design complexity of the server board.
[0070] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of this application.
[0071] Based on the above embodiments, this embodiment also provides a hot-swap device for devices, which can be applied to terminal devices, servers and other electronic devices.
[0072] Reference Figure 4 The diagram illustrates a structural block diagram of an embodiment of a hot-plugging device for a device according to this application, which may specifically include the following modules: The splitting method determination module 401 is used to obtain the splitting method of the interface component; The presence signal acquisition module 402 is used to determine the presence signal of the device; The in-situ signal determination module 403 is used to parse the in-situ signal according to the splitting method to obtain the target in-situ signal; The in-situ signal reporting module 404 is used to report the target in-situ signal to the processing component, so that the processing component can execute the corresponding hot-plug procedure according to the target in-situ signal.
[0073] Optionally, the logic device and the interface component are connected via a first serial bus, the splitting method has corresponding port combinations, the port combination includes at least one port on the interface component, and the splitting method determining module 401 includes: The processing component startup submodule is used to receive splitting information sent by the processing component through the first serial bus during the startup process of the processing component. The splitting information is used to divide the port into valid ports and invalid ports. The splitting information parsing submodule is used to determine the splitting method of the interface component based on the splitting information; The port number allocation submodule is used to allocate port numbers to the valid ports according to the port combinations corresponding to the splitting method, and the valid ports have corresponding devices; The port number distribution submodule is used to distribute the port number to the device accordingly; The splitting methods include: The port component can be split into one valid port and three invalid ports, or into two valid ports and two invalid ports, or into three valid ports and one invalid port, or into four valid ports.
[0074] Optionally, the device corresponding to the valid port has a corresponding port presence signal, and the presence signal acquisition module 402 includes: The device scanning submodule is used to scan the device according to the port number; The number matching submodule is used to obtain the target port presence signal of the target device corresponding to the target port number when the port number matches the target port number; The target signal determination submodule is used to determine the target port presence signal as the presence signal of the device.
[0075] Optionally, the device is a backplane, a hard drive is connected to the backplane, and the logic device is connected to the backplane via a second serial bus. The device scanning submodule includes: An interrupt signal receiving unit is used to receive an interrupt notification signal reported by the backplane via the second serial bus when the hard disk is hot-plugged. An interrupt signal processing unit is configured to perform a device scan according to the port number based on the interrupt notification signal.
[0076] Optionally, the presence signal determination module 403 includes: The table retrieval submodule is used to retrieve the table corresponding to the splitting method; The table determination submodule is used to determine the target presence signal corresponding to the presence signal of the device according to the table of the splitting method. The target presence signal includes the presence of the device and the absence of the device.
[0077] Optionally, the invalid port has a corresponding port presence signal, and the device includes: An invalid port setting module is used to set the port presence signal of the invalid port to indicate that the device is not present.
[0078] Optionally, the processing component has a corresponding operating system, and the in-situ signal reporting module 404 is specifically used for: The target presence signal is reported to the processing component, so that the processing component reports the target presence signal to the operating system, and the operating system executes a device loader or a device uninstaller based on the target presence signal.
[0079] This application embodiment uses a logic device as the data processing center. The logic device obtains the splitting method of the interface components of the processing component. Since the devices are connected to the logic device, the presence signals of all devices connected to the processing component must first be transmitted to the logic device. The logic device parses the presence signals of the devices according to the obtained interface component splitting method to obtain the target presence signal corresponding to the device, and reports it to the processing component so that the processing component can perform the corresponding hot-plugging process. This significantly reduces the number of cables used and avoids the need to customize special cables to adapt to different interface component splitting methods, thereby reducing the design complexity of the server board.
[0080] Reference Figure 5 This is a flowchart illustrating the steps of another embodiment of the hot-plugging method for a device in this application.
[0081] like Figure 5 As shown in some embodiments of this application, the hot-plugging method of the device provided in this application is illustrated using a target CPU (Central Processing Unit) platform as an example. The target CPU platform has the following characteristics: Compared to other CPUs, this CPU obtains information about the presence of hot-plugged devices or hard drives through a single PIN signal. According to the CPU manufacturer's solution, each CPU needs to output 16 single-PIN signals, and two CPUs need to output 32 single-PIN signals, which is impractical for deployment in a complete system environment. This application integrates these single-PIN signals into a bus mode for collection and then transmits them to the CPU one by one, thus meeting the needs of system deployment. When executing the hot-plugging method of the device provided in this application, applied to a logic device, the device is connected to the logic device, and the logic device is connected to the interface component of the processing component (i.e., the target CPU platform), the following steps are included: Step 501: Obtain the splitting method of the interface component.
[0082] Step 502: Determine the presence signal of the device.
[0083] Step 503: Analyze the in-situ signal according to the splitting method to obtain the target in-situ signal.
[0084] Step 504: Report the target presence signal to the processing component so that the processing component executes the corresponding hot-plug procedure based on the target presence signal.
[0085] Optionally, the logic device and the interface component are connected via a first serial bus, the splitting method has corresponding port combinations, the port combination includes at least one port on the interface component, and obtaining the splitting method of the interface component includes: During the startup of the processing component, the splitting information sent by the processing component is received through the first serial bus. The splitting information is used to divide the port into valid ports and invalid ports. The splitting method of the interface component is determined based on the splitting information; Based on the port combination corresponding to the splitting method, a port number is assigned to the valid port, and the valid port has a corresponding device; The port number is then sent to the device. The splitting methods include: The port component can be split into one valid port and three invalid ports, or into two valid ports and two invalid ports, or into three valid ports and one invalid port, or into four valid ports.
[0086] Optionally, the device corresponding to the valid port has a corresponding port presence signal, and determining the presence signal of the device includes: Scan the device according to the port number; When the port number matches the target port number, the target port presence signal of the target device corresponding to the target port number is obtained; The target port presence signal is determined as the device presence signal.
[0087] Optionally, the device is a backplane, a hard drive is connected to the backplane, and the logic device is connected to the backplane via a second serial bus. Scanning the device according to the port number includes: When the hard drive is hot-swapped, the interrupt notification signal reported by the backplane is received via the second serial bus; Based on the interrupt notification signal, perform a scan of the device according to the port number.
[0088] Optionally, parsing the in-situ signal according to the splitting method to obtain the target in-situ signal includes: Get the table corresponding to the splitting method; The target presence signal corresponding to the device's presence signal is determined according to the splitting method correspondence table. The target presence signal includes device presence and device absence.
[0089] Optionally, the invalid port has a corresponding port presence signal, and the method includes: Set the port presence signal of the invalid port to indicate that the device is not present.
[0090] Optionally, the processing component has a corresponding operating system, and the step of reporting the target presence signal to the processing component so that the processing component executes a corresponding hot-plugging procedure based on the target presence signal includes: The target presence signal is reported to the processing component, so that the processing component reports the target presence signal to the operating system, and the operating system executes a device loader or a device uninstaller based on the target presence signal.
[0091] This application also provides a non-volatile readable storage medium storing one or more modules (programs). When these modules are applied to a device, they enable the device to execute the instructions for the method steps in this application.
[0092] This application provides one or more machine-readable media storing instructions that, when executed by one or more processors, cause an electronic device to perform one or more of the methods described in the above embodiments. In this application, the electronic device includes various types of devices such as terminal devices and servers (clusters).
[0093] The embodiments of this disclosure can be implemented as an apparatus configured as desired using any suitable hardware, firmware, software, or any combination thereof, including electronic devices such as terminal devices, servers (clusters), etc. Figure 6 An exemplary apparatus 600 is schematically shown that can be used to implement the various embodiments described in this application.
[0094] In one embodiment, Figure 6 An exemplary device 600 is shown, which includes one or more processors 602, a control module (chipset) 604 coupled to at least one of the processors 602, a memory 606 coupled to the control module 604, a non-volatile memory (NVM) / storage device 608 coupled to the control module 604, one or more input / output devices 610 coupled to the control module 604, and a network interface 612 coupled to the control module 604.
[0095] Processor 602 may include one or more single-core or multi-core processors, and processor 602 may include any combination of general-purpose processors or special-purpose processors (e.g., graphics processors, application processors, baseband processors, etc.). In some embodiments, device 600 can serve as a terminal device, server (cluster), or other device as described in the embodiments of this application.
[0096] In some embodiments, apparatus 600 may include one or more computer-readable media (e.g., memory 606 or NVM / storage device 608) having instructions 614 and one or more processors 602 that are combined with the one or more computer-readable media and configured to execute instructions 614 to implement modules and thus perform the actions described in this disclosure.
[0097] In one embodiment, the control module 604 may include any suitable interface controller to provide any suitable interface to at least one of the processors 602 and / or any suitable device or component communicating with the control module 604.
[0098] The control module 604 may include a memory controller module to provide an interface to the memory 606. The memory controller module may be a hardware module, a software module, and / or a firmware module.
[0099] Memory 606 may be used, for example, to load and store data and / or instructions 614 for device 600. In one embodiment, memory 606 may include any suitable volatile memory, such as suitable DRAM. In some embodiments, memory 606 may include double data rate type quad synchronous dynamic random access memory (DDR4 SDRAM).
[0100] In one embodiment, the control module 604 may include one or more input / output controllers to provide an interface to the NVM / storage device 608 and (one or more) input / output devices 610.
[0101] For example, NVM / storage device 608 may be used to store data and / or instructions 614. NVM / storage device 608 may include any suitable non-volatile memory (e.g., flash memory) and / or may include any suitable (one or more) non-volatile storage devices (e.g., one or more hard disk drive (HDD), one or more optical disc (CD) drives, and / or one or more digital universal optical disc (DVD) drives).
[0102] NVM / storage device 608 may include storage resources that are physically part of a device on which device 600 is mounted, or that are accessible to the device but do not necessarily have to be part of the device. For example, NVM / storage device 608 may be accessed via a network via one or more input / output devices 610.
[0103] One or more input / output devices 610 may provide an interface for device 600 to communicate with any other suitable device. Input / output devices 610 may include communication components, audio components, sensor components, etc. A network interface 612 may provide an interface for device 600 to communicate via one or more networks. Device 600 may wirelessly communicate with one or more components of a wireless network according to any of one or more wireless network standards and / or protocols, such as accessing wireless networks based on communication standards, such as WiFi, 2G, 3G, 4G, 5G, etc., or combinations thereof.
[0104] In one embodiment, at least one of the processors 602 may be logically packaged with one or more controllers (e.g., memory controller modules) of the control module 604. In one embodiment, at least one of the processors 602 may be logically packaged with one or more controllers of the control module 604 to form a system-in-package (SiP). In one embodiment, at least one of the processors 602 may be integrated with the logic of one or more controllers of the control module 604 on the same die. In one embodiment, at least one of the processors 602 may be integrated with the logic of one or more controllers of the control module 604 on the same die to form a system-on-a-chip (SoC).
[0105] In various embodiments, device 600 may be, but is not limited to, a server, desktop computing device, or mobile computing device (e.g., laptop, handheld computing device, tablet, netbook, etc.). In various embodiments, device 600 may have more or fewer components and / or different architectures. For example, in some embodiments, device 600 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touchscreen display), a non-volatile memory port, multiple antennas, a graphics chip, an application-specific integrated circuit (ASIC), and a speaker.
[0106] The detection device can use a main control chip as a processor or control module, and sensor data, position information, etc. can be stored in a memory or NVM / storage device. The sensor group can be used as an input / output device, and the communication interface can include a network interface.
[0107] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0108] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0109] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a hot-swappable terminal device, such as a general-purpose computer, special-purpose computer, embedded processor, or other programmable device, to produce a machine, such that the instructions, which execute via the processor of the hot-swappable terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0110] These computer program instructions may also be stored in a computer-readable storage medium that enables a hot-pluggable terminal device of a computer or other programmable device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0111] These computer program instructions can also be loaded onto a hot-pluggable terminal device of a computer or other programmable device, causing a series of operational steps to be performed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0112] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0113] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0114] The above provides a detailed description of a hot-plugging method and apparatus for a device, an electronic device, and a storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for hot-plugging a device, characterized in that, Applied to a logic device, the device is connected to the logic device, the logic device is connected to an interface component of a processing component, the logic device and the interface component are connected via a first serial bus, the splitting method has corresponding port combinations, the port combination includes at least one port on the interface component, the method includes: During the startup of the processing component, the splitting information sent by the processing component is received through the first serial bus. The splitting information is used to divide the port into valid ports and invalid ports. The device corresponding to the valid port has a corresponding port presence signal. The splitting method of the interface component is determined based on the splitting information; wherein, the splitting method includes: splitting the port component into one valid port and three invalid ports, splitting the port component into two valid ports and two invalid ports, splitting the port component into three valid ports and one invalid port, or splitting the port component into four valid ports; Based on the port combination corresponding to the splitting method, a port number is assigned to the valid port, and the valid port has a corresponding device; The port number is then sent to the device. Scan the device according to the port number; When the port number matches the target port number, the target port presence signal of the target device corresponding to the target port number is obtained; The target port presence signal is determined as the device presence signal; Get the table corresponding to the splitting method; The target on-spot signal corresponding to the on-spot signal of the device is determined according to the splitting method correspondence table, and the target on-spot signal includes the device being on-spot and the device not being on-spot. The target presence signal is reported to the processing component so that the processing component executes the corresponding hot-plug procedure based on the target presence signal.
2. The hot-swap method for the device according to claim 1, characterized in that, The device is a backplane, a hard drive is connected to the backplane, and the logic devices are connected to the backplane via a second serial bus. Scanning the device according to the port number includes: When the hard drive is hot-swapped, the interrupt notification signal reported by the backplane is received via the second serial bus; Based on the interrupt notification signal, perform a scan of the device according to the port number.
3. The hot-swap method for the device according to claim 1, characterized in that, The invalid port has a corresponding port presence signal, and the method includes: Set the port presence signal of the invalid port to indicate that the device is not present.
4. The hot-swap method for the device according to claim 1, characterized in that, The processing component has a corresponding operating system. Reporting the target presence signal to the processing component so that the processing component executes a corresponding hot-plugging procedure based on the target presence signal includes: The target presence signal is reported to the processing component, so that the processing component reports the target presence signal to the operating system, and the operating system executes a device loader or a device uninstaller based on the target presence signal.
5. A hot-swap device for a device, characterized in that, Applied to a logic device, the device is connected to the logic device, the logic device is connected to an interface component of a processing component, the logic device and the interface component are connected via a first serial bus, and the splitting method has corresponding port combinations, the port combination including at least one port on the interface component, the device comprising: The processing component startup submodule is used to receive splitting information sent by the processing component through the first serial bus during the startup process of the processing component. The splitting information is used to divide the port into valid ports and invalid ports. The device corresponding to the valid port has a corresponding port presence signal. The splitting information parsing submodule is used to determine the splitting method of the interface component based on the splitting information; wherein, the splitting method includes: splitting the port component into one valid port and three invalid ports, splitting the port component into two valid ports and two invalid ports, splitting the port component into three valid ports and one invalid port, or splitting the port component into four valid ports; The port number allocation submodule is used to allocate port numbers to the valid ports according to the port combinations corresponding to the splitting method, and the valid ports have corresponding devices; The port number distribution submodule is used to distribute the port number to the device accordingly; The device scanning submodule is used to scan the device according to the port number; The number matching submodule is used to obtain the target port presence signal of the target device corresponding to the target port number when the port number matches the target port number; The target signal determination submodule is used to determine the target port presence signal as the presence signal of the device. The table retrieval submodule is used to retrieve the table corresponding to the splitting method; The table determination submodule is used to determine the target presence signal corresponding to the presence signal of the device according to the table of the splitting method, wherein the target presence signal includes device presence and device absence. The in-situ signal reporting module is used to report the target in-situ signal to the processing component, so that the processing component can execute the corresponding hot-plug procedure according to the target in-situ signal.
6. An electronic device, characterized in that, include: processor; and A memory having executable code stored thereon, which, when executed, causes the processor to perform a hot-plugging method for the device as described in one or more of claims 1-4.
7. One or more machine-readable media having executable code stored thereon, which, when executed, causes a processor to perform a hot-plugging method of one or more of the devices as claimed in claims 1-4.