Resource Management Method, Device, Storage Medium, and Program Product

By obtaining and monitoring the preset resource information of the data processor and dynamically adjusting the hardware resource allocation, the problem of insufficient resources during server operation is solved, and the stable operation of the equipment and system performance improvement is achieved.

CN120085939BActive Publication Date: 2025-07-25INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510559603.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-07-25
Estimated Expiration
2045-04-29

AI Technical Summary

Technical Problem

In the prior art, the server has insufficient resources due to port information flexibility during the operation stage, resulting in the access device being unable to operate normally.

Method used

By obtaining the preset resource information of the data processor, hardware resources are allocated to the device to be accessed, and the actual access device parameters are monitored in real time, compared with the preset resource information, and dynamically adjusting the hardware resource allocation to adapt to the actual changes in device access.

Benefits of technology

Effectively utilize hardware resources, avoid insufficient resource allocation, ensure normal operation of equipment, reduce server downtime losses, and improve system performance and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120085939B_ABST
    Figure CN120085939B_ABST
Patent Text Reader

Abstract

The present invention provides a resource management method, device, storage medium, and program product, which can be applied to the field of server technology. The resource management method includes: in response to a startup instruction of the server, obtaining preset resource information of a data processor from a storage unit of the server; based on the preset resource information, allocating corresponding hardware resources to a device to be connected to the data processor; monitoring device parameters of an actually connected data processor, so as to update the preset resource information according to the actually connected device parameters when it is determined that the actually connected device parameters are inconsistent with the parameters in the preset resource information; and using the updated resource information to dynamically adjust the hardware resources of a device whose device parameters in the data processor have changed relative to the preset resource information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of servers, and particularly to a resource management method, device, medium, and program product. Background Art

[0002] An intelligent network card can provide diversified input / output expansion functions for a server. It is equipped with multiple downstream ports, and various devices can be connected through these ports to achieve flexible expansion of computing, storage, and network resources. In the related art, when the server starts up, static allocation of resources is performed for each port according to the port information.

[0003] In the process of implementing the inventive concept of the present invention, the inventors found that there are at least the following problems in the related art. During the operation stage of the server, due to the flexibility of the port information and the fact that it will change, relying on the pre-allocation of resources in the initialization stage, it is easy to have a situation of insufficient resources, resulting in the inability of the connected devices to operate normally. Summary of the Invention

[0004] In view of the above problems, the present invention provides a resource management method, apparatus, device, medium, and program product.

[0005] According to a first aspect of the present invention, there is provided a resource management method, including: in response to a startup instruction of the server, obtaining preset resource information of a data processor from a storage unit of the server; based on the preset resource information, allocating corresponding hardware resources to devices to be connected to the data processor; monitoring device parameters of devices actually connected to the data processor, so as to, when it is determined that the device parameters actually connected are inconsistent with the parameters in the preset resource information, update the preset resource information according to the device parameters actually connected; and using the updated resource information to dynamically adjust the hardware resources of devices in the data processor whose device parameters have changed relative to the preset resource information.

[0006] A second aspect of the present invention provides a resource management apparatus, including: an information acquisition module, configured to obtain preset resource information of a data processor from a storage unit of the server in response to a startup instruction of the server; a resource allocation module, configured to allocate corresponding hardware resources to devices to be connected to the data processor based on the preset resource information; a parameter monitoring module, configured to monitor device parameters of devices actually connected to the data processor, so as to, when it is determined that the device parameters actually connected are inconsistent with the parameters in the preset resource information, update the preset resource information according to the device parameters actually connected; and a resource adjustment module, configured to use the updated resource information to dynamically adjust the hardware resources of devices in the data processor whose device parameters have changed relative to the preset resource information.

[0007] The third aspect of the present invention provides an electronic device, including: one or more processors; a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.

[0008] The fourth aspect of the present invention further provides a computer-readable storage medium, on which computer programs or instructions are stored, and when the computer programs or instructions are executed by a processor, the steps of the above method are implemented.

[0009] The fifth aspect of the present invention further provides a computer program product, including computer programs or instructions, and when the computer programs or instructions are executed by a processor, the steps of the above method are implemented.

[0010] According to the embodiments of the present invention, by obtaining preset resource information, resource pre-allocation is performed for the devices to be connected to the data processor, and the actually connected devices are compared with the preset devices to be connected, and the allocation of hardware resources is updated in real time. Thereby, the reserved hardware resources can be fully utilized, and the situation that the devices cannot operate normally due to insufficient resource allocation can be avoided, and further the losses caused by server downtime can be reduced, providing a strong guarantee for the stable operation of the server. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Through the following description of the embodiments of the present invention with reference to the drawings, the above content and other objects, features and advantages of the present invention will become clearer.

[0012] Figure 1 The application scenario diagram of the resource management method, device, equipment, medium and program product according to the embodiments of the present invention is shown.

[0013] Figure 2 The flowchart of the resource management method according to the embodiments of the present invention is shown.

[0014] Figure 3 The data interaction diagram of the resource management method according to the embodiments of the present invention is shown.

[0015] Figure 4 The flowchart of the resource management method according to another embodiment of the present invention is shown.

[0016] Figure 5 The structural block diagram of the resource management device according to the embodiments of the present invention is shown.

[0017] Figure 6 The block diagram of the electronic device suitable for implementing the resource management method according to the embodiments of the present invention is shown. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0018] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present invention. In the following detailed description, for the sake of explanation, numerous specific details are set forth to provide a comprehensive understanding of the embodiments of the present invention. However, it is obvious that one or more embodiments can also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts of the present invention.

[0019] The terms used herein are merely for describing specific embodiments and are not intended to limit the present invention. The terms "including", "comprising", etc. used herein indicate the presence of the described features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0020] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0021] In the case of using expressions such as "at least one of A, B, and C", generally, it should be interpreted according to the meaning usually understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include, but is not limited to, a system having only A, only B, only C, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.).

[0022] In the technical solution of the present invention, the user information involved (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) are all information and data authorized by the user or fully authorized by all parties. Moreover, the processing of relevant data, such as collection, storage, use, processing, transmission, provision, disclosure, and application, all complies with relevant laws, regulations, and standards, takes necessary confidentiality measures, does not violate public order and good customs, and provides corresponding operation entrances for users to choose to authorize or refuse.

[0023] An embodiment of the present invention provides a resource management method, which includes: in response to a startup instruction of a server, obtaining preset resource information of a data processor from a storage unit of the server; based on the preset resource information, allocating corresponding hardware resources to a device to be connected to the data processor; monitoring device parameters of an actually connected data processor to update the preset resource information according to the actually connected device parameters when it is determined that the actually connected device parameters are inconsistent with the parameters in the preset resource information; and using the updated resource information to dynamically adjust the hardware resources of a device whose device parameters in the data processor have changed relative to the preset resource information.

[0024] Figure 1 The application scenario diagram of the resource management method, device, equipment, medium and program product according to the embodiment of the present invention is shown.

[0025] As Figure 1 shown, the application scenario according to this embodiment may include a server 101, a smart network card 102, a device 103 connected to the smart network card 102, a switch 104, and a network device 105.

[0026] The server 101 is a device that provides various services. It can process requests from other devices (such as the smart network card 102), perform operations such as data processing and analysis on these requests, and then feedback the processing results to the corresponding devices.

[0027] The smart network card 102 is a network interface device that has certain data processing capabilities. It can be connected to the server 101 and the switch 104, used to process network data, reduce the network processing burden of the server 101. It can also interact with the device 103 connected to it to achieve efficient data transmission and processing.

[0028] The device 103 connected to the smart network card 102 is connected and communicates with other devices in the network through the smart network card 102. They can send requests to the server 101, or receive data such as processing results from the server 101, and use these data in their own operations.

[0029] The switch 104 is an important device in the network, used to provide a medium for communication links between the smart network card 102 and the network device 105. It can include various connection types, such as wired connections, etc., to ensure accurate and efficient data transmission between these devices.

[0030] The network device 105 is a device that can build a network connection with the server 101 by means of the smart network card 102, and this connection can expand the functions and application scope of the network. For example, taking a printer as an example, it realizes connection and data interaction with the smart network card 102 and the server 101 through the network, and then achieves related functions such as printing.

[0031] It should be noted that the resource management method provided by the embodiments of the present invention can generally be executed by the server 101. Correspondingly, the resource management device provided by the embodiments of the present invention can generally be set in the server 101.

[0032] It should be understood that Figure 1 the numbers of devices, network devices, and servers accessing the intelligent network card are merely illustrative. According to the implementation requirements, there can be any number of devices, network devices, and servers accessing the intelligent network card.

[0033] Based on the Figure 1 described scenario below, the resource management method of the disclosed embodiments will be described in detail through Figures 2 to 4 the following.

[0034] Figure 2 FIG. shows a flowchart of the resource management method according to an embodiment of the present invention.

[0035] As Figure 2 shown, the method includes operation S210 to operation S240.

[0036] In operation S210, in response to the startup instruction of the server, the preset resource information of the data processor is obtained from the storage unit of the server.

[0037] In operation S220, based on the preset resource information, the corresponding hardware resources are allocated to the devices to be connected to the data processor.

[0038] In operation S230, the device parameters of the actually connected data processor are monitored, so that in the case where it is determined that the actually connected device parameters are inconsistent with the parameters in the preset resource information, the preset resource information is updated according to the actually connected device parameters.

[0039] In operation S240, using the updated resource information, the hardware resources of the devices whose device parameters in the data processor have changed relative to the preset resource information are dynamically adjusted.

[0040] According to the embodiments of the present invention, with the continuous growth of the server's demand for high-performance intelligent network cards, the role of intelligent network cards in the server architecture has become increasingly important. By completely migrating the virtual switch function from the central processor to itself, it effectively releases the computing resources of the server processor, provides more abundant computing space for application programs, and thus can better expand the functions of the intelligent network card and provide higher performance.

[0041] A smart network card usually consists of one or more high-speed serial computer expansion bus switches, which can provide diversified input and output expansion capabilities for the server host. Multiple downstream ports can be configured under each high-speed serial computer expansion bus switch. By connecting various devices to these ports, elastic expansion of computing, storage, and network resources can be achieved. However, to ensure the coordinated operation of the connected devices and the data processor, the server needs to reserve sufficient hardware resources for each downstream port to meet the resource allocation requirements of the smart network card when connecting devices.

[0042] According to an embodiment of the present invention, after receiving the startup instruction of the server, obtain the preset resource information of the data processor from the storage unit of the server. The storage unit is a non-volatile random access memory used to store the preset resource information written in advance. The preset resource information includes the device type, manufacturer information, device bandwidth, rated rate, etc. of each device to be connected to the data processor, and can be presented in the form of a list specifically.

[0043] Analyze the obtained preset resource information and allocate corresponding hardware resources to the devices to be connected to the data processor. Specifically, the server identifies the hardware requirement characteristics of each device to be connected according to the device type and manufacturer information in the preset resource information. For example, some devices may require higher bandwidth support, while others have higher requirements for processing speed. The server will select appropriate resources from the available hardware resource pool for allocation according to these characteristics.

[0044] At the same time, the server dynamically adjusts the network bandwidth and processing capacity allocated to each device according to the device bandwidth and rated rate information. For devices with high bandwidth requirements, the server will preferentially allocate high-speed network interface resources; for devices with high processing rate requirements, more processor cores or dedicated accelerator resources will be allocated.

[0045] Finally, the server binds the allocated hardware resources to the devices to be connected through the downstream ports of the smart network card to ensure that the devices can immediately obtain the required resource support after connection, thus achieving efficient coordinated operation. This dynamic resource allocation method based on preset resource information can effectively improve the overall performance and resource utilization efficiency of the server, while ensuring the stable operation of the connected devices.

[0046] After the pre-allocation of hardware resources is completed, monitor the device parameters of the actually connected data processor. Specifically, a detection can be performed before the server runs, and continuous monitoring can be carried out after the server starts running. Compare the monitored device parameters of the connected data processor with the parameters in the preset resource information. If it is found that the two are inconsistent, it means that the connection situation of the device has changed.

[0047] Update the preset resource information according to the actually connected device parameters to obtain the updated resource information. Use the updated resource information to dynamically adjust the hardware resources for the devices in the data processor whose device parameters have changed relative to the preset resource information. This process ensures that the hardware resource allocation can adapt to the actual changes in device access, further optimizing the resource utilization efficiency and system performance.

[0048] As Figure 3 shown, during the process of resource management, after the server 310 is started, it obtains the preset resource information from the non-volatile memory 320. When the non-volatile memory 320 returns the preset resource information, the server 310 allocates corresponding hardware resources to the devices to be connected to the intelligent network card 330 according to the preset resource information.

[0049] During the operation of the device, continuously monitor the situation of the devices actually connected to the intelligent network card 330. When it is determined that the actually connected devices are inconsistent with the preset resource information, the intelligent network card 330 sends device change information to the server 310 to inform the server 310 that the device has changed.

[0050] After receiving the device change information, the server 310 updates the preset resource information and sends the updated resource information back to the non-volatile memory 320 for storage. Subsequently, the server 310 dynamically adjusts the previously pre-allocated hardware resources according to the updated resource information, and re-allocates the hardware resources to the intelligent network card 330 according to the adjustment result, so as to ensure that the server 310 can flexibly adapt to the changes in hardware devices and maintain the accuracy of resource allocation and the efficient operation of the system.

[0051] According to the embodiments of the present invention, by obtaining the preset resource information, pre-allocating resources for the devices to be connected to the data processor, and comparing the actually connected devices with the preset devices to be connected, the allocation of hardware resources is updated in real time. Thereby, the reserved hardware resources can be fully utilized, and the situation where devices cannot operate normally due to insufficient resource allocation can be avoided, thereby reducing the losses caused by server downtime and providing a strong guarantee for the stable operation of the server.

[0052] According to the embodiments of the present invention, monitoring the device parameters of the devices actually connected to the data processor includes: identifying the identifiers of the devices actually connected to the data processor, where the identifier is a digital identifier generated by encoding the device parameters; parsing the identified identifiers to determine the device parameters of each device in the data processor.

[0053] According to an embodiment of the present invention, each device connected to a data processor has a unique identifier. The identifier is usually pre-defined by the device manufacturer and contains standardized parameters, such as manufacturer identification, product identification, subsystem identification, and device category, and is solidified in the peripheral component interconnect standard (PCI) configuration space of the device. When the server starts, the Basic Input Output System (BIOS) will traverse all connected devices through PCI and read the identifiers in their PCI configuration space.

[0054] The identified identifiers are parsed to determine the device parameters of each device connected to the data processor. For example, when a new network adapter is connected to the server, the BIOS reads the device's identifier, which contains manufacturer information, model, version, etc. By parsing this information, the server can accurately identify the specific model of the network adapter and allocate the appropriate hardware resources to it.

[0055] Through the identifier recognition mechanism, the device can be quickly identified and the device parameters can be determined, ensuring that each device connected to the data processor can obtain matching hardware resources, thereby effectively improving the overall system performance and operational stability.

[0056] According to an embodiment of the present invention, the resource management method also includes: when it is determined that the server has entered an operating state, continuously monitoring the status information of the hot-swappable interface in the server; when the status information indicates that there is dynamic access to the device, identifying the identifier of the access device to determine the device parameters of the access device.

[0057] According to an embodiment of the present invention, when the server enters the running state, the status information of its hot-swappable interface needs to be continuously monitored. The hot-swappable interface supports the safe access or removal of devices without restarting the server, which greatly facilitates the maintenance and upgrade of server hardware. The status information is obtained by real-time detection of the hot-swappable interface to determine whether a new device is connected or an existing device is removed. The status monitoring process runs automatically and can capture any changes in the interface status in real time. Once the monitoring module detects a change in the hot-swappable interface status, it indicates that there may be dynamic device access.

[0058] Taking the Universal Serial Bus (USB) hot-plug interface commonly found in servers as an example, the operating system regularly scans the USB bus. When it detects that a new device address has been assigned, it means that a device has been dynamically connected through the USB interface. Similarly, for the Peripheral Component Interconnect Express (PCIe) hot-plug interface, the interface link status and configuration registers are continuously monitored. Once a change in the link status or new device information is written to the configuration register is detected, it can be determined that a device has been connected through this interface.

[0059] After confirming the dynamic connection of the device, the server will trigger the device identification process, identify the identifier of the connected device, and determine the device parameters of the device by parsing the identifier. Through this monitoring and processing mechanism for the status information of the hot-plug interface, the server can flexibly respond to the dynamic changes of hardware devices, ensure that newly connected devices can quickly and stably integrate into the system environment, and thus improve the overall performance and operation stability of the system.

[0060] In addition, when pre-assigning hardware resources for devices to be connected to the data processor, if there are multiple devices that are often connected through the hot-plug interface during the operation of the server in the preset resource information, a differentiated resource allocation strategy can be adopted based on historical resource management data. This strategy aims to avoid pre-assigning resources to devices connected during operation, so as to maximize the utilization of hardware resources.

[0061] Specifically, during the daily operation of the server, the access situation of devices on the hot-plug interface is recorded in detail, covering information such as access time, device type, and required hardware resources. By analyzing these historical data, the device types that are often connected during operation and their resource demand patterns are found. When pre-assigning hardware resources, according to the above analysis results, resources are not reserved for devices that are often connected during operation, but resources are preferentially allocated to devices with stable connections to ensure their normal operation. Continuously monitor the status information of the hot-plug interface. Once a status change is detected, it indicates that a device has been connected or removed. At this time, the preset resource information will be immediately updated, and corresponding hardware resources will be allocated to the newly connected device.

[0062] Through the differentiated resource allocation strategy, the utilization efficiency of hardware resources is significantly improved, effectively reducing the situation of resource idleness, and enabling the computing, storage, and network resources of the server to be more fully utilized. Under this strategy, the system stability is also enhanced. Since the resource requirements of devices with stable connections are preferentially guaranteed, the risk of device operation failures caused by insufficient resources is greatly reduced, ensuring the reliability of the server operation. At the same time, this strategy also significantly improves the dynamic adaptability of the system, can quickly respond to the connection and removal of devices, and ensures that the system always maintains an efficient operation state under various hardware change scenarios.

[0063] According to an embodiment of the present invention, the resource management method further includes: comparing the monitored device parameters with the parameters in the preset resource information to obtain a comparison result; when the comparison result indicates that the parameters are consistent, allocating corresponding hardware resources to each device accessing the data processor according to the preset resource information.

[0064] According to an embodiment of the present invention, after the device parameter monitoring is completed, it is necessary to comprehensively compare the real-time obtained device parameters with the preset resource information. During specific operations, the preset resource information is loaded into the memory through memory mapping or file reading to construct a structured data set. Subsequently, a multi-dimensional parameter matching algorithm is used to carry out the comparison work: for the device type parameters, exact matching is performed to ensure that the actual device type is exactly the same as the preset type; for numerical parameters such as performance indicators and bandwidth requirements, a reasonable error threshold range is set, and if the actual parameter value falls within this range, it is determined that the matching is successful. After the comparison is completed, a report containing the parameter consistency determination result is automatically generated, clearly marking the comparison status of each parameter.

[0065] When the comparison result shows that the device parameters are exactly the same as the preset resource information, the hardware resource allocation process will be started. According to the device priorities set in the preset resource information, a resource allocation queue is constructed, and high-priority devices such as core computing nodes and key storage devices are preferentially selected for matching resources from the available resource pool.

[0066] At the level of the resource allocation strategy, the corresponding network interface bandwidth is allocated strictly according to the bandwidth requirements of the device; the computing resources such as the number of processor cores and the memory capacity are configured with reference to the performance indicators; the appropriate power supply power is allocated according to the power supply requirements. During the allocation process, the status of the available resource pool is updated in real time to avoid resource duplication or over-allocation. At the same time, through the configuration file or database, the resource allocation information of each device is detailedly recorded, covering the allocated hardware type, quantity, allocation time, etc.

[0067] Taking the access of a server cluster to a new solid - state drive array storage device as an example, after the device parameter monitoring module obtains parameters such as the type of the device, the type of high - speed serial interface, the bandwidth requirement of 10 GB per second, and the storage capacity of 20 TB, it compares them with the preset resource information. If the parameter configuration requirements of this model of storage device are already detailedly recorded in the preset resource information and the comparison result is exactly the same, the resource allocation process will be immediately started. By preferentially allocating a dedicated high - speed network interface for this device to meet its bandwidth requirement, dividing sufficient memory cache space to optimize data read - write performance, and configuring an adapted power module to ensure the stable operation of the device. After the resource allocation is completed, the corresponding device driver program is automatically loaded, and a data storage path is established, enabling this storage device to quickly integrate into the server cluster, realizing efficient data storage and read - write functions, and significantly enhancing the data processing capacity and storage efficiency of the server.

[0068] In the above - mentioned way, the device can be smoothly connected to the server and start working without additional configuration or adjustment. This not only improves the flexibility and scalability of the server but also ensures the stability and performance of the newly connected device.

[0069] According to an embodiment of the present invention, by using updated resource information, dynamic adjustment of hardware resources for devices whose device parameters in the data processor have changed relative to the preset resource information includes: restarting the driver program of the data processor to read the updated resource information; according to the difference between the updated resource information and the preset resource information, making hardware resource adjustments for devices whose device parameters in the data processor have changed relative to the preset resource information.

[0070] According to an embodiment of the present invention, when it is necessary to update the preset resource information in the data processor, first, a driver program restart operation is executed. By sending a restart instruction to the data processor, the driver program enters the shutdown and restart process. In the shutdown phase, the driver program stops controlling the device. During the restart process, the driver program reloads the device driver according to the initialization process and establishes a communication connection with the changed device.

[0071] After the restart is completed, the driver program automatically reads the updated resource information in the non - volatile memory. To ensure accurate and complete reading, a cyclic redundancy check and error - handling mechanism is adopted: the driver program reads the information segment by segment and performs a hash check. If the check result does not match the preset hash value, the corresponding data segment is read again until the complete and accurate updated resource information is obtained.

[0072] After obtaining the updated resource information, it is compared with the preset resource information. Specifically, a difference comparison algorithm is used to analyze key information such as device type, performance parameters, and resource requirements item by item. When it is found that there is a difference between the updated resource information and the preset information of a certain device, a hardware resource adjustment strategy is formulated according to the specific situation of the difference.

[0073] Through the above process, after the driver restarts, it reads and updates the resource information and adjusts the hardware resources. This can not only give full play to the device performance, avoid resource idleness or over-allocation, but also reduce the failures caused by improper configuration, enhance the system stability and compatibility, achieve dynamic and flexible management, enable the system to quickly adapt to hardware changes, effectively reduce the operation and maintenance costs, and improve the management efficiency.

[0074] According to an embodiment of the present invention, according to the difference between the updated resource information and the preset resource information, the hardware resources of the devices with changed device parameters in the data processor are adjusted, including: determining the change type according to the difference between the updated resource information and the preset resource information; and dynamically adjusting the hardware resources of the devices with changed device parameters in the data processor according to the preset mapping relationship between the change type and the resource management operations, where the resource management operations include resource recovery operations and resource allocation operations.

[0075] According to an embodiment of the present invention, after obtaining the updated resource information and the preset resource information, by setting a unified quantization standard, the numerical information such as device performance parameters and resource requirements is compared item by item, and the difference between the parameters in the updated resource information and the preset resource information is calculated, so as to clarify the current change type.

[0076] Subsequently, according to the preset mapping relationship constructed, the corresponding resource management operations are executed. During the resource adjustment process, the status of the available resource pool and the operation of the devices are monitored in real time to ensure the accuracy and stability of the resource adjustment, and avoid abnormal device operation caused by improper resource allocation.

[0077] Taking the server storage system as an example, its original preset resource information shows that 2 mechanical hard disks are configured, with a total storage capacity of 4TB. As the data volume grows, 3 solid-state drives are newly added during operation, and the updated resource information shows that the storage devices increase to 5, and the total storage capacity is increased to 10TB. After comparing the updated and preset resource information, determining the change type, and according to the preset mapping relationship, dedicated high-speed data transfer channels are allocated for the newly added 3 solid-state drives from the available resource pool, and the corresponding storage cache space is increased to meet the data read and write performance requirements.

[0078] By comparing the updated resource information and the preset resource information to determine the change type and implementing dynamic adjustment of the hardware resources, it is possible to achieve precise adaptation of the hardware resource allocation to the actual needs of the devices. When the device needs increase, resources are supplemented in time to ensure performance; when the needs decrease, resources are recycled to avoid waste, thereby improving the resource utilization efficiency, enhancing the system stability and environmental adaptability, effectively reducing the operation and maintenance costs, and improving the overall operation efficiency of the system.

[0079] According to an embodiment of the present invention, based on a preset mapping relationship between change types and resource management operations, dynamic adjustment of hardware resources is performed on devices whose device parameters have changed in a data processor, including: in the case where it is determined that the change type is an increase type, based on the preset mapping relationship, a resource allocation operation is performed on the device newly connected to the data processor; in the case where it is determined that the change type is a decrease type, based on the preset mapping relationship, a resource recovery operation is performed on the device removed from the data processor.

[0080] According to an embodiment of the present invention, the change types are divided into an increase type and a decrease type, which are determined by calculating the difference between the parameters in the updated resource information and the preset resource information. If the calculated difference of parameters such as the number of devices, storage capacity, etc. is a positive number, that is, the parameter value in the updated resource information is greater than the corresponding value in the preset resource information, it is determined as the "increase type"; if the difference is a negative number, that is, the updated value is less than the preset value, it is determined as the "decrease type". For example, if the device storage capacity increases from 1TB to 2TB, the difference is positive, belonging to the increase type; if it decreases from 2TB to 1.5TB, the difference is negative, belonging to the decrease type.

[0081] After determining the change type, the corresponding operation is performed according to the pre-constructed mapping table. When the device change type is the "increase type", a resource allocation operation is started, and hardware resources matching the parameter increase amplitude are extracted from the available resource pool and allocated to the device. For example, if the device network bandwidth requirement increases, the corresponding amount will be allocated from the idle bandwidth resources.

[0082] If the device change type is the "decrease type", a resource recovery operation is triggered. The connection between the device and the allocated resources is closed, the resource binding is released through the driver, and the idle resources are released back to the available resource pool for other devices to allocate and use. During the recovery process, data protection measures are taken to avoid data loss or abnormal server operation. After the recovery is completed, the status of the available resource pool is updated, the recovery resource record is cleared, and an overall resource allocation balance check is performed. If necessary, the resource configuration of other devices is fine-tuned.

[0083] By accurately identifying the device change type and performing the corresponding resource allocation or recovery operation, dynamic and accurate scheduling of hardware resources can be achieved. When a device is newly added, resources can be quickly supplemented to ensure its efficient operation; when a device is removed, resources can be recovered in time to avoid waste, thereby improving resource utilization rate, enhancing the stability and efficiency of server operation, reducing resource management costs, enabling the data processor to flexibly respond to hardware environment changes, and enhancing the environmental adaptation ability.

[0084] According to an embodiment of the present invention, in response to a startup instruction of a server, preset resource information of a data processor is obtained from a storage unit of the server, including: in response to the startup instruction of the server, performing a power-on self-test operation on the server; when it is determined that all hardware components in the server are ready, obtaining the preset resource information from the storage unit; when it is determined that the obtained preset resource information meets a preset condition, repeatedly performing the power-on self-test operation on the server until the preset resource information is obtained.

[0085] According to an embodiment of the present invention, when a startup instruction of the server is received, the server will immediately start the Power-On Self-Test (POST) process. This process is led by the BIOS. The BIOS will comprehensively check each hardware component in the server according to a pre-set program.

[0086] The BIOS will check the working status of the central processing unit, including detecting whether parameters such as the main frequency and the number of cores of the central processing unit are normal, and whether the central processing unit can normally respond to the instructions of the BIOS. Then, it will detect the memory, and judge whether there are data read and write errors in the memory by writing data into the memory and reading for verification. After that, it will also check the connection status and basic functions of other hardware devices such as hard disks, graphics cards, and network cards. For example, checking whether the interface of the hard disk is firmly connected and whether the capacity and partition information of the hard disk can be normally recognized; checking whether the graphics card can normally output a display signal, etc.

[0087] After completing the power-on self-test and confirming that all hardware components are ready, the server will obtain the preset resource information from non-volatile storage units such as hard disks and flash memories. The server accesses the relevant information pre-stored in the storage unit through a file system or a specific storage interface, and reads and loads it into the system memory to prepare for subsequent resource allocation and management.

[0088] When obtaining the preset resource information, the server will check whether it meets a preset condition. The preset condition is that the preset resource information has not been obtained. If the first attempt to obtain it fails, it may be due to reasons such as storage unit failure, file corruption, or an abnormality during the reading process. At this time, the server will repeatedly perform the power-on self-test operation.

[0089] Each power-on self-test is to ensure that the hardware components are still in a normal working state, because hardware failures may be one of the reasons for the failure to obtain the preset resource information. For example, if the hard disk fails, it may not be able to normally read the preset resource information file. During the repeated power-on self-test process, the BIOS will again conduct a detailed check on each hardware component to identify possible problems.

[0090] Repeat the above process until the preset resource information is successfully obtained. For example, suppose that when the server obtains the preset resource information for the first time, a file reading fails due to an error in a sector of the hard disk. The server will perform a power-on self-test and, after discovering that there may be a problem with the hard disk, try to reconnect the hard disk or perform a simple error repair. Try to obtain the preset resource information again. If it still fails, continue to repeat the power-on self-test and acquisition operations until the preset resource information is finally successfully obtained.

[0091] Through such a mechanism, it can be ensured that the server can accurately obtain preset resource information during the startup process, providing a basis for subsequent normal operation and resource management.

[0092] According to an embodiment of the present invention, the resource management method further includes: determining the installation status of the data processor in the server; and releasing the hardware resources allocated to the device to be connected to the data processor when it is determined that the installation status indicates that the data processor is offline.

[0093] According to an embodiment of the present invention, the hardware connection detection circuit on the server motherboard is responsible for real-time monitoring of the physical connection status between the data processor and the server motherboard to confirm whether the data processor is correctly installed in the server. The circuit continuously sends a detection signal to the data processor interface. If a response signal from the data processor can be received, it means that the connection between the two is normal; if no response signal is received, the power supply line of the data processor will be further checked through the power supply detection module to confirm whether there is a power supply problem.

[0094] At the same time, the server's operating system will periodically scan the hardware device list to check whether the data processor appears in the list of identifiable devices. If the device information of the data processor is still not found after multiple scans, and the hardware connection detection circuit does not receive a response signal, then it can be determined that the data processor is offline. In addition, the results and timestamps of each detection will be saved through the logging module for subsequent tracing and troubleshooting.

[0095] If it is determined that the data processor is offline, the server will start the hardware resource release process. This process will traverse all devices associated with the data processor and obtain the hardware resources that these devices need to occupy through the device driver. Then, according to the preset resource release rules, these resources will be released back to the available resource pool one by one. For processor cores and memory resources, the mapping relationship between devices and resources will be released, and the corresponding resources will be marked as idle; for network bandwidth and storage channels, the corresponding connection ports will be closed and included in the available resource queue. During the release process, detailed information on resource release will be recorded, including the type, quantity, corresponding devices, etc. of released resources, for reference when resources are reallocated later.

[0096] Taking a data processor equipped with a server as an example, the data processor is connected to multiple devices, such as two high-performance graphics cards for graphics processing, three large-capacity hard disks for data storage, and multiple network adapters for data transmission. When the server management system detects no response signal at the data processor interface through the hardware connection detection circuit and the operating system fails to recognize the data processor device after multiple scans, it is determined that the data processor is in an offline state. Subsequently, the hardware resource release process is immediately carried out. These released hardware resources can be used by other online devices within the server or devices subsequently connected, avoiding resource idleness and waste and ensuring the efficient utilization of server resources.

[0097] By determining the installation status of the data processor in the server and releasing the hardware resources allocated for the devices to be connected when it is offline, idle resources can be recovered in a timely manner, avoiding resource waste caused by device offline, thereby improving the overall utilization rate of server resources.

[0098] Such as Figure 4 As shown, another embodiment of the resource management method includes operations S401 to S412.

[0099] In operation S401, start the server.

[0100] In operation S402, the server performs a power-on self-test operation.

[0101] In operation S403, determine whether preset resource information is obtained.

[0102] In operation S404, based on the preset resource information, allocate corresponding hardware resources to the devices to be connected to the data processor.

[0103] In operation S405, determine whether the data processor is online.

[0104] In operation S406, identify the identifiers of the devices actually connected to the data processor to determine the device parameters of each device in the data processor.

[0105] In operation S407, determine whether the monitored device parameters are consistent with the parameters in the preset resource information.

[0106] In operation S408, continuously monitor the status information of the hot-swap interface in the server.

[0107] In operation S409, determine whether the status information of the hot-swap interface has changed.

[0108] In operation S410, based on the preset resource information, allocate corresponding hardware resources to each device connected to the data processor.

[0109] In operation S411, update the preset resource information according to the actually connected device parameters.

[0110] In operation S412, release the hardware resources.

[0111] Through the above operations, during the entire process from the server startup to operation, precise management and dynamic adjustment of resources can be achieved. The power-on self-test process ensures the readiness of the server hardware, and the allocation of hardware resources according to the preset resource information lays the foundation for the access of devices. Real-time monitoring of the online status of the data processor, identification of the identifiers and parameters of the connected devices can ensure that the resource allocation matches the actual device situation. Continuously monitoring the status of the hot-plug interface, once a status change is detected, reallocate resources and update the preset parameters according to the preset information, so that the server can respond in a timely manner to the dynamic access and removal of devices, avoiding waste or shortage of resources.

[0112] This series of measures not only improves the utilization rate of server resources, but also enhances the system's adaptability to hardware changes, ensures the stable and efficient operation of the server, and at the same time reduces the complexity and cost of operation and maintenance. Through this refined resource management and dynamic allocation, the server can more flexibly handle various workloads, improving the overall operation efficiency and reliability.

[0113] According to an embodiment of the present invention, the resource management method further includes: based on the preset resource information, allocate corresponding data communication resources to the switch where the data processor is located, where the switch is used for data interaction between the data processor and other devices; in the case of determining that the hardware resources are dynamically adjusted, correspondingly update the data communication resources allocated to the switch.

[0114] According to an embodiment of the present invention, when allocating data communication resources to the switch where the data processor is located, it is necessary to deeply analyze the preset resource information. Read the preset resource information containing key contents such as the performance parameters of the data processor, data throughput requirements, the number and types of connected devices, etc. from the storage device. Subsequently, calculate the data transmission requirements of the data processor in the normal operation state according to these preset resource information, which includes parameters such as the total required bandwidth, the number of ports, and the priority settings.

[0115] According to the model of the switch, port specifications, and current load conditions, formulate corresponding resource allocation strategies. For switches that support port aggregation technology, multiple physical ports can be bundled into a logical port to meet the high-bandwidth requirements of the data processor. For data transmission tasks with higher priorities, dedicated communication channels will be reserved to ensure the real-time and stability of data interaction. During the allocation process, complete the allocation of data communication resources through the management interface of the switch and record the detailed information of the allocation for subsequent management and maintenance.

[0116] When it is detected that the hardware resources of the data processor have been dynamically adjusted, the update process of the data communication resources will be immediately started. First, obtain the specific information of the hardware resource adjustment, such as the increase in data processing volume caused by newly added devices or the resource idle caused by device removal. Then, re-evaluate the data transmission requirements of the data processor and calculate the required change amount of the data communication resources according to the new requirements.

[0117] When it is detected that the hardware resources of the data processor have been dynamically adjusted, the update process of the data communication resources will be immediately started. First, obtain the specific information of the hardware resource adjustment, for example, the increase in data processing volume caused by newly added devices or the resource idle caused by device removal. Then, re-evaluate the data transmission requirements of the data processor and calculate the required change amount of the data communication resources according to the new requirements.

[0118] Compare the calculation result with the resources currently allocated by the switch to determine the part that needs to be adjusted. If the data transmission requirements increase, additional resources such as bandwidth and ports will be allocated from the available resource pool of the switch, and the relevant parameters will be reconfigured. If the requirements decrease, the redundant resources will be recycled to optimize the resource utilization efficiency. During the adjustment process, the ongoing data transmission tasks will be given priority to be unaffected. An incremental adjustment method will be adopted to modify the configuration parameters of the switch in stages, and the data transmission status will be monitored in real time to ensure the continuity and stability of data interaction.

[0119] By allocating data communication resources for the switch based on the preset resource information and synchronously updating them when the hardware resources are dynamically adjusted, it can ensure that the data interaction between the data processor and other devices matches the actual requirements. When devices are connected or removed, the bandwidth, ports and other resources can be accurately allocated, which not only avoids waste caused by resource redundancy, but also prevents insufficient resources from affecting the data transmission efficiency, thereby improving the stability and fluency of data interaction, ensuring the efficient operation of the server cluster, and reducing the operation and maintenance costs and the risk of network congestion.

[0120] According to an embodiment of the present invention, the resource management method further includes: mapping the control registers of the devices connected to the data processor to a specific memory area within the address space of the central processing unit; allocating corresponding port numbers to each device connected to the data processor so that the central processing unit can communicate with the devices.

[0121] According to an embodiment of the present invention, during the initialization stage of the operating system, the device driver is responsible for mapping the device control registers to the memory address space. The driver first obtains the physical address of the device control register through the system bus configuration information. Subsequently, the memory management unit of the operating system selects an unoccupied memory area within the address space of the central processing unit according to the current usage of the system memory.

[0122] The memory management unit establishes a mapping relationship through the page table mechanism. Specifically, it associates the physical address of the device control register with a selected virtual address, and sets the physical address field, access permission field (such as read, write, and executable attributes), and cache control field (determining whether to enable the cache mechanism) in the page table entry, thus completing the mapping configuration. After the mapping is completed, the central processing unit can read and write the device control register connected to the data processor just like accessing a normal memory address, realizing the control of the device and the query of its status.

[0123] In addition, during the device initialization process, the device management module is responsible for port number allocation. The device management module maintains a port number resource pool, which records all available, allocated, and reserved port number information. When a new device is connected to the system, the device management module selects an unused port number from the resource pool and allocates it to the device.

[0124] The allocation of port numbers follows certain rules and strategies. For system-critical devices such as hard disk controllers and network cards, port numbers within a fixed range are preferentially allocated to ensure that device drivers and operating system components can quickly identify and access them. After the allocation is completed, the device management module updates the status of the port number resource pool and records the port number information in the device's configuration information table. At the same time, the system binds the port number to the device through the device driver. When the device communicates with the central processing unit, the port number serves as a communication identifier to help the central processing unit accurately locate the target device and achieve data interaction.

[0125] Mapping the device control register to a specific area of the central processing unit's address space and allocating a port number to the device enables the central processing unit to control the device and query its status in a unified memory access manner, and accurately locate the target device through the port number to achieve efficient data interaction.

[0126] According to an embodiment of the present invention, the resource management method further includes: obtaining the data generated during the communication between the central processing unit and the device connected to the data processor; and processing the data using the data processor.

[0127] According to an embodiment of the present invention, during the operation of the server, the data generated during the communication between the central processing unit and the device connected to the data processor can be captured through a network interface controller or a bus monitoring mechanism. For communication data transmitted over the network, the switch port mirroring function can be used to copy a copy of the communication data of the specified port and transmit it to the data acquisition device. The data acquisition device filters and screens the data according to preset rules, only retains the data related to the communication between the central processing unit and the target device, and stores this data in the cache area.

[0128] If the data is transmitted through the system bus, the bus arbiter will record relevant information during the data transmission. By reading the records of the bus arbiter, the data transmission situation between the central processing unit and the device can be located, and then the corresponding data signals can be intercepted from the bus. After these signals are decoded and converted, they will be stored in the specified memory area to complete the data acquisition.

[0129] After the data acquisition is completed, according to the type and processing requirements of the data, the data is transmitted to the data processor. This data transmission process can be achieved through direct memory access technology, that is, bypassing the central processing unit and directly establishing a transmission channel between the memory and the data processor. This method can reduce the occupancy of the central processing unit during the data transmission process and improve the data transmission efficiency.

[0130] Based on the above resource management method, the present invention also provides a resource management device. The following will be combined with Figure 5 to describe this device in detail.

[0131] Figure 5 The structural block diagram of the resource management device according to an embodiment of the present invention is shown.

[0132] As Figure 5 shown, the resource management device 500 of this embodiment includes an information acquisition module 510, a resource allocation module 520, a parameter monitoring module 530, and a resource adjustment module 540.

[0133] The information acquisition module 510 is used to obtain the preset resource information of the data processor from the storage unit of the server in response to the startup instruction of the server. In one embodiment, the information acquisition module 510 can be used to perform the operation S210 described above, which will not be elaborated here.

[0134] The resource allocation module 520 is used to allocate corresponding hardware resources to the devices to be connected to the data processor based on the preset resource information. In one embodiment, the resource allocation module 520 can be used to perform the operation S220 described above, which will not be elaborated here.

[0135] The parameter monitoring module 530 is used to monitor the device parameters of the devices actually connected to the data processor, so as to update the preset resource information according to the actually connected device parameters when it is determined that the actually connected device parameters are inconsistent with the parameters in the preset resource information. In one embodiment, the parameter monitoring module 530 can be used to perform the operation S230 described above, which will not be elaborated here.

[0136] The resource adjustment module 540 is used to dynamically adjust the hardware resources of the devices in the data processor whose device parameters have changed relative to the preset resource information by using the updated resource information. In one embodiment, the resource adjustment module 540 can be used to execute the operation S240 described above, which will not be elaborated here.

[0137] According to an embodiment of the present invention, the parameter monitoring module 530 includes an identifier recognition sub-module and an identifier parsing sub-module.

[0138] The identifier recognition sub-module is used to recognize the identifiers of the devices actually connected to the data processor, where the identifier is a digital identifier generated by encoding the device parameters.

[0139] The identifier parsing sub-module is used to parse the recognized identifiers to determine the device parameters of each device connected to the data processor.

[0140] According to an embodiment of the present invention, the resource management device 500 further includes an interface monitoring module and a parameter determination module.

[0141] The interface monitoring module is used to continuously monitor the status information of the hot-pluggable interfaces in the server when it is determined that the server enters the running state.

[0142] The parameter determination module is used to recognize the identifiers of the connected devices to determine the device parameters of the connected devices when the status information indicates that there are devices dynamically connected.

[0143] According to an embodiment of the present invention, the resource management device 500 further includes a parameter comparison module and a resource allocation module.

[0144] The parameter comparison module is used to compare the monitored device parameters with the parameters in the preset resource information to obtain a comparison result.

[0145] The resource allocation module is used to allocate corresponding hardware resources to each device connected to the data processor according to the preset resource information when the comparison result indicates that the parameters are consistent.

[0146] According to an embodiment of the present invention, the resource adjustment module 540 includes a restart program word module and a resource adjustment sub-module.

[0147] The restart program word module is used to restart the driver program of the data processor to read the updated resource information.

[0148] The resource adjustment sub-module is used to adjust the hardware resources of the devices in the data processor whose device parameters have changed relative to the preset resource information according to the difference between the updated resource information and the preset resource information.

[0149] According to an embodiment of the present invention, the resource adjustment sub-module includes a type determination unit and a dynamic adjustment unit.

[0150] The type determination unit is configured to determine the change type according to the difference between the updated resource information and the preset resource information.

[0151] The dynamic adjustment unit is configured to perform dynamic adjustment of the hardware resources of the devices with changed device parameters in the data processor according to the preset mapping relationship between the change type and the resource management operation, where the resource management operation includes a resource recovery operation and a resource allocation operation.

[0152] According to an embodiment of the present invention, the dynamic adjustment unit includes a resource allocation sub-unit and a resource recovery sub-unit.

[0153] The resource allocation sub-unit is configured to perform a resource allocation operation on the devices newly connected to the data processor based on the preset mapping relationship when it is determined that the change type is an increase type.

[0154] The resource recovery sub-unit is configured to perform a resource recovery operation on the devices removed from the data processor based on the preset mapping relationship when it is determined that the change type is a decrease type.

[0155] According to an embodiment of the present invention, the information acquisition module 510 includes a power-on self-test sub-module, an information acquisition sub-module, and an iteration sub-module.

[0156] The power-on self-test sub-module is configured to perform a power-on self-test operation on the server in response to the startup instruction of the server.

[0157] The information acquisition sub-module is configured to obtain the preset resource information from the storage unit when it is determined that all hardware components in the server are ready.

[0158] The iteration sub-module is configured to repeatedly perform the operation of power-on self-testing the server until the preset resource information is obtained when it is determined that the obtained preset resource information meets the preset conditions.

[0159] According to an embodiment of the present invention, the resource management device 500 further includes a status determination module and a resource release module.

[0160] The status determination module is configured to determine the installation status of the data processor in the server.

[0161] The resource release module is configured to release the hardware resources allocated to the devices of the data processor to be connected when it is determined that the installation status indicates that the data processor is offline.

[0162] According to an embodiment of the present invention, the resource management device 500 further includes a switching allocation module and a switching update module.

[0163] An exchange allocation module, configured to allocate corresponding data communication resources to a switch where a data processor is located based on preset resource information, where the switch is used for data interaction between the data processor and other devices.

[0164] An exchange update module, configured to correspondingly update the data communication resources allocated to the switch when it is determined that the hardware resources are dynamically adjusted.

[0165] According to an embodiment of the present invention, the resource management device 500 further includes a mapped memory module and a port allocation module.

[0166] The mapped memory module is configured to map the control registers of the devices accessing the data processor to a specific memory area within the central processor address space.

[0167] The port allocation module is configured to allocate corresponding port numbers to the devices accessing the data processor, so that the central processor can communicate with the devices.

[0168] According to an embodiment of the present invention, the resource management device 500 further includes a data acquisition module and a data processing module.

[0169] The data acquisition module is configured to acquire the data generated during the communication between the central processor and the devices accessing the data processor.

[0170] The data processing module is configured to process the data using the data processor.

[0171] According to an embodiment of the present invention, any combination of the information acquisition module 510, the resource allocation module 520, the parameter monitoring module 530, and the resource adjustment module 540 can be integrated into one module, or any one of them can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present invention, at least one of the information acquisition module 510, the resource allocation module 520, the parameter monitoring module 530, and the resource adjustment module 540 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on substrate, a system on package, an application specific integrated circuit (ASIC), or any other reasonable way of integrating or packaging circuits, etc., implemented by hardware or firmware, or implemented in any one of the three implementation manners of software, hardware, and firmware, or in any appropriate combination of several of them. Alternatively, at least one of the information acquisition module 510, the resource allocation module 520, the parameter monitoring module 530, and the resource adjustment module 540 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.

[0172] It should be noted that the resource management device part in the embodiment of the present invention corresponds to the resource management method part in the embodiment of the present invention. For the description of the resource management device part, please refer to the operation resource management part for details and will not be elaborated here.

[0173] Figure 6 The block diagram of an electronic device suitable for implementing the resource management method according to an embodiment of the present invention is shown.

[0174] As Figure 6 shown, the electronic device 600 according to an embodiment of the present invention includes a processor 601, which can perform various appropriate actions and processes according to the program stored in the read only memory (ROM) 602 or the program loaded from the storage part 608 into the random access memory (RAM) 603. The processor 601 can include, for example, a general microprocessor (such as a CPU), an instruction set processor, and / or a related chipset, and / or a dedicated microprocessor (such as an application specific integrated circuit (ASIC)), etc. The processor 601 can also include on-board memory for caching purposes. The processor 601 can include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.

[0175] In the RAM 603, various programs and data required for the operation of the electronic device 600 are stored. The processor 601, the ROM 602, and the RAM 603 are connected to each other via the bus 604. The processor 601 performs various operations of the method flow according to the embodiments of the present invention by executing the programs in the ROM 602 and / or the RAM 603. It should be noted that the programs can also be stored in one or more memories other than the ROM 602 and the RAM 603. The processor 601 can also perform various operations of the method flow according to the embodiments of the present invention by executing the programs stored in one or more memories.

[0176] According to an embodiment of the present invention, the electronic device 600 may further include an input / output (I / O) interface 605, and the input / output (I / O) interface 605 is also connected to the bus 604. The electronic device 600 may further include one or more of the following components connected to the input / output (I / O) interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage portion 608 including a hard disk, etc.; and a communication portion 609 including a network interface card such as a LAN card, a modem, etc. The communication portion 609 performs communication processing via a network such as the Internet. The drive 610 is also connected to the input / output (I / O) interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read from it can be installed into the storage portion 608 as needed.

[0177] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist separately without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiments of the present invention is implemented.

[0178] According to an embodiment of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In the present invention, the computer-readable storage medium may be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present invention, the computer-readable storage medium may include the above-described ROM 602 and / or RAM 603 and / or one or more memories other than ROM 602 and RAM 603.

[0179] An embodiment of the present invention also includes a computer program product, which includes a computer program that contains program code for executing the method shown in the flowchart. When the computer program product runs in a computer system, the program code is used to enable the computer system to implement the resource management method provided by the embodiment of the present invention.

[0180] When the computer program is executed by the processor 601, it executes the above functions defined in the system / apparatus of the embodiment of the present invention. According to an embodiment of the present invention, the above-described systems, apparatuses, modules, units, etc. can be implemented by computer program modules.

[0181] In one embodiment, the computer program can rely on tangible storage media such as optical storage devices and magnetic storage devices. In another embodiment, the computer program can also be transmitted and distributed in the form of a signal on a network medium, and is downloaded and installed through the communication part 609, and / or installed from the removable medium 611. The program code included in the computer program can be transmitted by any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0182] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, it executes the above functions defined in the system of the embodiment of the present invention. According to an embodiment of the present invention, the above-described systems, devices, apparatuses, modules, units, etc. can be implemented by computer program modules.

[0183] In accordance with embodiments of the present invention, program code for executing the computer programs provided by the embodiments of the present invention can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, such as Java, C++, Python, the "C" language, or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or alternatively, can be connected to an external computing device (e.g., by connecting through the Internet using an Internet service provider).

[0184] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, and the above-mentioned module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks can occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0185] Those skilled in the art can understand that the features described in the various embodiments of the present invention can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present invention. In particular, without departing from the spirit and teachings of the present invention, the features described in the various embodiments of the present invention can be combined and / or combined in various ways. All such combinations and / or combinations fall within the scope of the present invention.

[0186] The above describes the embodiments of the present invention. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present invention. Although the embodiments are described separately above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Without departing from the scope of the present invention, those skilled in the art can make various substitutions and modifications, and all such substitutions and modifications should fall within the scope of the present invention.

Claims

1. A resource management method, characterized in that, The method includes: In response to a startup instruction from the server, obtaining preset resource information of a data processor from a storage unit of the server; Based on the preset resource information, allocating corresponding hardware resources to devices to be connected to the data processor; When it is determined that the server enters the running state, continuously monitoring device parameters of devices actually connected to the data processor, so that when it is determined that the device parameters actually connected are inconsistent with the parameters in the preset resource information, updating the preset resource information according to the device parameters actually connected; Using the updated resource information to dynamically adjust the hardware resources of devices in the data processor whose device parameters have changed relative to the preset resource information; The using the updated resource information to dynamically adjust the hardware resources of devices in the data processor whose device parameters have changed relative to the preset resource information includes: Restarting a driver program of the data processor to read the updated resource information. During the restart process, the driver program reloads device drivers according to an initialization process and establishes a communication connection with the changed devices; According to the difference between the updated resource information and the preset resource information, adjusting the hardware resources of devices in the data processor whose device parameters have changed relative to the preset resource information.

2. The method according to claim 1, characterized in that, The monitoring of device parameters of devices actually connected to the data processor includes: Identifying identifiers of devices actually connected to the data processor, where the identifier is a digital identifier generated by encoding device parameters; Parsing the identified identifiers to determine the device parameters of each device connected to the data processor.

3. The method according to claim 2, characterized in that, The method includes: When it is determined that the server enters the running state, continuously monitoring status information of a hot-swap interface in the server; When the status information indicates that a device is dynamically connected, identifying the identifier of the connected device to determine the device parameters of the connected device.

4. The method according to claim 1, wherein The method includes: Comparing the monitored device parameters with the parameters in the preset resource information to obtain a comparison result; When the comparison result indicates that the parameters are consistent, allocating corresponding hardware resources to each device connected to the data processor according to the preset resource information.

5. The method according to claim 1, wherein The adjusting the hardware resources of devices with changed device parameters in the data processor according to the difference between the updated resource information and the preset resource information includes: Determining a change type according to the difference between the updated resource information and the preset resource information; According to a preset mapping relationship between the change type and a resource management operation, dynamically adjusting the hardware resources of devices in the data processor whose device parameters have changed, where the resource management operation includes a resource recovery operation and a resource allocation operation.

6. The method according to claim 5, characterized in that The dynamically adjusting the hardware resources of devices in the data processor whose device parameters have changed according to the preset mapping relationship between the change type and the resource management operation includes: When it is determined that the change type is an increase type, based on the preset mapping relationship, perform a resource allocation operation on the device newly connected to the data processor; When it is determined that the change type is a decrease type, based on the preset mapping relationship, perform a resource recovery operation on the device removed from the data processor.

7. The method according to claim 1, characterized in that, In response to the startup instruction of the server, obtain the preset resource information of the data processor from the storage unit of the server, including: In response to the startup instruction of the server, perform a power-on self-test operation on the server; When it is determined that all hardware components in the server are ready, obtain the preset resource information from the storage unit; When it is determined that obtaining the preset resource information meets the preset conditions, repeatedly perform the operation of performing a power-on self-test on the server until the preset resource information is obtained.

8. The method according to claim 1, wherein The method further includes: Determine the installation status of the data processor in the server; When it is determined that the installation status indicates that the data processor is offline, release the hardware resources allocated to the device to be connected to the data processor.

9. The method according to claim 1, wherein The method further includes: Based on the preset resource information, allocate corresponding data communication resources to the switch where the data processor is located, where the switch is used for data interaction between the data processor and other devices; When it is determined that the hardware resources are dynamically adjusted, correspondingly update the data communication resources allocated to the switch.

10. The method according to claim 1, characterized in that, The method further includes: Map the control registers of the devices connected to the data processor to a specific memory area within the central processor address space; Allocate corresponding port numbers to each of the devices connected to the data processor so that the central processor can communicate with the devices.

11. The method according to claim 10, characterized in that, The method further includes: Obtain the data generated during the communication between the central processor and the devices connected to the data processor; Use the data processor to process the data.

12. An electronic device, including: One or more processors; A memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 11.

13. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, The computer program or instruction, when executed by the processor, implements the steps of the method according to any one of claims 1 to 11.

14. A computer program product, comprising a computer program, characterized in that, The computer program, when executed by the processor, implements the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • PCIe resource allocation method and device for server and electronic equipment

    CN119179575A