Equipment control method and device and control equipment
By using switching equipment for network communication in the data center, the problem of slow communication caused by excessive bus communication load is solved, accurate control and fast synchronization of node servers are achieved, and the flexibility and operation and maintenance efficiency of controlling node servers are improved.
Patent Information
- Application Number
- CN202511087422.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-04
- Publication Date
- 2025-09-16
AI Technical Summary
In a data center, when node servers in a modular server architecture communicate through a bus, excessive communication load results in slow communication, making it impossible to update firmware and quickly synchronize node information, resulting in low flexibility in controlling the node servers.
The communication is carried out using switching equipment. By obtaining the address and equipment information of the target equipment and utilizing the network connection between the control equipment and the switching equipment, accurate control and operation of the target equipment can be achieved.
It improves the accuracy and flexibility of device control, simplifies operation and maintenance management, and enables rapid synchronization of firmware updates and node information.
Smart Images

Figure CN120658780A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a device control method, apparatus, and control device. Background Art
[0002] Currently, data centers use modular server architectures (e.g., blade servers, multi-node servers, etc.), where a device chassis contains multiple node servers, each of which is managed and controlled by the Chassis Management Module (CMM) of the master server.
[0003] In actual applications, the CMM of the master server communicates with each node server via a bus. When communicating large amounts of data, the bus communication load is excessive, resulting in slow communication. Furthermore, bus-based functions such as firmware updates and rapid synchronization of node information cannot be implemented within the node server. This results in a low level of flexibility for the control node server. Summary of the Invention
[0004] The embodiments of the present application provide a device control method, apparatus, and control device to solve the problem of low flexibility of a control node server.
[0005] In a first aspect, an embodiment of the present application provides a device control method, including:
[0006] Acquire a communication state of at least one first device, where the communication state of the first device is a ready state or a non-ready state, and the first device is a device to be controlled;
[0007] determining at least one target device in the at least one first device;
[0008] Acquire a first address of the at least one target device in the switching device;
[0009] For any target device, a control request is obtained, and the target device is controlled according to the first address and the control request.
[0010] In a possible implementation, determining at least one target device in the at least one first device includes:
[0011] For any first device, if the communication state of the first device is the ready state, determining at least one communication protocol corresponding to the first device;
[0012] If, among the at least one communication protocol, there is a communication protocol that matches a preset protocol, the first device is determined to be the target device.
[0013] In the embodiment of the present application, a target device with which communication is possible and with which the protocol matches is determined, thereby achieving the purpose of accurately controlling the target device.
[0014] In one possible implementation, the control request includes an identifier of at least one target device and at least one target operation corresponding to each target device; and controlling the target device according to the first address and the control request includes:
[0015] Determine a target address corresponding to the first address, where the address format of the target address is a format supported by the communication protocol corresponding to the control device;
[0016] According to the target address, obtaining device information of the target device;
[0017] The target device is controlled to execute the at least one target operation according to the device information and the target address.
[0018] In the embodiment of the present application, the target device is controlled to perform at least one target operation according to the device information and the target address, thereby improving the accuracy of device control.
[0019] In one possible implementation, the device information includes the device identification, the device status, and the first address; and controlling the target device to perform the at least one target operation according to the device information and the target address includes:
[0020] determining a control state of the target device according to the device information, the control request, and the target address, wherein the control state of the target device is a controllable state or an uncontrollable state;
[0021] If the control state of the target device is the controllable state, the target device is controlled to perform the at least one target operation.
[0022] In an embodiment of the present application, the control device can control at least one target device to perform at least one corresponding target operation, thereby simplifying operation and maintenance management work.
[0023] In a possible implementation, determining a control state of the target device according to the device information, the control request, and the target address, where the control state of the target device is a controllable state or an uncontrollable state, includes:
[0024] If the device identifier in the device information matches the identifier of the target device, the first address matches the target address, and the device state is the running state, determining that the control state of the target device is the controllable state;
[0025] If the device identifier in the device information does not match the identifier of the target device, or the first address does not match the target address, or the device state is a non-operating state, then the control state of the target device is determined to be the uncontrollable state.
[0026] In the embodiment of the present application, by determining the control state of the target device, it can be determined that the device performing the target operation is the correct target device, thereby improving the accuracy of device control.
[0027] In a possible implementation, obtaining, by the switching device, device information of the target device according to the target address includes:
[0028] Obtain at least one first thread;
[0029] Obtain an acquisition cycle corresponding to each first thread;
[0030] Obtaining a preset number, where the preset number is the number of at least one target device for which the first thread can obtain device information;
[0031] During an acquisition cycle corresponding to the first thread, device information of the target device is acquired through the first thread according to the preset number.
[0032] In the embodiment of the present application, the first thread acquires device information in different acquisition cycles, thereby improving the flexibility of acquiring device information. Furthermore, the device information is directly acquired from the BMC of the target device through network communication, thereby improving the efficiency of acquiring device information.
[0033] In a second aspect, an embodiment of the present application provides a device control apparatus, the apparatus comprising:
[0034] A first acquisition module is configured to acquire a communication state of at least one first device, where the communication state of the first device is a ready state or a non-ready state, and the first device is a device to be controlled;
[0035] a determining module, configured to determine at least one target device in the at least one first device, the target device being in the ready state;
[0036] A second acquisition module, configured to acquire a first address of the at least one target device in the switching device;
[0037] The control module is configured to obtain a control request for any target device and control the target device according to the first address and the control request.
[0038] In a possible implementation, the determining module is specifically configured to:
[0039] For any first device, if the communication state of the first device is the ready state, determining at least one communication protocol corresponding to the first device;
[0040] If, among the at least one communication protocol, there is a communication protocol that matches a preset protocol, the first device is determined to be the target device.
[0041] In a possible implementation, the control module is specifically configured to:
[0042] Determine a target address corresponding to the first address, where the address format of the target address is a format supported by the communication protocol corresponding to the control device;
[0043] According to the target address, obtaining device information of the target device;
[0044] The target device is controlled to execute the at least one target operation according to the device information and the target address.
[0045] In a possible implementation, the control module is specifically configured to:
[0046] determining a control state of the target device according to the device information, the control request, and the target address, wherein the control state of the target device is a controllable state or an uncontrollable state;
[0047] If the control state of the target device is the controllable state, the target device is controlled to perform the at least one target operation.
[0048] In a possible implementation, the control module is specifically configured to:
[0049] If the device identifier in the device information matches the identifier of the target device, the first address matches the target address, and the device state is the running state, determining that the control state of the target device is the controllable state;
[0050] If the device identifier in the device information does not match the identifier of the target device, or the first address does not match the target address, or the device state is a non-operating state, then the control state of the target device is determined to be the uncontrollable state.
[0051] In a possible implementation, the control module is specifically configured to:
[0052] Obtain at least one first thread;
[0053] Obtain an acquisition cycle corresponding to each first thread;
[0054] Obtaining a preset number, where the preset number is the number of at least one target device for which the first thread can obtain device information;
[0055] During an acquisition cycle corresponding to the first thread, device information of the target device is acquired through the first thread according to the preset number.
[0056] In a third aspect, an embodiment of the present application provides a control device, including:
[0057] at least one processor; and
[0058] a memory communicatively connected to the at least one processor; wherein,
[0059] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform any method described in the first aspect.
[0060] In a fourth aspect, an embodiment of the present application provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute any one of the methods in the first aspect.
[0061] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising a computer program, which implements any one of the methods in the first aspect when executed by a processor.
[0062] The device control method, apparatus, and control device provided in the embodiments of the present application enable the control device to communicate with each first device via a switching device. The control device controls the first device to perform corresponding operations based on the control request to implement the corresponding function. This avoids excessive bus communication load, resulting in slow communication, when communicating via the bus. Furthermore, network communication can be performed via the switching device, enabling functions such as firmware updates and rapid synchronization of node information. This improves the flexibility of the control node server. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0064] Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application;
[0065] Figure 2 A flow chart of a device control method provided in an embodiment of the present application;
[0066] Figure 3A schematic diagram of a process for obtaining a first address of at least one target device provided in an embodiment of the present application;
[0067] Figure 4 A schematic diagram of the process of obtaining a control request provided in an embodiment of the present application;
[0068] Figure 5 A flowchart of another device control method provided in an embodiment of the present application;
[0069] Figure 6 A schematic diagram of the device control process provided in an embodiment of the present application;
[0070] Figure 7 A schematic diagram of the structure of the device control device provided in an embodiment of the present application;
[0071] Figure 8 A schematic diagram of the structure of the control device provided in an embodiment of the present application.
[0072] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0073] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0074] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0075] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and corresponding operation entrances must be provided for users to choose to authorize or refuse.
[0076] For ease of understanding, below, combined with Figure 1 , describes the application scenarios to which the embodiments of the present application are applicable.
[0077] Figure 1 This is a schematic diagram of the application scenario provided by the embodiment of this application. Figure 1 , including a control device 101 and a node server system 102. The control device 101 and the node server system 102 can be set in the same chassis. The control device 101 can be a server, and a CMM is set in the control device 101. The node server system 102 includes multiple servers, namely server 1, server 2, ..., server N. Each server is provided with a baseboard management controller (Baseboard Management Controller, BMC) and a complex programmable logic device (Complex Programmable Logic Device, CPLD). Each server in the node server system 102 is locally managed through the BMC. The CMM of the control device 101 and the BMC of each server collaborate to complete operations such as firmware updates, status monitoring, and fault diagnosis.
[0078] In actual applications, the CMM of the master server communicates with each node server via a bus. When communicating large amounts of data, the bus communication load is excessive, resulting in slow communication. Furthermore, bus-based functions such as firmware updates and rapid synchronization of node information cannot be implemented within the node server. This results in a low level of flexibility for the control node server.
[0079] In the embodiments of the present application, the control device can communicate with each first device via a switching device. Based on the control request, the control device controls the first device to perform the corresponding operation to implement the corresponding function. This avoids excessive bus communication load and slow communication when communicating via the bus. Furthermore, network communication can be performed via the switching device, enabling functions such as firmware updates and rapid synchronization of node information. This improves the flexibility of the control node server.
[0080] The method of the present application is described below through specific embodiments. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or similar contents will not be repeated in different embodiments.
[0081] Figure 2 This is a flow chart of a device control method provided in an embodiment of the present application. Figure 2 , the method may include:
[0082] S201: Acquire the communication status of at least one first device.
[0083] The execution subject of the embodiments of the present application may be a control device or a device control device provided within the control device. The device control device may be implemented via software or a combination of software and hardware. The control device may be a server. The control room device may be a master server, and the control device may include a CMM. The first device may be a node server.
[0084] The communication state of the first device is a ready state or a non-ready state, and the first device is a device to be controlled.
[0085] The communication state is used to indicate whether the first device is currently capable of communication. If the first device is currently capable of communication, the communication state of the first device can be determined to be a ready state. If the first device is currently unable to communicate, the communication state of the first device can be determined to be a non-ready state.
[0086] The user can set the communication status of the first device through the interface provided by the terminal device. The control device can obtain the communication status of the first device through the CPLD of the first device.
[0087] For example, the first device includes device A1, device A2, and device A3. The control device obtains from the CPLDs of devices A1, A2, and A3 that the communication states of devices A1, A2, and A3 are all in the ready state.
[0088] S202: Determine at least one target device in at least one first device.
[0089] The target device is in the ready state.
[0090] At least one target device can be determined in at least one first device in the following manner: for any first device, if the communication status of the first device is a ready state, at least one communication protocol corresponding to the first device is determined; if there is a communication protocol in at least one communication protocol that matches a preset protocol, the first device is determined to be the target device.
[0091] The preset protocol may be a Link Layer Discovery Protocol (LLDP). The preset protocol may be set in advance and stored in a preset storage space of the first device.
[0092] At least one communication protocol corresponding to the first device may be a communication protocol supported by the first device, that is, the first device can communicate with other devices through a communication protocol, and the communication protocol may be determined to be the communication protocol corresponding to the first device.
[0093] The control device may determine the communication protocol corresponding to the first device according to the current communication status with the first device.
[0094] If the communication protocol is the same as the preset protocol, or if each field in the communication protocol matches each field in the preset protocol, then it can be determined that the communication protocol matches the preset protocol. If the communication protocol is different from the preset protocol, or if a field in the communication protocol does not match a field in the preset protocol, then it can be determined that the communication protocol matches the preset protocol.
[0095] Each field in the communication protocol matches each field in the preset protocol, indicating that each field in the communication protocol has a corresponding field in the preset protocol.
[0096] If no communication protocol matches the preset protocol in at least one communication protocol, it is determined that the first device is not the target device.
[0097] For example, according to the above example, it is determined that the communication states of device A1, device A2, and device A3 are all in the ready state. The at least one communication protocol corresponding to each first device can be specifically shown in Table 1:
[0098] Table 1
[0099]
[0100] Assuming the preset protocol is Protocol 1, Table 1 shows that at least one communication protocol corresponding to device A1 matches the preset protocol, and thus device A1 is determined to be the target device. Table 1 shows that the communication protocol corresponding to device A2 matches the preset protocol, and thus device A2 is determined to be the target device. Table 1 shows that the communication protocol corresponding to device A3 does not match the preset protocol, and thus device A3 is determined not to be the target device.
[0101] In the embodiment of the present application, a target device with which communication is possible and with which the protocol matches is determined, thereby achieving the purpose of accurately controlling the target device.
[0102] S203: Obtain a first address of at least one target device in the switching device.
[0103] The switching device may be a switch.
[0104] Switching equipment is used to forward electrical (optical) signals. It can provide an exclusive electrical signal path for any two devices connected to the switch.
[0105] Next, combine Figure 3 , a process of obtaining a first address of at least one target device in a switching device is described. Figure 3 This is a schematic diagram of a process for obtaining a first address of at least one target device provided in an embodiment of the present application. Figure 3 , including a control device 301, a switching device 302, and at least one first device. The control device 301 is provided with a management module, which may be a CMM. The switching device 302 is provided with a Vital Product Data (VPD) module. The VPD module stores a set of key data that uniquely identifies a hardware device or software component. The first device may be a server, provided with a BMC and a CPLD. The control device 301 and the at least one first device establish a network connection through the switching device 302. The BMC of each first device corresponds one-to-one with a port of the switching device 302. Based on the Media Access Control (MAC) self-learning function of the switching device 302, when the first device is in the ready state and the corresponding communication protocol of the first device is a preset protocol, the switching device 302 can learn the first address of the first device and store the first address in the VPD module. The management module of the control device 301 obtains the first address of the first device through the VPD module of the switching device. The first address may be a MAC address.
[0106] The switching device can be used to enable network communication between the control device and each first device, replacing bus communication to avoid the problem of low efficiency of bus communication.
[0107] S204: Obtain a control request for any target device, and control the target device according to the first address and the control request.
[0108] The control request includes an identifier of at least one target device and at least one target operation corresponding to each target device.
[0109] The user can determine the identifier of at least one target device and at least one target operation corresponding to each target device through a page provided by the terminal device. In response to the user's operation, the terminal device generates a control request and sends the control request to the control device.
[0110] Next, combine Figure 4 , describes the process of obtaining a control request. Figure 4 This is a schematic diagram of the process of obtaining a control request provided in an embodiment of the present application. Figure 4, including interfaces 401 and 402. Interfaces 401 and 402 may be pages provided by the terminal device. A user can click the icon corresponding to the control application on the terminal device's home page. The terminal device responds to the user's input and selects an operation, displaying the operation page. The operation page includes a drop-down selection menu corresponding to the device identifier, a drop-down selection menu corresponding to at least one operation, and a text input box.
[0111] The user can select at least one target device from the drop-down menu corresponding to the device identifier, including device A1 and device A2. In the drop-down menu corresponding to Operation 1, the user can select the target operation to turn on the device light and click the OK icon. In response to the user's input selecting the operation, the terminal device generates a control request. The terminal device sends the control request to the control device. The control request includes the device identifiers (device A1 and device A2) and the target operation (turning on the device light).
[0112] Optionally, after determining the at least one target device, the control device may send the at least one target device to the terminal device. In this way, the terminal device can update the current target device in real time based on the status change of the at least one first device. A user may determine the at least one target device to be controlled from the at least one target device.
[0113] For example, according to the above example, the at least one target device includes device A1 and device A2. The user can select at least one target device to be controlled in the drop-down selection menu corresponding to the device identifier to generate a control request.
[0114] For example, according to the above example, if the control request includes device identifiers: device A1 and device A2; and target operation: turning on device lights, the control device controls devices A1 and A2 through the switching device according to the control request to turn on the device lights.
[0115] In the device control method provided in the embodiments of the present application, a control device can communicate with each first device via a switching device. Based on a control request, the control device controls the first device to perform a corresponding operation to implement the corresponding function. This avoids excessive bus communication load, resulting in slow communication. Furthermore, network communication can be performed via the switching device, enabling functions such as firmware updates and rapid synchronization of node information. This improves the flexibility of the control node server.
[0116] Based on any of the above embodiments, Figure 5 , explaining the detailed process of device control.
[0117] Figure 5 This is a flow chart of another device control method provided in an embodiment of the present application. Figure 5, the method comprising:
[0118] S501: Acquire the communication status of at least one first device.
[0119] It should be noted that the execution process of S501 can refer to S201 and will not be repeated here.
[0120] S502: Determine at least one target device in at least one first device.
[0121] For example, the first device includes device B1 and device B2. The control device uses the CPLDs of devices B1 and B2 to determine that the communication status of both devices B1 and B2 is ready. The control device determines the communication protocols corresponding to devices B1 and B2 and confirms that the communication protocol corresponding to device B1 matches the preset protocol. Therefore, the control device determines that device B1 is the target device.
[0122] S503: Obtain a first address of at least one target device in the switching device.
[0123] When the first device is determined to be the target device, it indicates that the target device's communication status is in the ready state and the communication protocol is the preset protocol. The switching device can monitor network data frames and associate the first address of the first device with the switching device's receiving port, thereby generating a dynamic address table. The dynamic address table can be stored in the switching device's VPD, and the management module of the control device can obtain the first address of at least one target device from the VPD.
[0124] If the switching device receives the data sent by the target device through the receiving port, the receiving port corresponding to the first address of the target device is determined to be the receiving port.
[0125] For example, the control device obtains the first address of the device B1 in the VPD module of the switching device as address B1, where address B1 is a MAC address.
[0126] S504: Get a control request.
[0127] For example, the control device obtains a control request sent by the terminal device, where the control request includes a device identifier: device B1; and target operations: operation B1 and operation B2.
[0128] S505: For any target device, determine a target address corresponding to the first address.
[0129] The address format of the target address is a format supported by the communication protocol corresponding to the control device.
[0130] The address format of the destination address may be in Internet Protocol Version 6 (IPv6) format.
[0131] For example, the control device may calculate the IPv6 address corresponding to the MAC address according to the EUI-64 format, thereby determining the target address corresponding to the first address.
[0132] For example, according to the above example, the first address of the device B1 is determined to be address B1. The control device calculates the target address corresponding to address B1 as address B11 according to the EUI-64 format.
[0133] S506: Obtain device information of the target device according to the target address.
[0134] The device information of the target device can be obtained through the switching device according to the target address in the following manner: obtain at least one first thread; obtain the acquisition cycle corresponding to each first thread; obtain a preset number, which is the number of at least one target device whose device information can be obtained by the first thread; within the acquisition cycle corresponding to the first thread, obtain the device information of the target device through the first thread according to the preset number.
[0135] The device information includes a device identifier, a device state, and a first address. The device state is either an operating state or a non-operating state.
[0136] The management module of the control device can communicate with the BMC of each target device through the Redfish protocol to obtain the device information of the target device.
[0137] Multiple first threads can obtain device information of target devices in a polling manner. That is, each first thread can obtain device information of X target devices within a corresponding acquisition cycle, where X is a preset number.
[0138] If the number of target devices is less than a preset number, each first thread can obtain device information for Y target devices during the corresponding acquisition cycle, where Y is the number of target devices. If the number of target devices is greater than the preset number, each first thread can obtain device information for X target devices during the corresponding acquisition cycle. Target devices for which device information has not yet been obtained will obtain device information for them during the next acquisition cycle.
[0139] The preset number can be set in advance and stored in the preset storage space of the control device. For example, the preset number can be 4.
[0140] During the acquisition cycle, the first thread converts the first address into a target address. Based on the target address, it determines a Uniform Resource Locator (URL). Based on the URL, it calls a preset function to communicate with the target device's BMC to obtain device information. The target address and preset fields can be concatenated to obtain a URL. The preset fields can be random fields, user-defined fields, and so on. This application does not impose any restrictions. The preset function can be a callback function.
[0141] The control device is directly addressed through the BMC's unique hardware identifier MAC address, eliminating the need to assign an IP address to each BMC.
[0142] For example, the acquisition cycles corresponding to the first threads may be specifically as shown in Table 2:
[0143] Table 2
[0144]
[0145] Assuming the preset number is four, it can be determined that each first thread can obtain device information for four target devices within the corresponding acquisition cycle. As shown in Table 2, the control device can obtain device information for device B1 via thread B1 during cycle 1. During cycle 2, device information for device B1 can be obtained via thread B2. During cycle 3, device information for device B1 can be obtained via thread B3. Device B1's device information includes device identification (Device B1); device status (Operating Status); and first address (Address B1).
[0146] In the embodiment of the present application, the first thread acquires device information in different acquisition cycles, thereby improving the flexibility of acquiring device information. Furthermore, the device information is directly acquired from the BMC of the target device through network communication, thereby improving the efficiency of acquiring device information.
[0147] S507: Control the target device to execute at least one target operation according to the device information and the target address.
[0148] The target device can be controlled to perform at least one target operation based on the device information and the target address in the following manner: the control state of the target device is determined based on the device information, the control request and the target address, and the control state of the target device is a controllable state or an uncontrollable state; if the control state of the target device is a controllable state, the target device is controlled to perform at least one target operation.
[0149] In an embodiment of the present application, the control device can control at least one target device to perform at least one corresponding target operation, thereby simplifying operation and maintenance management work.
[0150] The control state of the target device can be determined based on the device information, control request and target address in the following manner: if the device identifier in the device information matches the identifier of the target device, the first address matches the target address, and the device state is in the running state, then the control state of the target device is determined to be a controllable state; if the device identifier in the device information does not match the identifier of the target device, or the first address does not match the target address, or the device state is in the non-running state, then the control state of the target device is determined to be an uncontrollable state.
[0151] If the device status is "Running", it means the target device is running normally and multiple operations can be performed. If the device status is "Non-Running", it means the target device is not running or has an abnormality and multiple operations cannot be performed.
[0152] If the device identification in the device information is the same as the identification of the target device, or if the device identification field in the device information matches the identification field of the target device, then it is determined that the device identification in the device information matches the identification of the target device. If the device identification in the device information is not the same as the identification of the target device, or if the device identification field in the device information does not match the identification field of the target device, then it is determined that the device identification in the device information matches the identification of the target device.
[0153] If the first address in the device information is calculated using the method described in the above embodiment and the target address are the same, or if at least one address field in the first address in the device information is calculated using the method described in the above embodiment and at least one address field in the target address match, then the first address is determined to match the target address. If the first address in the device information is calculated using the method described in the above embodiment and the target address are different, or if at least one address field in the first address in the device information is calculated using the method described in the above embodiment and at least one address field in the target address do not match, then the first address is determined to not match the target address.
[0154] The control device can determine to communicate with the BMC of each target device via the Redfish protocol based on the calling method of the target operation to control the target device to perform the target operation. Alternatively, the control device can control the target device to perform the target operation through the switching device.
[0155] For example, as shown in the example above, the device information for device B1 includes the device identifier (Device B1), the device status (Operating State), and the first address (Address B1). The control device determines that the device identifier in the device information matches the identifier of the target device, the first address matches the target address, and the device status is Operating State. It then determines that the control state of device B1 is Controllable. The control device controls device B1 through the switching device to perform Operations B1 and B2.
[0156] Optionally, when controlling at least one target device to perform at least one target operation, communication time slots or channel bandwidths may be dynamically allocated according to the priority and task type of the target device, thereby improving the flexibility of device control.
[0157] If the control state of the target device is an uncontrollable state, a prompt message is generated and sent to the control device. The prompt message is used to indicate that the control state of the target device is an uncontrollable state.
[0158] In the embodiment of the present application, by determining the control state of the target device, it can be determined that the device performing the target operation is the correct target device, thereby improving the accuracy of device control.
[0159] For example, at least one target operation can include turning the target device's device light on, off, or flashing, configuring the target device's BMC Internet Protocol (IP), starting or shutting down the target device's operating system, configuring the target device's BMC dedicated network to Dynamic Host Configuration Protocol (DHCP) mode, configuring the target device's BMC dedicated network to a static IP address, configuring the target device's BMC shared network to DHCP mode, configuring the target device's BMC shared network to a static IP address, and enabling or disabling detailed debugging information printing. Each target operation can be configured with a corresponding calling method.
[0160] The node setting function can be implemented through multiple threads, different threads can be configured for different nodes, and the function of mixed distribution of dynamic IP and static IP for different nodes is supported. It also supports the legitimacy verification of back-end json data and IP data, node number verification, etc.
[0161] The visual interface provides access to relevant information during the control process, as well as information about each target device. For example, the visual interface can display device configuration information, including device type, power status, power control, power consumption, and other information. The visual interface also includes icons for controlling power and device lighting; users can click these icons to perform batch control. The visual interface also includes a detailed page for each device. This page includes device and version information. The version information includes information about various versions of the target device, such as the BIOS version, BMC version, and CPLD version.
[0162] The visualization page also allows batch control of the same target operations on each target device. For example, the interface for configuring the target device's BMC dedicated network can batch set the BMC network information of multiple target devices, facilitating operation and maintenance and simplifying the maintenance workload.
[0163] In the device control method provided in the embodiments of the present application, a control device can communicate with each first device via a switching device. Based on the control request, the control device controls the first device to perform corresponding operations to implement the corresponding functions. This avoids excessive bus communication load and slow communication when communicating via a bus. Furthermore, network communication can be performed via the switching device, enabling batch control. This improves the flexibility of the control node server.
[0164] Based on any of the above embodiments, Figure 6 , the process of equipment control is illustrated with examples.
[0165] Figure 6 This is a schematic diagram of the device control process provided by the embodiment of this application. Figure 6 , including a control device 601, a switching device 602, and a first device group 603. Control device 601 may be a server, and is provided with a management module. Switching device 602 may be a switch, and is provided with a VPD module. First device group 603 includes three first devices, each of which is provided with a CPLD and a BMC. The first devices may be servers. The management module of control device 601 can obtain the communication status of each first device through the CPLD of each first device. The communication status of device 1, device 2, and device 3 are all in the ready state.
[0166] The management module of control device 601 determines the communication protocols corresponding to devices 1, 2, and 3, and determines that the communication protocols corresponding to devices 1 and 2 match the preset protocol. Therefore, the control device determines that devices 1 and 2 are target devices. The management module of control device 601 obtains the first address of device 1 as Address 1 and the first address of device 2 as Address 2 from the VPD module of switching device 602. The control request from the management module of control device 601 includes the device identifiers: Device 1, Device 2; and the target operation: Operation 1.
[0167] The management module of control device 601 determines that the target address corresponding to address 1 is address 11, and the target address corresponding to address 2 is address 21. Based on address 11, the management module of control device 601 obtains device information of device 1 from the BMC of device 1, including the device identifier: device 1; device status: running status; and first address: address 1. Based on address 21, the management module of control device 601 obtains device information of device 2 from the BMC of device 2, including the device identifier: device 2; device status: running status; and first address: address 2.
[0168] For device 1, the management module of control device 601 determines that the device identifier in the device information matches the identifier of the target device, the first address matches the target address, and the device status is running. It then determines that the control status of device 1 is controllable. For device 2, the management module of control device 601 determines that the device identifier in the device information matches the identifier of the target device, the first address matches the target address, and the device status is running. It then determines that the control status of device 2 is controllable. The management module of control device 601 controls devices 1 and 2 to perform operation 1.
[0169] In the device control process provided by the embodiments of the present application, the control device can communicate with each first device via a switching device. Based on the control request, the control device controls the first device to perform corresponding operations to implement the corresponding functions. This avoids excessive bus communication load and slow communication when communicating via the bus. Furthermore, the switching device enables network communication and batch control, thereby improving the flexibility of the control node server.
[0170] Figure 7 This is a schematic diagram of the structure of the device control device provided in the embodiment of this application. Figure 7 , the data storage device 10 may include:
[0171] A first acquisition module 11 is configured to acquire a communication state of at least one first device, where the communication state of the first device is a ready state or a non-ready state, and the first device is a device to be controlled;
[0172] a determining module 12, configured to determine at least one target device in the at least one first device, the target device being in the ready state;
[0173] A second acquisition module 13 is configured to acquire a first address of the at least one target device in the switching device;
[0174] The control module 14 is configured to obtain a control request for any target device and control the target device according to the first address and the control request.
[0175] In a possible implementation, the determining module 12 is specifically configured to:
[0176] For any first device, if the communication state of the first device is the ready state, determining at least one communication protocol corresponding to the first device;
[0177] If, among the at least one communication protocol, there is a communication protocol that matches a preset protocol, the first device is determined to be the target device.
[0178] In a possible implementation, the control module 14 is specifically configured to:
[0179] Determine a target address corresponding to the first address, where the address format of the target address is a format supported by the communication protocol corresponding to the control device;
[0180] According to the target address, obtaining device information of the target device;
[0181] The target device is controlled to execute the at least one target operation according to the device information and the target address.
[0182] In a possible implementation, the control module 14 is specifically configured to:
[0183] determining a control state of the target device according to the device information, the control request, and the target address, wherein the control state of the target device is a controllable state or an uncontrollable state;
[0184] If the control state of the target device is the controllable state, the target device is controlled to perform the at least one target operation.
[0185] In a possible implementation, the control module 14 is specifically configured to:
[0186] If the device identifier in the device information matches the identifier of the target device, the first address matches the target address, and the device state is the running state, determining that the control state of the target device is the controllable state;
[0187] If the device identifier in the device information does not match the identifier of the target device, or the first address does not match the target address, or the device state is a non-operating state, then the control state of the target device is determined to be the uncontrollable state.
[0188] In a possible implementation, the control module 14 is specifically configured to:
[0189] Obtain at least one first thread;
[0190] Obtain an acquisition cycle corresponding to each first thread;
[0191] Obtaining a preset number, where the preset number is the number of at least one target device for which the first thread can obtain device information;
[0192] During an acquisition cycle corresponding to the first thread, device information of the target device is acquired through the first thread according to the preset number.
[0193] The device control device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.
[0194] Figure 8 This is a schematic diagram of the structure of the control device provided in the embodiment of this application. Figure 8 The control device 20 may include a memory 21 and a processor 22. For example, the memory 21 and the processor 22 are interconnected via a bus 23.
[0195] The memory 21 is used to store program instructions;
[0196] The processor 22 is configured to execute the program instructions stored in the memory, so as to enable the control device 20 to execute the method shown in the above method embodiment.
[0197] The control device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principles and beneficial effects are similar and will not be repeated here.
[0198] An embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, which are used to implement the above method when executed by a processor.
[0199] The embodiment of the present application may also provide a computer program product, including a computer program, which can implement the above method when executed by a processor.
[0200] All or part of the steps in the above-mentioned method embodiments may be accomplished by hardware associated with program instructions. The aforementioned program may be stored in a readable memory. When executed, the program performs the steps of the above-mentioned method embodiments. The aforementioned memory (storage medium) includes: read-only memory (ROM), random access memory (RAM), flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disc, and any combination thereof.
[0201] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0202] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0203] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0204] Obviously, those skilled in the art may make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations.
[0205] In this application, the term "include" and its variations may refer to non-restrictive inclusion; the term "or" and its variations may refer to "and / or". In this application, the terms "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. In this application, "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship.
Claims
1. A device control method, characterized in that: include: Acquire a communication state of at least one first device, where the communication state of the first device is a ready state or a non-ready state, and the first device is a device to be controlled; determining at least one target device in the at least one first device; Acquire a first address of the at least one target device in the switching device; For any target device, a control request is obtained, and the target device is controlled according to the first address and the control request.
2. The method according to claim 1, characterized in that Determining at least one target device in the at least one first device includes: For any first device, if the communication state of the first device is the ready state, determining at least one communication protocol corresponding to the first device; If, among the at least one communication protocol, there is a communication protocol that matches a preset protocol, the first device is determined to be the target device.
3. The method according to claim 2, characterized in that The control request includes an identifier of at least one target device and at least one target operation corresponding to each target device; controlling the target device according to the first address and the control request includes: Determine a target address corresponding to the first address, where the address format of the target address is a format supported by the communication protocol corresponding to the control device; According to the target address, obtaining device information of the target device; The target device is controlled to execute the at least one target operation according to the device information and the target address.
4. The method according to claim 3, characterized in that The device information includes the device identification, device status, and the first address; Controlling the target device to perform the at least one target operation according to the device information and the target address includes: determining a control state of the target device according to the device information, the control request, and the target address, wherein the control state of the target device is a controllable state or an uncontrollable state; If the control state of the target device is the controllable state, the target device is controlled to perform the at least one target operation.
5. The method according to claim 4, characterized in that Determining a control state of the target device according to the device information, the control request, and the target address, where the control state of the target device is a controllable state or an uncontrollable state, includes: If the device identifier in the device information matches the identifier of the target device, the first address matches the target address, and the device state is the running state, determining that the control state of the target device is the controllable state; If the device identifier in the device information does not match the identifier of the target device, or the first address does not match the target address, or the device state is a non-operating state, then the control state of the target device is determined to be the uncontrollable state.
6. The method according to claim 4 or 5, characterized in that Acquiring device information of the target device through the switching device according to the target address includes: Obtain at least one first thread; Obtain an acquisition cycle corresponding to each first thread; Obtaining a preset number, where the preset number is the number of at least one target device for which the first thread can obtain device information; During an acquisition cycle corresponding to the first thread, device information of the target device is acquired through the first thread according to the preset number.
7. A device control device, characterized in that: The device comprises: A first acquisition module is configured to acquire a communication state of at least one first device, where the communication state of the first device is a ready state or a non-ready state, and the first device is a device to be controlled; a determining module, configured to determine at least one target device in the at least one first device, the target device being in the ready state; A second acquisition module, configured to acquire a first address of the at least one target device in the switching device; The control module is configured to obtain a control request for any target device and control the target device according to the first address and the control request.
8. A control device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: in, The computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.