DE-112025000087-T5 - Method, device, system for resetting a device and electronic device
Abstract
The present application relates to a method, a device, a system for resetting a device, and an electronic device, wherein the method comprises: receiving a restart signal from a first host, the restart signal carrying port identifications of the first host; determining, from the port identifications of the first host, destination switch domain information corresponding to those port identifications from preset configuration information, the configuration information comprising port identifications of various hosts and switch domain information corresponding to those port identifications. This technical solution predefines configuration information for an uplink port of the switch connected to a port of a host and for devices connected to the downlink ports corresponding to that port. Upon receiving a restart signal from a host, the electronic device, based on the pre-bound switch domain information, accurately assesses which uplink ports of the switch connected to the host's ports and which devices connected to the uplink ports need to be reset, and sends reset signals to the corresponding ports and devices connected to the uplink port, thus ensuring the normal operation of the other uplink ports of the switches connected to the host and the devices connected to the uplink port.
Inventors
- HONG ZHENG
- MO LIJUN
- ZHANG KAI
- Bai erhu
Assignees
- EVEX TECH CO LTD
Dates
- Publication Date
- 20260507
- Application Date
- 20250612
- Priority Date
- 20240731
Claims (11)
- A method for resetting a device, characterized in that it is used for an electrical device, comprising: receiving a restart signal from a first host, wherein the restart signal carries port identifications of the first host; determining from preset configuration information corresponding to the port identifications of the first host, wherein the configuration information comprises port identifications of various hosts and corresponding switch domain information, each of which comprises: uplink port identifications of a switch corresponding to a host port identification, downlink port identifications of the switch corresponding to the switch's uplink port identifications, and device identifications corresponding to the switch's downlink port identifications; and sending a reset signal to target switches and target devices affected by the target switch domain information to reset the uplink ports of the target switches and the target devices.
- The procedure according Claim 1 , characterized in that the method, prior to determining the destination switch domain information corresponding to the port identifications of the first host from the preset configuration information, further comprises: obtaining uplink port identifications of each switch, the downlink port identifications and port identifications of a host corresponding to the uplink port identifications of each switch, and a device identification corresponding to each downlink port identification; creating the configuration information according to the uplink port identifications of each switch, the host port identifications corresponding to the uplink port identifications of each switch, the downlink port identifications corresponding to the uplink port identifications of each switch, and the device identification corresponding to each downlink port identification; and storing the configuration information.
- The procedure according Claim 1 or 2 , characterized in that storing the configuration information comprises: generating a register value for each port identification in each host according to the uplink port identifications of the switch corresponding to the port identification and the device identifications corresponding to the downlink port identifications; and configuring a register address for the port identification in the electronic device and storing the register value at the register address, the register value at the register address being used to represent the switch domain information.
- The procedure according to one of the Claims 1 until 3 , characterized in that generating the register value according to the uplink port identifications of the switch corresponding to the port identification and the device identifications corresponding to the downlink port identifications comprises: determining the first N bits in the register value according to a serial number of the uplink port identification of the switch corresponding to the port identification among all uplink ports in the switch, where N is an integer greater than 0; and determining the N+1 to M bits in the register value according to serial numbers of the device identifications corresponding to the downlink port identifications of the switch among all downlink ports of the switch, where M is an integer greater than N+1.
- The procedure according to one of the Claims 1 until 4 , characterized in that determining the destination switch domain information corresponding to the port identifications of the first host from the preset configuration information includes: determining a destination register address from at least one register address according to the port identification of the first host; determining a destination register value under the destination register address; determining the destination switch domain information based on the destination register value.
- The procedure according to one of the Claims 1 until 5 , characterized in that an information transmission mode between the electronic device and a switch is an integrated circuit bus I 2 C.
- A device for resetting a device, characterized in that it is used for an electrical device, the device comprising: a maintenance module for receiving a restart signal from a first host, wherein the restart signal carries port identifications of the first host; a determination module for determining destination switch domain information corresponding to the port identifications of the first host from preset configuration information, wherein the configuration information comprises port identifications of various hosts and switch domain information corresponding to the respective port identifications, each switch domain information comprising: uplink port identifications of a switch corresponding to a host port identification, downlink port identifications of the switch corresponding to the switch uplink port identifications, and device identifications corresponding to the switch downlink port identifications; and a transmit module for sending a reset signal to target switches and target devices affected by the target switch domain information, in order to reset the uplink ports of the target switches and the target devices.
- A system for resetting a device, characterized in that the system comprises: an electronic device, at least one host, at least one switch, and at least one device; a first host in which at least one host sends a reset signal to the electronic device in response to a reset request, the reset signal carrying port identifications of the first host; and the electronic device is used to execute the method according to one of the above. Claims 1 until 6 to perform the following steps to reset the uplink ports of the target switch in the at least one switch and the target device in the at least one device.
- An electronic device characterized in that it comprises a processor and a memory communicating with the processor; wherein the memory stores computer-executable instructions; wherein the processor executes the computer-executable instructions stored in the memory to carry out the method according to one of the above. Claims 1 until 6 to implement.
- A computer-readable storage medium, characterized in that computer-executable instructions are stored in the computer-readable storage medium, wherein the computer-executable instructions, when executed by a processor, perform the method according to one of the above-mentioned Claims 1 until 6 implement.
- A computer program characterized in that the computer program product comprises a computer program stored in a computer-readable storage medium, wherein at least one processor can read the computer program from the computer-readable storage medium, and the at least one processor, when executing the computer program, performs the method according to one of the above-mentioned Claims 1 until 6 can implement.
Description
The present application claims priority over the Chinese patent application filed with the Chinese Patent Office on July 31, 2024, under application number 202411044178.6 filed under the application title “Method, device, system for resetting a device and electronic device”, the entire content of which is hereby incorporated into the present application by reference. Technical field The present application relates to the technical field of the Internet, in particular to a method, a device, a system for resetting a device and an electronic device. State of the art In the technical field of the Internet, there is one or more central processing units (CPUs) chips in a host, and a variety of serial high-speed computer expansion bus standard (Peripheral Component Interconnect Express, PCIe) devices establish a connection to at least one host via an uplink port of at least one PCIe switch. If a particular host requires a direct current (DC) restart, all switches connected to the host can be reset, causing all PCIe devices connected to the switches' downlink ports to be restarted or reset. This will also cause the uplink ports of switches not connected to target hosts, as well as their associated PCIe devices, to be restarted or reset, interrupting any running services. Therefore, how to avoid restarting or resetting non-relevant devices on a host during a host restart has become an urgent technical problem that needs to be solved. Content of the invention An embodiment of the present application provides a method, a device, a system for resetting a device and an electronic device to solve the prior art technical problem of resetting or restarting non-relevant devices in a host during a restart of that host. In a first aspect, an embodiment of the present application provides a method for resetting a device, comprising: Receiving a restart signal from a first host, where the restart signal carries port identifications of the first host; Determining destination switch domain information corresponding to the port identifications of the first host from preset configuration information, wherein the configuration information includes port identifications of various hosts and corresponding switch domain information for each port identification, with each piece of switch domain information including: uplink port identifications of a switch corresponding to a host port identification, downlink port identifications of the switch corresponding to the switch uplink port identifications, and device identifications corresponding to the switch downlink port identifications; and Sending a reset signal to target switches and target devices affected by the target switch domain information to reset the uplink ports of the target switches and the target devices. In one possible implementation for the first aspect, the procedure includes, before determining the target switch domain information corresponding to the port identifications of the first host from the preset configuration information, furthermore: Obtaining uplink port identifications of each switch, the corresponding downlink port identifications and port identifications of a host, as well as a device identification corresponding to each downlink port identification; Creating the configuration information according to the uplink port identifications of each switch, the host port identifications corresponding to the uplink port identifications of each switch, the downlink port identifications corresponding to the uplink port identifications of each switch, and the device identification corresponding to each downlink port identification; and Saving the configuration information. In another possible implementation for the first aspect, storing the configuration information includes: Generating a register value for each port identification in each host according to the uplink port identifications of the switch corresponding to the port identification and the device identification corresponding to the respective downlink port identifications; and Configuring a register address for port identification in the electronic device and storing the register value at the register address, the register value at the register address being used to represent the switch domain information. In another possible embodiment for the first aspect, generating the register value according to the uplink port identification of the switch and the device identifications corresponding to the uplink port identifications of the switch includes: Determining the first N bits in the register value according to a serial number corresponding to the uplink port identification of the switch among all uplink ports in the switch, where N is an integer greater than 0; and Determine the N+1 to M bits in the register value according to the serial numbers of the device identifications corresponding to the downlink port identifications of the switch among all downlink ports of the switch, where M is an integer greater t