Line diagnosis method and apparatus
A line diagnosis method includes, in a situation that a first interface of a first device is connected to a second interface of a second device, obtaining first interface information of the first interface and second interface information of the second interface, and diagnosing a line connection between the first device and the second device based on the first interface information and the second interface information.
1 . A line diagnosis method comprising:
in a situation that a first interface of a first device is connected to a second interface of a second device, obtaining first interface information of the first interface and second interface information of the second interface, at least one of the first interface information or the second interface information being transmitted over a bus, each of the first interface information and the second interface information including interface number information or serial number information of each contact corresponding to a respective interface of the first interface and the second interface, wherein the obtaining the first interface information and the second interface information comprises transmitting an instruction through a controller coupled to the bus and receiving, at the controller via the bus, at least one of the first interface information or the second interface information; and
diagnosing a line connection between the first device and the second device based on a comparison of the first interface information and the second interface information to preset line layout information.
2 . The method according to claim 1 , wherein obtaining the first interface information of the first interface and the second interface information of the second interface includes:
determining the first interface information of the first interface through the first device;
transmitting the first interface information to the second device; and
receiving the second interface information and the first interface information from the second device, the second interface information being determined through the second device.
3 . The method according to claim 1 , wherein obtaining the first interface information of the first interface and the second interface information of the second interface includes:
determining the first interface information of the first interface through the first device; and
receiving the second interface information from the second device, the second interface information being determined through the second device.
4 . The method according to claim 1 , further comprising:
performing circuit connection simulation of the first interface information and the second interface information on a preset circuit diagram, to generate a line logic diagram.
5 . A line diagnosis apparatus comprising:
a first device connected to a first interface and configured to:
determine first interface information of the first interface, the first interface being configured to be connected to a second interface of a second device, the first interface information including interface number information or serial number information of each contact corresponding to the first interface;
in a situation that the first interface is connected to the second interface, obtain, via a data bus, second interface information of the second interface determined by the second device, the second interface information including interface number information or serial number information of each contact corresponding to the second interface; and
diagnose a line connection between the first device and the second device based on a comparison of the first interface information and the second interface information to preset line layout information,
wherein the first device includes a processing circuit connected to the first interface and an information acquisition circuit, the information acquisition circuit includes the data bus and a management controller connected to the data bus, the data bus is connected to the processing circuit or the second device, and the management controller is configured to send an instruction to the processing circuit and the second device through the data bus, to instruct the processing circuit and the second device to obtain the first interface information and the second interface information, respectively.
6 . The apparatus according to claim 5 , wherein:
the processing circuit is configured to:
determine the first interface information of the first interface;
in a situation that the processing circuit is connected to the information acquisition circuit, obtain the second interface information determined by the second device and transmit the first interface information and the second interface information to the information acquisition circuit; and
in a situation that the information acquisition circuit is connected to the second device, transmit the first interface information to the second device, to enable the second device to transmit the first interface information and the second interface information to the information acquisition circuit; and
the information acquisition circuit is configured to diagnose the line connection between the first device and the second device based on the first interface information and the second interface information.
7 . The apparatus according to claim 6 , wherein the first interface information and the second interface information are set to a unified format before being transmitted to the information acquisition circuit.
8 . The apparatus according to claim 6 , wherein
the management controller is further configured to
diagnose the line connection between the first device and the second device based on the first interface information and the second interface information.
9 . An apparatus comprising:
a processor; and
a computer-readable storage medium storing instructions that, when executed by the processor, cause the processor to:
in a situation that a first interface of a first device is connected to a second interface of a second device, obtain first interface information of the first interface and second interface information of the second interface, at least one of the first interface information or the second interface information being transmitted over a bus, each of the first interface information and the second interface information including interface number information or serial number information of each contact corresponding to a respective interface of the first interface and the second interface, wherein the obtaining the first interface information and the second interface information comprises transmitting an instruction through a controller coupled to the bus and receiving, at the controller via the bus, at least one of the first interface information or the second interface information; and
diagnose a line connection between the first device and the second device based on a comparison of the first interface information and the second interface information to preset line layout information.
10 . The apparatus according to claim 9 , wherein the instructions further cause the processor to, when obtaining the first interface information of the first interface and the second interface information of the second interface:
determine the first interface information of the first interface through the first device;
transmit the first interface information to the second device; and
receive the second interface information and the first interface information from the second device, the second interface information being determined through the second device.
11 . The apparatus according to claim 9 , wherein the instructions further cause the processor to, when obtaining the first interface information of the first interface and the second interface information of the second interface:
determine the first interface information of the first interface through the first device; and
receive the second interface information from the second device, the second interface information being determined through the second device.
12 . The apparatus according to claim 9 , wherein the instructions further cause the processor to:
performing circuit connection simulation of the first interface information and the second interface information on a preset circuit diagram, to generate a line logic diagram.
13 . The method according to claim 1 , wherein the diagnosing the line connection between the first device and the second device further comprises:
in response to both the first interface information and the second interface information matching a requirement indicated by the preset line layout information, determining that the first interface and the second interface are connected; and
in response to at least one of the first interface information or the second interface information not matching the requirement indicated by the preset line layout information, determining that the first interface and the second interface are disconnected.
14 . The method according to claim 4 , wherein the generated line logic diagram includes a plurality of visual lines representing electric circuits to connect the first device and the second device when it is determined that the first device and the second device are in a connected state.