Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. Based on the embodiments of the present application, all other embodiments obtained by a person of ordinary skill in the art without making any inventive effort are within the scope of the present application.
It should be noted that in the description of the present application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. The terms "first," "second," and the like in this specification are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
First, the terms involved in the present application will be explained:
The peripheral component interconnect standard high-speed serial bus (PERIPHERAL COMPONENT INTERCONNECT EXPRESS, PCIE) is a high-speed serial bus used to connect servers to external devices. The server comprises PCIE slots, and the external equipment can be connected with the server through the PCIE slots on the server. PCIE was developed based on the peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus. The release of PCIE1.0 version provides an initial PCIE specification, PCIE1.0 supports single-channel data transmission, the data transmission rate of each channel is 2.5Gbps, and in addition, PCIE1.0 adopts a differential signal transmission mode in the data transmission process so as to improve the anti-interference capability in the data transmission process.
In order to meet the increasing computing demands and technical development, the PCIE technology is developed from PCIE1.0 version to PCIE5.0, and in the development process of the PCIE technology, not only bandwidth, rate and data transmission performance of data transmission are improved, but also new functions and characteristics are provided. By way of example, the new functions and features may include Single input output virtualization (Single Root I/O Virtualization, SR-IOV), advanced error reporting (Advanced Error Reporting, AER), non-volatile memory high speed interface (Non-Volatile Memory Express, NVMe), and the like.
Along with the development of PCIE technology, application scenarios of PCIE technology are becoming increasingly abundant. For some complex application scenarios, the connection mode of the external device and the server is not limited to the communication connection between the external device and the server through the PCIE slot on the server, and the connection mode of the external device and the server may be that the external device establishes the communication connection with the server through the switching device and the PCIE slot on the server. Aiming at an external device which establishes communication connection with a server through a PCIE slot on the switching device and the server, the probability of occurrence of the problem of speed reduction and bandwidth reduction of the external device is increased due to the fact that a communication link between the external device and the server is complex.
In the related art, the probability of occurrence of a reduced speed and reduced bandwidth problem of the external device can be reduced by reestablishing the communication connection between the external device and the server. For the device that establishes communication connection with the server through the PCIE slot on the server, the server cannot determine the switch connected with the external device and the port connected with the switch, and thus cannot reestablish communication connection between the external device and the server.
In view of this, the present application provides a device connection method for a target device (the target device establishes a communication connection with a server through a slot on a switching device and the server) having a problem of down-speed and down-bandwidth. Under the condition that the target equipment has the problem of speed reduction and bandwidth reduction, the target switching equipment connected with the target equipment and a target port on a slot of the server, which is in communication connection with the target switching equipment, can be determined according to the equipment type of the target equipment. And then reestablishing communication connection between the target equipment and the server according to the target switch and the target port, so that the probability of the problem of speed reduction and bandwidth reduction of the target equipment is reduced.
The present application will be further described in detail below with reference to the drawings and detailed description for the purpose of enabling those skilled in the art to better understand the aspects of the present application.
The specific application environment architecture or specific hardware architecture upon which the execution of the device connection method depends is described herein. Referring to fig. 1, fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application. As shown in fig. 1, the device comprises a server 11, a switching device 12 and a device 13, wherein a slot 14 exists on the server 11, the slot 14 may be, for example, a PCIE slot, the switching device 12 may be, for example, a switch, and the device 13 may include, for example, a network card, a graphics card, and other devices.
In the practical application process, the device 13 may establish a communication connection with the server 11 through the switching device 12 and the slot 14. After the device 13 establishes a communication connection with the server 11, the device 13 and the server 11 may perform data transmission based on the communication connection.
It should be noted that fig. 1 illustrates an application scenario by way of example only, and is not limited to the application scenario.
The following describes the technical scheme of the present application and how the technical scheme of the present application solves the above technical problems in detail with specific embodiments. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 2 is a schematic flow chart of a device connection method provided in an embodiment of the present application, and as shown in fig. 2, the embodiment of the present application provides a device connection method, and the method is described in detail as follows:
S201, determining target equipment in at least one equipment, wherein the at least one equipment is equipment which is in communication connection with a server through a switching equipment and a slot on the server, the current data transmission information of the target equipment meets the preset requirement, and the slot comprises a plurality of ports.
The execution body of the application can be a server, and can also be a device connecting device arranged in the server, wherein the device connecting device can be realized by software or realized by a combination of software and hardware.
In some embodiments, a slot for connecting an external device is stored on the server, and the slot includes a plurality of ports for connecting the external device and the switching device, and the like. The slot may be, for example, a PCIE slot. For any external device, the way of establishing communication connection between the external device and the server may include that the external device establishes communication connection with the server through a slot on the server, and that the external device establishes communication connection with the server through a switching device and a slot on the server, where the switching device may be a switch, for example.
It should be noted that, for the way that the external device establishes communication connection with the server through the switching device and the slot on the server, the external device may establish communication connection with the switching device, and the switching device establishes communication connection with the server through the slot on the server, so as to achieve that the external device establishes communication connection with the server through the switching device and the slot on the server.
The at least one device is a device for establishing communication connection with the server through the exchange device and a slot on the server, and the at least one device may include, for example, a network card, a graphics card, an NVMe solid state disk, and the like. Illustratively, it is assumed that a switching device that establishes a communication connection with a server through a slot on the server includes switch 1 and switch 2, wherein switch 1 establishes a communication connection with device a and device B, and switch 2 establishes a communication connection with device C. In summary, the device a and the device B establish a communication connection with the server through the switch 1 and the slot on the server, and the device C establishes a communication connection with the server through the switch 2 and the slot on the server, so that at least one device includes the device a, the device B and the device C.
For each device in the at least one device, the current data transmission information of the device may include, for example, a data transmission rate, a data transmission bandwidth, and the like when the device performs data transmission with the server at the current time.
The target device is a device in at least one device, and the current data transmission information of the target device meets the preset requirement. Taking the current data transmission information of the target device as an example, the data transmission rate and the data transmission bandwidth of the target device when the target device performs data transmission with the server at the current moment, the preset requirement can be that the data transmission rate of the target device is smaller than a target rate threshold value and/or the data transmission bandwidth of the target device is smaller than or equal to a target bandwidth threshold value. Under the condition that the current data transmission information of the target equipment meets the preset requirement, the problem of speed and bandwidth reduction of the target equipment is described.
S202, determining a target exchange device connected with the target device according to the device type of the target device.
The device type of the target device may be indicated, for example, by a type identification of the target device. The switching device that establishes a communication connection with the target device may be determined based on the device type of the target device. The target device refers to a switching device that establishes a communication connection with the target device and establishes a communication connection with the server through a slot on the server.
In some embodiments, the number of switching devices that establish a communication connection with the server through the slot on the server is plural, and the switching device that establishes a communication connection with the target device may be determined as the target switching device from among the switching devices that establish a communication connection with the server through the slot on the server according to the device type of the target device.
And S203, determining a target port in a plurality of ports according to the target switching equipment, wherein the communication connection is established based on the target switching equipment and the target port.
Because the slot on the server comprises a plurality of ports, the target switching device can establish communication connection with any port in the plurality of ports, thereby establishing communication connection with the server. Among the ports, the port establishing communication connection with the target switching device is the target port.
S204, reestablishing the communication connection between the target equipment and the server according to the target exchange equipment and the target port.
In the mode that the target equipment is connected with the server through the target switching equipment and the slot position on the server, the communication connection is established between the target equipment and the target switching equipment, and the communication connection is established between the target switching equipment and the target port, so that the communication connection between the target equipment and the server is established. Thus, after the target switching device and the target port are determined, the communication connection between the target device and the server may be reestablished according to the target switching device and the target port.
In the embodiment shown in fig. 2, the target device is determined in at least one device that establishes a communication connection with the server through the switching device and the slot on the server, where the current data transmission information of the target device meets the preset requirement. And then, according to the equipment type of the target equipment, determining the target switching equipment which establishes communication connection with the target equipment and establishes communication connection with the server, and further determining a target port which establishes communication connection with the target switching equipment on a slot of the server. Finally, reestablishing the communication connection between the target device and the server according to the target switching device and the target port. In the above method, since the target device has a problem of dropping down bandwidth, the occurrence of the problem of dropping down bandwidth is probabilistic. Aiming at target equipment with the problem of speed reduction and bandwidth reduction, determining target switching equipment of the target equipment according to equipment information of the target equipment, and determining a target port according to the target switching equipment. And finally, reestablishing communication connection between the target equipment and the server according to the target switching equipment and the target port, and reducing the probability of the problem of speed and bandwidth reduction of the target equipment.
Based on the embodiment shown in fig. 2, a process of determining a target device in at least one device in the device connection method provided in the embodiment of the present application is further described below with reference to fig. 3.
Fig. 3 is a schematic flow chart of determining a target device according to an embodiment of the present application. As shown in fig. 3, the process may include the following flow:
s301, at least one first device meeting preset requirements is determined in at least one device.
Aiming at each first device in at least one first device, wherein the first device is a device in which the current data transmission information of the device meets the preset requirements, and the preset requirements comprise that the current data transmission rate of the device is smaller than or equal to a target rate threshold value and/or the current data transmission bandwidth of the device is smaller than or equal to a target bandwidth threshold value.
Assume that at least one device includes a device a, where the current data transmission rate of the device a is 100bps, the current data transmission bandwidth of the device a is 8 bits/s, the target rate threshold is 500bps, and the target bandwidth threshold is 10 bits/s. Since the current data transmission rate of device a is less than the target rate threshold and the current data transmission bandwidth of device a is less than the target bandwidth threshold. Thus, it can be determined that the device a satisfies the preset requirement, that is, the device a can be determined as the first device.
The number of the at least one first device is smaller than or equal to the number of the at least one device.
In some embodiments, for each device in the at least one device, the target rate threshold is a rate threshold corresponding to the device, and the target bandwidth threshold is a bandwidth threshold corresponding to the device. Specifically, the mode of determining the target rate threshold and the target bandwidth threshold may be shown in the following steps of obtaining a maximum data transmission rate of the device and a maximum data transmission rate of a port corresponding to the device, wherein the port corresponding to the device is a port for establishing communication connection between the device and the server, determining a smaller value of the maximum data transmission rate of the device and the maximum data transmission rate of the port corresponding to the device as the target rate threshold, obtaining a maximum data transmission bandwidth of the device and a maximum data transmission bandwidth of the port corresponding to the device, and determining a smaller value of the maximum data transmission bandwidth of the device and the maximum data transmission bandwidth of the port corresponding to the device as the target bandwidth threshold.
The maximum data transmission rate of the device refers to the maximum data transmission rate supported by the device, and similarly, the maximum bandwidth transmission bandwidth of the device refers to the maximum data transmission bandwidth supported by the device.
The port corresponding to the device refers to a logical port corresponding to the device on a slot of the server. It should be noted that the slot further includes a plurality of physical connection channels. For each device, the device may be connected to a port on the socket by at least one of a plurality of physical connection channels. It should be noted that, the greater the number of physical connection channels corresponding to the device, the greater the maximum data transmission rate and the maximum data transmission bandwidth of the port corresponding to the device. Therefore, the maximum data transmission rate of the port corresponding to the device can be the maximum data transmission rate of the physical connection channel corresponding to the device, and the maximum data transmission bandwidth of the port corresponding to the device can be the maximum data transmission bandwidth of the physical connection channel corresponding to the device.
The method includes the steps of determining that a target rate threshold is 400bps if a maximum data transmission rate of a device A is 500bps and a maximum transmission rate of a port corresponding to the device A is 400bps, determining that a maximum data transmission bandwidth of the device A is 1MB/s and determining that a target bandwidth threshold is 1MB/s if a maximum data transmission bandwidth of a port corresponding to the device A is 2 MB/s.
In some embodiments, the amount of data transferred between the device and the server is different due to different time periods. And when the data volume of data transmission between the equipment and the server is larger, the data transmission rate and the data transmission bandwidth of the equipment are higher.
The target rate threshold and the target bandwidth threshold may be determined by determining a time period in which the current time is located, in a first time period and a second time period, specifically, determining a time period in which the current time is located, determining a first rate threshold as the target rate threshold and a first bandwidth threshold as the target bandwidth threshold when the time period in which the current time is located is the first time period, determining a second rate threshold as the target rate threshold and a second bandwidth threshold as the target bandwidth threshold when the time period in which the current time is located is the second time period, wherein the second rate threshold is smaller than the first rate threshold, and the second bandwidth threshold is smaller than the first bandwidth threshold for each of at least one device.
The first period is a period with larger data volume for data transmission between the device and the server, the first period can be, for example, 9:00-18:00 of each day, the second period is a period with smaller data volume for data transmission between the device and the server, and the second period can be, for example, 18:00 of each day to 9:00 of the second day. If the time period of the current moment is the first time period, the data transmission rate and the data transmission bandwidth of the device are required to be high, so that the first rate threshold is determined to be the target rate threshold, and the first bandwidth threshold is determined to be the target bandwidth threshold. Thus, the device is determined to be the first device in the event that the data transmission rate of the device is less than or equal to the first rate threshold and/or the data transmission bandwidth of the device is less than or equal to the first bandwidth threshold.
If the time period of the current moment is the second time period, the requirements on the data transmission rate and the data transmission bandwidth of the equipment are lower, so that the second rate threshold value is determined as a target rate threshold value, and the second bandwidth threshold value is determined as a target bandwidth threshold value. Thus, the device is determined to be the first device in the event that the data transmission rate of the device is less than or equal to the second rate threshold and/or the data transmission bandwidth of the device is less than or equal to the second bandwidth threshold.
And S302, determining a target device in at least one first device.
In some embodiments, the manner in which the target device is determined in the at least one first device may be as follows, where the device set is obtained, where the device set includes at least one device with a data transmission requirement greater than or equal to a preset requirement value, and the target device is determined in the at least one first device according to the device set.
The data transmission requirement of the device refers to the requirement of the device for data transmission rate and data transmission bandwidth during the data transmission process. In some embodiments, for a device with a higher data transmission requirement, after the device has a problem of speed-down bandwidth-reduction, the problem of speed-down bandwidth-reduction of the device needs to be solved, and for a device with a lower data transmission requirement, after the device has a problem of speed-down bandwidth-reduction, the problem of speed-down bandwidth-reduction of the device may not be solved.
In some embodiments, devices having data transmission requirements greater than or equal to a preset requirement value are determined to be devices having higher data transmission requirements. The data transmission requirement of the device is larger than or equal to the preset requirement value, which means that the data transmission rate of the device is required to be larger than or equal to the preset rate value corresponding to the device and/or the data transmission bandwidth of the device is required to be larger than or equal to the preset bandwidth value corresponding to the device in the data transmission process of the device.
Specifically, the mode of determining the target device in at least one first device according to the device set may be as follows, wherein for each first device in at least one first device, whether the first device is included in the device set is determined, if the first device is included in the device set, the first device is determined to be the target device, and if the first device is not included in the device set, the first device is not determined to be the target device.
Illustratively, it is assumed that at least one first device includes a device X, a device Y, and a device Z, and the device set includes a device a, a device B, a device X, and a device C. A first device X of the at least one first device is determined as the target device.
In some embodiments, the target device may be determined by determining at least one first device from the at least one device, and then determining the at least one first device as the target device.
In some embodiments, the manner in which devices that have a problem of reduced speed and reduced bandwidth are handled may be indicated by the indication information. The processing mode comprises the steps of processing all devices with the problem of speed reduction and bandwidth reduction, not processing all devices with the problem of speed reduction and bandwidth reduction, and processing part of devices with the problem of speed reduction and bandwidth reduction. The instruction information may be represented by, for example, 0,1, and 2, wherein 0 indicates that all devices having a problem of dropping speed and dropping bandwidth are not processed, 1 indicates that all devices having a problem of dropping speed and dropping bandwidth are processed, and 2 indicates that some devices having a problem of dropping speed and dropping bandwidth are processed.
The method comprises the steps of determining at least one first device as a target device when all devices with the problem of speed reduction and bandwidth reduction are processed, determining the target device in the at least one first device when some devices with the problem of speed reduction and bandwidth reduction are processed, and stopping determining the target device when all devices with the problem of speed reduction and bandwidth reduction are not processed.
In some embodiments, the manner in which devices that have a problem with reduced bandwidth may be handled may be modified by modifying the indication information. Illustratively, assume that the processing in the server is not done for all devices that have a problem of reduced speed and reduced bandwidth. The client may send a modification request to the server, where the indication information included in the modification request is 2, which indicates that a portion of devices with a problem of reducing the bandwidth in a reduced speed is processed. After receiving the modification request, the server modifies the processing mode from not processing all the devices with the problem of speed reduction and bandwidth reduction to processing the devices with the problem of speed reduction and bandwidth reduction.
For modification of the indication information, a worker may operate at the client, and the client then sends a modification request to the server. The way that the staff performs the modification operation on the client side can be shown as follows, wherein the client side comprises an option for determining the indication information, and the option for the indication information can comprise 0, 1 and 2, for example, wherein 0 indicates that all devices with the problem of reducing the speed and the bandwidth are not processed, 1 indicates that all devices with the problem of reducing the speed and the bandwidth are processed, and 2 indicates that all devices with the problem of reducing the speed and the bandwidth are processed. The worker can modify the processing mode through the option of indicating the information. In addition, the operator may also modify the indication information under an Operating System (OS) using a System configuration editor (System Configuration Editor, SCE) tool. Alternatively, the worker may modify the process by a remote management tool, such as Redfish tools, redfish tools, which is a new generation of hardware management specifications defined by distributed management tasks.
In addition, the embodiment of the application also provides a method for determining the target equipment in at least one first equipment according to the load of the server, wherein the specific implementation method can be as follows, load information of the server is obtained, and the load information is used for indicating the load of the server; the target device is determined in the at least one first device according to the load of the server.
The load information of the server is used for measuring the running state and the resource usage condition of the server, and the load information of the server can be, for example, the occupancy rate of a central processing unit (Central Processing Unit, CPU) of the server. In some embodiments, the load of the server reflects how busy the server is, the greater the load of the server, the more busy the server, and the less the load of the server, the more idle the server.
Thus, the target device may be determined in the at least one first device according to the load of the server. Specifically, when the load of the server is greater than or equal to a preset load threshold, determining a device with a data transmission requirement greater than or equal to a preset requirement value in at least one first device as a target device, and when the load of the server is less than the preset load threshold, determining the at least one first device as the target device.
When the load of the server is greater than or equal to a preset load threshold, the server is in a busy state, so that the device with the data transmission requirement greater than or equal to the preset requirement in the at least one first device can be determined as the target device, and when the load of the server is less than the preset load threshold, the server is in a idle state, so that each first device in the at least one first device can be determined as the target device.
In the embodiment shown in fig. 3, at least one first device having a reduced bandwidth problem is determined among at least one device, and then a target device that needs to solve the reduced bandwidth problem is determined among at least one first device. It should be noted that the target device may be determined in at least one first device in a plurality of manners, and the first device with a higher data transmission requirement in the at least one first device may be determined to be the target device according to the indication information, or the at least one first device may be determined to be the target device. In addition, according to the load condition of the server, the first equipment with higher data transmission requirements in at least one first equipment is determined to be the target equipment under the condition that the server is busy, and the first equipment is determined to be the target equipment under the condition that the server is idle, so that the flexibility of determining the target equipment in the first equipment is improved.
In addition, the device connection method further comprises the steps of obtaining a first difference value of a target rate threshold and a current data transmission rate of the first device, obtaining a second difference value of the target bandwidth threshold and the current data transmission bandwidth of the first device, and sending prompt information for prompting that the first device is in an abnormal state when the first difference value is greater than or equal to a first preset value and/or when the second difference value is greater than or equal to a second preset value.
And when the first difference value is greater than or equal to a first preset value and/or the second difference value is greater than or equal to a second preset value, the data transmission rate of the target device is too low and/or the data transmission bandwidth of the target device is too low after the problem of speed reduction and bandwidth reduction occurs. At this time, the server sends a prompt message to the client to prompt the first device to handle the abnormal state.
On the basis of the above embodiment, a process of reestablishing the communication connection between the target device and the server in the embodiment of the present application will be further described with reference to fig. 4.
Fig. 4 is a schematic flow chart of reestablishing a communication connection between a target device and a server according to an embodiment of the present application, and as shown in fig. 4, the process may include the following steps:
s401, acquiring a first mapping relation between a plurality of device types and switching devices.
The plurality of device types are device types of respective ones of the plurality of devices. The device type may include, for example, a device type of a network card, a graphics card, or the like, and the device type may be represented by a type identifier. In some embodiments, the first mapping relationship is used to represent, for each of the plurality of device types, a switching device connected to a device of that device type, unlike a switching device connected to a device of a different device type.
For example, assume that the device types include a network card and a graphics card, wherein the switching device connected to the network card is switch 1, and the switching device connected to the graphics card is switch 2. The first mapping relation comprises a plurality of equipment types including network cards and display cards, the switching equipment comprises a switch 1 and a switch 2, wherein the network cards and the switch 1 have mapping relation, and the display cards and the switch 2 have mapping relation.
S402, determining the target switching equipment according to the first mapping relation and the equipment type of the target equipment.
The manner of determining the target switch according to the first mapping relation and the device type of the target device may be as follows, wherein the switching device associated with the target device is determined in the switching devices connected with the server according to the device type of the target device, the switching device associated with the target device includes the switching device directly connected with the target device and/or the switching device indirectly connected with the target device, and the target switching device is determined in the switching device associated with the target device according to the device type of the target device and the first mapping relation.
In some embodiments, the connection between the target device and the switching device may include a direct connection and an indirect connection. The switching device directly connected with the target device is the switching device which establishes physical connection with the target device, and the switching device indirectly connected with the target device is the switching device which establishes communication connection with the target device through other switching devices. The server stores the switching devices which have association relation with each device, so that the switching device associated with the target device can be determined according to the device type of the target device.
Illustratively, assume that the target device establishes a communication connection with the server through a slot on the server, switch 1, switch 2, and that the target device is connected to switch 1, switch 1 is connected to switch 2, and switch 2 is connected to the server through a slot on the server. At this time, it is determined that the switching device associated with the target device includes switch 1 and switch 2, and switch 1 is the switching device directly connected to the target device and switch 2 is the switching device indirectly connected to the target device.
Since the number of switching devices associated with the target device is one or more, the switching device may be determined as the target device for the case where the number of switching devices associated with the target device is one. However, for the case where the number of switching devices associated with the target device is plural, it is necessary to determine the target switching device among the plural switching devices associated with the target.
In some embodiments, a target switching device may be determined from among switching devices associated with the target device according to a device type and a first mapping relationship of the target device. Specifically, the switching device having a mapping relationship with the target device can be determined in the first mapping relationship according to the device type of the target device, and then, for each switching device associated with the target device, it is determined whether the switching device is the switching device having the mapping relationship with the target device. And determining that the switching device is not the target switching device when the switching device is not the switching device with the mapping relation with the target device.
In some embodiments, the target switching device may be further determined by determining, among the switching devices connected to the server, a switching device associated with the target device according to a device type of the target device, the switching device associated with the target device including a switching device directly connected to the target device and/or a switching device indirectly connected to the target device, determining a switching device connected to the slot, and determining, among the switching devices associated with the target device, the target switching device according to the switching device connected to the slot.
In some embodiments, the connection between the switching device and the slot may include the switching device being directly connected to the slot, or the switching device establishing a communication connection with the slot through another switching device. The switching device connected to the slot refers to a manner in which the switching device is directly connected to the slot.
The switching device associated with the target device may be determined by among the switching devices connected to the server. Since the number of switching devices associated with the target device is one or more, it is possible to determine the switching devices directly connected to the slot. Then, for each of the switching devices associated with the target device, it is determined whether the switching device is a switching device directly connected to the slot. And determining that the switching device is not the target switching device in the case that the switching device is not the switching device on the slot which is directly connected.
S403, acquiring a second mapping relation between the device information of the plurality of switching devices and the port codes.
Since the slot includes a plurality of ports, for any one of the plurality of ports, the port corresponds to a port code that identifies the port. Since the communication connection between the target device and the server is established based on the target switching device and the target port, for any switching device, there is a port to which the switching device is correspondingly connected.
The server stores device information of the plurality of switching devices and a second mapping relation between port codes, wherein the device information of the plurality of switching devices may include respective device identifiers (DEVICE IDENTITY, DID), vendor Identifiers (VIDs), subsystem-identifier codes (SSID), subsystem-provider identifiers (Subsystem-Vendor Identification, SVIDs) of the plurality of switching devices, and the device information of the switching devices may identify the switching devices. For any switching device, the port code having a mapping relationship with the switching device refers to the port corresponding to the switching device from the ports in the slot.
S404, determining the port code of the target switching equipment according to the second mapping relation and the equipment information of the target switching equipment.
For example, the plurality of switching devices included in the second mapping relationship are assumed to include switch 1 and switch 2, where the DID of switch 1 is 0X12, the VID is 123, the SSID is 319301, and the SVID is 294102, and the DID of switch 2 is 0X28, the VID is 242, the SSID is 138041, and the SVID is 341280. The port code having a mapping relation with the switch 1 is 0X01, and the port code having a mapping relation with the switch 2 is 0X02. The destination switching device has a DID of 0X12, a VID of 123, an SSID of 319301, and a SVID of 294102. And determining that the port code of the target switching device is 0X01 according to the second mapping relation and the device information of the target switching device.
S405, determining a port indicated by port codes of target switching equipment in the plurality of ports as a target port.
For example, assuming that the plurality of ports includes port 1, port 2, and port 3, where the port code of port 1 is 0X01, the port code of port 2 is 0X02, the port code of port 3 is 0X03, and the port code of the target device is 0X01, the target port is determined to be port 1.
And S406, sending indication information to the target switching equipment, wherein the indication information is used for indicating the target switching equipment to reestablish the first communication connection with the target equipment.
The first communication connection is a communication connection between the target switching device and the target device.
And the target switching equipment reestablishes the first communication connection with the target equipment after receiving the indication information sent by the server. It should be noted that, the reestablishing of the first communication connection with the target device by the target switching device means that the target switching device reestablishes the first communication connection between the target switching device and the target device by means of resetting the link state, refreshing protocol negotiation, resynchronizing the data stream, and the like, that is, reestablishing the first communication connection between the target switching device and the target device on the logic level under the condition that the target switching device is not disconnected from the target device. The manner in which the target switching device reestablishes the first communication connection with the target device may be, for example, a warm reset (hotreset) manner. The physical connection of the target device with the target switching device means that the target device is connected with the target switching device at a physical level through a connection link.
And S407, receiving response information, wherein the response information is used for indicating that the target exchange equipment has reestablished the first communication connection with the target equipment.
And after reestablishing the first communication connection between the target switching equipment and the target equipment, sending response information to the server.
And S408, reestablishing a second communication connection between the server and the target switching equipment through the target port under the condition that the first communication connection is reestablished, wherein the communication connection between the target equipment and the server comprises the first communication connection and the second communication connection.
After receiving the response information sent by the target switching device, the server determines that the first communication connection between the target switching device and the target device is re-established. At this point, the server may reestablish a second communication connection between the server and the target switching device through the target port. It should be noted that reestablishing the second communication connection between the server and the target switching device means that the server reestablishes the second communication connection between the server and the target switching device by resetting the link state, refreshing protocol negotiation, and resynchronizing the data stream when the server is not disconnected from the target switching device, that is, the server reestablishes the second communication connection with the target switching device on a logic level. The manner of reestablishing the second communication connection may be, for example, hotreset. The physical connection of the server to the target switching device means that the target switching device is physically connected to the server by a connection link.
After the second communication connection is reestablished, since the communication connection between the target device and the server includes the first communication connection and the second communication connection, and both the first communication connection and the second communication connection have been reestablished, it is indicated that the communication connection between the target device and the server has been completed.
In the embodiment shown in fig. 4, first, a target switching device is determined in a switching device connected to a server according to a device type of the target switching device, where the target switching device is a device connected to the target device and establishes a communication connection with the server, and then, a plurality of ports on a slot of the server are determined according to device information of the target switching device, and a target port corresponding to the target switching device is determined. And then sending indication information to the target switching equipment, indicating the target switching equipment to reestablish the first communication connection with the target equipment, and reestablishing the second communication connection between the target switching equipment and the server according to the target port after the target switching equipment reestablishes the first communication connection. In this way, the destination switch device is determined in the switch device connected to the server, and the destination port is determined in the plurality of ports of the slot. And then, reestablishing the first communication connection and the second communication connection according to the target switching equipment and the target port, thereby realizing reestablishment of the communication connection between the target equipment and the server and reducing the occurrence probability of the speed and bandwidth reduction problem of the target equipment.
In addition, the device connection method provided by the embodiment of the application further comprises the steps of acquiring the data transmission information of the target device after the ith updating after the communication connection between the target device and the server is re-established for the ith time, and re-establishing the communication connection between the target device and the server for the (i+1) th time according to the target switching device and the target port under the condition that the data transmission information of the ith updating meets the preset requirement, wherein i is 1,2 and 3 in sequence.
By way of example, after reestablishing the communication connection between the target device and the server for the 1 st time by the method in the above embodiment, the server obtains the data transmission information of the target device at this time, and determines whether the data transmission information of the target device at this time meets the preset requirement. And if the data transmission information of the target equipment meets the preset requirement, the problem that the target equipment still has the speed and bandwidth reduction is solved, so that the communication connection between the target equipment and the server is established for the 2 nd time according to the target switching equipment and the target port.
After reestablishing the communication connection between the target equipment and the server for the 2 nd time, the server acquires the data transmission information of the target equipment at the moment and judges whether the data transmission information of the target equipment at the moment meets the preset requirement. And if the data transmission information of the target equipment does not meet the preset requirement, the problem that the target equipment does not have the speed and bandwidth reduction is solved, and therefore the communication connection between the target equipment and the server is stopped to be reestablished.
In the above embodiment, the implementation process of the device connection method provided by the embodiment of the present application is described. In addition, the server comprises a basic Input/Output System (BIOS) and a baseboard management controller (Baseboard Management Controller, BMC), and the device connection method provided by the application can be realized based on the BIOS and the BMC in the server. The device connection method provided by the application is further described below through a specific embodiment with reference to fig. 5.
Fig. 5 is a flow chart of another device connection method according to an embodiment of the present application, as shown in fig. 5, the process may include the following steps:
S501, BIOS initialization.
The underlying firmware program that runs when the server hardware is started at BIOS, therefore, at server start-up, BIOS will enter the initialization phase. The initialization phase of the BIOS mainly includes detecting whether there is a failure or abnormality in the core hardware of the server. Therefore, in the initialization stage of the BIOS, it is necessary to detect whether or not devices such as a network card and a graphics card connected to the server are abnormal.
For at least one device such as a network card and a display card connected with a PCIE slot on a server through a switching device, it is also required to detect whether a data transmission rate and a data transmission bandwidth of the at least one device are normal.
S502, the BIOS determines whether at least one first device meeting preset requirements in at least one device according to the indication information.
If yes, S503 is executed.
The indication information is used for indicating the processing mode of the equipment with the problem of speed reduction and bandwidth reduction. The processing mode comprises the steps of processing all devices with the problem of speed reduction and bandwidth reduction, not processing all devices with the problem of speed reduction and bandwidth reduction, and processing part of devices with the problem of speed reduction and bandwidth reduction. And stopping determining at least one first device under the condition that the processing mode is that all devices with the problem of speed reduction and bandwidth reduction are not processed.
In the case where the processing method is to process all the devices having the problem of the reduced speed and the reduced bandwidth and to process some of the devices having the problem of the reduced speed and the reduced bandwidth, S503 is executed.
The BIOS sets a first mapping relationship between the plurality of device types and the switching device S503.
The first mapping relation between the plurality of equipment types and the switching equipment is preset, and for any equipment type, the first mapping relation comprises the switching equipment which can be connected with the equipment of the equipment type, and the mapping relation exists between the equipment of the equipment type and the switching equipment which can be connected with the equipment of the equipment type.
S504, BIOS determines a target rate threshold according to the maximum data transmission rate of the device and the maximum data transmission rate of the port corresponding to the device, and determines a target bandwidth threshold according to the maximum data transmission bandwidth of the device and the maximum data transmission bandwidth of the port corresponding to the device.
The specific process of determining the target rate threshold and the target bandwidth threshold may refer to S301 in the embodiment shown in fig. 3, and will not be described herein.
The BIOS determines at least one first device from the at least one device based on the device 'S current data transfer rate, the target rate threshold, the device' S current data transfer bandwidth, and the target bandwidth threshold.
The process of determining at least one first device in at least one device may refer to S301 in the embodiment shown in fig. 3, and will not be described herein.
And S506, the BIOS determines that the mode of determining the target device in the at least one first device is to take the device with the data transmission requirement being greater than or equal to the preset requirement value in the at least one first device as the target device or the at least one first device as the target device according to the indication information.
Executing S507 under the condition that the mode of determining the target device is to take the device with the data transmission requirement being greater than or equal to the preset requirement value in at least one first device as the target device;
In the case where the manner of determining the target device is to determine at least one first device as the target device, S509 is performed.
At this time, when the indication information is 1, the mode of determining the target device in the at least one first device is to determine the device with the data transmission requirement being greater than or equal to the preset requirement value in the at least one first device as the target device, and when the indication information is 2, the mode of determining the target device in the at least one first device is to determine the at least one first device as the target device.
Therefore, when the instruction information is 1, S507 is executed, and when the instruction information is 2, S509 is executed.
S507, under the condition that the mode of determining the target device is that the device with the data transmission requirement being greater than or equal to the preset requirement value in at least one first device is taken as the target device, the BIOS acquires the device set.
The device set comprises at least one device with a data transmission requirement greater than or equal to a preset requirement. The device set is stored in the BMC of the server. Thus, the BIOS may acquire the device set by sending a first acquisition request to the BMC, where the first acquisition request is used to acquire the device set. After receiving the first acquisition request, the BIOS sends the device set to the BIOS. The first acquisition request may be, for example, an intelligent platform management interface (INTELLIGENT PLATFORM MANAGEMENT INTERFACE, IPMI) command.
The BIOS determines a target device from the set of devices in the at least one first device S508.
The manner of determining the target device in the at least one first device according to the device set may refer to S302 in the embodiment shown in fig. 3, and will not be described herein.
If the manner of determining the target device is that the at least one first device is determined as the target device, the BIOS determines the at least one first device as the target device (S509).
And S510, the BIOS determines the switching device associated with the target device in the switching devices connected with the server according to the device type of the target device.
It should be noted that, at least one device type of each device is also stored in the BMC. The BIOS may acquire the device type of the target device in the BMC, and the BIOS may acquire the device type of the target device in a manner that the BIOS sends a second acquisition request to the BMC, where the second acquisition request is used to acquire the device type of the target device. After receiving the second acquisition request, the BIOS sends the device type of the target device to the BIOS. The second fetch request may be, for example, an IPMI command. After receiving the device type of the target device, the BIOS determines the switching device associated with the target device from among the switching devices connected with the server according to the device type of the target device.
The specific description of determining the switching device associated with the target device may refer to S402 in the embodiment shown in fig. 4, which is not described herein.
S511, the BIOS determines the target switching device from the switching devices associated with the target device according to the device type and the first mapping relation of the target device.
According to the device type and the first mapping relationship of the target device, a specific description of determining the target switching device in the switching device associated with the target device may refer to S402 in the embodiment shown in fig. 4, which is not described herein.
S512, the BIOS determines a target port from the plurality of ports according to the target switching device.
According to the destination switch device, specific description of determining the destination port among the multiple ports may refer to S403, S404, and S405 in the embodiment shown in fig. 4, which are not described herein.
And S513, the BIOS reestablishes the communication connection between the target device and the server according to the target switching device and the target port.
The specific description of reestablishing the communication connection between the target device and the server according to the target switch device and the target port can be referred to in S406, S407, and S408 in the embodiment shown in fig. 4, which are not described herein.
In the embodiment shown in fig. 5, the target device is determined in at least one device that establishes a communication connection with the server through the switching device and the slot on the server, where the current data transmission information of the target device meets the preset requirement. And then, according to the equipment type of the target equipment, determining the target switching equipment which establishes communication connection with the target equipment and establishes communication connection with the server, and further determining a target port which establishes communication connection with the target switching equipment on a slot of the server. Finally, reestablishing the communication connection between the target device and the server according to the target switching device and the target port. In the above method, since the target device has a problem of dropping down bandwidth, the occurrence of the problem of dropping down bandwidth is probabilistic. Aiming at target equipment with the problem of speed reduction and bandwidth reduction, determining target switching equipment of the target equipment according to equipment information of the target equipment, and determining a target port according to the target switching equipment. And finally, reestablishing communication connection between the target equipment and the server according to the target switching equipment and the target port, and reducing the probability of the problem of speed and bandwidth reduction of the target equipment.
In the above embodiments, the device connection method provided by the present application is described. In addition, the device connection method provided by the application further comprises the processing of the device set, and the processing mode of the device set is described below with reference to fig. 6.
Fig. 6 is a schematic diagram of a process flow for a device set according to an embodiment of the present application, and as shown in fig. 6, the process may include the following steps:
s601, receiving an update instruction, wherein the update instruction comprises equipment information and processing mode information of the second equipment, and the processing mode information is used for indicating a processing mode of the equipment set.
The update instruction is an IPMI command, and after receiving the update instruction, the server further has processing mode information in the update instruction, and determines a processing mode of the device set. The processing method for the device set comprises the processes of adding and deleting. The new adding process refers to adding the device information of the second device in the device set, and the deleting process refers to deleting the device information of the second device in the device set.
In some embodiments, the update instruction further includes instruction identification information, for example, the instruction identification information may be _ SWEPID _, which is used to indicate that the instruction is an update instruction.
S602, updating the device set according to the processing mode and the device information of the second device to obtain an updated device set.
For easy understanding, in the following, taking the processing mode information in the update instruction for indicating that the processing mode of the device set is new processing as an example, a mode of updating the device set according to the processing mode and the device information of the second device to obtain an updated device set is described in connection with fig. 7. Fig. 7 is a schematic flow chart of a new process for processing a device set according to an embodiment of the present application, as shown in fig. 7, the process may include the following steps:
S701, the BMC receives an instruction sent by the client.
Because the device set is stored in the BMC in the server, the BMC updates the device set after receiving the update instruction sent by the client.
S702, judging whether the instruction is an updating instruction according to the instruction identification information.
If yes, S703 is executed.
After receiving the instruction sent by the client, the server judges whether the instruction is an update instruction according to the instruction identification information. When the instruction is an update instruction, starting to process the device set; in the case where the instruction is not an update instruction, the device set is not processed.
S703, analyzing the equipment information of the second equipment in the updating instruction to obtain the analyzed equipment information of the second equipment.
The parsing processing of the device information of the second device means that the device information of the second device is processed according to a preset parsing rule, so that the format of the device information of the second device is consistent with the format of the device information of each device in the device set. Through the analysis, the device information of the second device is the device information which can be understood by the server.
For example, the device information of the second device includes DID, VID, SSID and the SVID of the second device, and the method of analyzing the device information of the second device may be, for example, combining the DID and VID of the second device and combining the SSID and SVID of the second device.
And S704, creating a structural body, setting variables in the structural body, and assigning the analyzed device information of the second device to the variables.
After the resolved device information of the second device is assigned to the variable, the resolved device information of the second device can be obtained by obtaining the variable in the structural body.
S705, reading the device set in the first storage area.
S706, determining whether the second device is included in the device set according to the parsed device information of the second device.
If not, then S707 is performed;
If yes, S709.
And S707, writing the device information of the second device into the device set.
And S708, returning a second response message to the client, wherein the second response message is used for indicating that a second device is newly added in the device set.
And S709, returning a first response message to the client, wherein the first response message is used for indicating that the second device exists in the device set.
When the processing mode information indicates that the processing mode of the device set is deletion processing, the process of deleting the device set by the BMC is similar to the process of adding the device set. The difference is that when the resolved device information of the second device exists in the device set, the resolved device information of the second device in the device set is deleted, and the updated device set is obtained. And then erasing the original device set in the first storage area, and writing the updated device set into the first storage area. And finally, sending a third response message to the client, wherein the third response message is used for indicating that the second device in the device set is deleted.
And under the condition that the resolved device information of the second device does not exist in the device set, sending a fourth response message to the client, wherein the fourth response message is used for indicating that the second device does not exist in the device set.
In some embodiments, the BMC may further receive a query instruction, where the query instruction includes device information of the third device, and send a query response, where the query response is used to indicate whether the third device is included in the device set.
After receiving the query instruction, the BMC analyzes the device information of the third device to obtain the analyzed device information of the third device. Creating a structural body, setting variables in the structural body, and assigning the analyzed device information of the third device to the variables. And acquiring a device set in the first storage area, and determining whether the device set comprises the third device according to the parsed device information of the third device. And if the equipment information of the third equipment after analysis is not included in the equipment set, sending a query response to the client, wherein the query response is used for indicating that the equipment set does not include the third equipment.
It should be noted that, both the update instruction and the query instruction may be IPMI commands. In some embodiments, a communication medium, IPMI, BMC, BIOS, and a Representational state transfer application programming interface (RESTful API) are included in the server. As can be understood with reference to fig. 8, fig. 8 is an interaction schematic diagram of each component in a server according to an embodiment of the present application, where, as shown in fig. 8, the server includes a communication medium, IPMI, BMC, BIOS, and RESTful API, and each component may communicate with each other. The communication medium is a carrier for data transmission, and is used for data transmission between the IPMI management software and the bottom layer equipment. The BMC is a hardware management core component, and may register an IPMI command according to a protocol specification, where the IPMI command is used to instruct update processing or query processing on a device set, i.e., the IPMI command may be an update instruction or a query instruction. On the other hand, the BMC may also interact with the BIOS through redfish. IPMI is a physical or logical interface of the BMC with external connections for transmitting related IPMI commands. Outside of this, the BMC may interact with the BIOS through IPMI. The RESTful API provides an application program interface of a REST architecture, and is used for the interaction between the client and the IPMI management system, thereby being convenient for realizing functions such as remote management and the like.
In the embodiment shown in fig. 6, an update instruction or a query instruction may be sent to a server through a client, after receiving the update instruction, the BMC of the server performs update processing on the device set to obtain an updated device set, after receiving the query instruction, the BMC of the server performs query processing on the device set, and returns response information to the client, where the response information is used to indicate a query result in the device set. In this way, the flexibility of determining the set of devices is increased.
Fig. 9 is a schematic structural diagram of a device connection apparatus according to an embodiment of the present application. As shown in fig. 9, an embodiment of the present application further provides a device connection apparatus 90, which includes a first determining module 91, a second determining module 92, a third determining module 93, and a reconstructing module 94, wherein:
The first determining module 91 is configured to determine, in at least one device, a target device, where the at least one device is a device that establishes a communication connection with a server through a switching device and a slot on the server, where current data transmission information of the target device meets a preset requirement;
A second determining module 92, configured to determine, according to a device type of a target device, a target switching device connected to the target device;
A third determining module 93, configured to determine a target port from a plurality of ports according to the target switching device, where the communication connection is established based on the target switching device and the target port;
A reestablishing module 94, configured to reestablish a communication connection between the target device and the server according to the target switching device and the target port.
The description of the features of the embodiment corresponding to the device connection apparatus 90 may refer to the related description of the embodiment corresponding to the device connection method, which is not described in detail herein.
Fig. 10 is a schematic structural diagram of an electronic device provided by the present application. As shown in fig. 10, the electronic device 100 provided in this embodiment includes at least one processor 101 and a memory 102. Optionally, the electronic device 100 further comprises a communication component 103. The processor 101, the memory 102, and the communication unit 103 are connected via a bus.
In a specific implementation, at least one processor 101 executes computer-executable instructions stored in memory 102, such that at least one processor 101 executes the device connection method embodiments described above.
The specific implementation process of the processor 101 may refer to the above-mentioned method embodiment, and its implementation principle and technical effects are similar, and this embodiment will not be described herein again.
In the above embodiment, it should be understood that the Processor may be a central processing unit (Central Processing Unit, abbreviated as CPU), other general purpose Processor, digital signal Processor (DIGITAL SIGNAL Processor, abbreviated as DSP), application SPECIFIC INTEGRATED Circuit (ASIC), and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present application may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in a processor for execution.
The Memory may include high-speed Memory (Random Access Memory, RAM) or may further include Non-volatile Memory (NVM), such as at least one disk Memory.
The bus may be an industry standard architecture (Industry Standard Architecture, ISA) bus, an external device interconnect (PERIPHERAL COMPONENT, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, the buses in the drawings of the present application are not limited to only one bus or to one type of bus.
Embodiments of the present application also provide a computer readable storage medium having a computer program stored therein, wherein the computer program is configured to perform the steps of any of the device connection method embodiments described above when run.
In an exemplary embodiment, the computer readable storage medium may include, but is not limited to, a U disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, etc. various media in which a computer program may be stored.
Embodiments of the present application also provide a computer program product comprising a computer program which, when executed by a processor, implements the steps of any of the device connection method embodiments described above.
Embodiments of the present application also provide another computer program product comprising a non-volatile computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of any of the device connection method embodiments described above.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The device connection method, the device, the electronic device and the storage medium provided by the application are described in detail. The principles and embodiments of the present application have been described herein with reference to specific examples, the description of which is intended only to facilitate an understanding of the method of the present application and its core ideas. It should be noted that it will be apparent to those skilled in the art that various modifications and adaptations of the application can be made without departing from the principles of the application and these modifications and adaptations are intended to be within the scope of the application as defined in the following claims.