Bandwidth setting method and device, computer equipment and storage medium
By obtaining and analyzing the bandwidth correlation information and working status information of PCIE devices, and dynamically adjusting the bandwidth parameter value in combination with the device priority, the resource waste and insufficient caused by traditional static bandwidth allocation methods are solved, and the system performance is improved.
Patent Information
- Application Number
- CN202412000272.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-11
AI Technical Summary
Traditional static bandwidth allocation methods cannot match appropriate bandwidth resources to PCIE devices according to different working scenarios, resulting in wasted bandwidth resources or insufficient bandwidth of certain key devices, affecting system performance.
By obtaining the bandwidth correlation information of each device on the host and the current working status information, as well as the priority of the configuration bandwidth of each device, the target bandwidth value of each device is determined, and recorded in the register, so that the switch can set the bandwidth of the device according to these parameter values.
It realizes dynamic adjustment of bandwidth resources according to different work scenarios and equipment priorities, avoids the problems of wasted bandwidth resources and insufficient bandwidth of key equipment, and improves bandwidth resource utilization.
Smart Images

Figure CN119814682A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a bandwidth setting method, device, computer equipment and storage medium. Background Art
[0002] With the rapid development of artificial intelligence and big data analysis, the demand for high-performance computing and graphics processing is also increasing. Traditional computer systems often cannot meet these needs, so high-performance computing servers based on graphics processing units (GPUs) have emerged. High-performance servers usually need to integrate multiple peripheral component interconnect express (PCIE) devices, such as high-performance graphics cards, high-speed solid-state drives, professional network cards, and field-programmable gate array (FPGA) acceleration cards to achieve different functions. Different PCIE devices require different working bandwidths.
[0003] In the related art, a switch (PCIe Switch) is an important PCIE expansion device that can allocate bandwidth for each PCIE device. PCIe Switch will allocate default bandwidth to each PCIE device according to the current server model, that is, a certain amount of bandwidth resources will be fixedly allocated to each PCIE device when the system starts. However, the bandwidth requirements of PCIE devices may vary greatly in different working scenarios. The traditional static bandwidth allocation method cannot match the appropriate bandwidth resources for the device based on different working scenarios, resulting in a waste of bandwidth resources or insufficient bandwidth for some key devices, affecting the overall performance of the system. Summary of the invention
[0004] In view of this, the present invention provides a bandwidth setting method to solve the problem that it is impossible to match appropriate bandwidth resources for devices based on different working scenarios, resulting in bandwidth resource waste or insufficient bandwidth for certain key devices.
[0005] In a first aspect, the present invention provides a bandwidth setting method, the method comprising: obtaining bandwidth association information and current working status information of each device in at least one device associated with a host; obtaining the priority of configuring bandwidth for each device in at least one device; determining each target bandwidth parameter value corresponding to each device based on the priority, bandwidth association information and current working status information; recording each target bandwidth parameter value in a register corresponding to each device, so that a switch reads from the register and sets at least one bandwidth of at least one device based on each target bandwidth parameter value.
[0006] The method provided in this aspect can obtain bandwidth association information and current working status information of each device in at least one device associated with the host, as well as the priority of each device to configure the bandwidth; based on the priority, bandwidth association information and current working status information, determine each target bandwidth parameter value corresponding to each device to set at least one bandwidth of at least one device.
[0007] Since the target bandwidth parameter value is determined based on the bandwidth association information, current working status information and priority of each device, and the determined target bandwidth parameter value can be recorded in the corresponding register, the switch can set the bandwidth of each device based on the target bandwidth parameter value in the register. Compared with the method in the related art where the switch directly sets the default bandwidth for each device, the present invention can match the appropriate bandwidth parameter value for each device based on different working scenarios and the bandwidth association information of each device, thereby avoiding the waste of bandwidth resources or the problem of insufficient bandwidth of certain key devices, and improving the utilization rate of bandwidth resources.
[0008] In an optional implementation, the bandwidth association information includes a manufacturer identification code and a device identification code, and obtaining the priority of configuring the bandwidth for each device in at least one device includes: obtaining a service weight value corresponding to each device, the service weight value is used to indicate the criticality of each device to the service; determining the device type of each device based on the manufacturer identification code and the device identification code; determining the priority corresponding to each device based on the device type and the service weight value.
[0009] Based on the above method, the priority of each device can be determined based on the criticality of each device to the business and the device type, so as to facilitate the subsequent allocation of bandwidth resources based on priority and ensure that the devices corresponding to the key business can obtain sufficient bandwidth resources.
[0010] In an optional implementation, the bandwidth association information includes a maximum bandwidth parameter value supported by each device, and the current working status information includes a current working mode and current operation information of each device; based on the priority, the bandwidth association information and the current working status information, each target bandwidth parameter value corresponding to each device is determined, including: determining a first bandwidth parameter value corresponding to each device according to the current working mode, the first bandwidth parameter value being a minimum bandwidth parameter value required for the current working mode; determining a second bandwidth parameter value corresponding to each device according to the current working status information; determining each bandwidth parameter value corresponding to each device based on the first bandwidth parameter value, the second bandwidth parameter value and the maximum bandwidth parameter value; adjusting each bandwidth parameter value based on the priority, and determining each target bandwidth parameter value corresponding to each device.
[0011] Based on the above method, by determining the first bandwidth parameter value, that is, the minimum bandwidth required for the current working mode, it can be ensured that each device can obtain sufficient bandwidth to maintain basic operations under any circumstances. The second bandwidth parameter value determined based on the current working status information, that is, the bandwidth parameter value consistent with the current actual working status can be determined in combination with the current actual working status of each device; and the maximum bandwidth parameter value can limit the maximum bandwidth resources that can be allocated to each device, avoiding the situation where too many resources are allocated to each device that the device does not support. Adjust each bandwidth parameter value based on priority to avoid allocating too much bandwidth to low-priority or inactive devices, thereby improving overall bandwidth utilization and ensuring that high-priority devices always have sufficient bandwidth to ensure the stability and high performance of key services.
[0012] In an optional implementation, the current operation information includes the bandwidth utilization rate and bandwidth power consumption value of each device; based on the current working status information, the second bandwidth parameter value corresponding to each device is determined, including: obtaining the available bandwidth resources of the host at the current moment; determining the second bandwidth parameter value corresponding to each device according to the available bandwidth resources and the bandwidth utilization rate, or determining the second bandwidth parameter value corresponding to each device according to the available bandwidth resources and the bandwidth power consumption value.
[0013] Based on the above method, the real-time demand of each device is determined according to the bandwidth usage rate or bandwidth power consumption value of each device, and real-time adjustment is made according to the available bandwidth resources of the host at the current moment to ensure that the second bandwidth parameter value corresponding to each device matches the actual demand.
[0014] In an optional implementation, a second bandwidth parameter value corresponding to each device is determined based on available bandwidth resources and bandwidth usage, including: determining a bandwidth allocation ratio for each device based on a bandwidth power consumption value of each device in at least one device; and determining a second bandwidth parameter value corresponding to each device based on the bandwidth allocation ratio and available bandwidth resources.
[0015] Based on the above method, the bandwidth allocation ratio of each device can be accurately determined through the bandwidth usage rate of each device, so that bandwidth resources can be accurately allocated to each device to ensure that each device obtains the most appropriate bandwidth.
[0016] In an optional implementation, at least one device includes a first device; based on the first bandwidth parameter value, the second bandwidth parameter value and the maximum bandwidth parameter value, determining each target bandwidth parameter value corresponding to each device includes: determining the bandwidth parameter value corresponding to the first device based on the first bandwidth parameter value, the second bandwidth parameter value and the maximum bandwidth parameter value of the first device; wherein, based on the first bandwidth parameter value, the second bandwidth parameter value and the maximum bandwidth parameter value of the first device, determining the bandwidth parameter value corresponding to the first device includes: comparing the first bandwidth parameter value and the second bandwidth parameter value of the first device; if the second bandwidth parameter value of the first device is greater than or equal to the first bandwidth parameter value, and the second bandwidth parameter value of the first device is less than or equal to the maximum bandwidth parameter value, determining the bandwidth parameter value corresponding to the first device is the second bandwidth parameter value; if the second bandwidth parameter value of the first device is greater than or equal to the first bandwidth parameter value, and the second bandwidth parameter value of the first device is greater than or equal to the maximum bandwidth parameter value, determining the bandwidth parameter value corresponding to the first device is the maximum bandwidth parameter value; if the second bandwidth parameter value of the first device is less than the first bandwidth parameter value, and the first bandwidth parameter value of the first device is less than the maximum bandwidth parameter value, determining the bandwidth parameter value corresponding to the first device is the first bandwidth parameter value.
[0017] Based on the above method, the first bandwidth parameter value and the second bandwidth parameter value can be compared, and based on the maximum bandwidth parameter value, each target bandwidth parameter value corresponding to the first device can be accurately determined.
[0018] In an optional implementation, after the switch sets at least one bandwidth of at least one device, the average throughput and average delay of each device in the at least one device within a preset time period are obtained; it is detected whether the average throughput and average delay of each device meet preset conditions, and the preset conditions are associated with the throughput and delay required by each device; if not, it is determined that the average actual bandwidth does not meet the business requirements of supporting each device, and each target bandwidth parameter value is adjusted.
[0019] Based on the above method, by monitoring the average throughput and average latency of each device, it is possible to determine whether the average actual bandwidth of each device meets the business needs of each device, thereby avoiding service interruption or user experience degradation caused by insufficient bandwidth resources of each device. When it is detected that the bandwidth of some devices fails to meet the preset conditions, the target bandwidth parameter value can be adjusted in time.
[0020] In a second aspect, the present invention provides a bandwidth setting device, which includes: an acquisition module, used to obtain bandwidth association information and current working status information of each device in at least one device associated with a host; the acquisition module is also used to obtain the priority of configuring the bandwidth of each device in at least one device; a processing module is used to determine each target bandwidth parameter value corresponding to each device based on the priority, bandwidth association information and current working status information; the processing module is also used to record each target bandwidth parameter value in a register corresponding to each device, so that the switch reads from the register and sets at least one bandwidth of at least one device based on each target bandwidth parameter value.
[0021] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the bandwidth setting method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0022] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the bandwidth setting method of the first aspect or any corresponding embodiment thereof.
[0023] In a fifth aspect, the present invention provides a computer program product, including computer instructions, where the computer instructions are used to enable a computer to execute the bandwidth setting method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0025] Figure 1 is a topological diagram of a bandwidth setting system according to an embodiment of the present invention;
[0026] Figure 2 is a schematic flow chart of a bandwidth setting method according to an embodiment of the present invention;
[0027] Figure 3 is a flow chart of another bandwidth setting method according to an embodiment of the present invention;
[0028] Figure 4 is a structural block diagram of a bandwidth setting device according to an embodiment of the present invention;
[0029] Figure 5 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0031] The embodiment of the present invention is applied in a server, in a scenario where a PCIe Switch allocates bandwidth for each PCIE device.
[0032] High-performance servers are usually equipped with a variety of PCIE devices, and different PCIE devices require different working bandwidths. Based on the use of business, the same PCIE device may also have different bandwidth working modes. The traditional static bandwidth allocation method cannot match the appropriate bandwidth resources for the device based on different working scenarios, resulting in bandwidth resource waste or insufficient bandwidth for some key devices, affecting the overall performance of the system.
[0033] In order to solve the above technical problems, an embodiment of the present invention provides a bandwidth setting method, which determines each target bandwidth parameter value corresponding to each device through the priority, bandwidth association information and current working status information of each device, so as to achieve the effect of matching the appropriate bandwidth parameter value for each device in different working scenarios.
[0034] Below Figure 1 Taking the bandwidth setting system 100 of the device shown as an example, the method provided in the embodiment of the present application is described. Figure 1 It is only a schematic diagram and does not constitute a limitation on the applicable scenarios of the technical solution provided in this application.
[0035] like Figure 1 As shown, Figure 1 4 is a topological diagram of a bandwidth setting system according to an embodiment of the present invention. Figure 1 In the embodiment, the bandwidth setting system 100 may include a baseboard management controller 101 , a register 102 , a switch 103 , a first device 104 , and a second device 105 .
[0036] The baseboard management controller 101 in the embodiment of the present invention may be a controller (Baseboard Management Controller, BMC) integrated in a server, a network device, or other computer systems.
[0037] The register 102 in the embodiment of the present invention may be any register. For example, the register 102 may be a register in a complex programmable logic device (CPLD), a general register, a special register, a base address register, a floating point register, or a status register. The register 102 is used to store the bandwidth parameter value of each device.
[0038] The switch 103 in the embodiment of the present invention is also called a PCIe Switch. As an important PCIe expansion device, the PCIe Switch can effectively solve the problem of limited number of PCIe slots on the motherboard. Multiple PCIe devices are connected to the host system through one or more PCIe Switches.
[0039] The first device 104 or the second device 105 in the embodiment of the present invention may be any PCIE device. For example, the first device 104 may be a network card, and the second device 105 may be a hard disk.
[0040] Figure 1 The bandwidth setting system 100 shown is only used as an example and is not used to limit the technical solution of the present application. Those skilled in the art should understand that in the specific implementation process, the bandwidth setting system 100 may also include other devices without limitation.
[0041] According to an embodiment of the present invention, a bandwidth setting method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0042] In this embodiment, a bandwidth setting method is provided, which can be used in the above-mentioned baseboard management controller. Figure 2 is a flow chart of a bandwidth setting method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0043] S201: Obtain bandwidth association information and current working status information of each device in at least one device associated with the host.
[0044] The bandwidth-related information includes a manufacturer identification code, a device identification code, and a maximum bandwidth parameter value supported by each device.
[0045] The current working status information includes the current working mode and current operation information of each device. The current operation information includes the bandwidth usage rate and bandwidth power consumption value of each device.
[0046] Exemplarily, the BMC uses a built-in PCIe scanning function or a PCIe bus enumeration tool to scan the PCIe bus on the host, and obtains bandwidth association information and current working status information of each device in at least one device associated with the host.
[0047] Optionally, the BMC may also obtain a bus number, a device number, and a function number of each device in the at least one device to determine a physical location of each device.
[0048] S202: Obtain a priority of bandwidth configuration for each device in at least one device.
[0049] In some optional implementations, the BMC obtains a service weight value corresponding to each device; determines the device type of each device based on the manufacturer identification code and the device identification code; and determines the priority corresponding to each device based on the device type and the service weight value.
[0050] The service weight value is used to indicate the criticality of each device to the service. Optionally, the service weight value is associated with the degree of impact of each device on the overall performance of the system. For example, for a server system, the service weight values of network communication and storage devices are high, and the service weight values of other devices are low. For a graphics processing system, the service weight values corresponding to graphics card devices are high, and the service weight values of other devices are low.
[0051] The device type can be a high-performance graphics processing type (e.g., graphics card), a network communication type (e.g., 10 Gigabit network card), a storage type (e.g., high-speed solid-state hard disk), or a computing acceleration type (e.g., Field-Programmable Gate Array (FPGA)). Different device types have different priorities for configuring bandwidth. For example, the priority of configuring bandwidth for a high-performance graphics processing device is higher than the priority of configuring bandwidth for a computing acceleration device.
[0052] In one example, taking at least one device including a first device and a second device as an example, if the first device and the second device are of the same device type, the BMC compares the first business weight value of the first device and the second business weight value of the second device; if the first business weight value is higher than the second business weight value, it is determined that the priority of the first device is higher than the priority of the second device.
[0053] In another example, taking at least one device including a first device and a second device as an example, if the service weight values of the first device and the second device are consistent, the BMC determines the priority of the first device and the second device according to the first device type of the first device and the second device type of the second device.
[0054] In some optional embodiments, the baseboard management controller determines a first priority value corresponding to the device type of each device based on the device type of each device and a preset correspondence; obtains a weight coefficient corresponding to the business weight value of each device; calculates the product between the business weight value of each device and the weight coefficient to obtain a second priority value corresponding to the business weight value of each device; calculates the sum of the first priority value and the second priority value to obtain a total priority value for each device, and determines the priority of each device based on the total priority value of each device.
[0055] The preset corresponding relationship is the corresponding relationship between the device type and the first priority value.
[0056] It is understandable that the larger the total priority value, the higher the priority of the device. BMC calculates the total priority value of each device by combining the device type, the criticality of each device to the business, and the impact on the overall system performance, so that BMC can determine the allocation of bandwidth resources according to the priority of each device to ensure that the devices corresponding to key businesses can obtain sufficient bandwidth resources.
[0057] S203: Determine each target bandwidth parameter value corresponding to each device based on the priority, bandwidth association information and current working status information.
[0058] The target bandwidth parameter value may be a link speed value and a number of virtual channels of a port of the switch connected to the PCIE device.
[0059] In some optional embodiments, the baseboard management controller determines a first bandwidth parameter value corresponding to each device according to the current working mode; determines a second bandwidth parameter value corresponding to each device according to the current working status information; determines each bandwidth parameter value corresponding to each device based on the first bandwidth parameter value, the second bandwidth parameter value and the maximum bandwidth parameter value; and adjusts each bandwidth parameter value based on a priority to determine each target bandwidth parameter value corresponding to each device.
[0060] The first bandwidth parameter value is the minimum bandwidth parameter value required for the current working mode. The current working mode is associated with the performance of each device. For example, for a storage device, the current working mode may be an idle mode, a data read / write mode, or an initialization mode. The first bandwidth parameter value corresponding to the data read / write mode is greater than the first bandwidth parameter value corresponding to the initialization mode.
[0061] In some optional embodiments, the baseboard management controller obtains the available bandwidth resources of the host at the current moment; determines the second bandwidth parameter value corresponding to each device based on the available bandwidth resources and the bandwidth utilization rate, or determines the second bandwidth parameter value corresponding to each device based on the available bandwidth resources and the bandwidth power consumption value.
[0062] In one example, the baseboard management controller determines the bandwidth allocation ratio of each device according to the bandwidth power consumption value of each device in at least one device; and determines the second bandwidth parameter value corresponding to each device according to the bandwidth allocation ratio and the available bandwidth resources.
[0063] For example, taking at least one device including a first device and a second device, and the ratio of the first bandwidth power consumption value of the first device to the second bandwidth power consumption value of the second device is 2:3, the baseboard management controller determines that the bandwidth allocation ratio of the first device to the second device is 2:3 according to the first bandwidth power consumption value of the first device and the second bandwidth power consumption value of the second device; and determines the second bandwidth parameter value corresponding to each device according to the ratio of 2:3 for the available bandwidth resources.
[0064] In one example, the baseboard management controller determines the bandwidth allocation ratio of each device according to the bandwidth usage rate of each device in at least one device; and determines the second bandwidth parameter value corresponding to each device according to the bandwidth allocation ratio and the available bandwidth resources.
[0065] In one example, for a network card device, the BMC can obtain the current flow of the network card port at the current moment and the maximum flow of the network card port in a preset time period, and calculate the bandwidth usage rate of the network card device.
[0066] It is understandable that the preset time period can be set according to actual needs without limitation.
[0067] In some optional embodiments, the baseboard management controller compares the first bandwidth parameter value and the second bandwidth parameter value of the first device; if the second bandwidth parameter value of the first device is greater than or equal to the first bandwidth parameter value, and the second bandwidth parameter value of the first device is less than or equal to the maximum bandwidth parameter value, the bandwidth parameter value corresponding to the first device is determined to be the second bandwidth parameter value; if the second bandwidth parameter value of the first device is less than the first bandwidth parameter value, and the second bandwidth parameter value of the first device is greater than or equal to the maximum bandwidth parameter value, the bandwidth parameter value corresponding to the first device is determined to be the maximum bandwidth parameter value; if the second bandwidth parameter value of the first device is less than the first bandwidth parameter value, and the first bandwidth parameter value of the first device is less than the maximum bandwidth parameter value, the bandwidth parameter value corresponding to the first device is determined to be the first bandwidth parameter value.
[0068] It can be understood that each bandwidth parameter value of each device is greater than or equal to the first bandwidth parameter value, and less than or equal to the maximum bandwidth parameter value.
[0069] In one example, the baseboard management controller adjusts each bandwidth parameter value based on the priority and determines each target bandwidth parameter value corresponding to each device.
[0070] It is understandable that, since the working state of each device in at least one device changes dynamically, and the service tasks performed by each device at different times are also different, that is, the priorities of different devices also change dynamically. Therefore, in the case of limited bandwidth resources, for high-priority devices, the BMC can give priority to allocating sufficient bandwidth resources to ensure the execution of key services. For example, during the data backup period of the storage device, the BMC can give priority to allocating sufficient bandwidth resources to the storage device to ensure the success of the data backup.
[0071] S204: Record each target bandwidth parameter value in a register corresponding to each device, so that the switch reads from the register and sets at least one bandwidth of at least one device based on each target bandwidth parameter value.
[0072] Exemplarily, the BMC obtains a register mapping document of the CPLD to determine a register address and a function description related to PCIe Switch control; based on the register address and the function description, determines a register address corresponding to a bandwidth of a PCIe Switch port to which each device is connected; and writes a register value corresponding to each target bandwidth parameter value into a register address corresponding to each determined device through a communication interface with the CPLD, so as to record each target bandwidth parameter value in a register corresponding to each device.
[0073] It is understandable that in the process of the BMC writing each target bandwidth parameter value into the register address corresponding to each determined device, a data check and error handling mechanism (eg, a cyclic redundancy check mechanism) may be used to prevent a write error from causing a system failure.
[0074] In one example, after the BMC records each target bandwidth parameter value in a register corresponding to each device, the CPLD may return response information to the BMC. The BMC receives the response information returned by the CPLD and determines that the register value modification operation is successfully completed.
[0075] It is understandable that if the BMC cannot receive the response information returned by the CPLD, it can rewrite the register or send a prompt message to prompt the administrator that the writing fails.
[0076] Furthermore, the CPLD generates a corresponding control signal and sends it to the PCIe Switch according to the register value modified by the BMC. The control signal is used to adjust the routing configuration and port bandwidth allocation parameters inside the PCIe Switch. The PCIe Switch reconfigures its internal circuit structure according to the received control signal and sets at least one bandwidth of at least one device connected to each port. For example, the PCIe Switch can set the link speed and number of virtual channels of the port to set the bandwidth of each device.
[0077] In some optional embodiments, after the switch sets at least one bandwidth of at least one device, the baseboard management controller obtains the average throughput and average delay of each device in the at least one device within a preset time period; detects whether the average throughput and average delay of each device meet preset conditions, and the preset conditions are associated with the throughput and delay required by each device; if not, it is determined that the average actual bandwidth does not meet the business requirements of supporting each device, and each target bandwidth parameter value is adjusted.
[0078] The preset condition is that the average throughput of each device is greater than or equal to the throughput required by each device, and the average delay of each device is less than or equal to the minimum delay corresponding to each device.
[0079] Based on the above Figure 2 According to the method, the BMC can obtain bandwidth association information and current working status information of each device in at least one device associated with the host, as well as the priority of each device to configure the bandwidth; based on the priority, bandwidth association information and current working status information, determine each target bandwidth parameter value corresponding to each device to set at least one bandwidth of at least one device.
[0080] Since the target bandwidth parameter value is determined based on the bandwidth association information, current working status information and priority of each device, and the determined target bandwidth parameter value can be recorded in the corresponding register, the switch can set the bandwidth of each device based on the target bandwidth parameter value in the register. Compared with the method in the related art where the switch directly sets the default bandwidth for each device, the present invention can match the appropriate bandwidth parameter value for each device based on different working scenarios and the bandwidth association information of each device, thereby avoiding the waste of bandwidth resources or the problem of insufficient bandwidth of certain key devices, and improving the utilization rate of bandwidth resources.
[0081] In this embodiment, another bandwidth setting method is provided, which can be used for the above-mentioned baseboard management controller. Figure 3 is a flow chart of another bandwidth setting method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0082] S301: The host is powered on.
[0083] S302: The BMC accesses at least one device associated with the host and determines whether the access is successful.
[0084] S303: If not, if the BMC access fails, the PCIeSwich sets the bandwidth of each device to the default bandwidth.
[0085] S304: If yes, the BMC obtains bandwidth association information, current working status information and priority of each device associated with the host.
[0086] S305: The BMC determines each target bandwidth parameter value corresponding to each device based on the priority, bandwidth association information and current working status information.
[0087] S306: The BMC determines whether to record each target bandwidth parameter value in a register corresponding to each device.
[0088] S307: If not, the register setting fails, and PCIeSwich sets the bandwidth of each device to the default bandwidth.
[0089] S308: If yes, PCIeSwich determines whether the target bandwidth parameter value recorded in the register is obtained.
[0090] S309: If not, obtaining the target bandwidth parameter value fails, and PCIeSwich sets the bandwidth of each device to the default bandwidth.
[0091] S310: If yes, the PCIeSwich sets at least one bandwidth of at least one device according to the target bandwidth parameter value.
[0092] In this embodiment, a bandwidth setting device is also provided, which is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0093] This embodiment provides a bandwidth setting device, such as Figure 4 As shown, Figure 4 is a structural block diagram of a bandwidth setting device according to an embodiment of the present invention; the device comprises:
[0094] The acquisition module 401 is used to acquire bandwidth association information and current working status information of each device in at least one device associated with the host.
[0095] The acquisition module 401 is further configured to acquire the priority of bandwidth configuration of each device in at least one device.
[0096] The processing module 402 is used to determine each target bandwidth parameter value corresponding to each device based on the priority, bandwidth association information and current working status information.
[0097] The processing module 402 is further configured to record each target bandwidth parameter value in a register corresponding to each device, so that the switch reads from the register and sets at least one bandwidth of at least one device based on each target bandwidth parameter value.
[0098] In some optional implementations, the bandwidth association information includes a manufacturer identification code and a device identification code. The acquisition module 401 is specifically used to obtain a service weight value corresponding to each device, and the service weight value is used to indicate the criticality of each device to the service; the acquisition module 401 is also specifically used to determine the device type of each device based on the manufacturer identification code and the device identification code; the acquisition module 401 is also specifically used to determine the priority corresponding to each device based on the device type and the service weight value.
[0099] In some optional implementations, the bandwidth association information includes the maximum bandwidth parameter value supported by each device, and the current working status information includes the current working mode and current operation information of each device; according to the current working mode, the first bandwidth parameter value corresponding to each device is determined, and the first bandwidth parameter value is the minimum bandwidth parameter value required for the current working mode; the processing module 402 is specifically used to determine the second bandwidth parameter value corresponding to each device according to the current working status information; the processing module 402 is also specifically used to determine each bandwidth parameter value corresponding to each device based on the first bandwidth parameter value, the second bandwidth parameter value and the maximum bandwidth parameter value; the processing module 402 is also specifically used to adjust each bandwidth parameter value based on the priority and determine each target bandwidth parameter value corresponding to each device.
[0100] In some optional embodiments, the current operating information includes the bandwidth utilization rate and bandwidth power consumption value of each device; the processing module 402 is also specifically used to obtain the available bandwidth resources of the host at the current moment; the processing module 402 is also specifically used to determine the second bandwidth parameter value corresponding to each device based on the available bandwidth resources and the bandwidth utilization rate; the processing module 402 is also specifically used to determine the second bandwidth parameter value corresponding to each device based on the available bandwidth resources and the bandwidth power consumption value.
[0101] In some optional embodiments, the processing module 402 is further specifically used to determine the bandwidth allocation ratio of each device according to the bandwidth power consumption value of each device in at least one device; the processing module 402 is further specifically used to determine the second bandwidth parameter value corresponding to each device according to the bandwidth allocation ratio and the available bandwidth resources.
[0102] In some optional implementations, at least one device includes a first device; the processing module 402 is further used to determine a bandwidth parameter value corresponding to the first device based on the first bandwidth parameter value, the second bandwidth parameter value and the maximum bandwidth parameter value of the first device.
[0103] The processing module 402 is further specifically used to compare the first bandwidth parameter value and the second bandwidth parameter value of the first device; the processing module 402 is further specifically used to determine that the bandwidth parameter value corresponding to the first device is the second bandwidth parameter value if the second bandwidth parameter value of the first device is greater than or equal to the first bandwidth parameter value, and the second bandwidth parameter value of the first device is less than or equal to the maximum bandwidth parameter value; the processing module 402 is further specifically used to determine that the bandwidth parameter value corresponding to the first device is the maximum bandwidth parameter value if the second bandwidth parameter value of the first device is greater than or equal to the first bandwidth parameter value, and the second bandwidth parameter value of the first device is greater than or equal to the maximum bandwidth parameter value; the processing module 402 is further specifically used to determine that the bandwidth parameter value corresponding to the first device is the first bandwidth parameter value if the second bandwidth parameter value of the first device is less than the first bandwidth parameter value, and the first bandwidth parameter value of the first device is less than the maximum bandwidth parameter value.
[0104] In some optional implementations, the acquisition module 401 is further used to obtain the average throughput and average delay of each device in at least one device within a preset time period after the switch sets at least one bandwidth of at least one device; the processing module 402 is further used to detect whether the average throughput and average delay of each device meet preset conditions, and the preset conditions are associated with the throughput and delay required by each device; the processing module 402 is further used to determine that the average actual bandwidth does not meet the business requirements of supporting each device, and adjust each target bandwidth parameter value if not.
[0105] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0106] The bandwidth setting device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0107] The embodiment of the present invention also provides a computer device having the above Figure 4 The bandwidth setting device shown.
[0108] See also Figure 5 , Figure 5 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 5As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.
[0109] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0110] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0111] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0112] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0113] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0114] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0115] Part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present application through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes but is not limited to source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0116] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A bandwidth setting method, characterized in that: The method comprises: Obtaining bandwidth association information and current working status information of each of at least one device associated with the host; Obtaining a priority of bandwidth configuration for each of the at least one device; Determine each target bandwidth parameter value corresponding to each of the devices based on the priority, the bandwidth association information and the current working state information; Each of the target bandwidth parameter values is recorded in a register corresponding to each of the devices, so that the switch reads from the register and sets at least one bandwidth of the at least one device based on each of the target bandwidth parameter values.
2. The method according to claim 1, characterized in that The bandwidth association information includes a vendor identification code and a device identification code, and obtaining the priority of bandwidth configuration of each of the at least one device includes: Obtaining a service weight value corresponding to each of the devices, where the service weight value is used to indicate the criticality of each of the devices to the service; Determining a device type of each of the devices according to the manufacturer identification code and the device identification code; The priority corresponding to each of the devices is determined according to the device type and the service weight value.
3. The method according to claim 2, characterized in that The bandwidth association information includes a maximum bandwidth parameter value supported by each of the devices, and the current working state information includes a current working mode and current operation information of each of the devices; and determining each target bandwidth parameter value corresponding to each of the devices based on the priority, the bandwidth association information, and the current working state information includes: Determine, according to the current working mode, a first bandwidth parameter value corresponding to each of the devices, where the first bandwidth parameter value is a minimum bandwidth parameter value required by the current working mode; Determining a second bandwidth parameter value corresponding to each of the devices according to the current working state information; Determine, based on the first bandwidth parameter value, the second bandwidth parameter value and the maximum bandwidth parameter value, each bandwidth parameter value corresponding to each of the devices; Each of the bandwidth parameter values is adjusted based on the priority, and each of the target bandwidth parameter values corresponding to each of the devices is determined.
4. The method according to claim 3, characterized in that The current operation information includes a bandwidth usage rate and a bandwidth power consumption value of each of the devices; and determining a second bandwidth parameter value corresponding to each of the devices based on the current working state information includes: Obtaining the available bandwidth resources of the host at the current moment; Determining the second bandwidth parameter value corresponding to each of the devices according to the available bandwidth resources and the bandwidth usage rate; Alternatively, the second bandwidth parameter value corresponding to each of the devices is determined according to the available bandwidth resources and the bandwidth power consumption value.
5. The method according to claim 4, characterized in that The determining, according to the available bandwidth resources and the bandwidth usage rate, the second bandwidth parameter value corresponding to each of the devices includes: Determining a bandwidth allocation ratio for each of the at least one device according to the bandwidth power consumption value of each of the at least one device; The second bandwidth parameter value corresponding to each of the devices is determined according to the bandwidth allocation ratio and the available bandwidth resources.
6. The method according to claim 3, characterized in that The at least one device includes a first device; and determining each bandwidth parameter value corresponding to each of the devices based on the first bandwidth parameter value, the second bandwidth parameter value, and the maximum bandwidth parameter value, includes: Determine a bandwidth parameter value corresponding to the first device based on the first bandwidth parameter value, the second bandwidth parameter value, and the maximum bandwidth parameter value of the first device; The determining, based on the first bandwidth parameter value, the second bandwidth parameter value, and the maximum bandwidth parameter value of the first device, a bandwidth parameter value corresponding to the first device includes: comparing the first bandwidth parameter value and the second bandwidth parameter value of the first device; If the second bandwidth parameter value of the first device is greater than or equal to the first bandwidth parameter value, and the second bandwidth parameter value of the first device is less than or equal to the maximum bandwidth parameter value, determining that the bandwidth parameter value corresponding to the first device is the second bandwidth parameter value; If the second bandwidth parameter value of the first device is greater than or equal to the first bandwidth parameter value, and the second bandwidth parameter value of the first device is greater than or equal to the maximum bandwidth parameter value, determining that the bandwidth parameter value corresponding to the first device is the maximum bandwidth parameter value; If the second bandwidth parameter value of the first device is less than the first bandwidth parameter value, and the first bandwidth parameter value of the first device is less than the maximum bandwidth parameter value, the bandwidth parameter value corresponding to the first device is determined to be the first bandwidth parameter value.
7. The method according to claim 6, characterized in that The method further comprises: After the switch completes setting the at least one bandwidth of the at least one device, obtaining an average throughput and an average delay of each of the at least one device in a preset time period; Detecting whether the average throughput and the average delay of each of the devices meet a preset condition, where the preset condition is associated with the throughput and delay required by each of the devices; If not, it is determined that the average actual bandwidth does not meet the service requirements of supporting each of the devices, and each of the target bandwidth parameter values is adjusted.
8. A bandwidth setting device, characterized in that: The device comprises: An acquisition module, used to acquire bandwidth association information and current working status information of each of at least one device associated with the host; The acquisition module is further used to acquire the priority of bandwidth configuration of each of the at least one device; A processing module, configured to determine each target bandwidth parameter value corresponding to each of the devices based on the priority, the bandwidth association information and the current working state information; The processing module is further configured to record each of the target bandwidth parameter values in a register corresponding to each of the devices, so that the switch reads from the register and sets at least one bandwidth of the at least one device based on each of the target bandwidth parameter values.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the bandwidth setting method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the bandwidth setting method according to any one of claims 1 to 7.
Citation Information
Cited By
Data acquisition method, device and equipment of photovoltaic inverter, storage medium and program product
CN120416187A