Equipment control method and device, equipment and computer readable storage medium
By identifying and applying policies to the device types in complex links, customizing fault diagnosis of port isolation functions is achieved, and problems of poor fault positioning performance and large resource consumption in complex links are solved, and system stability and security are improved .
Patent Information
- Application Number
- CN202411381639.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-03
AI Technical Summary
In complex links, it is difficult for the prior art to effectively locate fault locations and handle fault sources, and the resource consumption of equipment port isolation function is large, affecting system stability and security.
By identifying the link, identifying the root node device and the downlink device, applying different port isolation policies according to the device type, identifying the end device step by step, and turning on or off the port isolation function to achieve customized fault diagnosis strategies.
In the case of controlling resource consumption and complexity, quickly and accurately locate faulty equipment in the link to improve system stability and security.
Smart Images

Figure CN119248590A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a device control method, apparatus, device and computer-readable storage medium. Background Art
[0002] During the development of AI (Artificial Intelligence) servers, various types of devices are expanded through SW boards, making the PCIE (high-speed expansion device) device resources loaded on AI servers very rich, and of course the formed links are more complex. Therefore, based on complex links, how to accurately locate the fault location, report the faulty device, and handle the fault source, etc., puts forward higher requirements for a series of fault diagnosis. In terms of link fault location, the DPC (Downstream Port Containment) function provides a rich data source. For example, when a device in the link fails, the status information collected by DPC can quickly identify the fault point. However, due to the complexity of the link, if all devices in the link have the DPC function turned on, the complexity and resource consumption will increase.
[0003] Therefore, it is very important to control the port isolation function of devices in a complex link to achieve the fault location performance of the entire complex link while controlling resource consumption and complexity. Summary of the invention
[0004] In view of this, an object of the present invention is to provide a device control method, apparatus, device and computer-readable storage medium, which solve the problems of poor device fault location performance and high resource consumption in complex links in the prior art.
[0005] In order to solve the above technical problems, the present invention provides a device control method, comprising:
[0006] Perform link identification on the link and determine the root node device;
[0007] Identify the device connected to the root node device;
[0008] If the downstream device is a hardware device, determining whether to enable a port isolation function of the downstream device according to a first strategy;
[0009] If the downstream device is a switching device, the link is identified step by step to determine the terminal device, and whether to enable the port isolation function of the terminal device is determined according to the second strategy.
[0010] On the one hand, if the downstream device is a hardware device, determining whether to enable the port isolation function of the downstream device according to the first strategy includes:
[0011] If the downstream device is in the first whitelist, enabling the port isolation function of the downstream device;
[0012] If the downstream device is not in the first whitelist, the port isolation function of the downstream device is disabled.
[0013] On the one hand, after the port isolation function of the downstream device is turned off, the method further includes:
[0014] Disable the port isolation function of the upper node device connected to the downstream device.
[0015] On the one hand, the link is identified step by step to determine the terminal device, and whether to enable the port isolation function of the terminal device according to the second strategy includes:
[0016] Taking the downstream device as a starting point, identifying the link;
[0017] If the downstream device of the downstream device is a switching device, continue to identify step by step until a hardware device in the link is identified, and use the hardware device as the terminal device;
[0018] If the downstream device of the downstream device is a hardware device, then the identification is stopped and the hardware device is used as the terminal device;
[0019] Determine whether the terminal device is online;
[0020] If it is not online, the terminal device exits the port isolation function setting;
[0021] If online, determine whether the terminal device is in the second whitelist;
[0022] If the terminal device is in the second whitelist, enabling the port isolation function of the terminal device;
[0023] If the terminal device is not in the second whitelist, the port isolation function of the terminal device is disabled.
[0024] On the one hand, after the port isolation function of the terminal device is enabled, the method further includes:
[0025] Enable the port isolation function of the upper node device connected to the terminal device.
[0026] On the one hand, after the hardware device is used as the terminal device, the method further includes:
[0027] The device between the starting point and the terminal device is used as a link intermediate device, and the port isolation function of the link intermediate device is disabled.
[0028] On the one hand, it also includes:
[0029] The port isolation function of the root node device is enabled, and the port isolation function of the switching device is disabled.
[0030] The present invention also provides a device control apparatus, comprising:
[0031] A root node device determination module is used to identify the link and determine the root node device;
[0032] A device identification module, used to identify the downstream device of the root node device;
[0033] A first identification result module, used for determining whether to enable a port isolation function of the downstream device according to a first strategy if the downstream device is a hardware device;
[0034] The second result identification module is used to identify the link level by level if the downstream device is a switching device, determine the terminal device, and determine whether to enable the port isolation function of the terminal device according to the second strategy.
[0035] The present invention also provides a device control device, comprising:
[0036] Memory for storing computer programs;
[0037] The processor is used to implement the steps of the above-mentioned device control method when executing the computer program.
[0038] The present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned device control method are implemented.
[0039] The present invention also provides a computer program product, comprising a computer program / instruction, which implements the steps of the above-mentioned device control method when executed by a processor.
[0040] It can be seen from the above technical scheme that the present invention determines the root node device by link identification of the link; identifies the downstream device of the root node device; if the downstream device is a hardware device, it is determined whether to turn on the port isolation function of the downstream device according to the first strategy; if the downstream device is a switching device, the link is identified step by step to determine the terminal device, and it is determined whether to turn on the port isolation function of the terminal device according to the second strategy. The beneficial effect of the present invention is: based on the fault diagnosis function requirements of the complex link of the AI server, it fully combines the characteristics of the complex link, such as the long link, many devices, and complex device types of the downstream devices of the complex server, and applies different control strategies after identifying the switching devices and hardware devices connected to the root node device, and turns on and off the port isolation function of the hardware device according to the requirements. This method can accurately identify the device type at each level in the link, and set different fault diagnosis strategies for the hierarchical characteristics of the link where different device types are located. Such a method can realize customized fault diagnosis strategies for required hardware devices through devices that turn on the port isolation function in the link while controlling resource consumption and complexity. Based on such port isolation function settings, the location of faulty devices in the link can be further quickly discovered and accurately located, the problem can be quickly solved, and the system stability and security can be improved.
[0041] In addition, the present invention also provides a device control apparatus, a device and a computer-readable storage medium, which also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0043] Figure 1 A flow chart of a device control method provided by an embodiment of the present invention;
[0044] Figure 2 An example flow chart of a device control method provided by an embodiment of the present invention;
[0045] Figure 3 An example flow chart of another device control method provided by an embodiment of the present invention;
[0046] Figure 4 A schematic diagram of the structure of a device control device provided by an embodiment of the present invention;
[0047] Figure 5 A schematic diagram of the structure of a device control device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0049] First, several nouns involved in the present invention are analyzed:
[0050] PCIE: Short for PCI Express, high-speed expansion device.
[0051] CPU RootPort: It is the starting point of the PCIE bus. It is connected to the processor or chipset on the motherboard and is responsible for managing and controlling other PCIE devices connected to this port.
[0052] SW bridge: Switch Bridge adapter board, responsible for connecting multiple devices and expanding the coverage of the link.
[0053] End Point PCIE device: The PCIE device at the end of the link refers to the hardware component that actually performs specific functions, such as network cards, graphics cards, sound cards and other hardware devices.
[0054] NVME disk: Non-Volatile Memory Express, is a storage device.
[0055] GPU: Graphics Processing Unit, server graphics card.
[0056] DPC: Downstream Port Containment, is a mechanism for handling error conditions in PCIE links.
[0057] DBF: BUS, Device and Function information of the device, that is, the bus type information, device identification information and function number information of the device.
[0058] It should be noted that: the root node device in this embodiment refers to the CPU RootPort device; the hardware device in this embodiment refers to the PCIE device; the switching device in this embodiment refers to the Switch Bridge device; the port isolation function in this embodiment refers to the DPC function; the terminal device in this embodiment refers to the End Point PCIE device, that is, the terminal PCIE device.
[0059] The present invention is to expand various types of devices through the Switch Bridge adapter board during the development of the AI server. For example: through the Switch Bridge adapter board, 8 NVME hard disks, 8 network cards, 8 GPU cards and other devices can be expanded and connected on the Switch Bridge adapter board. The PCIE device resources loaded on such an AI server are very rich, the PCIE link is very long, and at the same time, the PCIE devices matched with different AI server models have a variety of changing combinations. In this way, in the model of the AI server project, the End Point PCIE device is connected to the CPU RootPort through the Switch Bridge adapter board. The link is very long, and the End Point PCIE device has a variety of types of complex links. Therefore, in the problem of fault diagnosis, how to accurately locate the fault, report the faulty device, and handle the fault source puts forward higher requirements. Under the condition of controlling resource consumption and complexity, it is very important to achieve the fault location performance of the entire complex link by controlling the port isolation function of the device in the complex link.
[0060] The present invention provides a device control method, which locates the positions of various devices based on complex links and applies DPC functions with different strategies to solve the above problems. Figure 1 , Figure 1 A flow chart of a device control method provided by an embodiment of the present invention. The method may include:
[0061] S101: Perform link identification on the link to determine the root node device.
[0062] The link in this embodiment is a complex link of the AI server. A complex link refers to a link with a long link, multiple device types in the link, and multiple device levels. In general, the port isolation function of the root node device can be enabled. Of course, it can also be determined whether to enable it according to the actual situation. Taking into account the complexity of the link, when the root node device and the switching device are in the same link, the system does not know which device is the root node device, so link identification is required to accurately locate the root node device. The root node device is determined first to facilitate traversing the entire link and determining the types of other downstream devices in the link. Specifically, the link information can be read, and the link information includes Socket, Bus, Device, Function, Mmioinfo (memory mapped input / output information), Slotriser (slot allocator) and other information to identify the root node device of the link.
[0063] S102: Identify the device connected to the root node device.
[0064] When the root node device is determined, the root node device is used as the starting point to perform device testing on the downstream devices (i.e., the next-connected devices) of the device in the link to determine the device type of the next-layer node.
[0065] S103: If the downstream device is a hardware device, determine whether to enable a port isolation function of the downstream device according to a first strategy.
[0066] It is understandable that the hardware device is directly connected to the root node device without any switching device in between. Generally, the port isolation function of the hardware device can be enabled. However, in order to meet customer needs, a first strategy of the hardware device is also set, and whether to enable the port isolation function of the hardware device is determined according to the first strategy.
[0067] Furthermore, if the downstream device is a hardware device, determining whether to enable the port isolation function of the downstream device according to the first strategy may include the following steps:
[0068] If the downstream device is in the first whitelist, the port isolation function of the downstream device is enabled;
[0069] If the downstream device is not in the first whitelist, the port isolation function of the downstream device is disabled.
[0070] Specifically, the first strategy in this embodiment is a whitelist strategy. The customer formulates a whitelist according to actual needs. This embodiment does not limit the customization method of the whitelist. For example, the whitelist can be customized according to the device type. For example, if the device type in the whitelist is a GPU and a network card, if the hardware device directly connected to the root node device is a GPU, the port isolation function of the GPU is turned on; if the hardware device directly connected to the root node device is an NVME disk, the port isolation function of the NVME disk is turned off.
[0071] Furthermore, the first whitelist may specifically include hot-swappable devices and devices directly involved in data reading, writing and transmission.
[0072] This embodiment takes into account the devices that are frequently added or removed in systems that support hot plugging, such as servers and data centers. Hot plugging operations may cause exceptions, but the port isolation function can effectively deal with this situation, so hot plug devices can be included in the white list. Key devices that are directly involved in data reading, writing, and transmission, such as storage controllers and network adapters, may cause data damage or loss due to errors in these devices, so port isolation functions are also needed to isolate errors and prevent them from spreading. Therefore, it is very necessary to turn on the port isolation function for hot plugging devices and devices that are directly involved in data reading, writing, and transmission, so that they can effectively deal with abnormal situations caused by hot plugging, and can also isolate errors and prevent them from spreading in time through the port isolation function when data is damaged or lost.
[0073] Furthermore, after disabling the port isolation function of the downstream device, the following steps may also be included:
[0074] Disable the port isolation function of the upper node device connected to the downstream device.
[0075] Specifically, when two devices have a problem connecting, it is not possible to determine whether the problem is with the device itself or with the upper device. Therefore, when shutting down the device, the port isolation function of the upper node device connected to it, that is, the port isolation function of the root node device, must also be shut down.
[0076] S104: If the downstream device is a switching device, the link is identified level by level to determine the terminal device, and whether to enable the port isolation function of the terminal device is determined according to the second strategy.
[0077] When the device connected to the root node device is a switching device, it is necessary to continue to identify, that is, to identify the link step by step until the end of the link. Generally, the end device is generally a hardware device. Although the hardware of the link end device and the hardware of the directly connected root node device are both hardware devices, different strategies need to be formulated due to their different link locations. That is, determine whether to enable the port isolation function of the hardware device according to the second strategy. Generally, the port isolation function of the switching device can also be turned off.
[0078] Further, the step-by-step identification of the link, determining the terminal device, and determining whether to enable the port isolation function of the terminal device according to the second strategy may include the following steps:
[0079] Take the following connected devices as the starting point and identify the link;
[0080] If the downstream device of the downstream device is a switching device, the identification is continued step by step until the hardware device in the link is identified and the hardware device is regarded as the terminal device;
[0081] If the downstream device of the downstream device is a hardware device, the identification is stopped and the hardware device is regarded as the terminal device;
[0082] Determine whether the terminal device is online;
[0083] If it is not online, the terminal device will exit the port isolation function setting;
[0084] If online, determine whether the terminal device is in the second whitelist;
[0085] If the terminal device is in the second whitelist, the port isolation function of the terminal device is enabled;
[0086] If the terminal device is not in the second whitelist, the port isolation function of the terminal device is disabled.
[0087] Specifically, a step-by-step identification strategy is implemented for the link where the switching device is located. For example, the Switch Bridge expansion board BDF:01:00.0 identifies that it is a Bridge, and then identifies the device connected to Bridge BDF:01:00.0. If it is still a Bridge type device, continue to identify step by step until the device connected to the end of this link is found, until all devices are traversed, so as to find the End Point PCIE device (i.e., the end device, which is also a hardware device). For the End Point PCIE device at the end of the Switch Bridge expansion board link, if the End Point PCIE device is in place and is in the white list, the port isolation function of this End Point PCIE device is enabled. This embodiment determines the hardware device at the end of the link by step-by-step identification of the multi-layer link containing the switching device, and determines whether to enable or disable the port isolation function of the hardware device at the end of the link according to the white list and the device status. Such a traversal method can identify all device types and device locations in the entire link, and apply DPC function strategies to them, so as to realize customized fault diagnosis strategies for required devices. Such devices can quickly locate the device fault location and improve system stability and security.
[0088] Furthermore, after the hardware device is used as the terminal device, the following steps may also be included:
[0089] The device between the starting point and the end device is regarded as the link intermediate device, and the port isolation function of the link intermediate device is disabled.
[0090] Specifically, when the device at the end of the link is determined, all the intermediate devices between the end of the link and the starting point belong to nodes without an external End Point (End Point refers to the device or component at the end of the PCIE hierarchy), and the endpoint isolation function of these intermediate devices can be turned off. It needs to be explained that the intermediate device may be a transfer device, or it may be a hardware device with a transfer function, because some hardware devices themselves may have integrated external transfer boards. This means that these devices can establish connections with other devices or components through their built-in transfer boards.
[0091] Furthermore, after the port isolation function of the terminal device is enabled, the following steps may also be included:
[0092] Enable the port isolation function of the upper node device connected to the terminal device.
[0093] Specifically, when there is a problem with the connection between two devices, it is impossible to determine whether it is a problem with the device itself or the upper-level device. Therefore, after passing the second whitelist verification, when the port isolation function of the terminal device is enabled, the port isolation of the upper-level device connected to the terminal device can also be enabled.
[0094] The device control method provided by the embodiment of the present invention is applied to determine the root node device by link identification of the link; identify the downstream device of the root node device; if the downstream device is a hardware device, determine whether to enable the port isolation function of the downstream device according to the first strategy; if the downstream device is a switching device, identify the link step by step, determine the terminal device, and determine whether to enable the port isolation function of the terminal device according to the second strategy. Based on the fault diagnosis function requirements of the complex link of the AI server, the present invention fully combines the characteristics of complex links, such as the long link, many devices, and complex device types of the downstream devices of the complex server, and applies different control strategies after identifying the switching devices and hardware devices connected to the root node device, and turns on and off the port isolation function of the hardware device according to the requirements. This method can accurately identify the device type at each level in the link, and set different fault diagnosis strategies for the hierarchical characteristics of the link where different device types are located. Such a method can realize customized fault diagnosis strategies for required hardware devices through devices that enable port isolation functions in the link while controlling resource consumption and complexity. Based on such port isolation function settings, the location of faulty devices in the link can be further quickly discovered and accurately located, the problem can be quickly solved, and the system stability and security can be improved.
[0095] In order to make the present invention easier to understand, please refer to Figure 2 and Figure 3 . Figure 2 An example flow chart of a device control method provided by an embodiment of the present invention, Figure 3 An example flowchart of another device control method provided by an embodiment of the present invention. Figure 2 It is aimed at the End Point PCIE identification and DPC control of the CPU Root Port; Figure 3 It is aimed at the identification and DPC control of the SW bridge and the End Point PCIE under the SW bridge in the link. This method traverses the link to identify all devices (CPU RootPort, SW bridge, End Point PCIE), as well as the node location of the device in the link. Customize the DPC policy for the CPU RootPort, perform whitelist 1 type identification on the End Point PCIE under the CPU RootPort, and apply the DPC policy of whitelist 1; customize the DPC policy for the SW bridge, perform whitelist 2 type identification on the End Point PCIE under the SW bridge, and apply the DPC policy of whitelist 2.
[0096] The following is a device control method analyzed from the code level:
[0097]
[0098] After this method is applied to this link, the DPC control strategy of each device in the link is as follows:
[0099] (1) Determine that BDF:c0:01.0 is connected to a Switch Bridge and disable the DPC function of BDF:c0:01.0.
[0100] (2) Identify BDF:c3:00.0 as the End Point PCIE device of the Switch Bridge. Identify it as a network card through the EndPoint PCIE device information. The network card is in the whitelist, so enable the DPC function of BDF:c3:00.0.
[0101] (3) Identify that the parent node of the End Point PCIE device of BDF:c3:00.0 is BDF:c2:00.0, and enable the DPC function of c2:00.0.
[0102] (4) The device information of BDF:8F:00.0 connected to BDF:8e:01.0 of CPU Root Port is identified as a network card. The network card is in whitelist 1, so the DPC function of BDF:8F:00.0 is enabled, and the DPC function of BDF:8e:01.0 of CPU Root Port is also enabled.
[0103] (5) The Device information of the End Point PCIE device of BDF:c5:00.0 identifies that it is an NVME disk. The NVME disk is not in the whitelist 2, so the DPC function of BDF:c5:00.0 is turned off.
[0104] The following is an introduction to a device control apparatus provided in an embodiment of the present invention. The device control apparatus described below and the device control method described above can be referenced to each other.
[0105] Please refer to Figure 4 , Figure 4 A schematic diagram of a structure of a device control device provided in an embodiment of the present invention may include:
[0106] The root node device determination module 100 is used to identify the link and determine the root node device;
[0107] A device identification module 200, used to identify a device connected to the root node device;
[0108] The first identification result module 300 is used to determine whether to enable the port isolation function of the downstream device according to the first strategy if the downstream device is a hardware device;
[0109] The second result identification module 400 is used to identify the link level by level if the downstream device is a switching device, determine the terminal device, and determine whether to enable the port isolation function of the terminal device according to the second strategy.
[0110] Based on the above embodiment, the first recognition result module 300 may include:
[0111] A first enabling unit, configured to enable a port isolation function of the downstream device if the downstream device is in a first whitelist;
[0112] The first closing unit is used to close the port isolation function of the downstream device if the downstream device is not in the first whitelist.
[0113] Based on the above embodiment, the device control device may further include:
[0114] The first closing module is used to close the port isolation function of the upper node device connected to the lower connection device.
[0115] Based on the above embodiment, the second result identification module 400 may include:
[0116] A link identification unit, used to identify the link with the downstream device as a starting point;
[0117] A step-by-step identification unit, configured to, if the downstream device of the downstream device is a switching device, continue to perform step-by-step identification until a hardware device in the link is identified, and use the hardware device as the terminal device;
[0118] a terminal device determining unit, configured to stop identifying if the downstream device of the downstream device is a hardware device, and use the hardware device as the terminal device;
[0119] An online determination unit, used to determine whether the terminal device is online;
[0120] An exit unit, used for causing the terminal device to exit the port isolation function setting if it is not online;
[0121] A judging unit, configured to judge whether the terminal device is in a second whitelist if the terminal device is online;
[0122] A second enabling unit, configured to enable a port isolation function of the terminal device if the terminal device is in the second whitelist;
[0123] The second closing unit is used to close the port isolation function of the terminal device if the terminal device is not in the second whitelist.
[0124] Based on the above embodiment, the device control device may further include:
[0125] The first enabling module is used to enable the port isolation function of the upper node device connected to the terminal device.
[0126] Based on the above embodiment, the device control device may further include:
[0127] The second closing module is used to use the switching device between the starting point and the terminal device as a link intermediate device and close the port isolation function of the link intermediate device.
[0128] Based on the above embodiment, the device control device may further include:
[0129] The port isolation function setting module is used to enable the port isolation function of the root node device and disable the port isolation function of the switching device.
[0130] It should be noted that the order of the modules and units in the above-mentioned equipment control device can be changed without affecting the logic.
[0131] The device control device provided by the embodiment of the present invention is applied, through the root node device determination module 100, used to identify the link and determine the root node device; the device identification module 200 is used to identify the downstream device of the root node device; the first identification result module 300 is used to determine whether to enable the port isolation function of the downstream device according to the first strategy if the downstream device is a hardware device; the second result identification module 400 is used to identify the link step by step if the downstream device is a switching device, determine the terminal device, and determine whether to enable the port isolation function of the terminal device according to the second strategy. Based on the fault diagnosis function requirements of the AI server under the complex link situation, this device fully combines the characteristics of complex links, such as the long link of the downstream device of the complex server, many devices, and complex device types, and applies different control strategies after identifying the switching device and hardware device connected to the root node device, and turns on and off the port isolation function of the hardware device according to the needs. Such a device can realize customized fault diagnosis strategies for required hardware devices through devices that enable port isolation functions in the link while controlling resource consumption and complexity. Based on such port isolation function settings, the location of faulty devices in the link can be further quickly discovered and accurately located, the problem can be quickly solved, and the system stability and security can be improved.
[0132] Figure 5 A schematic diagram of a device control device provided by an embodiment of the present invention is shown in FIG. Figure 5 As shown, the device control device includes:
[0133] A memory 60, for storing computer programs;
[0134] The processor 61 is used to implement the steps of the device control method in the above embodiment when executing the computer program.
[0135] The device control device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.
[0136] Among them, the processor 61 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 61 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 61 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 61 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 61 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0137] The memory 60 may include one or more computer-readable storage media, which may be non-transitory. The memory 60 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 60 is at least used to store the following computer program 601, wherein, after the computer program is loaded and executed by the processor 61, it can implement the relevant steps of the device control method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 602 may include Windows, Unix, Linux, etc. Data 603 may include but is not limited to data of the device control method, etc.
[0138] In some embodiments, the device control device may further include a display screen 62 , an input / output interface 63 , a communication interface 64 , a power supply 65 , and a communication bus 66 .
[0139] Those skilled in the art will understand that Figure 5 The structure shown in the figure does not constitute a schematic diagram of the structure of the device control device, such as Figure 5 As shown, the device control device includes:
[0140] The invention is limited and may include more or fewer components than those shown in the figure.
[0141] It is understandable that if the device control method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the current technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk or optical disk and other media that can store program codes.
[0142] Based on this, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned device control method are implemented.
[0143] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0144] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0145] Finally, it should be noted that, in this article, relationships such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variations are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0146] The above is a detailed introduction to a device control method, apparatus, equipment and computer-readable storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for a general technician in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A device control method, characterized in that: include: Perform link identification on the link and determine the root node device; Identify the device connected to the root node device; If the downstream device is a hardware device, determining whether to enable a port isolation function of the downstream device according to a first strategy; If the downstream device is a switching device, the link is identified step by step to determine the terminal device, and whether to enable the port isolation function of the terminal device is determined according to the second strategy.
2. The device control method according to claim 1, characterized in that: If the downstream device is a hardware device, determining whether to enable the port isolation function of the downstream device according to the first strategy includes: If the downstream device is in the first whitelist, enabling the port isolation function of the downstream device; If the downstream device is not in the first whitelist, the port isolation function of the downstream device is disabled.
3. The device control method according to claim 2, characterized in that: After disabling the port isolation function of the downstream device, the method further includes: Disable the port isolation function of the upper node device connected to the downstream device.
4. The device control method according to claim 1, characterized in that: Identifying the link level by level, determining the terminal device, and determining whether to enable the port isolation function of the terminal device according to the second strategy, including: Taking the downstream device as a starting point, identifying the link; If the downstream device of the downstream device is a switching device, continue to identify step by step until a hardware device in the link is identified, and use the hardware device as the terminal device; If the downstream device of the downstream device is a hardware device, then the identification is stopped and the hardware device is used as the terminal device; Determine whether the terminal device is online; If it is not online, the terminal device exits the port isolation function setting; If online, determine whether the terminal device is in the second whitelist; If the terminal device is in the second whitelist, enabling the port isolation function of the terminal device; If the terminal device is not in the second whitelist, the port isolation function of the terminal device is disabled.
5. The device control method according to claim 4, characterized in that: After the port isolation function of the terminal device is enabled, the method further includes: Enable the port isolation function of the upper node device connected to the terminal device.
6. The device control method according to claim 4, characterized in that: After the hardware device is used as the terminal device, the method further includes: The device between the starting point and the terminal device is used as a link intermediate device, and the port isolation function of the link intermediate device is disabled.
7. The device control method according to claim 1, characterized in that: Also includes: The port isolation function of the root node device is enabled, and the port isolation function of the switching device is disabled.
8. A device control device, characterized in that: include: A root node device determination module is used to identify the link and determine the root node device; A device identification module, used to identify the downstream device of the root node device; A first identification result module, used for determining whether to enable a port isolation function of the downstream device according to a first strategy if the downstream device is a hardware device; The second result identification module is used to identify the link level by level if the downstream device is a switching device, determine the terminal device, and determine whether to enable the port isolation function of the terminal device according to the second strategy.
9. A device control device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the device control method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the device control method according to any one of claims 1 to 7 are implemented.
