CN113746680A - Physical position determining method and device testing method and device - Google Patents

Physical position determining method and device testing method and device Download PDF

Info

Publication number
CN113746680A
CN113746680A CN202111032203.5A CN202111032203A CN113746680A CN 113746680 A CN113746680 A CN 113746680A CN 202111032203 A CN202111032203 A CN 202111032203A CN 113746680 A CN113746680 A CN 113746680A
Authority
CN
China
Prior art keywords
hub
tree structure
port information
structure data
data table
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111032203.5A
Other languages
Chinese (zh)
Inventor
李玮
廖强
张俊峰
夏博儒
谢晓民
陈维
吴魁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Rock Jiahua Chongqing Technology Co ltd
Original Assignee
Rock Jiahua Chongqing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Rock Jiahua Chongqing Technology Co ltd filed Critical Rock Jiahua Chongqing Technology Co ltd
Priority to CN202111032203.5A priority Critical patent/CN113746680A/en
Publication of CN113746680A publication Critical patent/CN113746680A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0677Localisation of faults

Abstract

The application provides a physical position determining method and device and a device testing method and device, wherein the physical position determining method comprises the steps of obtaining a tree structure data table, wherein the tree structure data table comprises hub port information and connection port information in a computing equipment system, and data units in the tree structure data table correspond to physical positions of connection ports provided by a hub; determining a port path corresponding to the device according to the name of the device in the computing equipment system, wherein the port path comprises connection port information and hub port information; and positioning a corresponding data unit in the tree structure data table according to the hub port information and the connection port information of the device to obtain a connection port connected with the device so as to determine the physical position of the device and provide convenience for quickly searching for a specific device in a plurality of devices.

Description

Physical position determining method and device testing method and device
Technical Field
The present application relates to the field of physical location determination technologies, and in particular, to a physical location determination method and apparatus, and a device testing method and apparatus.
Background
In order to ensure that each product circulated to the user's hand functions normally, stably and reliably, in the production link of the device, multiple tests, such as a pressure test, an aging test and the like, are often required to be performed on the produced finished product.
At present, because the number of devices directly connected to most computing devices is limited, a method for testing devices (e.g., an intelligent cryptographic key) generally includes inserting a plurality of devices to be tested on a hub, connecting the hub to the computing devices (e.g., a computer), obtaining names of all devices connected to a host by the computing devices, obtaining handles of corresponding devices according to the names, communicating with the corresponding devices based on the handles, and determining whether the corresponding devices have faults according to communication states to complete testing.
However, the above method can only give the name of the failed device, and the physical location of the failed device on the hub cannot be intuitively judged and indicated by the name.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method and an apparatus for determining a physical location, and a method and an apparatus for testing a device, so as to solve the above problems.
In a first aspect, the present invention provides a physical location determination method for determining physical locations of a plurality of devices connected to a computing device, the plurality of devices being connected to different connection ports of a hub and being connected to a port of the computing device through a hub port, the method comprising: acquiring a tree structure data table, wherein the tree structure data table comprises hub port information and connection port information in a computing equipment system, and data units in the tree structure data table correspond to physical positions of connection ports provided by a hub; determining a port path corresponding to a device according to the name of the device in the computing equipment system, wherein the port path comprises the connection port information and the hub port information; and positioning a corresponding data unit in the tree structure data table according to the hub port information and the connection port information of the device, and obtaining a connection port connected with the device so as to determine the physical position of the device.
In the designed physical position determining method, the scheme firstly obtains a tree structure data table containing hub port information and connector port information in a computing equipment system, then determines a port path corresponding to a device according to the name of the device in the computing equipment system, and then positions a corresponding data unit in the tree structure data table according to the hub port information and the connector port information in the port path, and further obtains a connector port of the device in a hub to determine the physical position of the device.
In an optional implementation manner of the first aspect, the method searches, in the tree structure data table, a hub port corresponding to the hub port information according to the hub port information of the device, and searches, in the tree structure data table, a connection port corresponding to the connection port information according to the connection port information of the device, so as to locate a corresponding data unit, thereby obtaining the connection port to which the device is connected.
In an optional implementation manner of the first aspect, the method obtains the tree structure data table by traversing hub port information and connection port information in the computing device system to generate the tree structure data table.
In an optional implementation manner of the first aspect, the hub includes a plurality of hub ports, each hub port corresponds to a plurality of connection ports, and the method configures a plurality of tree structure data tables according to a plurality of tree structure data by configuring a plurality of tree structure data tables according to port information of a plurality of hub ports of a hub in the computing device system and a plurality of connection port information corresponding to each hub port; the hub port information of the hub port is used as a root node of each tree structure data, and the connection port information corresponding to the hub port is used as a data unit.
In an optional implementation manner of the first aspect, the method searches, in the plurality of tree structure data, tree structure data to which the device belongs according to hub port information of the device, and searches, in the tree structure data to which the device belongs, a corresponding data unit according to the connection port information of the device, so as to search, in the tree structure data table, a connection port corresponding to the device. The method for multi-layer query improves the searching efficiency by searching the data keywords/words in different layers by firstly obtaining the tree structure data (namely, on which tree) in the tree structure data according to the hub port information of the device and then further searching the corresponding data unit in the corresponding tree structure data so as to judge the physical position of the device.
In an optional implementation manner of the first aspect, the method determines, according to the name of the device in the computing apparatus system, a first handle corresponding to the device, and determines, according to the first handle corresponding to the device, a port path corresponding to the device.
In an optional implementation of the first aspect, before the determining the first handle corresponding to the device according to the name of the device in the computing device system, the method further comprises: and determining the name of each device on the hub according to the power-on sequence of the devices connected to the hub.
In a second aspect, the present invention provides a physical location determining apparatus for determining physical locations of a plurality of devices connected to a computing device, the plurality of devices being connected to different connection ports of a hub and connected to ports of the computing device through hub ports, the apparatus comprising: the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a tree structure data table, the tree structure data table comprises port information of a hub and connection port information in a computing equipment system, and a data unit in the tree structure data table corresponds to the physical position of a connection port provided by the hub; a second determining module, configured to determine, according to a name of a device in the computing device system, a port path corresponding to the device, where the port path includes the connection port information and the hub port information; and the searching module is used for searching a corresponding connector in the tree structure data table according to the hub port information and the connector information of the device to obtain the connector connected with the device so as to determine the physical position of the device.
In the physical position determining apparatus designed above, the scheme first obtains a tree structure data table containing hub port information and connection port information in a computing device system, then determines a port path corresponding to the device according to a name of the device in the computing device system, and then locates a corresponding data unit in the tree structure data table according to the hub port information and the connection port information in the port path, and further obtains a connection port of the device in the hub to determine a physical position of the device.
In a third aspect, the present invention provides a device testing method for performing fault testing on a plurality of devices connected to a computing device, the plurality of devices being connected to different connection ports of a hub and connected to a port of the computing device through a hub port, the method comprising: determining a second handle corresponding to the device according to the name of the device; establishing communication connection with the device according to the second handle of the device, and judging whether the communication state with the device is abnormal or not; if no abnormity occurs, determining that the device does not have a fault; if so, determining the physical location of the device on the hub according to the method for determining a physical location according to any optional implementation manner in the first aspect, or determining the physical location of the device by using a device for determining a physical location provided in the second aspect of the present invention.
In the device testing method designed above, the second handle corresponding to the device is determined by the name of the device, then communication is established with the device according to the second handle of the device, and further whether the device fails or not is judged according to the communication state, and after the device fails, the physical position of the failed device is determined by the method based on the physical position determination in the first embodiment, so that the failed device can be quickly found from the multiple devices of the hub, and the purpose of saving time is achieved.
In an optional implementation of the third aspect, after the determining the physical location of the device, the method further comprises: indicating a physical location of the device on the hub.
In a fourth aspect, the present invention provides a device testing apparatus for performing fault testing on a plurality of devices connected to a computing device, the plurality of devices being connected to different connection ports of a hub and connected to a port of the computing device through a hub port, the apparatus being applied to the computing device, comprising: the second determining module is used for determining a second handle corresponding to the device according to the name of the device; the judging module is used for establishing communication connection with the device according to the second handle of the device and judging whether the communication state with the device is abnormal or not; the judging module is used for determining that the device does not have a fault after the judging module judges that the device is not abnormal; and is configured to determine the physical location of the device on the hub according to the physical location determination method of any one of the foregoing embodiments after the determining module determines the abnormality, or determine the physical location of the device by using the physical location determination apparatus provided in the second aspect of the present invention.
In the device testing apparatus designed above, the second handle corresponding to the device is determined by the name of the device, then communication is established with the device according to the second handle of the device, and further whether the device fails is determined according to the communication state, and after the device fails is determined, the physical position of the failed device is determined according to the physical position determination method in the first embodiment, so that the failed device can be quickly found from the multiple devices of the hub, and the purpose of saving time is achieved.
In a fifth aspect, an embodiment provides an electronic device, including a memory and a processor, where the memory stores a computer program, and the processor executes the computer program to perform the method in the first aspect, any optional implementation manner of the first aspect, or any optional implementation manner of the third aspect.
In a sixth aspect, embodiments provide a storage medium having a computer program stored thereon, where the computer program is executed by a processor to perform the method in the first aspect, any optional implementation manner of the first aspect, or any optional implementation manner of the third aspect and the third aspect.
In a seventh aspect, an embodiment provides a computer program product, which when run on a computer, causes the computer to execute the method in the first aspect, any optional implementation manner of the first aspect, or any optional implementation manner of the third aspect.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
FIG. 1 is a schematic diagram of a computing device system according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a method for determining a physical location according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a physical location determining apparatus according to an embodiment of the present application;
FIG. 4 is a flowchart of a device testing method provided in an embodiment of the present application;
FIG. 5 is a schematic diagram of a display interface provided in an embodiment of the present application;
FIG. 6 is a schematic structural diagram of a device testing apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Icon: 10-a computing device; 20-a hub; 201-connection port; 30-a device; 300-an acquisition module; 310-a first determination module; 320-a lookup module; 500-a second determination module; 510-a judgment module; 520-a decision module; 5210-a first decision submodule; 5220-second decision sub-module; 530-an indication module; 6-an electronic device; 601-a processor; 602-a memory; 603-communication bus.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
The present application provides a computing device system, as shown in fig. 1, comprising a computing device 10, a hub 20, and a plurality of devices 30, the plurality of devices 30 being connected to different connection ports 201 of the hub 20 and connected to ports of the computing device 10 through ports of the hub 20. As a possible implementation, the device 30 may be a smart key, the hub 20 may be a USB hub, the computing apparatus 10 may be a computer; if the hub 20 is a USB hub with 100 connectors 201, and the number of the smart key is 100, then the 100 smart keys can be respectively inserted into the 100 connectors of the hub 20, and further connected to the USB port of the computer through the hub 20 by USB connection, so as to form a computing device system. It should be noted that the smart key and the non-limiting embodiments are only illustrative for ease of understanding. That is, the device 30 may be not only an intelligent password key, but also a device such as a usb disk and a mobile hard disk; the hub 20 may be not only a USB hub but also a hub of HDMI or VGA interface mode.
First embodiment
An embodiment of the present application provides a physical location determining method, where the physical location determining method is used to determine a physical location in a hub where a device in the foregoing computing device system is located, and the method may be applied to a computing device of the foregoing computing device system, as shown in fig. 2, where the method may include the following steps:
step S200: and acquiring a tree structure data table.
Step S210: and determining a corresponding port path of the device according to the name of the device in the computing equipment system, wherein the port path comprises the connection port information and the hub port information.
Step S220: and positioning a corresponding data unit in the tree structure data table according to the hub port information and the connection port information of the device, and obtaining a connection port connected with the device so as to determine the physical position of the device.
In step S200, the tree structure data table includes hub port information and connection port information in the computing device, and the tree structure data table further has a plurality of data units, each data unit corresponding to a physical location of a connection port provided by the hub. As a possible implementation manner, the tree structure data table may be generated in advance and stored in the computing device, so that the computing device may directly call when performing step S200; as another possible implementation manner, the step S200 of obtaining the tree structure data table may be a process of generating the tree structure data table, where the process of generating the tree structure data table may be that the computing device generates the tree structure data table by traversing hub port information and connection port information in the computing device system.
As a specific embodiment, assuming that the hub has a plurality of hub ports, and each hub port corresponds to a plurality of connection ports, on this basis, the process of generating the tree structure data table may specifically be: and then, the tree structure data table is constructed according to the plurality of tree structure data, wherein each tree structure data takes the hub port information as a root node and takes the plurality of connection port information corresponding to the hub ports as a data unit.
If the hub has 3 hub ports, a hub port 1 corresponds to 32 connection ports, a hub port 2 corresponds to 32 connection ports, and a hub port 3 corresponds to 36 connection ports, then tree structure data 1 corresponding to the hub port 1 can be generated, a root node of the tree structure data 1 is the hub port 1, and a plurality of data units of the tree structure data 1 are 32 connection port information corresponding to the hub port 1; similarly, the root node of the tree structure 2 corresponding to the hub port 2 is the hub port 2, and the multiple data units of the tree structure data 2 are 32 pieces of connection port information corresponding to the hub port 2; the root node of the tree structure 3 corresponding to the hub port 3 is the hub port 3, and the plurality of data units of the tree structure data 3 are 36 pieces of connection port information corresponding to the hub port 3.
In step S210, the name of the device in the computing device system may be determined by the daemon through monitoring the power-on sequence of the device, as a possible implementation, the name of the smart key may be assigned by the daemon of the computing device, when the daemon detects that the smart key is inserted, an unused number is searched from 0, and the name of the smart key is obtained by matching with the modification of other keywords. For example, after the plurality of devices are connected to the hub, and after the hub is powered on, some of the plurality of devices connected to the hub are powered on quickly, and some of the plurality of devices are powered on slowly, so that a situation that the plurality of devices have a power-on sequence is formed. For example, assuming that three devices are connected to the hub, which are device a, device B, and device C, respectively, after the hub is powered on, device a is powered on successfully first, and the computing device assigns the name of the smart key a to device a; then the device C is powered on, and the computing equipment allocates the name of the intelligent password key B to the device C; the device B is finally powered up and the computing device assigns the name of the key C to the device B.
As a specific implementation manner, the computing device in this scheme may adopt a Linux system, and further monitor the insertion of the smart cryptographic key by using a daemon process of PCSC-Lite in the Linux system, assign a name to the smart cryptographic key when monitoring the insertion of the smart cryptographic key, and provide a scardlists reader interface for obtaining a name list of all currently inserted smart cryptographic keys to an upper layer application.
In step S210, after obtaining the name of the device based on the foregoing manner, the present solution may determine the port path corresponding to the device based on the name of the device. As a possible implementation manner, the present solution may first determine a first handle corresponding to the device based on the name of the device, and then determine a port path corresponding to the device according to the first handle corresponding to the device. For example, after detecting the device through a set process, the computing device may obtain a first handle corresponding to the device by calling an interface provided by a usb interface library (libusb), where the first handle may be represented as a libusb device handle, then establish a mapping table between the first handle and the device name, and store the mapping table in the computing device, and then when executing step S210, may find the mapped first handle directly according to the device name.
After the first handle of the device is obtained, the port path corresponding to the device can be determined according to the first handle, as a possible implementation manner, the first handle, that is, the libusb device handle, can be used as a parameter of the libusb _ get _ port _ number function, and then the port path of the device can be obtained by calling the libusb _ get _ port _ number function based on the first handle of the device. The method for obtaining the device port path through the first handle of the device may be implemented by any existing method, which is not limited in this application.
It should be noted that the name of the smart key and the corresponding first handle are temporarily assigned by the daemon process after the insertion of the smart key is detected, and are stored in the memory of the computing device, and are lost when the system is powered off. In addition, when the daemon detects that the smart key is removed, the daemon releases the corresponding first handle and recovers the name assigned to the daemon before, namely, the number in the name can be continuously used for the subsequently inserted smart key.
In step S220, after obtaining the port path of the device, the computing device may search, according to the hub port information in the port path, the hub port corresponding to the hub port information in the tree-structured data table, and search, according to the connection port information in the port path, the connection port corresponding to the connection port information in the tree-structured data table, and further locate the data unit corresponding to the device, so as to obtain the connection port of the hub to which the device is connected, and further obtain the physical location of the device in the hub.
As a possible implementation manner, on the basis of the foregoing example with multiple tree structure data, step S220 may first search, according to port information of the hub of the device, tree structure data to which the device belongs from the multiple tree structure data, and then search, according to connector information of the device, a corresponding connector in the tree structure data to which the device belongs, so as to locate a data unit corresponding to the device, thereby obtaining a connector of the hub to which the device is connected, and further obtaining a physical location of the device in the hub.
In the physical position determining method, the tree structure data table containing the hub port information and the connection port information in the computing equipment system is firstly obtained, then the corresponding port path of the device is determined according to the name of the device in the computing equipment system, the corresponding data unit is positioned in the tree structure data table according to the hub port information and the connection port information in the port path, and the connection port of the device in the hub is further obtained to determine the physical position of the device.
Fig. 3 shows a schematic block diagram of a physical location determining apparatus provided in the present application, and it should be understood that the apparatus corresponds to the method embodiment executed in fig. 2, and can execute the steps involved in the foregoing method, and the specific functions of the apparatus can be referred to the description above, and a detailed description is appropriately omitted here to avoid redundancy. The device includes at least one software function that can be stored in memory in the form of software or firmware (firmware) or solidified in the Operating System (OS) of the device. Specifically, the apparatus includes: an obtaining module 300, configured to obtain a tree structure data table, where the tree structure data table includes port information of a hub and connection port information in a computing device system, and a data unit in the tree structure data table corresponds to a physical location of a connection port provided by the hub; a first determining module 310, configured to determine, according to a name of the device in the computing device system, a port path corresponding to the device, where the port path includes connection port information and hub port information; and the searching module 320 is configured to search a corresponding connection port in the tree structure data table according to the hub port information and the connection port information of the device, and obtain a connection port to which the device is connected, so as to determine a physical location of the device.
In the physical position determining apparatus designed above, the scheme first obtains a tree structure data table containing hub port information and connection port information in a computing device system, then determines a port path corresponding to the device according to a name of the device in the computing device system, and then locates a corresponding data unit in the tree structure data table according to the hub port information and the connection port information in the port path, and further obtains a connection port of the device in the hub to determine a physical position of the device.
In an optional implementation manner of this embodiment, the searching module 320 is specifically configured to search, according to the hub port information of the device, a hub port corresponding to the hub port information in the tree-structure data table, and search, according to the connection port information of the device, a connection port corresponding to the connection port information in the tree-structure data table, so as to locate the corresponding data unit, thereby obtaining the connection port connected to the device.
In an optional implementation manner of this embodiment, the obtaining module 300 is specifically configured to traverse the hub port information and the connection port information in the computing device system to generate a tree structure data table, so as to obtain the tree structure data table.
In an optional implementation manner of this embodiment, the hub includes a plurality of hub ports, each hub port corresponds to a plurality of connection ports, and the obtaining module 300 is further specifically configured to form a plurality of tree structure data according to a plurality of hub port information of the hub in the computing device system and a plurality of connection port information corresponding to each hub port, and form a tree structure data table according to the plurality of tree structure data; the hub port information is used as a root node of each tree structure data, and a plurality of connection port information corresponding to the hub port information is used as a data unit.
In an optional implementation manner of this embodiment, the searching module 320 is further specifically configured to first search, according to the hub port information of the device, tree structure data to which the device belongs from the multiple tree structure data, and then search, according to the connector port information of the device, a corresponding connector in the tree structure data to which the device belongs, to locate the corresponding data unit, so as to search, in the tree structure data table, a connector corresponding to the device.
In an optional implementation manner of this embodiment, the first determining module 310 is specifically configured to determine a first handle corresponding to a device according to a name of the device in the computing apparatus system, and determine a port path corresponding to the device according to the first handle corresponding to the device.
Second embodiment
The method of the present application provides a device testing method for performing fault testing on a plurality of devices in the aforementioned computing device system, as shown in fig. 4, the method comprising the steps of:
step S400: and determining a second handle corresponding to the device according to the name of the device.
Step S410: establishing communication connection with the device according to the second handle of the device, judging whether the communication state with the device is abnormal or not, and if so, going to step S420; if not, go to step S430.
Step S420: the physical location of the device on the hub is determined according to the physical location determination method in the first embodiment.
Step S430: it is determined that the device is not malfunctioning.
In step S400, the device name is obtained according to the same principle as that of the device name obtained in step S210 of the first embodiment, and is not described herein again.
In step S400, the second handle is different from the first handle in the first embodiment, the second handle is returned by the SCardConnect function of the PSCS-Lite, and the second handle can be obtained by calling the SCardConnect function with the device name as a parameter.
In step S410, the computing device may communicate with the device according to the second handle of the device, as a possible implementation manner, the computing device may call a SCardTransmit function to communicate with the device based on the second handle of the device, and further may determine whether the device is abnormal according to the communication state of the device, and if not, determine that the device is not faulty; if there is an abnormality, it indicates that the device is faulty, and the physical location of the device in the hub can be determined by the method for determining the physical location of the device in the first embodiment.
In the device testing method designed above, the scheme first determines the second handle corresponding to the device according to the name of the device, then establishes communication with the device according to the second handle of the device, and further determines whether the device fails according to the communication state, and after the device fails, the scheme determines the physical position of the failed device based on the physical position determining method in the first embodiment, so that the failed device can be quickly found from the multiple devices of the hub, and further the purpose of saving time is achieved.
In an optional implementation manner of this embodiment, after determining the physical location of the faulty device in step S420, the present solution may further indicate the physical location of the faulty device.
As a possible embodiment, the present application may further design a display interface as shown in fig. 5, where a circular icon corresponds to a connection port position in the hub, and in a possible embodiment, when no device is detected at the physical location, the corresponding circular icon on the display interface may be gray as shown in the figure, and after the physical location of the device in the hub is determined based on the foregoing physical location determining method, the circular icon corresponding to the physical location may be lit to green; when the device is detected to have no fault based on the test method, the circular icon is in a green flashing form on a display interface, and when the device is detected to have a fault based on the test method, the circular icon corresponding to the physical position of the faulty device changes the green color into the red color so as to remind a worker that the device has a fault; through the implementation mode of software indication, the state and the physical position of the intelligent password key on the concentrator can be monitored in real time under the condition that certain types of intelligent password keys possibly have no indicator lamps or testing equipment possibly placed in places which are difficult to observe, such as an incubator and the like.
Fig. 6 shows a schematic structural block diagram of a device testing apparatus provided in the present application, it should be understood that the apparatus corresponds to the method embodiment executed in fig. 4, and can execute the steps involved in the foregoing method, and the specific functions of the apparatus can be referred to the description above, and the detailed description is appropriately omitted here to avoid repetition. The device includes at least one software function that can be stored in memory in the form of software or firmware (firmware) or solidified in the Operating System (OS) of the device. Specifically, the apparatus includes: a second determining module 500, configured to determine a second handle corresponding to the device according to the name of the device; a determining module 510, configured to establish a communication connection with the device according to the second handle of the device, and determine whether a communication state with the device is abnormal; a determining module 520, configured to determine that the device has not failed after the determining module 510 determines that there is no abnormality; and is configured to determine the physical location of the device on the hub according to the physical location determination method of any of the alternative embodiments of the first embodiment after the determination module 510 determines the anomaly.
According to the device testing device, the second handle corresponding to the device is determined through the name of the device, then communication is established between the device and the second handle of the device, whether the device fails or not is judged according to the communication state, and after the device fails, the physical position of the failed device is determined based on the physical position determining method in the first embodiment, so that the failed device can be quickly found from the devices of the concentrator, and the purpose of saving time is achieved.
In an alternative implementation of the present embodiment, the determination module 520 includes a first determination submodule 5210 and a second determination submodule 5220, and the first determination submodule 5210 is configured to determine that the device has not failed after the determination module 510 determines that there is no abnormality; the second determination sub-module 5220 is used for determining the physical location of the device on the hub according to the physical location determination method of any of the alternative embodiments in the first embodiment after the determination module 510 determines the abnormality.
In an optional implementation of this embodiment, the apparatus further includes an indication module 530 for indicating the physical location of the device on the hub.
As shown in fig. 7, the present application provides an electronic device 6 including: the processor 601 and the memory 602, the processor 601 and the memory 602 are interconnected and communicate with each other through a communication bus 603 and/or other types of connection mechanisms (not shown), and the memory 602 stores a computer program executable by the processor 601, and when the computing device runs, the processor 601 executes the computer program to execute the method in any alternative implementation manner of the first embodiment, for example, steps S200 to S220: acquiring a tree structure data table; determining a port path corresponding to the device according to the name of the device in the computing equipment system, wherein the port path comprises connection port information and hub port information; and positioning a corresponding data unit in the tree structure data table according to the hub port information and the connection port information of the device, and obtaining a connection port connected with the device so as to determine the physical position of the device.
Or when executed, perform the method in any optional implementation manner of the second embodiment, for example, steps S400 to S430: determining a second handle corresponding to the device according to the name of the device; establishing communication connection with the device according to the second handle of the device, and judging whether the communication state with the device is abnormal or not; if no abnormity occurs, determining that the device has no fault; if so, the physical location of the device on the hub is determined according to the physical location determination method in the first embodiment.
The present application provides a storage medium having stored thereon a computer program which, when executed by a processor, performs the method of any of the alternative implementations of the first embodiment or the method of any of the alternative implementations of the second embodiment.
The storage medium may be implemented by any type of volatile or nonvolatile storage device or combination thereof, such as a Static Random Access Memory (SRAM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), an Erasable Programmable Read-Only Memory (EPROM), a Programmable Read-Only Memory (PROM), a Read-Only Memory (ROM), a magnetic Memory, a flash Memory, a magnetic disk, or an optical disk.
The present application provides a computer program product which, when run on a computer, causes the computer to perform the method of any of the alternative implementations of the first embodiment or the method of any of the alternative implementations of the second embodiment.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
It should be noted that the functions, if implemented in the form of software functional modules and sold or used as independent products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A physical location determination method for determining physical locations of a plurality of devices connected to a computing device, the plurality of devices being connected to different connection ports of a hub and connected to ports of the computing device through hub ports, the method comprising:
acquiring a tree structure data table, wherein the tree structure data table comprises hub port information and connection port information in a computing equipment system, and data units in the tree structure data table correspond to physical positions of connection ports provided by a hub;
determining a port path corresponding to a device according to the name of the device in the computing equipment system, wherein the port path comprises the connection port information and the hub port information;
and positioning a corresponding data unit in the tree structure data table according to the hub port information and the connection port information of the device, and obtaining a connection port connected with the device so as to determine the physical position of the device.
2. The method according to claim 1, wherein the method locates the corresponding data unit by looking up the hub port corresponding to the hub port information in the tree structure data table according to the hub port information of the device and looking up the connection port corresponding to the connection port information in the tree structure data table according to the connection port information of the device, respectively, so as to obtain the connection port connected by the device.
3. The method of claim 1, wherein the method generates the tree structure data table by traversing hub port information and connection port information in the computing device system to obtain the tree structure data table.
4. The method according to claim 1, wherein the hub comprises a plurality of hub ports, each hub port corresponds to a plurality of connection ports, and the method constructs the tree structure data table according to a plurality of tree structure data by constructing a plurality of tree structure data according to a plurality of hub port information of the hub and a plurality of connection port information corresponding to each hub port in the computing equipment system;
the hub port information is used as a root node of each tree structure data, and a plurality of connection port information corresponding to the hub port information is used as a data unit.
5. The method according to claim 4, wherein the method first searches tree structure data to which the device belongs from the plurality of tree structure data according to hub port information of the device, and then searches corresponding connection ports from the tree structure data to which the device belongs according to the connection port information of the device, so as to locate corresponding data units, thereby searching the connection ports corresponding to the device in the tree structure data table.
6. The method of claim 1, wherein the method determines the port path corresponding to the device according to the first handle corresponding to the device by determining the first handle corresponding to the device according to the name of the device in the computing equipment system.
7. A physical location determining apparatus for determining physical locations of a plurality of devices connected to a computing device, the plurality of devices being connected to different connection ports of a hub and connected to ports of the computing device through hub ports, the apparatus comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a tree structure data table, the tree structure data table comprises port information of a hub and connection port information in a computing equipment system, and a data unit in the tree structure data table corresponds to the physical position of a connection port provided by the hub;
a first determining module, configured to determine, according to a name of a device in the computing device system, a port path corresponding to the device, where the port path includes the connection port information and the hub port information;
and the searching module is used for searching a corresponding connector in the tree structure data table according to the hub port information and the connector information of the device to obtain the connector connected with the device so as to determine the physical position of the device.
8. A device testing method for performing fault testing on a plurality of devices connected to a computing device, wherein the plurality of devices are connected to different connection ports of a hub and are connected to a port of the computing device through a hub port, the method comprising:
determining a second handle corresponding to the device according to the name of the device;
establishing communication connection with the device according to the second handle of the device, and judging whether the communication state with the device is abnormal or not;
if no abnormity occurs, determining that the device does not have a fault;
if so, determining the physical location of the device on the hub according to the physical location determination method of any of claims 1-6.
9. The method of testing of claim 8, wherein after said determining the physical location of the device, the method further comprises: indicating a physical location of the device on the hub.
10. A device testing apparatus for performing fault testing on a plurality of devices connected to a computing device, wherein the plurality of devices are connected to different connection ports of a hub and are connected to ports of the computing device through hub ports, the apparatus being applied to a computing device, comprising:
the second determining module is used for determining a second handle corresponding to the device according to the name of the device;
the judging module is used for establishing communication connection with the device according to the second handle of the device and judging whether the communication state with the device is abnormal or not;
the judging module is used for determining that the device does not have a fault after the judging module judges that the device is not abnormal; and for determining the physical location of the device on the hub according to the physical location determination method of any of claims 1-6 after the determining module determines the anomaly.
CN202111032203.5A 2021-09-03 2021-09-03 Physical position determining method and device testing method and device Pending CN113746680A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111032203.5A CN113746680A (en) 2021-09-03 2021-09-03 Physical position determining method and device testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111032203.5A CN113746680A (en) 2021-09-03 2021-09-03 Physical position determining method and device testing method and device

Publications (1)

Publication Number Publication Date
CN113746680A true CN113746680A (en) 2021-12-03

Family

ID=78735377

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111032203.5A Pending CN113746680A (en) 2021-09-03 2021-09-03 Physical position determining method and device testing method and device

Country Status (1)

Country Link
CN (1) CN113746680A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101963950A (en) * 2010-09-30 2011-02-02 北京飞天诚信科技有限公司 Method for positioning USB port in connection of device
CN105930243A (en) * 2016-04-18 2016-09-07 深圳市德名利电子有限公司 Port determining method and system for testing USB (Universal Serial Bus) equipment
CN109918306A (en) * 2019-03-08 2019-06-21 深圳市腾讯网络信息技术有限公司 Audio processing equipment, system, method, apparatus and storage medium
CN111458596A (en) * 2020-03-31 2020-07-28 海南掌上能量传媒有限公司 Integrated detection device for mobile power supply

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101963950A (en) * 2010-09-30 2011-02-02 北京飞天诚信科技有限公司 Method for positioning USB port in connection of device
CN105930243A (en) * 2016-04-18 2016-09-07 深圳市德名利电子有限公司 Port determining method and system for testing USB (Universal Serial Bus) equipment
CN109918306A (en) * 2019-03-08 2019-06-21 深圳市腾讯网络信息技术有限公司 Audio processing equipment, system, method, apparatus and storage medium
CN111458596A (en) * 2020-03-31 2020-07-28 海南掌上能量传媒有限公司 Integrated detection device for mobile power supply

Similar Documents

Publication Publication Date Title
CN106330593B (en) Protocol detection method and device
CN110178121B (en) Database detection method and terminal thereof
CN109165170B (en) Method and system for automatic request test
CN108460271B (en) Terminal identification method and device
CN112311574B (en) Network topology connection checking method, device and equipment
US10558513B2 (en) System management apparatus and system management method
CN113672306B (en) Server component self-checking abnormity recovery method, device, system and medium
CN113746680A (en) Physical position determining method and device testing method and device
CN116225804A (en) PCIe link detection method, system, equipment and storage medium
CN111538994A (en) System security detection and repair method, device, storage medium and terminal
CN115373916A (en) Abnormality detection method, abnormality detection device, electronic apparatus, and computer-readable storage medium
CN104317645B (en) A kind of method and device of Application Instance listening port
CN107678917B (en) Test machine automation management method, device, equipment and storage medium
CN116225802A (en) Fault testing method and device and computing equipment
CN115185778A (en) Database monitoring method and device
CN114218001A (en) Fault repairing method and device, electronic equipment and readable storage medium
CN107885640B (en) Hard disk management method and device
CN117499214B (en) Method and device for determining fault equipment, storage medium and electronic equipment
CN106992873B (en) Protection group processing method and device
CN110909378A (en) Automatic detection method and device, storage medium and electronic equipment
CN116382968B (en) Fault detection method and device for external equipment
WO2023226601A1 (en) Anomaly processing method and apparatus for heterogeneous acceleration resource, and storage medium and electronic apparatus
CN117707815A (en) Method and device for determining fault link
CN117290147A (en) Solid state disk fault repairing method and device and electronic equipment
CN117453567A (en) Chaos testing method, device and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination