Power on / off control method and system for PCIe device
By remotely controlling the power-on and power-off of PCIe devices, the problem of high maintenance costs when NVMe SSDs fail is solved, and device management and stable system testing without human intervention are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZTE CORP
- Filing Date
- 2019-11-20
- Publication Date
- 2026-08-04
AI Technical Summary
In server storage systems, when an NVMe SSD fails, maintenance personnel need to manually power it on and off, which results in high maintenance costs and may cause system malfunctions due to plugging and unplugging.
A method for controlling the power-on and power-off of a PCIe device is provided. Through the coordinated work of a CPU, a logic module, and a power control module, the method enables remote control of the power-on and power-off of the PCIe device. This includes receiving operation commands, simulating the device's on-site state, controlling the clock and reset signals, triggering hot-plug drive operations, and power management.
It reduces the workload of maintenance personnel, avoids system anomalies caused by manual plugging and unplugging, and improves the reliability of system testing and maintenance efficiency.
Smart Images

Figure CN112825011B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic technology, and in particular to a power-on / off control method and system for a PCIe device. Background Technology
[0002] PCIe (Peripheral Component Interconnect express) is a high-speed serial computer expansion bus standard, mainly used for data interaction between the CPU (Central Processing Unit) and peripheral devices.
[0003] For example, Non-Volatile Memoryexpress Solid State Disk (NVMe SSD) is a PCIe device based on the PCIe bus interface. Currently, NVMe SSDs are gradually replacing traditional hard disk drives (HDDs) and are widely used in server storage systems. Server storage systems typically employ storage arrays containing multiple NVMe SSDs. When an NVMe SSD in a storage array fails, maintenance personnel often need to perform a power-on / power-off operation to determine if the NVMe SSD can recover and whether replacement is necessary. However, this power-on / power-off operation often requires maintenance personnel to manually operate within the data center, resulting in high maintenance costs. Summary of the Invention
[0004] The following is an overview of the subject matter described in detail herein. This overview is not intended to limit the scope of the claims.
[0005] On the one hand, the embodiments of this application provide a method, system, device and computer-readable storage medium for controlling the power-on and power-off of PCIe devices, which can realize remote control of the power-on and power-off of PCIe devices and help reduce operation and maintenance costs.
[0006] On the other hand, embodiments of this application provide a power-on / off control method for a PCIe device, including:
[0007] Receive operation instructions from the CPU, the operation instructions including a power-on instruction or a power-off instruction carrying target device information;
[0008] Simulate the in-situ state of the target device according to the operation instructions;
[0009] Based on the simulated in-situ state of the target device, enable the clock and reset signal that control the target device;
[0010] The simulated target device's in-situ status is reported to the CPU to trigger the operating system's hot-plug driver to add or remove the target device.
[0011] Furthermore, based on the operation instructions, corresponding power control instructions are output to the power control module, so that the power control module controls the power signal supplied to the target device to be turned on or off.
[0012] On the other hand, embodiments of this application provide a power-on / off control method for a PCIe device, including:
[0013] Receive operation instructions from the system application layer and forward the operation instructions to the logic module. The operation instructions include power-on instructions or power-off instructions carrying target device information.
[0014] Based on the simulated in-situ state of the target device from the logic module, the operating system's hot-plug driver is triggered to perform the operation of adding or removing the target device.
[0015] On the other hand, embodiments of this application provide a power-on / off control system, including:
[0016] The CPU is used to receive operation instructions from the system application layer and forward the operation instructions to the logic module. The operation instructions include power-on instructions or power-off instructions carrying target device information; and, based on the simulated target device presence status from the logic module, trigger the operating system's hot-plug driver to perform operations to add or remove the target device.
[0017] The logic module is configured to receive operation instructions from the CPU, including power-on or power-off instructions carrying target device information; simulate the on-state of the target device according to the operation instructions; enable the clock and reset signal of the target device according to the simulated on-state of the target device; report the simulated on-state of the target device to the CPU to trigger the hot-plug driver of the operating system to perform the operation of adding or removing the target device; and output corresponding power control instructions to the power control module according to the operation instructions, so that the power control module controls the power signal supplied to the target device to be turned on or off.
[0018] The power control module is used to receive and control the power signal supplied to the target device to be turned on or off according to the power control command from the logic module.
[0019] On the other hand, embodiments of this application provide an apparatus, including:
[0020] Memory, used to store programs;
[0021] A processor is configured to execute a program stored in the memory. When the processor executes the program stored in the memory, the processor is configured to execute any of the power-on / off control methods for a PCIe device as described above.
[0022] In another aspect, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which are used to execute any of the above-described power-on / off control methods for a PCIe device.
[0023] This application embodiment includes: receiving an operation instruction from a CPU, the operation instruction including a power-on instruction or a power-off instruction carrying target device information; simulating the on-site state of the target device according to the operation instruction; enabling the clock and reset signal of the target device according to the simulated on-site state of the target device; reporting the simulated on-site state of the target device to the CPU to trigger the hot-plug driver of the operating system to perform the operation of adding or removing the target device; and outputting a corresponding power control instruction to a power control module according to the operation instruction, so that the power control module controls the power signal supplied to the target device to be turned on or off. Based on the technical solution of this application embodiment, it is possible to remotely control the power-on and power-off of the PCIe device in the computer room when a PCIe device malfunctions, to determine whether the device needs to be replaced, without requiring maintenance personnel to enter the computer room, reducing the workload of maintenance personnel. It is also possible to remove the device by using a power-off instruction before replacing the PCIe device, avoiding system abnormalities caused by forceful insertion or removal of the device. In addition, the solution provided in this application can be used for the stability testing of the hot-plug function of PCIe devices during the system development and testing phase, avoiding a large amount of manual insertion and removal of disks, and improving the reliability of system testing.
[0024] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the description, claims and drawings. Attached Figure Description
[0025] The accompanying drawings are used to provide a further understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.
[0026] Figure 1 This is a schematic diagram of the power-on / off control system of a PCIe device provided in the embodiments of this application;
[0027] Figure 2 This is a schematic diagram of the power-on / off control system of another PCIe device provided in an embodiment of this application;
[0028] Figure 3 This is a flowchart of a power-on / off control method for a PCIe device provided in an embodiment of this application;
[0029] Figure 4 This is a flowchart of another PCIe device power-on / off control method provided in an embodiment of this application;
[0030] Figure 5 This is a schematic diagram of the structure of a device provided in an embodiment of this application. Detailed Implementation
[0031] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0032] It should be understood that in the description of the embodiments of this application, "multiple" (or more than) means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. If "first," "second," etc., are used, they are only for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.
[0033] PCIe (Peripheral Component Interconnect Express) is a high-speed serial computer expansion bus standard, mainly used for data interaction between the CPU (Central Processing Unit) and peripheral devices.
[0034] For example, Non-Volatile Memoryexpress Solid State Disk (NVMe SSD) is a PCIe device based on the PCIe bus interface. Currently, NVMe SSDs are gradually replacing traditional hard disk drives (HDDs) and are widely used in server storage systems. Server storage systems typically employ storage arrays containing multiple NVMe SSDs. When an NVMe SSD in a storage array fails, maintenance personnel often need to perform a power-on / power-off operation to determine if the NVMe SSD can recover and whether replacement is necessary. However, this power-on / power-off operation often requires maintenance personnel to manually operate within the data center, resulting in high maintenance costs.
[0035] To address the aforementioned technical problems, this application provides a method, system, device, and computer-readable storage medium for controlling the power-on and power-off of PCIe devices. This enables remote control of PCIe devices to power on and off, and allows for the removal of PCIe devices via a power-off command before replacing faulty devices, thus avoiding system malfunctions caused by forceful insertion or removal of devices.
[0036] Figure 1 This application illustrates a power-on / off control system 100 for a PCIe device according to an embodiment of the present application. For example... Figure 1 As shown, the system 100 includes, but is not limited to, a CPU 110, a logic module 120, and a power control module 130. The CPU 110 is connected to N PCIe devices 140 and the logic module 120 respectively, where N is an integer greater than or equal to 1; the logic module 120 is connected to N PCIe devices 140 and the power control module 130 respectively. The power control module 130 is connected to the N PCIe devices 140.
[0037] Figure 1 The topology of the system 100 shown is suitable for applications where the number of PCIe devices 140 is small and the number of PCIe lanes of the CPU 110 itself can meet the connection requirements of N PCIe devices 140. The CPU 110 can directly connect to the PCIe interfaces of N PCIe devices 140 through N PCIe buses, and can also connect to the logic module 120 through the I2C bus, thereby reducing the complexity and cost of system design.
[0038] In another possible design, such as Figure 2 As shown, CPU 110 is connected to N PCIe devices 140 via PCIe switch module 150, which expands the number of PCIe lanes. Optionally, CPU 110 is connected to PCIe switch module 150 via a PCIe bus, and PCIe switch module 150 connects to N PCIe devices 140 via N PCIe buses. The PCIe buses and PCIe devices 140 can be connected via fixed connectors (e.g., slots). CPU 110 is also connected to logic module 120 via PCIe switch module 150. Specifically, PCIe switch module 150 and logic module 120 can be connected via I2C bus. The I2C bus can flexibly select the interface to connect to, such as the Local Bus interface, depending on the interface provided by PCIe switch module 150.
[0039] In this embodiment, the logic module 120 may be a CPLD (Complex Programmable Logic Device). Those skilled in the art will understand that the logic module 120 may also be an FPGA (Field Programmable Gate Array) or other similar logic devices. This application does not impose excessive restrictions on the type of the logic module 120.
[0040] Optional, such as Figure 2 As shown, logic module 120 can be connected to power control module 130 via I / O expansion chip 160. Logic module 120 and I / O expansion chip 160 can be connected via an I2C bus. I / O expansion chip 160 is connected to power control module 130 via N I / O signal transmission lines. Those skilled in the art should understand that when the number of PCIe devices 140 is large and one I / O expansion chip 160 cannot meet the I / O interface requirements, the number of I / O expansion chips 160 can be increased as needed, simply by setting the I2C addresses of the I / O expansion chips 160 to different addresses.
[0041] It should be understood that when the number of PCIe devices 140 is small and the number of I / O interfaces of the logic module 120 itself is sufficient, the I / O expansion chip 160 can be removed, such as... Figure 1 As shown in the structure, the logic module 120 is directly connected to the power control module 130 through its own I / O interface and N I / O signal transmission lines.
[0042] In this embodiment, the power control module 130 has N power output terminals, which are connected to N PCIe devices 140 via N power transmission lines to output power signals to the N PCIe devices 140. The power signal outputs of the N power output units are controlled by the I / O signals of the logic module 120 to enable the power-on and power-off of the PCIe devices 140.
[0043] Figure 3 A flowchart illustrating a power-on / off control method for a PCIe device according to an embodiment of this application is shown. This method can be applied to the power-on / off control system 100 described above, which includes a CPU 110, a logic module 120, and a power control module 130. Figure 3 As shown, the method includes, but is not limited to, the following steps.
[0044] S201, the CPU receives operation instructions from the system application layer and forwards the operation instructions to the logic module.
[0045] The operation instructions include power-on or power-off instructions carrying information about the target device.
[0046] For example, maintenance personnel can input operation commands through an application installed in the system application layer. These operation commands include power-on commands for powering on the target device and power-off commands for powering off the target device. After receiving the power-on or power-off command carrying the target device information from the system application layer, the CPU forwards the power-on or power-off command to the logic module via the I2C bus.
[0047] S202, the logic module receives operation instructions from the CPU.
[0048] The operation instructions include power-on or power-off instructions carrying information about the target device.
[0049] S203, the logic module simulates the in-situ state of the target device according to the operation instructions.
[0050] For example, when the logic module receives an operation instruction from the CPU, it can parse the operation instruction to determine whether the operation instruction is a power-on instruction or a power-off instruction, and then determine the target device and the slot where the target device is located based on the target device information carried in the power-on instruction or power-off instruction.
[0051] When the operation command received by the logic module is a power-on command, it simulates the actual state of the target device; when the operation command received by the logic module is a power-off command, it simulates that the target device is not in place.
[0052] The actual status of the target device can be obtained from the registers configured on the target device. Generally, PCIe devices are configured with registers to record their presence status. The value in these registers indicates whether the PCIe device in the corresponding slot is present. For example, a register value of 1 indicates that the PCIe device in the slot is not present; a register value of 0 indicates that the PCIe device in the slot is present.
[0053] In practical implementation, a register for recording the simulated presence status of the target device can be set in the logic module, and the state of the target device can be simulated by updating the value of this register. For example, when simulating the target device being absent, the value of the register for recording the simulated presence status is set to 1; when simulating the target device being present, the value of the register for recording the simulated presence status is set to 0. This embodiment of the application simulates the insertion or removal of a device in the corresponding slot by simulating the presence or absence of the target device.
[0054] S204, the logic module enables the clock and reset signal of the target device based on the simulated target device's in-situ state.
[0055] For example, data transmission in PCIe devices, such as NVMe SSDs, occurs with the clock and reset signals enabled. If the clock and reset signals of a PCIe device are disabled, data transmission will be terminated. In this embodiment, the logic module determines whether to provide an enable signal to enable the clock and reset signals to the target device based on the value of a register that records the simulated in-place state.
[0056] For example, when the value of the register recording the simulated in-place state is 0, the logic module outputs an enable signal to the target device to enable the clock and reset signals, allowing the target device to perform data transmission; when the value of the register recording the simulated in-place state is 1, the logic module stops outputting enable signals to the target device, thereby disabling the clock and reset signals of the target device and causing the target device to terminate data transmission.
[0057] S205, the logic module reports the simulated target device's on-site status to the CPU.
[0058] For example, the logic module sends the in-situ status of the corresponding target device to the CPU via the I2C bus based on the value of the register that records the simulated in-situ status.
[0059] S206, the CPU triggers the operating system's hot-plug driver to perform operations to add or remove the target device based on the simulated target device presence status from the logic module.
[0060] For example, the CPU determines whether there is a device plugging or unplugging action in the slot corresponding to the target device based on the simulated target device presence status information updated by the logic module, and thereby triggers the hot-plug driver of the operating system to perform the operation of adding or removing the target device.
[0061] For example, when the value of the register recording the simulated in-situ state in the logic module is updated from 1 to 0, the CPU, after obtaining this in-situ state update information from the logic module, determines that a device has been inserted into the slot corresponding to the target device. This triggers the operating system's hot-plug driver to add the target device and establish a connection between the PCIe slot and the target device. Conversely, when the value of the register recording the simulated in-situ state in the logic module is updated from 0 to 1, the CPU, after obtaining this in-situ state update information from the logic module, determines that a device has been removed from the slot corresponding to the target device. This triggers the operating system's hot-plug driver to remove the target device and disconnect the connection between the PCIe slot and the target device. Here, the hot-plug driver is a device driver program in the operating system kernel. Since hot-plug drivers are existing technology, they will not be described in detail here.
[0062] S207, the logic module outputs the corresponding power control command to the power control module according to the operation command.
[0063] Specifically, when the operation command received by the logic module is a power-on command, it outputs the target device power-on command to the power control module through the I / O signal transmission line, so that the power control module outputs a power signal to the target device.
[0064] Specifically, when the operation command received by the logic module is a power-down command, it determines whether the hot-plug driver has completed the removal of the target device. If so, it outputs a power-off command for the target device to the power control module through the I / O signal transmission line, so that the power control module stops outputting power signals to the target device.
[0065] To determine whether the hot-plug driver has completed the removal of the target device, the following steps can be taken: obtain the status value of the corresponding PCIe slot power status register, and determine whether the hot-plug process has ended based on the status value.
[0066] For example, a PCIe device is configured with a register for recording the power status of the PCIe slot corresponding to the target device. The logic module can determine whether the hot-plugging process has ended by reading the status value of the power status register.
[0067] S208, the power control module receives and controls the power signal supplied to the target device to be turned on or off according to the power control command from the logic module.
[0068] For example, the power control module determines whether the power control command is a power-on command or a power-off command based on the power control command received from the logic module, and responds to the power control command by performing the operation of turning the power signal of the target device on or off accordingly, thereby completing the power-on and power-off operation of the target device.
[0069] Figure 4 A flowchart of another power-on / off control method for a PCIe device provided in an embodiment of this application is shown. To improve the speed of CPU processing power-on / off commands, combined with… Figure 3 ,like Figure 4 As shown, steps S205 and S206 can be replaced by steps S301 and S302.
[0070] S301, the logic module sends an interrupt signal to the CPU to indicate the update of the in-situ status, and reports the in-situ status of the simulated target device to the CPU.
[0071] The interrupt signal is used to trigger the hot-plug drive in step S206, causing the CPU to execute step S302.
[0072] S302, the CPU receives an interrupt signal from the logic module to indicate an update of the in-situ status, and triggers the operating system's hot-plug driver to perform the operation of adding or removing the target hard disk based on the received simulated in-situ status.
[0073] It should be noted that, in specific implementations, in addition to sending an interrupt signal to the CPU, hot-plugging can also be triggered by polling. This application embodiment does not impose specific restrictions on this.
[0074] Based on the technical solution of this application embodiment, when a PCIe device malfunctions, the PCIe device in the computer room can be remotely powered on and off to determine whether the device needs to be replaced, without requiring maintenance personnel to enter the computer room, thus reducing the workload of maintenance personnel.
[0075] Furthermore, although PCIe devices support hot-swapping, if the system's support for hot-swapping is unreliable, performing plugging and unplugging operations during device replacement can easily lead to system malfunctions and service interruptions. Based on the technical solution of this application embodiment, the device can be removed via a power-down command before replacement, avoiding system malfunctions caused by forceful plugging and unplugging.
[0076] Furthermore, the technical solutions provided in this application can also be applied to the scenario of PCIe device hot-swap function stability testing during the system development and testing phase, avoiding a large number of manual disk insertion and removal operations and improving the reliability of system testing.
[0077] Figure 5 An apparatus 400 provided in an embodiment of this application is shown. For example... Figure 5 As shown, the device 400 includes, but is not limited to:
[0078] Memory 420 is used to store programs;
[0079] The processor 410 is used to execute the program stored in the memory 420. When the processor 410 executes the program stored in the memory 420, the processor 410 is used to execute the power-on / off control method of the PCIe device described above.
[0080] The processor 410 and the memory 420 can be connected via a bus or other means.
[0081] The memory 420, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs, such as the power-on / off control method for PCIe devices described in the embodiments of this application. The processor 410 implements the aforementioned power-on / off control method for PCIe devices by running the non-transitory software program and instructions stored in the memory 420.
[0082] The memory 420 may include a program storage area and a data storage area. The program storage area may store the operating system and application programs required for at least one function. The data storage area may store the power-on / off control methods for executing the aforementioned PCIe device. Furthermore, the memory 420 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 420 may optionally include memory remotely located relative to the processor 410, and these remote memories may be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0083] The non-transient software program and instructions required to implement the power-on / off control method for the PCIe device described above are stored in memory 420. When executed by one or more processors 410, the power-on / off control method for the PCIe device described above is executed, for example, executing... Figure 3 The method steps S201 and S206 described herein, Figure 3 The method steps S202 to S205 and step S207 described herein, Figure 3 The method step S208 described in the document, Figure 4 The method steps S201 and S302 described herein, Figure 4 The method steps S201 to S204, S301, and S207 described herein, Figure 4 The method steps S208 described in the document.
[0084] This application also provides a computer-readable storage medium storing computer-executable instructions for executing the above-described power-on / off control method for PCIe devices.
[0085] In one embodiment, the computer-readable storage medium stores computer-executable instructions that are executed by one or more control processors 410, for example, by one of the processors 410 in the aforementioned device 400, causing the one or more processors 410 to perform the aforementioned power-on / off control method for the PCIe device, for example, executing... Figure 3 The method steps S201 and S206 described herein, Figure 3 The method steps S202 to S205 and step S207 described herein, Figure 3 The method step S208 described in the document, Figure 4 The method steps S201 and S302 described herein, Figure 4 The method steps S201 to S204, S301, and S207 described herein, Figure 4 The method steps S208 described in the document.
[0086] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0087] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically include computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0088] The above provides a detailed description of the preferred embodiments of this application. However, this application is not limited to the above-described embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.
Claims
1. A power-on / off control method for a PCIe device, applied to a logic module, comprising: Receive operation instructions from the CPU, the operation instructions carrying target device information; When the operation instruction is a power-on instruction, the value of the register configured by the logic module is set to the value of the register configured by the target device to simulate the real state of the target device. The register configured by the logic module is used to record the simulated on-site state of the target device, and the value in the register configured by the target device indicates whether the PCIe device on the corresponding slot is in place. When the operation instruction is a power-down instruction, the value of the register configured in the logic module is set to a value indicating that the target device is not in place, so as to simulate that the target device is not in place; Based on the simulated in-situ state of the target device, determine whether to provide an enable signal for clock and reset signals to the target device; The simulated target device's in-situ status is reported to the CPU to trigger the operating system's hot-plug driver to add or remove the target device. Furthermore, based on the operation instructions, corresponding power control instructions are output to the power control module, so that the power control module controls the power signal supplied to the target device to be turned on or off.
2. The method of claim 1, wherein, After enabling the clock and reset signal controlling the target device, the following is also included: An interrupt signal is sent to the CPU to indicate an update to the in-situ status.
3. The method according to claim 1, characterized in that, The step of outputting a corresponding power control command to the power control module according to the operation command includes at least one of the following: When the operation command is a power-on command, the target device power-on command is output to the power control module; When the operation command is a power-down command, determine whether the hot-swap driver has completed the operation of removing the target device. If so, output a target device power-off command to the power control module.
4. The method according to claim 3, characterized in that, The step of determining whether the hot-plug driver has completed the removal of the target device includes: Obtain the status value of the corresponding PCIe slot power status register, and determine whether the hot-plugging process has ended based on the status value.
5. A power-on / off control method for a PCIe device, applied to a CPU, comprising: The system receives operation instructions from the system application layer and forwards the operation instructions to the logic module. The operation instructions carry target device information. Based on the simulated target device presence status from the logic module, the operating system's hot-plug driver is triggered to perform the operation of adding or removing the target device. The simulated target device presence status is the status value recorded in the register configured by the logic module. Wherein, when the operation instruction is a power-on instruction, the status value recorded in the register configured by the logic module is the actual status of the target device. The actual status of the target device is obtained from the register configured by the target device, and the value in the register configured by the target device indicates whether the PCIe device on the corresponding slot is in place; when the operation instruction is a power-off instruction, the simulated target device is in place but not in place. When the simulated target device is in position, indicating that the target device is in position, the enable signals for the clock and reset signals of the target device are turned on; when the simulated target device is in position, indicating that the target device is not in position, the enable signals for the clock and reset signals of the target device are turned off.
6. The method according to claim 5, characterized in that, Based on the simulated in-situ state of the target device from the logic module, triggering the operating system's hot-plug driver to perform operations to add or remove the target device includes: The system receives an interrupt signal from the logic module indicating an update to the in-situ status, and triggers the operating system's hot-plug driver to perform operations to add or remove the target device based on the simulated in-situ status of the target device from the logic module.
7. A power-on / off control system for a PCIe device, characterized in that, include: The CPU is used to receive operation instructions from the system application layer and forward the operation instructions to the logic module. The operation instructions carry target device information. And based on the simulated in-situ state of the target device from the logic module, trigger the hot-plug driver of the operating system to perform operations to add or remove the target device; A logic module is configured to, when the operation instruction is a power-on instruction, set the value of a register configured in the logic module to the value of a register configured in the target device to simulate the actual state of the target device. The register configured in the logic module records the simulated presence status of the target device, and the value in the register indicates whether a PCIe device in the corresponding slot is present. When the operation instruction is a power-off instruction, the logic module sets the value of a register configured in the logic module to a value indicating that the target device is not present, to simulate that the target device is not present. Based on the simulated presence status of the target device, the module determines whether to provide clock and reset enable signals to the target device. The simulated presence status of the target device is reported to the CPU to trigger the operating system's hot-plug driver to perform the operation of adding or removing the target device. Furthermore, based on the operation instruction, the module outputs corresponding power control instructions to the power control module, so that the power control module controls the power signal supplied to the target device to be turned on or off. The power control module is used to receive and control the power signal supplied to the target device to be turned on or off according to the power control command from the logic module.
8. The system according to claim 7, characterized in that, It also includes a PCIe switching module, through which the CPU is connected to the logic module; the CPU is also connected to N PCIe devices through the PCIe switching module, where N is an integer greater than or equal to 1.
9. The system according to claim 7, characterized in that, It also includes an I / O expansion module, through which the logic module is connected to the power control module.
10. A power-on / off control device for a PCIe device, characterized in that, include: Memory, used to store programs; A processor is configured to execute a program stored in the memory. When the processor executes the program stored in the memory, the processor is configured to perform: The method as described in any one of claims 1 to 4; or The method as described in any one of claims 5 to 6.
11. A computer-readable storage medium storing computer-executable instructions for performing: The method as described in any one of claims 1 to 4; or The method as described in any one of claims 5 to 6.