Device connection method, device, electronic device, and storage medium
By determining the device type of the target device, selecting the appropriate switching device and port, and re-establishing the communication connection, the problem of speed reduction and bandwidth reduction when external devices connect to the server is solved, and communication stability and efficiency are improved.
Patent Information
- Application Number
- CN202510772642.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2045-06-11
AI Technical Summary
When an external device establishes a communication connection with the server's PCIE slot through the switch, the server cannot determine the switch and port connected to the external device, resulting in frequent speed reduction and bandwidth reduction problems.
By determining the device type of the target device, selecting the target switching device and port connected to it, re-establishing the communication connection, reducing the probability of speed reduction and bandwidth reduction problems.
It effectively reduces the speed reduction and bandwidth problem between external devices and servers, and improves the stability and efficiency of communication connections.
Smart Images

Figure CN120281807B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of server technology, and in particular to a device connection method, apparatus, electronic device, and storage medium. Background Art
[0002] Currently, external devices can establish a communication connection with the server through a slot on the server, thereby transmitting data between the server and the external device based on the communication connection. The external device can be directly connected to the port on the slot or connected to the port on the slot through a switch.
[0003] In some cases, external devices may experience speed and bandwidth reduction issues, meaning their data transmission rate and / or bandwidth may decrease significantly. Reestablishing the communication connection between the external device and the server can reduce the likelihood of these speed and bandwidth reduction issues.
[0004] However, in the case where an external device establishes a communication connection with the server through a switch and a slot on the server, the server cannot determine the switch connected to the external device and the port connected to the switch. Summary of the Invention
[0005] The present application provides a device connection method, apparatus, electronic device and storage medium for determining a target switching device connected to a device that establishes a communication connection with a server through a switching device and a slot on the server, and a target port connected to the target switching device.
[0006] This application provides a device connection method, which includes:
[0007] Determining a target device from at least one device, wherein the at least one device is a device that establishes a communication connection with the server through a switching device and a slot on the server; current data transmission information of the target device meets preset requirements; and the slot includes a plurality of ports;
[0008] Determine a target switching device connected to the target device according to the device type of the target device;
[0009] Determining a target port from among a plurality of ports according to a target switching device; wherein the communication connection is established based on the target switching device and the target port;
[0010] Re-establish the communication connection between the target device and the server based on the target switching device and target port.
[0011] The present application also provides a device connection device, the device connection device comprising:
[0012] A first determining module is configured to determine a target device from at least one device, wherein the at least one device is a device that establishes a communication connection with the server via a switching device and a slot on the server; current data transmission information of the target device meets a preset requirement; and the slot includes a plurality of ports;
[0013] A second determining module is used to determine a target switching device connected to the target device according to a device type of the target device;
[0014] A third determining module is configured to determine a target port from among the plurality of ports according to the target switching device; wherein the communication connection is established based on the target switching device and the target port;
[0015] The reconstruction module is used to re-establish the communication connection between the target device and the server according to the target switching device and the target port.
[0016] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned device connection methods when executing the computer program.
[0017] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned device connection methods are implemented.
[0018] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned device connection methods when executed by a processor.
[0019] The device connection method, apparatus, electronic device and storage medium provided in the embodiments of the present application determine a target device in at least one device that establishes a communication connection with a server through a switching device and a slot on the server. The target device has a speed reduction and bandwidth reduction problem. Since the speed reduction and bandwidth reduction problem is a probabilistic event, the probability of the target device having a speed reduction and bandwidth reduction problem can be reduced by re-establishing the communication connection between the target device and the server. Therefore, for the target device, the target switching device connected to the target device can be determined based on the device type of the target device, and then the target port connected to the target switching device can be determined based on the target switching device. In this way, the communication connection between the target device and the server can be re-established based on the target switching device and the target port, thereby reducing the probability of the target device having a speed reduction and bandwidth reduction problem. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0021] Figure 1 Schematic diagram of application scenarios provided by embodiments of the present application;
[0022] Figure 2 A schematic diagram of a device connection method according to an embodiment of the present invention;
[0023] Figure 3 A schematic diagram of a process for determining a target device provided in an embodiment of the present application;
[0024] Figure 4 A schematic diagram of a process for re-establishing a communication connection between a target device and a server provided in an embodiment of the present application;
[0025] Figure 5 A flowchart of another device connection method provided in an embodiment of the present application;
[0026] Figure 6 A schematic diagram of a process flow for processing a device set provided in an embodiment of the present application;
[0027] Figure 7 A schematic diagram of a process for adding a new device set provided in an embodiment of the present application;
[0028] Figure 8 A schematic diagram of the interaction between various components in a server provided in an embodiment of the present application;
[0029] Figure 9 A schematic diagram of the structure of a device connection device provided in an embodiment of the present application;
[0030] Figure 10 This is a schematic diagram of the structure of the electronic device provided in this application. DETAILED DESCRIPTION
[0031] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0032] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device 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 device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0033] First, let’s explain the terms involved in this application:
[0034] Peripheral Component Interconnect Express (PCIE) is a high-speed serial bus used to connect servers to external devices. Servers include PCIE slots, through which external devices can connect to the server. PCIE is an evolution of the Peripheral Component Interconnect (PCI) bus. The release of PCIE version 1.0 provided the initial PCIE specification and supported single-channel data transmission at a rate of 2.5 Gbps per channel. Furthermore, PCIE 1.0 used differential signaling to improve interference immunity during data transmission.
[0035] To meet ever-increasing computing demands and technological advancements, PCIE technology has evolved from PCIE 1.0 to PCIE 5.0. This advancement has not only improved data transmission bandwidth, speed, and performance, but also provided new functions and features. For example, these new functions and features may include Single Root I / O Virtualization (SR-IOV), Advanced Error Reporting (AER), and Non-Volatile Memory Express (NVMe).
[0036] With the development of PCIE technology, its application scenarios are becoming increasingly diverse. For some complex application scenarios, the connection method between external devices and servers is no longer limited to establishing a communication connection between the external device and the server through the PCIE slot on the server. External devices can also establish a communication connection between the external device and the server through a switch device and a PCIE slot on the server. For external devices that establish a communication connection with the server through a switch device and a PCIE slot on the server, the complexity of the communication link between the external device and the server increases the probability of speed and bandwidth reduction.
[0037] In related technologies, the probability of external devices experiencing speed and bandwidth reduction issues can be reduced by re-establishing the communication connection between the external device and the server. For devices that establish a communication connection with the server through a PCIE slot on the server, the server cannot determine the switch connected to the external device and the port connected to the switch, and thus cannot re-establish the communication connection between the external device and the server.
[0038] In light of this, the present application provides a device connection method for target devices experiencing speed and bandwidth reduction issues (the target device establishes a communication connection with a server via a switch device and a slot on the server). When a target device experiences speed and bandwidth reduction issues, the method can determine, based on the target device's device type, a target switch device connected to the target device and a target port on the server slot that establishes a communication connection with the target switch device. Then, based on the target switch and target port, the communication connection between the target device and the server is reestablished, reducing the probability of the target device experiencing speed and bandwidth reduction issues.
[0039] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0040] In conjunction with the specific application environment architecture or specific hardware architecture on which the execution of the device connection method depends, the specific application environment architecture or specific hardware architecture is described here. Figure 1 , Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 As shown, it includes: a server 11, a switching device 12 and a device 13, wherein there is a slot 14 on the server 11, the slot 14 can be, for example, a PCIE slot, the switching device 12 can be, for example, a switch, and the device 13 can include, for example, a network card, a graphics card and other devices.
[0041] In actual application, the device 13 can establish a communication connection with the server 11 through the switching device 12 and the slot 14. After the device 13 establishes the communication connection with the server 11, the device 13 and the server 11 can perform data transmission based on the communication connection.
[0042] It should be noted that Figure 1 This is just an example to illustrate an application scenario, and is not intended to limit the application scenario.
[0043] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0044] Figure 2 A flow chart of a device connection method provided in an embodiment of the present application is shown as follows: Figure 2 As shown, the embodiment of the present application provides a device connection method, which is described in detail as follows:
[0045] S201: Determine a target device in at least one 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; current data transmission information of the target device meets preset requirements; and the slot includes multiple ports.
[0046] The execution subject of the present application may be a server, or a device connection device provided in the server. The device connection device may be implemented through software, or through a combination of software and hardware.
[0047] In some embodiments, a server stores a slot for connecting an external device, the slot including multiple ports for connecting the external device and a switching device. For example, the slot may be a PCIE slot. For any external device, the external device may establish a communication connection with the server by: establishing a communication connection with the server via a slot on the server, or establishing a communication connection with the server via a switching device and a slot on the server. For example, the switching device may be a switch.
[0048] It should be noted that, with respect to the method in which an external device establishes a communication connection with a server through a switching device and a slot on the server, the external device can establish a communication connection with the switching device, and the switching device establishes a communication connection with the server through the slot on the server, thereby enabling the external device to establish a communication connection with the server through the switching device and the slot on the server.
[0049] The at least one device is a device that establishes a communication connection with the server through a switching device and a slot on the server. The at least one device may include, for example, a network card, a graphics card, an NVMe solid-state drive, etc. For example, assume that the switching devices that establish a communication connection with the server through a slot on the server include 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, device A and device B establish a communication connection with the server through switch 1 and a slot on the server; device C establishes a communication connection with the server through switch 2 and a slot on the server. Therefore, the at least one device includes device A, device B, and device C.
[0050] 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 and a data transmission bandwidth when the device is performing data transmission with the server at the current moment.
[0051] The target device is a device among the at least one device, and the current data transmission information of the target device meets preset requirements. For example, the current data transmission information of the target device includes the data transmission rate and data transmission bandwidth of the target device during data transmission between the target device and the server at the current moment. For example, the preset requirements may include that the data transmission rate of the target device is less than a target rate threshold, and / or that the data transmission bandwidth of the target device is less than or equal to a target bandwidth threshold. In other words, if the current data transmission information of the target device meets the preset requirements, it indicates that the target device is experiencing a speed reduction or bandwidth reduction issue.
[0052] S202: Determine a target switching device connected to the target device according to the device type of the target device.
[0053] The device type of the target device can be indicated by, for example, a type identifier of the target device. A switching device that establishes a communication connection with the target device can be determined based on the device type of the target device. The target device is a switching device that establishes a communication connection with the target device and that establishes a communication connection with the server via a slot on the server.
[0054] In some embodiments, there are multiple switching devices that establish a communication connection with the server through the slots on the server. According to the device type of the target device, the switching device that establishes a communication connection with the target device can be determined among the switching devices that establish a communication connection with the server through the slots on the server, and the switching device can be determined as the target switching device.
[0055] S203: Determine a target port from a plurality of ports according to the target switching device; wherein the communication connection is established based on the target switching device and the target port.
[0056] Since the slot on the server includes multiple ports, the target switching device can establish a communication connection with any port in the multiple ports, thereby establishing a communication connection with the server. Among the multiple ports, the port that establishes a communication connection with the target switching device is the target port.
[0057] S204: Re-establishing the communication connection between the target device and the server according to the target switching device and the target port.
[0058] In the method where the target device establishes a connection with the server via the target switching device and the slot on the server, the target device establishes a communication connection with the target switching device, and the target switching device establishes a communication connection with the target port, thereby establishing a communication connection between the target device and the server. Therefore, after determining the target switching device and the target port, the communication connection between the target device and the server can be re-established based on the target switching device and the target port.
[0059] exist Figure 2 In the illustrated embodiment, in at least one device that establishes a communication connection with the server through a switching device and a slot on the server, a target device is determined, and the current data transmission information of the target device meets the preset requirements. Then, based on the device type of the target device, a target switching device that establishes a communication connection with the target device and with the server is determined, and then a target port on the server slot that establishes a communication connection with the target switching device is determined. Finally, based on the target switching device and the target port, the communication connection between the target device and the server is re-established. In the above method, since the target device has a speed reduction and bandwidth reduction problem, and the occurrence of the speed reduction and bandwidth reduction problem is probabilistic. For the target device that has a speed reduction and bandwidth reduction problem, the target switching device of the target device is determined through the device information of the target device, and the target port is determined based on the target switching device. Finally, based on the target switching device and the target port, the communication connection between the target device and the server is re-established to reduce the probability of the target device having a speed reduction and bandwidth reduction problem.
[0060] exist Figure 2 Based on the embodiment shown below, combined with Figure 3 The 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.
[0061] Figure 3 This is a flow chart of determining a target device provided by an embodiment of the present application. Figure 3 As shown, the process may include the following steps:
[0062] S301: Determine at least one first device that meets a preset requirement among at least one device.
[0063] For each first device in at least one first device, the first device is a device in at least one device whose current data transmission information meets preset requirements, and the preset requirements include: the current data transmission rate of the device is less than or equal to the target rate threshold, and / or the current data transmission bandwidth of the device is less than or equal to the target bandwidth threshold.
[0064] Assume that at least one device includes device A, where device A's current data transmission rate is 100 bps, device A's current data transmission bandwidth is 8 bit / s, the target rate threshold is 500 bps, and the target bandwidth threshold is 10 bit / s. Because device A's current data transmission rate is less than the target rate threshold, and device A's current data transmission bandwidth is less than the target bandwidth threshold, it can be determined that device A meets the preset requirements, that is, device A can be determined as the first device.
[0065] It should be noted that the number of the at least one first device is less than or equal to the number of the at least one device.
[0066] In some embodiments, for each device in at least one device, the target rate threshold is the rate threshold corresponding to the device, and the target bandwidth threshold is the bandwidth threshold corresponding to the device. Specifically, the target rate threshold and the target bandwidth threshold may be determined as follows: obtaining the maximum data transmission rate of the device and the maximum data transmission rate of the port corresponding to the device; the port corresponding to the device is the port that establishes a communication connection between the device and the server; the smaller value of the maximum data transmission rate of the device and the maximum data transmission rate of the port corresponding to the device is determined as the target rate threshold; obtaining the maximum data transmission bandwidth of the device and the maximum data transmission bandwidth of the port corresponding to the device; the smaller value of the maximum data transmission bandwidth of the device and the maximum data transmission bandwidth of the port corresponding to the device is determined as the target bandwidth threshold.
[0067] The maximum data transmission rate of a device refers to the maximum data transmission rate supported by the device. Similarly, the maximum bandwidth of a device refers to the maximum data transmission bandwidth supported by the device.
[0068] The port corresponding to a device refers to the logical port corresponding to the device on the server's slot. It should be noted that the slot also includes multiple physical connection channels. For each device, the device can be connected through at least one of the multiple physical connection channels, thereby connecting to the port on the slot. It should be noted that the more physical connection channels the device corresponds to, the greater the maximum data transmission rate and 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; 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.
[0069] For example, assuming that the maximum data transmission rate of device A is 500bps and the maximum transmission rate of the port corresponding to device A is 400bps, the target rate threshold is determined to be 400bps; assuming that the maximum data transmission bandwidth of device A is 1MB / s and the maximum data transmission bandwidth of the port corresponding to device A is 2MB / s, the target bandwidth threshold is determined to be 1MB / s.
[0070] In some embodiments, the amount of data transmitted between a device and a server varies in different time periods. When the amount of data transmitted between a device and a server is small, the data transmission rate and bandwidth requirements for the device are lower; when the amount of data transmitted between a device and a server is large, the data transmission rate and bandwidth requirements for the device are higher.
[0071] Therefore, the target rate threshold and the target bandwidth threshold can be determined by the time period in which the current moment is located. The specific method can be as follows: in the first time period and the second time period, the time period in which the current moment is located is determined; for each device in at least one device, the data transmission demand of the device in the first time period is greater than the data transmission demand of the device in the second time period; when the time period in which the current moment is located is the first time period, the first rate threshold is determined as the target rate threshold, and the first bandwidth threshold is determined as the target bandwidth threshold; when the time period in which the current moment is located is the second time period, the second rate threshold is determined as the target rate threshold, and the second bandwidth threshold is determined as the target bandwidth threshold; wherein, the second rate threshold is smaller than the first rate threshold; and the second bandwidth threshold is smaller than the first bandwidth threshold.
[0072] The first time period is a period of time when a large amount of data is transmitted between the device and the server. For example, the first time period can be from 9:00 to 18:00 every day. The second time period is a period of time when a small amount of data is transmitted between the device and the server. For example, the second time period can be from 18:00 every day to 9:00 the next day. If the time period of the current moment is the first time period, the data transmission rate and data transmission bandwidth of the device are required to be higher. Therefore, the first rate threshold is determined as the target rate threshold, and the first bandwidth threshold is determined as the target bandwidth threshold. In this way, when 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, the device is determined to be the first device.
[0073] If the time period of the current moment is the second time period, the data transmission rate and data transmission bandwidth requirements for the device are lower. Therefore, the second rate threshold is determined as the target rate threshold, and the second bandwidth threshold is determined as the target bandwidth threshold. In this way, if 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, the device is determined as the first device.
[0074] S302: Determine a target device in at least one first device.
[0075] In some embodiments, the method for determining the target device in at least one first device can be as follows: obtain a device set, the device set including at least one device whose data transmission demand is greater than or equal to a preset demand value; determine the target device in at least one first device based on the device set.
[0076] A device's data transmission requirements refer to the device's requirements for data transmission rate and bandwidth during data transmission. In some embodiments, for devices with higher data transmission requirements, if speed and bandwidth reduction issues occur on the device, these issues need to be addressed. For devices with lower data transmission requirements, if speed and bandwidth reduction issues occur on the device, these issues do not need to be addressed.
[0077] In some embodiments, a device with a data transmission demand greater than or equal to a preset demand value is determined to be a device with a higher data transmission demand. The preset demand value includes a preset rate value and a preset bandwidth value. For any device, a device's data transmission demand greater than or equal to the preset demand value means that during data transmission, the device's data transmission rate needs to be greater than or equal to the device's corresponding preset rate value, and / or the device's data transmission bandwidth needs to be greater than or equal to the device's corresponding preset bandwidth value.
[0078] Specifically, based on the device set, the method of determining the target device in at least one first device can be as follows: for each first device in the at least one first device, determine whether the first device is included in the device set. If the first device is included in the device set, the first device is determined as the target device; if the first device is not included in the device set, the first device is not determined as the target device.
[0079] For example, assuming that the at least one first device includes device X, device Y, and device Z, and the device set includes device A, device B, device X, and device C, the first device X in the at least one first device is determined as the target device.
[0080] In some embodiments, the target device may be determined in the following manner: after determining at least one first device in at least one device, the at least one first device may be determined as the target device.
[0081] In some embodiments, indication information can be used to indicate how to handle devices experiencing speed reduction and bandwidth reduction issues. These handling methods include handling all devices experiencing speed reduction and bandwidth reduction issues, not handling all devices experiencing speed reduction and bandwidth reduction issues, and handling some devices experiencing speed reduction and bandwidth reduction issues. The indication information can be represented, for example, by 0, 1, or 2, where 0 indicates not handling all devices experiencing speed reduction and bandwidth reduction issues; 1 indicates handling all devices experiencing speed reduction and bandwidth reduction issues; and 2 indicates handling some devices experiencing speed reduction and bandwidth reduction issues.
[0082] When the processing method is to process all devices with speed reduction and bandwidth reduction problems, at least one first device is determined as the target device; when the processing method is to process some devices with speed reduction and bandwidth reduction problems, the target device is determined in at least one first device; when the processing method is not to process all devices with speed reduction and bandwidth reduction problems, the determination of the target device is stopped.
[0083] In some embodiments, the processing method for devices with speed reduction and bandwidth reduction problems can be modified by modifying the indication information. For example, assume that the processing method in the server is to not process all devices with speed reduction and bandwidth reduction problems. The client can send a modification request to the server, and the indication information included in the modification request is 2, indicating that some devices with speed reduction and bandwidth reduction problems will be processed. After receiving the modification request, the server changes the processing method from not processing all devices with speed reduction and bandwidth reduction problems to processing some devices with speed reduction and bandwidth reduction problems.
[0084] To modify the indication information, the staff can perform operations on the client, and then the client sends a modification request to the server. Exemplarily, the staff can perform the modification operation on the client as follows: the client includes an option to determine the indication information. Exemplarily, the options for the indication information can include 0, 1, and 2, where 0 means no processing is performed on all devices with speed reduction and bandwidth reduction issues; 1 means processing is performed on all devices with speed reduction and bandwidth reduction issues; and 2 means processing is performed on some devices with speed reduction and bandwidth reduction issues. The staff can modify the processing method through the options of the indication information. In addition, the staff can also use the System Configuration Editor (SCE) tool under the operating system (OS) to modify the indication information. Alternatively, the staff can modify the processing method through a remote management tool, such as the Redfish tool, which is a new generation of hardware management specifications defined by distributed management tasks.
[0085] In addition, an embodiment of the present application also provides a method for determining a target device in at least one first device based on the load of the server. The specific implementation method can be as follows: obtaining the load information of the server, where the load information is used to indicate the load of the server; and determining the target device in at least one first device based on the load of the server.
[0086] Server load information is used to measure the server's operating status and resource usage. For example, server load information may include the server's central processing unit (CPU) utilization. In some embodiments, server load reflects the server's busyness. A higher server load indicates a busier server, while a lower server load indicates a less busy server.
[0087] Therefore, a target device can be determined from at least one first device based on the server load. Specifically, if the server load is greater than or equal to a preset load threshold, a device in the at least one first device whose data transmission demand is greater than or equal to a preset demand value is determined as a target device; if the server load is less than the preset load threshold, the at least one first device is determined as a target device.
[0088] When the server load is greater than or equal to the preset load threshold, it means that the server is in a relatively busy state, so the device in at least one first device whose data transmission demand is greater than or equal to the preset demand can be determined as the target device; when the server load is less than the preset load threshold, it means that the server processing is in a relatively idle state, so each first device in at least one first device can be determined as the target device.
[0089] exist Figure 3 In the illustrated embodiment, at least one first device having a speed reduction and bandwidth reduction problem is determined in at least one device, and then a target device for which the speed reduction and bandwidth reduction problem needs to be resolved is determined in at least one first device. It should be noted that the target device can be determined in at least one first device in a variety of ways. According to the indication information, the first device with a higher data transmission demand in at least one first device can be determined as the target device; or at least one first device can be determined as the target device. In addition, according to the load of the server, when the server is busy, the first device with a higher data transmission demand in at least one first device can be determined as the target device; when the server is idle, the at least one first device can be determined as the target device, thereby increasing the flexibility of determining the target device in at least one first device.
[0090] In addition, the device connection method provided in an embodiment of the present application also includes: obtaining a first difference between a target rate threshold and the current data transmission rate of the first device; obtaining a second difference between a target bandwidth threshold and the current data transmission bandwidth of the first device; when the first difference is greater than or equal to a first preset value, and / or the second difference is greater than or equal to a second preset value, sending a prompt message, the prompt message being used to prompt that the first device is in an abnormal state.
[0091] If the first difference is greater than or equal to a first preset value, and / or the second difference is greater than or equal to a second preset value, it indicates that the target device has experienced a speed reduction and bandwidth reduction problem, and the data transmission rate of the target device is too low, and / or the data transmission bandwidth of the target device is too low. In this case, the server sends a prompt message to the client, prompting the first device to handle the abnormal state.
[0092] Based on the above embodiments, Figure 4 The process of re-establishing the communication connection between the target device and the server in the embodiment of the present application is further explained.
[0093] Figure 4 A schematic diagram of a process for re-establishing a communication connection between a target device and a server is provided in an embodiment of the present application. Figure 4 As shown, the process may include the following steps:
[0094] S401: Acquire a first mapping relationship between multiple device types and switching devices.
[0095] The multiple device types are device types of the multiple devices. Device types may include, for example, network cards, graphics cards, and other device types, and the device types may be represented by type identifiers. In some embodiments, different switching devices are connected to devices of different device types. The first mapping relationship is used to represent, for each device type in the multiple device types, the switching device connected to the device of that device type.
[0096] For example, assume that the device types include a network card and a graphics card, where 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 relationship includes multiple device types: network card and graphics card, and the switching devices include switch 1 and switch 2. The network card has a mapping relationship with switch 1, and the graphics card has a mapping relationship with switch 2.
[0097] S402: Determine a target switching device according to the first mapping relationship and the device type of the target device.
[0098] Based on the first mapping relationship and the device type of the target device, a method for determining the target switch can be as follows: based on the device type of the target device, a switching device associated with the target device is determined among the switching devices connected to the server; the switching devices associated with the target device include switching devices directly connected to the target device and / or switching devices indirectly connected to the target device; based on the device type of the target device and the first mapping relationship, the target switching device is determined among the switching devices associated with the target device.
[0099] In some embodiments, the connection between the target device and the switching device may include a direct connection and an indirect connection. A switching device directly connected to the target device refers to a switching device that establishes a physical connection with the target device; an indirect connection to the target device refers to a switching device that establishes a communication connection with the target device via another switching device. The server stores the switching devices associated with various devices, so the switching device associated with the target device can be determined based on the device type of the target device.
[0100] For example, assume that the target device establishes a communication connection with the server via switch 1, switch 2, and a slot on the server. Furthermore, the target device is connected to switch 1, switch 1 is connected to switch 2, and switch 2 is connected to the server via a slot on the server. In this case, the switching devices associated with the target device are determined to include switch 1 and switch 2, with switch 1 being the switching device directly connected to the target device and switch 2 being the switching device indirectly connected to the target device.
[0101] Since the number of switching devices associated with the target device is one or more, if the number of switching devices associated with the target device is one, the switching device can be determined as the target device. However, if the number of switching devices associated with the target device is multiple, it is necessary to determine the target switching device from the multiple switching devices associated with the target.
[0102] In some embodiments, a target switching device can be determined from switching devices associated with the target device based on the device type of the target device and a first mapping relationship. Specifically, based on the device type of the target device, a switching device with a mapping relationship to the target device can be determined in the first mapping relationship. Then, for each switching device associated with the target device, a determination is made as to whether the switching device is a switching device with a mapping relationship to the target device. If the switching device is a switching device with a mapping relationship to the target device, the switching device is determined to be the target switching device; if the switching device is not a switching device with a mapping relationship to the target device, the switching device is determined not to be the target switching device.
[0103] In some embodiments, the method for determining the target switching device can also be: based on the device type of the target device, determining the switching device associated with the target device among the switching devices connected to the server; the switching devices associated with the target device include switching devices directly connected to the target device, and / or switching devices indirectly connected to the target device; determining the switching device connected to the slot; and determining the target switching device among the switching devices associated with the target device based on the switching device connected to the slot.
[0104] In some embodiments, the connection between the switch device and the slot may include: the switch device is directly connected to the slot, or the switch device establishes a communication connection with the slot through another switch device. The switch device connected to the slot refers to the mode in which the switch device is directly connected to the slot.
[0105] The switching device associated with the target device can be determined from the switching devices connected to the server. Since there can be one or more switching devices associated with the target device, the switching device directly connected to the slot can be determined. Then, for each switching device associated with the target device, it is determined whether the switching device is directly connected to the slot. If the switching device is directly connected to the slot, the switching device is determined to be the target switching device; if the switching device is not directly connected to the slot, the switching device is determined not to be the target switching device.
[0106] S403: Acquire a second mapping relationship between device information and port codes of multiple switching devices.
[0107] Since the slot includes multiple ports, each of the multiple ports corresponds to a port code, which is used to identify 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, each switching device has a port corresponding to the connection of the switching device.
[0108] The server stores device information of multiple switching devices and a second mapping relationship between port codes. The device information of the multiple switching devices may include a device identifier (DID), a vendor identifier (VID), a subsystem identification code (SSID), and a subsystem vendor identification code (SVID) of each of the multiple switching devices. The device information of the switching device can identify the switching device. For any switching device, the port code that is mapped to the switching device refers to the port to which the switching device is connected among the multiple ports in the slot.
[0109] S404: Determine the port code of the target switching device according to the second mapping relationship and the device information of the target switching device.
[0110] For example, assume that the multiple switching devices included in the second mapping relationship include Switch 1 and Switch 2, where Switch 1 has a DID of 0X12, a VID of 123, an SSID of 319301, and an SVID of 294102; and Switch 2 has a DID of 0X28, a VID of 242, an SSID of 138041, and an SVID of 341280. The port code associated with Switch 1 is 0X01, and the port code associated with Switch 2 is 0X02. The DID of the target switching device is 0X12, a VID of 123, an SSID of 319301, and an SVID of 294102. Based on the second mapping relationship and the device information of the target switching device, the port code of the target switching device is determined to be 0X01.
[0111] S405: Determine the port indicated by the port code of the target switching device among the multiple ports as the target port.
[0112] For example, assuming that the multiple ports include port 1, port 2, and port 3, where the port code of port 1 is 0X01, the port code of port 2 is 0X02, and the port code of port 3 is 0X03, and the port code of the target device is 0X01, then the target port is determined to be port 1.
[0113] S406: Send instruction information to the target switching device, where the instruction information is used to instruct the target switching device to re-establish the first communication connection with the target device.
[0114] The first communication connection is a communication connection between the target switching device and the target device.
[0115] After receiving the instruction information sent by the server, the target switching device re-establishes the first communication connection with the target device. It should be noted that the target switching device re-establishes the first communication connection with the target device, which means that the target switching device re-establishes the first communication connection between the target switching device and the target device by resetting the link status, refreshing the protocol negotiation, resynchronizing the data stream, etc. without disconnecting the physical connection with the target device, that is, the target switching device re-establishes the first communication connection with the target device at the logical level. The method for the target switching device to re-establish the first communication connection with the target device can be, for example, a hot reset method. The physical connection between the target device and the target switching device refers to connecting the target device and the target switching device at the physical level through a connection link.
[0116] S407: Receive response information, where the response information is used to indicate that the target switching device has re-established the first communication connection with the target device.
[0117] After re-establishing the first communication connection with the target device, the target switching device sends a response message to the server.
[0118] S408: When the first communication connection has been re-established, re-establish the second communication connection between the server and the target switching device through the target port; the communication connection between the target device and the server includes the first communication connection and the second communication connection.
[0119] 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 has been re-established. At this time, the server can re-establish the second communication connection between the server and the target switching device through the target port. It should be noted that re-establishing the second communication connection between the server and the target switching device means that the server re-establishes the second communication connection between the server and the target switching device by resetting the link status, refreshing the protocol negotiation, resynchronizing the data stream, etc. without disconnecting the physical connection with the target switching device, that is, the server and the target switching device re-establish the second communication connection at the logical level. The method of re-establishing the second communication connection can be, for example, the hotreset method. The physical connection between the server and the target switching device refers to connecting the target switching device and the server at the physical level through a connection link.
[0120] After the second communication connection is re-established, 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 re-established, it means that the communication connection between the target device and the server has been completed.
[0121] exist Figure 4 In the embodiment shown, first, based on the device type of the target device, a target switching device is determined in a switching device connected to the server, wherein the target switching device refers to a device connected to the target device and establishing a communication connection with the server, and then based on the device information of the target switching device, a target port corresponding to the target switching device is determined among a plurality of ports on the slot of the server. Then, an instruction message is sent to the target switching device, instructing the target switching device to re-establish a first communication connection with the target device, and after the target switching device re-establishes the first communication connection, the server re-establishes a second communication connection between the target switching device and the server based on the target port. In the above manner, by determining the target switching device in the switching device connected to the server and determining the target port among a plurality of ports in the slot. Then, based on the target switching device and the target port, the first communication connection and the second communication connection are re-established, thereby achieving the re-establishment of the communication connection between the target device and the server, and reducing the probability of the occurrence of the speed reduction and bandwidth reduction problem of the target device.
[0122] In addition, the device connection method provided in the embodiment of the present application also includes obtaining the data transmission information of the target device after the i-th update after the communication connection between the target device and the server is re-established for the i-th time; when the data transmission information after the i-th update meets the preset requirements, the communication connection between the target device and the server is re-established for the i+1th time according to the target switching device and the target port; i is 1, 2, 3... in sequence.
[0123] For example, after reestablishing the communication connection between the target device and the server for the first time using 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 requirements. If it is determined that the data transmission information of the target device meets the preset requirements, it indicates that the target device still has the problem of reduced speed and bandwidth. Therefore, based on the target switching device and the target port, a second communication connection is established between the target device and the server.
[0124] After the server reestablishes the communication connection between the target device and the server for the second time, it obtains the target device's data transmission information and determines whether the target device's data transmission information meets the preset requirements. If the target device's data transmission information does not meet the preset requirements, it indicates that the target device is not experiencing a speed reduction or bandwidth reduction issue. Therefore, the server stops reestablishing the communication connection between the target device and the server.
[0125] In the above embodiment, the implementation process of the device connection method provided by the embodiment of the present application is introduced. In addition, since the server includes a basic input / output system (BIOS) and a baseboard management controller (BMC), the device connection method provided by the present application can be implemented based on the BIOS and BMC in the server. Figure 5 , the device connection method provided in this application is further introduced through specific embodiments.
[0126] Figure 5 A flow chart of another device connection method provided in an embodiment of the present application is shown as follows: Figure 5 As shown, the process may include the following steps:
[0127] S501: BIOS initialization.
[0128] The BIOS is the underlying firmware program that runs when the server hardware starts up. Therefore, when the server boots up, the BIOS enters the initialization phase. This initialization phase primarily involves detecting faults or anomalies in the server's core hardware. Therefore, during this initialization phase, it's necessary to check for anomalies in devices connected to the server, such as the network card and graphics card.
[0129] For at least one device such as a network card or a graphics card connected to a PCIE slot on a server through a switching device, it is also necessary to detect whether the data transmission rate and data transmission bandwidth of the at least one device are normal.
[0130] S502: The BIOS determines whether it is necessary to determine at least one first device that meets a preset requirement in at least one device according to the indication information.
[0131] If yes, execute S503.
[0132] The indication information is used to indicate a handling method for devices experiencing speed reduction and bandwidth reduction issues. The handling methods include handling all devices experiencing speed reduction and bandwidth reduction issues, not handling all devices experiencing speed reduction and bandwidth reduction issues, and handling some devices experiencing speed reduction and bandwidth reduction issues. If the handling method is not handling all devices experiencing speed reduction and bandwidth reduction issues, determining the at least one first device is stopped.
[0133] In the case where the processing method is to process all devices with the speed reduction and bandwidth reduction problem, or to process some devices with the speed reduction and bandwidth reduction problem, S503 is executed.
[0134] S503: The BIOS sets a first mapping relationship between multiple device types and switching devices.
[0135] The first mapping relationship between multiple device types and switching devices is preset. For any device type, the first mapping relationship includes switching devices that can be connected to devices of this device type, and a mapping relationship exists between devices of this device type and switching devices that can be connected to devices of this device type.
[0136] S504: The BIOS determines, for each device in the at least one device, a target rate threshold based on 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 based on the maximum data transmission bandwidth of the device and the maximum data transmission bandwidth of the port corresponding to the device.
[0137] The specific process of determining the target rate threshold and target bandwidth threshold can be found in Figure 3 S301 in the illustrated embodiment will not be described in detail here.
[0138] S505: The BIOS determines at least one first device from the at least one device according to the current data transmission rate of the device, the target rate threshold, the current data transmission bandwidth of the device, and the target bandwidth threshold.
[0139] The process of determining at least one first device in at least one device can refer to Figure 3 S301 in the illustrated embodiment will not be described in detail here.
[0140] S506: The BIOS determines, based on the instruction information, that a method of determining a target device in the at least one first device is to use a device in the at least one first device whose data transmission requirement is greater than or equal to a preset requirement value as a target device, or to determine the at least one first device as a target device.
[0141] In a case where the method of determining the target device is to use a device among the at least one first device whose data transmission demand is greater than or equal to the preset demand value as the target device, executing S507;
[0142] In case the method of determining the target device is to determine at least one first device as the target device, S509 is executed.
[0143] At this time, when the indication information is 1, the method for determining the target device in at least one first device is: the device in at least one first device whose data transmission demand is greater than or equal to the preset demand value is the target device; when the indication information is 2, the method for determining the target device in at least one first device is: at least one first device is determined as the target device.
[0144] Therefore, when the indication information is 1, S507 is executed; when the indication information is 2, S509 is executed.
[0145] S507: When the method of determining the target device is to use a device in the at least one first device whose data transmission requirement is greater than or equal to the preset requirement value as the target device, the BIOS obtains a device set.
[0146] The device set includes at least one device whose data transmission requirement is greater than or equal to a preset requirement. It should be noted that the device set is stored in the server's BMC. Therefore, the BIOS may obtain the device set by sending a first acquisition request to the BMC, where the first acquisition request is used to obtain the device set. After receiving the first acquisition request, the BIOS sends the device set to the BMC. The first acquisition request may, for example, be an Intelligent Platform Management Interface (IPMI) command.
[0147] S508: The BIOS determines a target device from the at least one first device according to the device set.
[0148] According to the device set, the method of determining the target device in at least one first device can refer to Figure 3 S302 in the illustrated embodiment will not be described in detail here.
[0149] S509: When the method of determining the target device is to determine at least one first device as the target device, the BIOS determines the at least one first device as the target device.
[0150] S510: The BIOS determines, according to the device type of the target device, a switching device associated with the target device from the switching devices connected to the server.
[0151] It should be noted that the BMC also stores the device type of at least one device. The BIOS can obtain the device type of the target device from the BMC. The BIOS can obtain the device type from the device set by sending a second acquisition request to the BMC, where the second acquisition request is used to obtain 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 BMC. The second acquisition request can be, for example, an IPMI command. After receiving the device type of the target device, the BIOS determines, based on the device type of the target device, a switching device associated with the target device from among the switching devices connected to the server.
[0152] For details on determining the switch device associated with the target device, see Figure 4 S402 in the illustrated embodiment will not be described in detail here.
[0153] S511: The BIOS determines a target switching device from switching devices associated with the target device according to the device type of the target device and the first mapping relationship.
[0154] According to the device type of the target device and the first mapping relationship, the target switching device is determined from the switching devices associated with the target device. For a detailed introduction, please refer to Figure 4 S402 in the illustrated embodiment will not be described in detail here.
[0155] S512: The BIOS determines a target port from among the multiple ports according to the target switching device.
[0156] For details on determining the target port among multiple ports based on the target switching device, see Figure 4 S403, S404 and S405 in the illustrated embodiment are not described in detail here.
[0157] S513: The BIOS re-establishes the communication connection between the target device and the server according to the target switching device and the target port.
[0158] For details on re-establishing the communication connection between the target device and the server based on the target switching device and the target port, see Figure 4 S406, S407 and S408 in the illustrated embodiment are not described in detail here.
[0159] exist Figure 5 In the illustrated embodiment, in at least one device that establishes a communication connection with the server through a switching device and a slot on the server, a target device is determined, and the current data transmission information of the target device meets the preset requirements. Then, based on the device type of the target device, a target switching device that establishes a communication connection with the target device and with the server is determined, and then a target port on the server slot that establishes a communication connection with the target switching device is determined. Finally, based on the target switching device and the target port, the communication connection between the target device and the server is re-established. In the above method, since the target device has a speed reduction and bandwidth reduction problem, and the occurrence of the speed reduction and bandwidth reduction problem is probabilistic. For the target device that has a speed reduction and bandwidth reduction problem, the target switching device of the target device is determined through the device information of the target device, and the target port is determined based on the target switching device. Finally, based on the target switching device and the target port, the communication connection between the target device and the server is re-established to reduce the probability of the target device having a speed reduction and bandwidth reduction problem.
[0160] In the above embodiment, the device connection method provided by the present application is introduced. In addition, the device connection method provided by the present application also includes processing of the device set. Figure 6, which introduces how to handle device collections.
[0161] Figure 6 A schematic diagram of a process flow for processing a device set provided in an embodiment of the present application is shown as follows: Figure 6 As shown, the process may include the following steps:
[0162] S601: Receive an update instruction, where the update instruction includes device information and processing method information of a second device, where the processing method information is used to indicate a processing method for a device set.
[0163] The update command is an IPMI command. After receiving the update command, the server determines how to handle the device collection based on the processing method information in the update command. Device collection processing methods include adding and deleting. Adding refers to adding the device information of a second device to the device collection; deleting refers to deleting the device information of a second device from the device collection.
[0164] In some embodiments, the update instruction further includes instruction identification information. The instruction identification information may be, for example, _SWEPID_, which is used to indicate that the instruction is an update instruction.
[0165] S602: Update the device set according to the processing method and the device information of the second device to obtain an updated device set.
[0166] For ease of understanding, the following Figure 7 Taking the processing method information in the update instruction as an example to indicate that the processing method for the device set is new processing, the method of updating the device set according to the processing method and the device information of the second device to obtain the updated device set is introduced. Figure 7 A schematic diagram of a process for adding a new device set is provided in an embodiment of the present application, such as Figure 7 As shown, the process may include the following steps:
[0167] S701: The BMC receives a command sent by the client.
[0168] Since 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.
[0169] S702: Determine whether the instruction is an update instruction according to the instruction identification information.
[0170] If yes, execute S703.
[0171] After receiving the instruction sent by the client, the server determines whether the instruction is an update instruction based on the instruction identification information. If the instruction is an update instruction, it starts processing the device set; if the instruction is not an update instruction, it does not process the device set.
[0172] S703: Parse the device information of the second device in the update instruction to obtain the parsed device information of the second device.
[0173] Parsing the device information of the second device means processing the device information of the second device 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. Therefore, the parsed device information of the second device is device information that the server can understand.
[0174] Taking the device information of the second device including the DID, VID, SSID, and SVID of the second device as an example, the method of parsing the device information of the second device can be, for example, combining the DID and VID of the second device, and combining the SSID and SVID of the second device.
[0175] S704: Create a new structure and set a variable in the structure, and assign the parsed device information of the second device to the variable.
[0176] After the parsed device information of the second device is assigned to the variable, the parsed device information of the second device can be obtained by obtaining the variable in the structure.
[0177] S705: Read the device set in the first storage area.
[0178] S706: Determine whether the device set includes the second device according to the parsed device information of the second device.
[0179] If not, execute S707;
[0180] If so, proceed to S709.
[0181] S707: Write the device information of the second device into the device set.
[0182] S708: Return a second response message to the client, where the second response message is used to indicate that a second device has been added to the device set.
[0183] S709: Return a first response message to the client, where the first response message is used to indicate that the second device already exists in the device set.
[0184] If the processing method information indicates that the device set is to be deleted, the BMC performs the deletion process similar to the addition process. The difference is that, if the parsed device information of the second device exists in the device set, the parsed device information of the second device is deleted from the device set to obtain an updated device set. The original device set is then erased from the first storage area, and the updated device set is written to the first storage area. Finally, a third response message is sent to the client, indicating that the second device has been deleted from the device set.
[0185] In a case where the parsed device information of the second device does not exist in the device set, a fourth response message is sent to the client, where the fourth response message is used to indicate that the second device does not exist in the device set.
[0186] In some embodiments, the BMC may further receive a query instruction including device information of a third device; and send a query response indicating whether the device set includes the third device.
[0187] After receiving the query instruction, the BMC parses the device information of the third device to obtain the parsed device information of the third device. A structure is created, a new structure is created, a variable is set in the structure, and the parsed device information of the third device is assigned to the variable. A device set is obtained from the first storage area, and based on the parsed device information of the third device, a determination is made as to whether the device set includes the third device. If the device set includes the parsed device information of the third device, a query response is sent to the client. In this case, the query response indicates that the device set includes the third device. If the device set does not include the parsed device information of the third device, a query response is sent to the client. In this case, the query response indicates that the device set does not include the third device.
[0188] It should be noted that both the update instruction and the query instruction can be IPMI commands. In some embodiments, the server includes a communication medium, IPMI, BMC, BIOS, and a Representational State Transfer Application Programming Interface (RESTful API). Figure 8 To understand, Figure 8 A schematic diagram of the interaction between various components in a server provided in an embodiment of the present application is shown as follows: Figure 8As shown, the server includes communication media, IPMI, BMC, BIOS, and RESTful API, and each component can communicate with each other. Among them, the communication medium is the carrier of data transmission, which is used for data transmission between IPMI management software and underlying devices. BMC is the core component of hardware management and can register IPMI commands according to the protocol specification. IPMI commands are used to instruct update processing or query processing of a device set, that is, IPMI commands can be update instructions or query instructions. On the other hand, BMC can also interact with BIOS through redfish. IPMI is the physical interface or logical interface between BMC and the outside world, which is used to transmit relevant IPMI commands. In addition, BMC can interact with BIOS through IPMI. RESTful API provides an application program interface with a REST architecture for the client to interact with the IPMI management system, facilitating the implementation of remote management and other functions.
[0189] exist Figure 6 In the illustrated embodiment, a client can send an update command or query command to the server. After receiving the update command, the server's BMC updates the device set to obtain an updated device set. After receiving the query command, the server's BMC queries the device set and returns a response to the client indicating the query result within the device set. This improves the flexibility of determining device sets.
[0190] Figure 9 This is a schematic diagram of the structure of a device connection device provided in an embodiment of the present application. Figure 9 As shown, an embodiment of the present application further provides a device connection apparatus 90, which includes a first determination module 91, a second determination module 92, a third determination module 93 and a reconstruction module 94, wherein:
[0191] A first determining module 91 is configured to determine a target device from at least one device, wherein the at least one device is a device that establishes a communication connection with the server via a switching device and a slot on the server; current data transmission information of the target device meets a preset requirement; and the slot includes a plurality of ports;
[0192] A second determining module 92 is configured to determine a target switching device connected to the target device according to the device type of the target device;
[0193] A third determining module 93 is configured to determine a target port from among a plurality of ports according to a target switching device; wherein the communication connection is established based on the target switching device and the target port;
[0194] The reconstruction module 94 is used to re-establish the communication connection between the target device and the server according to the target switching device and the target port.
[0195] For the description of the features in the embodiment corresponding to the device connection apparatus 90, reference can be made to the relevant description of the embodiment corresponding to the device connection method, which will not be repeated here.
[0196] Figure 10 This is a schematic diagram of the structure of the electronic device provided in this application. Figure 10 As shown, the electronic device 100 provided in this embodiment includes: at least one processor 101 and a memory 102. Optionally, the electronic device 100 further includes a communication component 103. The processor 101, the memory 102 and the communication component 103 are connected via a bus.
[0197] During the specific implementation process, at least one processor 101 executes the computer-executable instructions stored in the memory 102, so that the at least one processor 101 executes the above-mentioned device connection method embodiment.
[0198] The specific implementation process of the processor 101 can be found in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here in this embodiment.
[0199] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the application may be directly executed by a hardware processor or by a combination of hardware and software modules within the processor.
[0200] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage.
[0201] A bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be categorized as address buses, data buses, and control buses. For ease of illustration, the buses in the drawings of this application are not limited to just one bus or just one type of bus.
[0202] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above-mentioned device connection method embodiments when running.
[0203] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0204] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above-mentioned device connection method embodiments are implemented.
[0205] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned device connection method embodiments are implemented.
[0206] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0207] The above is a detailed introduction to a device connection method, apparatus, electronic device and storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A device connection method, characterized in that: The method comprises: Determining at least one first device that meets preset requirements from at least one device; wherein, for each device in the at least one device, the preset requirements include: a current data transmission rate of the device being less than or equal to a target rate threshold, and / or a current data transmission bandwidth of the device being less than or equal to a target bandwidth threshold; Determining a target device in the at least one first device, wherein the at least one device is a device that establishes a communication connection with the server through a switching device and a slot on the server; current data transmission information of the target device meets a preset requirement; and the slot includes a plurality of ports; Determining a target switching device connected to the target device according to the device type of the target device; According to the target switching device, determining a target port among the multiple ports; wherein the communication connection is established based on the target switching device and the target port; The communication connection between the target device and the server is re-established according to the target switching device and the target port.
2. The method according to claim 1, characterized in that The step of determining a target switching device connected to the target device according to the device type of the target device includes: Acquire a first mapping relationship between a plurality of device types and switching devices; The target switching device is determined according to the first mapping relationship and the device type of the target device.
3. The method according to claim 2, characterized in that The determining the target switching device according to the first mapping relationship and the device type of the target device includes: Determining, according to the device type of the target device, a switching device associated with the target device among the switching devices connected to the server; the switching device associated with the target device includes a switching device directly connected to the target device and / or a switching device indirectly connected to the target device; The target switching device is determined from the switching devices associated with the target device according to the device type of the target device and the first mapping relationship.
4. The method according to claim 1, wherein The step of determining a target switching device connected to the target device according to the device type of the target device includes: Determining, according to the device type of the target device, a switching device associated with the target device among the switching devices connected to the server; the switching device associated with the target device includes 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; The target switching device is determined from the switching devices associated with the target device according to the switching device connected to the slot.
5. The method according to any one of claims 1 to 4, characterized in that Determining a target port from among the multiple ports according to the target switching device includes: Acquire a second mapping relationship between device information and port codes of a plurality of switching devices; Determining a port code of the target switching device according to the second mapping relationship and the device information of the target switching device; The port indicated by the port code of the target switching device among the multiple ports is determined as the target port.
6. The method according to any one of claims 1 to 4, characterized in that The re-establishing the communication connection between the target device and the server according to the target switching device and the target port includes: Sending instruction information to the target switching device, wherein the instruction information is used to instruct the target switching device to re-establish the first communication connection with the target device; receiving response information, where the response information is used to indicate that the target switching device has re-established the first communication connection with the target device; When the first communication connection is re-established, a second communication connection is re-established between the server and the target switching device through the target port; the communication connection between the target device and the server includes the first communication connection and the second communication connection.
7. The method according to claim 1, characterized in that The determining the target device in the at least one first device includes: Acquire a device set, wherein the device set includes at least one device whose data transmission demand is greater than or equal to a preset demand value; The target device is determined from the at least one first device according to the device set.
8. The method according to claim 7, characterized in that The method further comprises: receiving an update instruction, wherein the update instruction includes device information and processing method information of the second device, wherein the processing method information is used to indicate a processing method for the device set; The device set is updated according to the processing manner and the device information of the second device to obtain an updated device set.
9. The method according to claim 7, characterized in that The method further comprises: receiving a query instruction, wherein the query instruction includes device information of a third device; A query response is sent, where the query response is used to indicate whether the device set includes the third device.
10. The method according to claim 1, characterized in that The determining the target device in the at least one first device includes: Obtaining load information of the server, where the load information is used to indicate the load of the server; The target device is determined in the at least one first device according to the load of the server.
11. The method according to claim 10, characterized in that The determining the target device in the at least one first device according to the load of the server includes: When the load of the server is greater than or equal to a preset load threshold, determining a device among the at least one first device whose data transmission demand is greater than or equal to a preset demand value as the target device; When the load of the server is less than a preset load threshold, the at least one first device is determined as the target device.
12. The method according to claim 1, characterized in that For each device in the at least one device, the method further includes: Obtaining a maximum data transmission rate of the device and a maximum data transmission rate of a port corresponding to the device; the port corresponding to the device is a port for establishing a communication connection between the device and the server; Determine the 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 the maximum data transmission bandwidth of the device and the maximum data transmission bandwidth of the port corresponding to the device; A smaller value between the maximum data transmission bandwidth of the device and the maximum data transmission bandwidth of the port corresponding to the device is determined as the target bandwidth threshold.
13. The method according to claim 1, wherein The method further comprises: Determining, in the first time period and the second time period, the time period in which the current moment is located; for each device in the at least one device, a data transmission demand of the device in the first time period is greater than a data transmission demand of the device in the second time period; When the time period of the current moment is the first time period, determining the first rate threshold as the target rate threshold, and determining the first bandwidth threshold as the target bandwidth threshold; When the time period of the current moment is the second time period, the second rate threshold is determined as the target rate threshold, and the second bandwidth threshold is determined as the target bandwidth threshold; wherein the second rate threshold is smaller than the first rate threshold; and the second bandwidth threshold is smaller than the first bandwidth threshold.
14. The method according to claim 1, wherein The method further comprises: Obtaining a first difference between the target rate threshold and a current data transmission rate of the first device; Obtaining a second difference between the target bandwidth threshold and the current data transmission bandwidth of the first device; When the first difference is greater than or equal to a first preset value, and / or the second difference is greater than or equal to a second preset value, a prompt message is sent, where the prompt message is used to prompt that the first device is in an abnormal state.
15. The method according to any one of claims 1 to 4, characterized in that The method further comprises: After re-establishing the communication connection between the target device and the server for the i-th time, obtaining data transmission information of the target device after the i-th update; When the data transmission information updated for the i-th time meets the preset requirement, the communication connection between the target device and the server is re-established for the i+1th time according to the target switching device and the target port; i is 1, 2, 3... in sequence.
16. A device connection device, characterized in that: The device comprises: a first determining module configured to determine, from at least one device, at least one first device that meets preset requirements; wherein, for each device in the at least one device, the preset requirements include: a current data transmission rate of the device being less than or equal to a target rate threshold, and / or a current data transmission bandwidth of the device being less than or equal to a target bandwidth threshold; Determining a target device in the at least one first device, wherein the at least one device is a device that establishes a communication connection with the server through a switching device and a slot on the server; current data transmission information of the target device meets a preset requirement; and the slot includes a plurality of ports; A second determining module is used to determine a target switching device connected to the target device according to the device type of the target device; a third determining module, configured to determine a target port among the plurality of ports according to the target switching device; wherein the communication connection is established based on the target switching device and the target port; A reconstruction module is used to re-establish the communication connection between the target device and the server according to the target switching device and the target port.
17. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the device connection method according to any one of claims 1 to 15 when executing the computer program.
18. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the device connection method according to any one of claims 1 to 15 are implemented.
19. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the device connection method according to any one of claims 1 to 15 are implemented.
Citation Information
Patent Citations
Method and device for selecting target storage server and electronic equipment
CN115834587A
Network congestion processing method, device, equipment, medium and product
CN119906675A