Resource query method and computing device
By configuring the Redfish interface in the computing device cluster management node, response resources conforming to different versions of the Redfish protocol are generated, solving the problem of interface differences between computing devices and realizing a unified resource query interface and an efficient resource query process.
Patent Information
- Application Number
- CN202610002509.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-04
- Publication Date
- 2026-04-28
AI Technical Summary
In existing technologies, the centralized management software for various computing equipment manufacturers lacks a unified northbound interface standard. This results in upper-layer management software needing to perform specific interface adaptations when connecting to equipment from different manufacturers, increasing the workload of system integration and reducing the flexibility and scalability of data center management.
This paper provides a resource query method that configures a Redfish interface in the management node of a computing device cluster, generates response resources based on resource query requests and interface protocols, realizes resource format conversion, ensures that response resources comply with the requirements of different versions of the Redfish protocol, and provides a unified resource query interface.
It simplifies the differentiated processing flow of computing devices in the upper-layer system, improves the efficiency of resource query, ensures the accuracy and standardization of response resources, and reduces the complexity of development and maintenance of management nodes.
Smart Images

Figure CN121935309A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of server technology, and in particular to a resource query method and computing device. Background Technology
[0002] With the advancement of computer technology, efficient management of computing devices has become a key concern in the industry. Centralized device management software can provide unified management of all computing devices within a data center and offer a unified northbound interface to upper-layer systems for invocation. Through centralized device management software, administrators can efficiently complete a series of management tasks such as monitoring the status of computing devices, adjusting configurations, and troubleshooting, thereby improving the operational efficiency of the data center. While current vendors all possess their own centralized device management software, a unified northbound interface standard has not been established. Each vendor defines its own proprietary unified northbound interface based on the characteristics of its products. This necessitates targeted interface adaptation development for upper-layer management software when interfacing with centralized management nodes from different vendors. This not only increases the workload of system integration but also reduces the flexibility and scalability of the entire data center management system. Therefore, defining a unified northbound interface that can mask the differences between different devices, simplifying the upper-layer system's handling of various device variations and reducing the development and maintenance complexity of upper-layer management nodes, has become an urgent technical problem to be solved. Summary of the Invention
[0003] This application provides a resource query method and computing device, which can provide a unified resource query interface for computing device clusters to the upper-layer system, shield the differences in resource query methods of different computing devices, simplify the resource query process, and improve resource query efficiency.
[0004] To achieve the above objectives, the embodiments of this application adopt the following technical solutions: In a first aspect, embodiments of this application provide a resource query method applied to a management node of a computing device cluster. The management node is configured with a Redfish interface. The method includes: obtaining a resource query request sent by an upper-layer system; generating a response resource in response to the resource query request based on the resource query parameters in the resource query request and the interface protocol of the Redfish interface; and returning the response resource to the upper-layer system.
[0005] Based on this solution, the resource query request sent by the upper-layer system is obtained. According to the resource query parameters in the resource query request and the interface protocol of the Redfish interface, a response resource is generated to respond to the resource query request and returned to the upper-layer system. In this way, the resource format of the computing device can be converted according to the requirements of different versions of the Redfish protocol, so that the response resource can meet the requirements of each version of the Redfish protocol.
[0006] In another possible implementation, the above-mentioned generation of response resources to respond to resource query requests based on the request type of the resource query request and the interface protocol of the Redfish interface includes: when the resource category in the resource query parameters is a node resource category used to query the node resources of the management node, generating response resources to respond to resource query requests based on the Redfish protocol; the response resources include the protocol version of the Redfish protocol, the node identifier of the management node, the resource query methods supported by the management node, the device identifiers and / or resource access paths of each computing device in the computing device cluster.
[0007] Based on this method, for node resource category query scenarios, a response resource containing protocol version, node identifier, query method, device identifier / access path is generated through the Redfish protocol. This solves the problem that the upper-layer system cannot quickly obtain the basic capabilities of the management node and the overview of the cluster devices, allowing the upper-layer system to quickly grasp the management scope and interaction rules.
[0008] In another possible implementation, the above-mentioned generation of response resources to respond to resource query requests based on the request type of the resource query request and the interface protocol of the Redfish interface includes: if the resource category in the resource query parameters is a cluster resource category used to query the cluster resources of the computing device cluster, querying the target device cluster resources corresponding to the device identifier and the resource type in the resource query parameters in the resource storage module; writing the target device resources into the resource generation template corresponding to the target version of the Redfish protocol to obtain the response resources.
[0009] Based on this solution, for cluster resource category query scenarios, the target cluster resource is first accurately located by device identifier and resource type to be queried, and then the response is assembled by Redfish protocol template to solve the problems of low accuracy and inconsistent format of cluster-level resource query, ensuring that the cluster resource data obtained by the upper layer system is both accurate and conforms to the Redfish standard.
[0010] In another possible implementation, the above-mentioned generation of response resources to respond to resource query requests based on the request type of the resource query request and the interface protocol of the Redfish interface includes: when the resource category in the resource query parameters is a device resource category used to query device resources of each computing device in the computing device cluster, querying the target device resource corresponding to the device identifier and resource link in the resource storage module according to the device identifier and resource link of the device to be queried in the resource query parameters; writing the target device resource into the resource generation template corresponding to the target version of the Redfish protocol to obtain the response resource.
[0011] Based on this solution, for the scenario of querying equipment resource categories, the target equipment resources are queried by equipment identifier and resource link and Redfish template is applied to solve the problems of unclear query path and chaotic response format of single-device level resources. This enables accurate positioning and standardized output of single-device resource queries, and adapts to the query requirements of upper-layer systems for single-device details.
[0012] In another possible implementation, the target device resources are written into the resource generation template corresponding to the target version of the Redfish protocol to obtain response resources. This includes: writing the target device data into the data generation template corresponding to the target version of the Redfish protocol to obtain intermediate data; and replacing the preset fields in the intermediate data according to the response resource generation configuration to obtain response data.
[0013] Based on this solution, writing target device resources into the template is split into two steps: writing the template to obtain intermediate data and replacing preset fields according to the configuration. This solves the problems of poor field adaptability and low flexibility when directly generating responses. It supports adjusting field content through response resource generation configuration, so that response resources can adapt to the field requirements of different upper-layer systems (such as custom identifiers, supplementary fields, etc.).
[0014] In another possible implementation, the above method further includes: if the initial configuration includes an interface protocol version configuration, using the interface protocol version in the interface protocol version configuration as the target version; if the initial configuration does not include an interface protocol version configuration, determining the target version of the Redfish interface protocol based on the preset protocol version of the interface protocol.
[0015] Based on this solution, the logic of determining the target version is clarified: if there is an initial configuration, it is followed; if there is no configuration, it is determined by the preset version. This solves the problem of interaction failure caused by the lack of basis for Redfish protocol version selection and inconsistent versions. It ensures that the response resources generated by the management node match the Redfish version supported by the upper layer system and avoids query anomalies caused by version incompatibility.
[0016] In another possible implementation, the method further includes: obtaining the user's initial configuration in the management node; the initial configuration includes at least one of the following: resource acquisition configuration, interface protocol version configuration, response resource generation configuration, and resource type matching configuration; wherein, the resource acquisition configuration is used to instruct the management node to acquire raw device resources from each computing device in the computing device cluster; the interface protocol version configuration is used to indicate the protocol version corresponding to the interface protocol of the Redfish interface; the response resource generation configuration is used to instruct the generation of response resources; and the resource type matching configuration is used to indicate the resource type of each computing device in the computing device cluster.
[0017] Based on this solution, by obtaining initial configurations such as resource acquisition, protocol version, response generation, and resource type matching, the problem of management nodes having no configuration to rely on and being unable to adapt to different clusters and upper-layer requirements is solved. This allows management nodes to flexibly adjust resource acquisition methods, protocol versions, response formats, and resource type matching rules according to user configurations, thereby improving system adaptability.
[0018] In another possible implementation, the above method further includes: acquiring the original device resources of each computing device in the computing device cluster according to the resource acquisition configuration; wherein the original device resources include original resource links and original device resources; matching the preset resource type with the original device resources to obtain the resource type that matches the original device resources; updating the original resource links based on the updated device identifiers of each computing device generated according to the device identifier configuration to obtain updated resource links, and updating the original device resources based on the generated updated resource links of each computing device to obtain updated device resources; and storing the updated device identifiers, original device resources, resource types that match the original device resources, and updated device resources containing updated resource links and updated device resources in the resource storage module.
[0019] Based on this solution, the entire process from obtaining the original device resources to matching resource types, updating device identifiers and resource links, and finally storing the updated resources is completed. This solves the problems of non-standard original device resource formats, invalid identifiers and links, and inability to be directly used for querying. It provides basic resource data with unified format, valid identifiers, and clear types for subsequent queries, ensuring that the target resource can be quickly located during the query.
[0020] Secondly, embodiments of this application provide a resource query device, which includes: a request acquisition module for acquiring a resource query request sent by an upper-layer system; a response resource generation module for generating a response resource in response to the resource query request according to the request type of the resource query request and the interface protocol of the Redfish interface; and a response resource return module for returning the response resource to the upper-layer system.
[0021] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program for executing the resource query method provided in the first aspect above.
[0022] Fourthly, embodiments of this application also provide a computing device, including: one or more processors; and a memory configured to store one or more programs; wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the resource query method as described in any one of the first aspects above.
[0023] Fifthly, embodiments of this application provide a computer program product that, when instructions in the computer program product are executed by a processor, performs the resource query method provided in the first aspect above. Attached Figure Description
[0024] Figure 1 A computing device resource tree is provided for an embodiment of this application.
[0025] Figure 2 This is a schematic diagram of a system architecture provided for an embodiment of this application.
[0026] Figure 3 This is a flowchart illustrating a resource query method provided in an embodiment of this application.
[0027] Figure 4 This is a flowchart illustrating a protocol version determination method provided in an embodiment of this application.
[0028] Figure 5 This is a schematic diagram of a resource query device provided in an embodiment of this application.
[0029] Figure 6 This is a schematic diagram of a computing device provided in an embodiment of this application. Detailed Implementation
[0030] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. To facilitate a clear description of the technical solutions of the embodiments of this application, the use of terms such as "first," "second," etc., in the embodiments of this application is for illustrative purposes and to distinguish the objects being described. There is no particular order between them, nor does it indicate a specific limitation on the number of devices in the embodiments of this application, and they do not constitute any limitation on the embodiments of this application.
[0031] To better understand the embodiments of this application, the relevant technologies of the embodiments of this application will be described below.
[0032] A RESTful Application Programming Interface (API) specifically refers to an interface that conforms to the REST design style. The current Redfish protocol uses the Open Data Protocol (OData), a specification developed by the Organization for the Advancement of Structured Information Standards (OASIS) to define how RESTful services are created and accessed. Using the OData protocol (such as OData v4), queryable and operable RESTful APIs can be built in a standardized and easy manner. It should be noted that the Redfish interface in this embodiment can be an interface conforming to the REST design style; that is, the Redfish interface can be a RESTful interface.
[0033] As a management standard, Redfish's core objective is to provide simple and secure management capabilities for converged architectures, hybrid information technology (IT), and software-defined data centers (SDDCs). This standard employs RESTful interface semantics to access data defined in a schema format, thereby enabling out-of-band system management functions. The Redfish standard (i.e., the protocol) is applicable to large-scale server scenarios, including standalone servers, rack and blade server environments, and extends to large-scale cloud environments and data centers. The Redfish standard includes a hypermedia application programming interface (API) as the Redfish interface, allowing programs to access data content from the schema file.
[0034] In the Redfish protocol suite, a Uniform Resource Identifier (URI) is used to identify a single resource, a service, or a group of resources (i.e., a collection of resources). Typically, a URI consists of three parts: the first part includes the service method (such as the communication protocol), the host's Internet Protocol (IP) address or domain name (and in some scenarios, the port number); the second part includes the root service identifier and the Redfish protocol version; and the third part is the resource-specific identifier. For example, with a URI URL of "https: / / mgmt.vendor.com / redfish / v1 / Systems / 1 / EthernetInterfaces / 1", the first part shows the service method as HTTPS (i.e., communication is achieved via the HTTPS protocol), and the host domain name as mgmt.vendor.com; the second part shows the root service identifier as "redfish" and the Redfish protocol version as "v1", with " / redfish / v1" typically referred to as the root URL; and the third part, the resource-specific identifier " / Systems / 1 / EthernetInterfaces / 1", is generally called the resource path.
[0035] In some examples, the root URL from the second part above can be combined with the resource path from the third part to form the URI of a resource. This URI uniquely identifies the associated resource of a Redfish device. For example, after the upper-layer system sends a POST request, the response header (i.e., the field indicating the location of the new resource created by the POST request) might return the URI " / redfish / v1 / Systems / 2". To access this new resource, the first part (i.e., service method, host IP address, or domain name) must be added before the above URI; assuming the server domain name is mgmt.vendor.com, the complete URL for accessing the new resource would be "https: / / mgmt.vendor.com / redfish / v1 / Systems / 2".
[0036] The Redfish protocol is implemented based on Hypertext Transfer Protocol (HTTP) or Secure Hypertext Transfer Protocol (HTTPS). In this architecture, upper-layer systems can send requests (i.e., request messages) to the management node of the computing device cluster, and the management node of the computing device cluster returns responses (i.e., response messages) to the upper-layer system. Request messages typically include request headers and a request body (i.e., request message body); response messages typically include response headers, a response body (i.e., response message body), and a response code (i.e., HTTP status code). The Redfish protocol specifies request types including GET, POST, PATCH, and DELETE, with the following functions: GET requests are used to retrieve resource representation information (i.e., resource description or resource); POST requests are used to create new resources; PATCH requests are used to modify resources (such as updating resource attributes); and DELETE requests are used to delete specified resources. It should be noted that resources in the Redfish protocol are represented in JSON (JavaScript Object Notation) media type (i.e., "application / json"), and in HTTP messages, this media type must be specified through the Content-Type attribute of the request or response header.
[0037] As can be seen, the Redfish protocol reduces the difficulty of device management for users by abstracting computing devices as independent resources and providing corresponding API interfaces in a RESTful manner. Here, " / redfish / v1" is the root URL (i.e., the root resource), and all other resources extend from the root resource, forming a resource tree. For the specific structure, please refer to [reference needed]. Figure 1 .
[0038] As shown in the computing device resource tree in Figure 1, the next level below the root resource " / redfish / v1" includes sub-resources such as Systems, Managers, Chassis, Event, and Task; the next level below that includes the subordinate resources of the aforementioned sub-resources. For example, the next level below the Systems resource can contain one or more specific system resources (such as the resource identified as "437XR1138R2", where "437XR1138R2" is the ID of the specific system resource). Each specific system resource can contain sub-resources such as BIOS resources and Processors, and these sub-resources can further contain other subordinate resources. Similarly, the next level of a Chassis resource can contain one or more specific chassis resources (such as resources identified as "1U"). Each specific chassis resource contains sub-resources such as chassis thermal resources, power resources, sensor resources, and controller resources. These sub-resources can also contain other subordinate resources (e.g., a Sensor resource can contain one or more specific sensor resources, identified as "Sersor1-SersorX"). It should be noted that the resource tree shown in Figure 1 is only an example and does not constitute a limitation on the actual structure. For example, if the Redfish protocol version is updated to v2, the root resource can be adjusted accordingly to " / redfish / v2". In addition, there is a correspondence between a resource and a resource URL (resource link). For example, the resource URL corresponding to the Systems resource can be " / redfish / v1 / Systems", or " / redfish / v1 / Systems" can be directly regarded as the Systems resource.
[0039] With the development of computer technology, the functionality and performance of computing devices have continuously improved, playing an increasingly crucial role in fields such as cloud computing, data centers, and big data. To reduce the complexity of computing device management and improve operation and maintenance efficiency, computing device manufacturers typically provide centralized management software for users. When a computing device supports the Redfish protocol, the centralized management software can manage the computing device through the RESTful interface provided by the device. It can also traverse the associated resources of the computing device (all resources in the resource tree shown in Figure 1) to obtain the resources of each computing device in the cluster. Since the Redfish protocol is relatively new, different vendors' implementations may not fully comply with the standard requirements. Therefore, after obtaining the computing device's resources, the resources can be formatted according to the requirements of different versions of the Redfish protocol to ensure they conform to the requirements of each version. This allows the centralized management software to respond to interface calls from upper-layer systems and return resources that meet the requirements of the target Redfish protocol version.
[0040] For example, Redfish resource traversal operations can be performed in the following serial execution mode: The first step is to build a first-in-first-out queue with a capacity of N, and add the root node address " / redfish / v1" to the queue. The value of N must be greater than the total number of nodes in the largest subtree of the resource tree. The second step is to retrieve a resource address from the queue and check whether the resource address has been acquired or resolved. If it has not been acquired or resolved, proceed to the next step, which is to obtain the resource information corresponding to the resource address by combining the device's network address, port, and authentication credentials. If it has already been acquired or resolved, there is no need to repeat the operation. Continue to retrieve the next resource address and repeatedly check whether the next resource address has been acquired or resolved. The third step involves combining the Redfish device's network address, port information, authentication credentials, and the resource address retrieved in the previous step, using an HTTP client tool (such as HttpClient) to obtain the resource information corresponding to that resource address from the device. Once the resource information is successfully obtained, the corresponding resource address is marked as "processed." The fourth step is to parse out the sub-resource addresses contained in the obtained resource information and add the sub-resource addresses to the queue; The fifth step is to process the attribute information of the Redfish device: If the purpose of obtaining resource information is to achieve data synchronization, the obtained resource information is stored in the resource storage module according to the prescribed format; if the purpose of obtaining resource information is to test the compliance of the Redfish protocol, the resource information needs to be compared and verified with the schema file provided by the protocol standard to confirm whether the information conforms to the specification.
[0041] The operations from step two to step five above must be repeated until there are no resource addresses to be processed in the queue. Only then can it be determined that all resource addresses of the device have been traversed.
[0042] After obtaining the resources of each computing device in the computing device cluster by traversing the associated resources of the computing devices (all resources in the resource tree shown in Figure 1), in order to improve the efficiency of querying the resources of each computing device, different resource query codes need to be configured for the RESTful interfaces of different manufacturers to achieve resource query, which results in low efficiency in obtaining resources.
[0043] To address the aforementioned issues, this embodiment configures a Redfish interface in the management node of the computing device cluster. After receiving a resource query request from the upper-layer system, the interface generates a response resource based on the request type and the Redfish interface protocol, and returns the response resource to the upper-layer system. This allows for format conversion of computing device resources according to different versions of the Redfish protocol, ensuring that the resources returned to the upper-layer system conform to the requirements of each version of the Redfish protocol.
[0044] To better understand the embodiments of this application, the system architecture of the embodiments of this application will be described below.
[0045] Please see Figure 2 , Figure 2 This is a schematic diagram of a system architecture disclosed in an embodiment of this application. For example... Figure 2 As shown, the system architecture may include: an upper-layer system 201, a management node 202 for the computing device cluster, and a computing device cluster 203. The upper-layer system 201, the management node 202 for the computing device cluster, and the computing device cluster 203 can communicate with each other.
[0046] The upper-layer system 201 includes the calling software of the management node 202. The upper-layer system 201 does not directly interface with individual computing devices, but rather manages all computing devices in the computing device cluster 203 through a unified interface provided by the management node 202. For example, the upper-layer system 201 can be a unified operation and maintenance platform for a data center, used to monitor the operating status of all servers (CPU utilization, temperature, fault alarms), and perform remote power on / off or firmware upgrades. The upper-layer system 201 can also be an enterprise's IT asset management system, used to collect information such as the model, configuration, and service life of all servers in the data center. Alternatively, the upper-layer system 201 can be a cloud management platform from a cloud vendor, used to schedule server resources (such as allocating computing power and expanding storage). The upper-layer system 201 can run on a dedicated server for running management software. For example, the upper-layer system 201 can run on the server's central processing unit (CPU), or it can run on a virtual machine or other hardware device; this embodiment does not limit this.
[0047] The management node 202 of the computing device cluster includes a server or a server's CPU. For example, the management node 202 may be equipped with management software used to manage each computing device in the computing device cluster. It should be noted that the server running the upper-layer system 201 can be deployed separately from the server corresponding to the management node 202. In addition, the upper-layer system 201 can also be deployed on the same server as the management node 202. This embodiment does not impose any limitations on this.
[0048] It should be noted that each computing device in the computing device cluster 203 includes devices that support the Redfish protocol. In this embodiment, each computing device in the computing device cluster 203 can be a server that supports the Redfish protocol, such as a blade server, a high-density server, a rack server, or a cabinet server. The computing devices in the computing device cluster 203 can be from different manufacturers.
[0049] In some embodiments, each computing device in the computing device cluster 203 described above may further include a processor, a memory, etc. The memory may include, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or compact disc read-only memory (CD-ROM). The processor may be a CPU, a complex programmable logic device, a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof.
[0050] It should be understood that any type of server typically includes an out-of-band controller. This out-of-band controller can be an external processor, separate from the central processing unit (CPU). It can include external monitoring and management units, management hardware within external management chips, baseboard management controllers (BMCs), system management modules (SMMs), etc. The out-of-band controller is primarily used for monitoring and managing the server, and supports management via the management network port (e.g., server reset, power on / off, etc.).
[0051] For example, out-of-band controllers can monitor the status of various hardware devices in a server (such as humidity, temperature, voltage, current, etc.). Furthermore, out-of-band controllers can be used for system configuration, firmware upgrades, and fault diagnosis.
[0052] In this embodiment, the management software running on the management node 202 of the computing device cluster communicates with the out-of-band controller of each computing device through the Redfish protocol (out-of-band management protocol) to obtain data such as the hardware status and firmware information of each computing device. The out-of-band controller is equivalent to the data acquisition end of the management software, which transmits the underlying hardware data of the server to the management software. The management software then integrates and transforms this data before providing it to the upper-layer system.
[0053] In this system architecture, the server carrying the upper-layer system 201 sends a resource query request to the management node 202 of the computing device cluster. Correspondingly, the management software of the management node 202 of the computing device cluster obtains the resource query request sent by the upper-layer system 201, generates a response resource in response to the resource query request according to the request type of the resource query request and the interface protocol of the Redfish interface, and returns the response resource to the upper-layer system 201.
[0054] It should be noted that, Figure 2 The system architecture shown is merely illustrative and does not constitute a limitation thereof. In other embodiments of this application, Figure 2 The system architecture shown may include more or fewer devices than illustrated.
[0055] In some examples, the management node 202 stores an initial configuration that can be set by the user according to their needs. For example, the initial configuration includes at least one of the following: resource acquisition configuration, interface protocol version configuration, response resource generation configuration, and / or resource type matching configuration.
[0056] The resource acquisition configuration is used to instruct the management node 202 to acquire raw device resources from each computing device in the computing device cluster. For example, the resource acquisition configuration can be a user-configured method for traversing resources from the computing device resource tree, such as whether to use expanded access when traversing resources from the computing device resource tree, the number of expanded layers, the thread pool size, the default queue length, and the list of valid resources (blacklist or whitelist).
[0057] The interface protocol version configuration is used to indicate the protocol version corresponding to the interface protocol of the Redfish interface of the management node 202. For example, the interface protocol version configuration can be the Redfish protocol version configured by the user, such as the protocol version of the Redfish interface configured by the user as v1.2.
[0058] The response resource generation configuration is used to instruct the management node 202 to generate response resources. For example, the response resource generation configuration can be a user-configured method for generating response resources based on the protocol version of the interface protocol. For example, the Model field under System resource is set to Chassis resource.Oem.ProductModel, which means that when generating response resources, the ProductModel field under the Oem object under the device's Chassis resource needs to be replaced with the Model field under System resource.
[0059] The resource type matching configuration is used to instruct the management node 202 to determine the resource type of each computing device in the computing device cluster. For example, the resource type matching configuration can specify the resource type of each Redfish resource, such as the resource type of the resource with the link " / redfish / v1" being Root Resource, the resource type of the resource with the link " / redfish / v1 / Systems / [^ / ]+" being System, the resource type of the resource with the link " / redfish / v1 / Managers / [^ / ]+" being Managers, and the resource type of the resource with the link " / redfish / v1 / Systems / [^ / ]+ / BIOS / [^ / ]+" being BIOS.
[0060] For example, management node 202 recursively traverses from the root resource / redfish / v1 of each computing device in the computing device cluster according to the resource acquisition configuration, obtains the URI of all resources and the corresponding original resources (in JSON format by default), and then outputs the key-value pair "URI: original resource" (such as / redfish / v1 / Systems / 1:{system 1 original resource}).
[0061] Following this, management node 202 can normalize the "URI: original resource" key-value pairs to obtain normalized resources. For example, during the normalization process, management node 202 can classify resources, map resource links, and store resources on the "URI: original resource" key-value pairs.
[0062] In this process, management node 202 first generates a unique identifier for each computing device in the computing device cluster within the management node. This identifier can be a UUID or other unique identifier that can distinguish the device; this scheme does not impose any restrictions. This unique identifier serves as the index for management node 202 to access this computing device. Subsequently, during resource classification, management node 202 matches the resource type according to the URI (resource link) in the "URI: original resource" key-value pair configuration. For example, a resource with the link " / redfish / v1" is of type Root Resource; a resource with the link " / redfish / v1 / Systems / [^ / ]+" is of type System; a resource with the link " / redfish / v1 / Managers / [^ / ]+" is of type Managers; and a resource with the link " / redfish / v1 / Systems / [^ / ]+ / BIOS / [^ / ]+" is of type BIOS. Subsequently, during the resource link mapping process, management node 202 performs URI mapping to URIde in the management node. This involves replacing local identifiers in the URI (e.g., 1) with the management node's universally unique device identifier (UUID) (e.g., uuid-1). Each computing device's UUID is unique within the cluster and will not be repeated. For example, to replace the ID of a first-level resource with a unique identifier, such as replacing resource links like / redfish / v1 / Systems / 1, / redfish / v1 / Systems / 2 / Processors / 1 with resource links like / redfish / v1 / Systems / uuid-1, / redfish / v1 / Systems / uuid-2 / Processors / 1, only the resource ID of the first-level resource needs to be replaced, while keeping the IDs and devices of the sub-resources unchanged. Finally, management node 202 replaces the URIs in the original resources with pre-set URIs stored by the management node. For example, it replaces URIs such as / redfish / v1 / Systems / 1 and / redfish / v1 / Systems / 2 / Processors / 1 in the original resources with URIs such as / redfish / v1 / Systems / uuid-1 and / redfish / v1 / Systems / uuid-2 / Processors / 1. In addition, management node 202 can also store resources, such as associating and storing device UUIDs, URIs in key-value pairs, resource types, mapped URIs, and cleaned resources in the resource storage module to support subsequent queries and retrieval.
[0063] The management node 202 can also generate configurations based on response resources, converting the obtained standardized resources into resources that conform to the protocol standard of the interface protocol specified by the user, solving the problem of differences in Redfish interface protocol versions from different vendors, and providing Redfish interfaces that conform to the Redfish interface specification for upper-layer systems.
[0064] Figure 3 This is a flowchart illustrating a resource query method provided in an embodiment of this application, such as... Figure 3 As shown, the method includes steps 301 to 303.
[0065] Step 301: Respond to the resource query request submitted by the upper-layer system through the interface call.
[0066] The resource query method provided in this embodiment can be applied to the management node of a computing device cluster. The management node is configured with a Redfish interface for upper-layer systems to call. In some examples, the upper-layer system submits a resource query request to the management node of the computing device cluster through the interface call method defined by the Redfish protocol. Correspondingly, the management node of the computing device cluster responds to the resource query request submitted by the upper-layer system through the interface call and performs a resource query.
[0067] Redfish interfaces are standardized RESTful APIs implemented according to the Redfish protocol. They serve as the specific interaction entry point for the management nodes of computing device clusters to provide management capabilities. Redfish interfaces include network-based software interfaces, such as the specific interfaces implemented by various vendors in the management nodes of the computing device cluster according to the rules of the Redfish protocol. For example, if the Redfish protocol stipulates that "server resources must be queried through / redfish / v1 / Systems / {ID}", the vendor will implement the resource query request https: / / deviceIP / redfish / v1 / Systems / 1 in the device; if the Redfish protocol stipulates that "GET requests are used to query resources", the vendor will make this interface respond to GET requests and return the server's status resources in JSON format (such as CPU model, running status, etc.).
[0068] The Redfish Protocol (i.e., the Redfish Standard) is a complete specification system that defines the rules that Redfish interfaces must follow. These rules include: interface design methods (must conform to RESTful style, use URLs to identify resources, define operations using HTTP methods, etc.), resource transmission methods (use JSON format, and fields must conform to Redfishschema definitions), and methods to ensure secure resource transmission (support HTTPS, authentication, etc.). These core rules clarify the functionality and usage of Redfish interfaces.
[0069] For example, a resource query request can be a request containing the resource link " / redfish / v1", a request containing the resource link " / redfish / v1 / Systems / [^ / ]+", or a request containing the resource link " / redfish / v1 / Managers / [^ / ]+".
[0070] In this embodiment, by configuring a Redfish interface in the management node of the computing device cluster and providing a Redfish interface to the upper-layer system, the upper-layer system can directly query the relevant resources of the computing device cluster through the management node in a unified manner, without having to query resources according to the rules of any vendor's custom resource query interface. This reduces the difficulty of differentiated adaptation, reduces the workload of resource query, and improves the efficiency of resource query.
[0071] In some examples, the user's initial configuration in the management node is obtained; the initial configuration includes at least one of the following: resource acquisition configuration, interface protocol version configuration, response resource generation configuration, and resource type matching configuration.
[0072] Among them, the resource acquisition configuration is used to instruct the management node to acquire raw device resources from each computing device in the computing device cluster; the interface protocol version configuration is used to instruct the protocol version corresponding to the interface protocol of the Redfish interface; the response resource generation configuration is used to instruct the generation of response resources; and the resource type matching configuration is used to instruct the resource type of each computing device in the computing device cluster.
[0073] Resource acquisition configuration is used to instruct the management node to acquire raw device resources from each computing device in the computing device cluster. For example, resource acquisition configuration can be a user-configured method for traversing resources from the computing device resource tree, such as whether to use expanded access when traversing resources from the computing device resource tree, the number of expanded layers, thread pool size, default queue length, and list of valid resources (blacklist or whitelist).
[0074] The interface protocol version configuration is used to indicate the protocol version corresponding to the interface protocol of the Redfish interface. For example, the interface protocol version configuration can be the Redfish protocol version configured by the user, such as the protocol version of the Redfish interface configured by the user as v1.2.
[0075] The response resource generation configuration is used to instruct the generation of response resources. For example, the response resource generation configuration can be a user-configured method for generating response resources based on the protocol version of the interface protocol. For example, if the Model field under System resource is set to Chassis resource.Oem.ProductModel, then the Model field under System resource needs to be replaced with the ProductModel field under the Oem object under the device Chassis resource when generating response resources.
[0076] Resource type matching configuration is used to indicate and determine the resource type of each computing device in the computing device cluster. For example, resource type matching configuration can be a configuration that specifies the resource type of each Redfish resource, such as the resource type of the resource link " / redfish / v1" being Root Resource, the resource type of the resource link " / redfish / v1 / Systems / [^ / ]+" being System, the resource type of the resource link " / redfish / v1 / Managers / [^ / ]+" being Managers, and the resource type of the resource link " / redfish / v1 / Systems / [^ / ]+ / BIOS / [^ / ]+" being BIOS.
[0077] In some examples, based on the resource acquisition configuration, the original device resources of each computing device in the computing device cluster are acquired. The original device resources include original resource links and original device resources. The preset resource types are matched with the original device resources to obtain the resource types that match the original device resources. Based on the updated device identifiers of each computing device generated according to the device identifier configuration, the original resource links are updated to obtain updated resource links. Based on the updated resource links of each computing device, the original device resources are updated to obtain updated device resources. The updated device identifiers, original device resources, resource types that match the original device resources, and updated device resources containing updated resource links and updated device resources are stored in the resource storage module.
[0078] For example, based on resource acquisition configurations such as whether to use expand access, the number of expand layers, thread pool size, default queue length, and valid resource list (blacklist or whitelist), the system recursively traverses from the root resource / redfish / v1 of each computing device in the computing device cluster to obtain the URIs of all resources and their corresponding original resources (in JSON format by default). Then, it outputs "URI: original resource" key-value pairs (e.g., / redfish / v1 / Systems / 1:{system 1 original resource}), where the "URI: original resource" key-value pair is called the original device resource, and the URI is the link to the original resource and the original resource is the original device resource. Subsequently, the resource type matching configuration is set to match the URI (resource link) in the "URI: original resource" key-value pair with the resource type. For example, the resource type of the resource link " / redfish / v1" is Root Resource, the resource type of the resource link " / redfish / v1 / Systems / [^ / ]+" is System, the resource type of the resource link " / redfish / v1 / Managers / [^ / ]+" is Managers, and the resource type of the resource link " / redfish / v1 / Systems / [^ / ]+ / BIOS / [^ / ]+" is BIOS. Subsequently, the resource storage module 302 performs URI mapping to the URIs in the management node. For example, it replaces the IDs of first-level resources with unique identifiers, such as replacing resource links like / redfish / v1 / Systems / 1, / redfish / v1 / Systems / 2 / Processors / 1 with resource links like / redfish / v1 / Systems / uuid-1, / redfish / v1 / Systems / uuid-2 / Processors / 1. Only the resource IDs of the first-level resources need to be replaced, keeping the IDs and devices of the sub-resources unchanged. Finally, it replaces the URIs in the original resources with the URIs in the management node. For example, it replaces URIs like / redfish / v1 / Systems / 1, / redfish / v1 / Systems / 2 / Processors / 1 in the original resources with URIs like / redfish / v1 / Systems / uuid-1, / redfish / v1 / Systems / uuid-2 / Processors / 1. In addition, the resource storage module 302 can also store resources, such as associating and storing the device UUID, URI in the key-value pair, resource type, mapped URI, cleaned resources, etc., to support subsequent queries and calls.
[0079] Step 302: Generate a response resource to respond to the resource query request based on the resource query parameters in the resource query request and the interface protocol of the Redfish interface.
[0080] For example, resource query parameters include the device identifier of the device to be queried, the resource type of the resource to be queried, and the resource URI of the resource to be queried.
[0081] The device identifier of the device to be queried can be a unique identifier generated by the management node for each computing device in the computing device cluster within the management node, such as a UUID. The resource type to be queried can be the resource type matched by the URI (resource link) in the "URI: original resource" key-value pair. For example, the resource type of the resource link " / redfish / v1" is Root Resource, the resource type of the resource link " / redfish / v1 / Systems / [^ / ]+" is System, the resource type of the resource link " / redfish / v1 / Managers / [^ / ]+" is Managers, and the resource type of the resource link " / redfish / v1 / Systems / [^ / ]+ / BIOS / [^ / ]+" is BIOS.
[0082] For example, the resource categories to be queried include node resource categories, cluster resource categories, and / or device resource categories.
[0083] System resources under the Node Resources category include resources related to the management node of the computing device cluster. For example, system resources may include: Id: "RootService": a unique identifier for the root resource of the computing device resource tree (fixed to "RootService", as defined by the Redfish protocol); Name: "Root Service": the name of the root resource, used for user-readable identification; RedfishVersion: "1.15.0": the Redfish protocol version (1.15.0) supported by this management node, which determines the rules and data format for interface interaction; UUID: "92384634-2938-2342-8820-489239905423": a globally unique identifier for the management node, used to uniquely distinguish the system in the network; Product: "xxx management software": the product name of the management node (such as centralized management software from a server vendor), and other basic identifiers.
[0084] For example, system resources can also include ProtocolFeaturesSupported descriptions. These descriptions clearly state the Redfish protocol extensions supported by the management node, helping upper-layer systems understand its interaction capabilities: ExpandQuery: Supports "expanded query" functionality, including: ExpandAll: true: Allows retrieving the resource and all its sub-resources at once; Levels: true, MaxLevels: 6: Supports specifying extension levels (up to 6 levels); Links: true, NoLinks: true: Supports including or excluding links between resources. SelectQuery: false: Does not support "field filtering" (i.e., cannot return only specified fields, must return the complete resource). FilterQuery: false: Does not support "conditional filtering" (i.e., cannot filter resources by conditions, such as querying by status). Other features such as OnlyMemberQuery and MultipleHTTPRequests also indicate support for their respective protocol features.
[0085] Alternatively, system resources may also include: Resource navigation entry points, which are the most crucial part of the root resources. These entry points provide URI links to various core sub-resources via the `@odata.id` field, allowing clients to further access specific resources: Systems: Points to a collection of server system resources (e.g., ` / redfish / v1 / Systems`), containing information on all managed server nodes. Chassis: Points to a collection of chassis resources (e.g., ` / redfish / v1 / Chassis`), containing physical structure information such as hardware chassis, power supply, and cooling. Managers: Points to management controller resources (e.g., ` / redfish / v1 / Managers`), containing information on management modules such as the BMC (Baseboard Management Controller). UpdateService: Points to the firmware update service (e.g., ` / redfish / v1 / UpdateService`), used to initiate device firmware upgrades and other operations. Tasks: Points to the task service (e.g., ` / redfish / v1 / TaskService`), used to manage asynchronous tasks (e.g., long-running configuration modifications). SessionService / AccountService: Points to session management and account services, used for authentication and user permission management. EventService: Points to the event service, used to subscribe to hardware alarms (such as server failure, high temperature, and other event pushes).
[0086] In addition, system resources may include other supplementary information, such as: ServiceConditions: points to service status resources (e.g., / redfish / v1 / ServiceConditions), which may contain information such as system alarms and maintenance status. Links.Sessions: points to a list of currently active sessions (e.g., / redfish / v1 / SessionService / Sessions), used to view or manage currently logged-in sessions. Oem: {}: a vendor-extended field (empty here), allowing vendors to add custom information (e.g., vendor-specific interface links). @odata.id: " / redfish / v1 / ": the URI of the current root resource itself, conforming to the Redfish protocol's specification for resource self-referencing.
[0087] Cluster resources under the "Cluster Resources" category include resources from multiple computing devices within a computing device cluster that fall under the same resource category. For example, cluster resources may include resources assembled according to the "Collection Resources" format.
[0088] Device resources under the device resource category include the resources of any computing device in the computing device cluster under the target resource category. For example, device resources may include the device resources corresponding to the resource link " / redfish / v1 / Systems / uuid-1", which represents the Systems resource of the computing device identified as uuid-1.
[0089] In some examples, when the resource category in the resource query parameters is a node resource category used to query node resources for the management node, a response resource is generated based on the Redfish protocol to respond to the resource query request. For instance, if the resource type in the resource query parameters is a system resource type, a RootService resource can be generated as the response resource according to the Redfish interface protocol.
[0090] As mentioned above, RootService resources may include basic identifiers, protocol function support descriptions, resource navigation entry points, and / or other supplementary information. For example, RootService resources may include the Redfish protocol version, the node identifier of the management node, the resource query methods supported by the management node, the device identifiers of each computing device in the computing device cluster, and / or resource access paths.
[0091] In some examples, when the resource category in the resource query parameters is the cluster resource category used to query the cluster resources of the computing device cluster, the target device resource corresponding to the device identifier and the resource type to be queried is queried in the resource storage module according to the device identifier and the resource type to be queried in the resource query parameters. The target device resource is then written into the resource generation template corresponding to the target version of the Redfish protocol to obtain the response resource.
[0092] For example, firstly, based on the device identifier of the device to be queried and the type of resource to be queried, the resource storage module is queried (e.g., by calling the path / redfish / v1 / Systems) to obtain a list of all resources under the type of resource to be queried (e.g., a collection of all computing devices, a collection of all chassis). These lists contain basic information of multiple resources of the same type (e.g., the ID, name, access path, etc. of each device). Then, they are assembled according to the format of a resource collection. The Redfish protocol has a unified specification for the return format of the resource collection, namely the resource generation template. After the resource collection is queried, it needs to be organized and assembled according to the fixed format specified by the resource generation template, and finally generate a CollectionResources that conforms to the specification as the response resource.
[0093] Among them, Collection Resources is a standardized resource list format defined in the Redfish protocol, specifically used for batch returning resource data of the same type and level. For example, CollectionResources is a unified return template developed by Redfish for querying multiple similar resources at once. Collection Resources allows devices from different manufacturers and different upper-level management software to read and parse batch resource information in the same format.
[0094] In some examples, when the resource category in the resource query parameters is the device resource category used to query the device resources of each computing device in the computing device cluster, the target device resource corresponding to the device identifier and resource link of the device to be queried in the resource query parameters is queried in the resource storage module. The target device resource is then written into the resource generation template corresponding to the target version of the Redfish protocol to obtain the response resource.
[0095] For example, based on the device identifier and resource link of the device to be queried in the resource query parameters, the target device resource corresponding to the device identifier and resource link is queried in the resource storage module: " / redfish / v1 / Systems / uuid-1", which represents the Systems resource of the computing device uuid-1.
[0096] In some examples, after the target device resource is found in the resource storage module, the target device data can be written into the data generation template corresponding to the target version of the Redfish protocol to obtain intermediate data. Then, the preset fields in the intermediate data are replaced according to the response resource generation configuration to obtain the response data.
[0097] The reason for replacing preset fields in intermediate data based on the response resource generation configuration is that different manufacturers may not strictly adhere to the Redfish protocol. The differentiated parts need to be converted according to the response resource generation configuration, which can be as follows: X resource type.A1 attribute = Y resource type.A2 attribute. For example: the Model field under the System resource = Chassis resource.Oem.ProductModel, indicating that it needs to be replaced with the ProductModel field under the Oem object of the device's Chassis resource.
[0098] In some examples, the target version of the Redfish interface is determined based on the interface protocol version configuration and the default protocol version.
[0099] For example, if there is an interface protocol version configuration in the initial configuration, the protocol version in the interface protocol version configuration is determined as the target version of the interface protocol. If there is no interface protocol version configuration in the initial configuration, the target version of the interface protocol of the Redfish interface is determined according to the preset protocol version of the interface protocol.
[0100] For example, you can refer to Figure 4 As shown in the flowchart for determining the protocol version, the process first obtains the highest supported Redfish protocol version as x, and then obtains the user-configured Redfish protocol version as y. If y is not found, the Redfish protocol version is determined to be x. If y is found, the min...<x,y> As a protocol version of the Redfish protocol; Then, the resource query request sent by the upper-layer system is retrieved from the Redfish data storage module. This involves three scenarios. The first scenario (where the resource query request is for a node resource) involves the upper-layer system querying a resource of type ServiceRoot. In this case, according to the Redfish protocol requirements, basic information about the centralized management software (Redfish) is returned. This information includes information supported by the Redfish protocol itself. Detailed field descriptions refer to the ServiceRoot resource description in the Redfish protocol specification. The Redfish Version field must be filled with the user-configured Redfish protocol version, the UUID identifies the unique identifier of the centralized management software, and the Product field is the product name of the cluster management software. The second scenario (where the resource query request is not for a node resource and the resource type is not empty) involves the upper-layer system querying Collection Resources. This type of resource is assembled from a resource collection according to the Collection Resources format. Therefore, the query requires the resource type and the device's unique identifier. These two parameters are used to filter out all sub-resources associated with the resource type, and the data is presented in Collection Resource format. The third scenario (where the resource query request is not a node resource query request and the resource type is empty) involves querying specific device resource information. This can be achieved simply by retrieving the device's raw data using its unique identifier (URI). It's important to note that after obtaining the device data, a conversion from the raw device data to the user-required Redfish protocol version is necessary. Since the Redfish protocol is backward compatible, it's sufficient to pre-configure models for different protocol versions and then use the required protocol version resource to convert the raw device data.
[0101] The following uses Battery resources as an example to explain the conversion process in detail: Users can preset the interface protocol version configuration, such as specifying that the response resource should be generated according to the v1.2 version interface protocol; the preset protocol version of the Battery resource interface protocol can be any version of the Redfish protocol, v1.0, v1.1, v1.2, v1.3, v1.4. The Redfish protocol matches the resource version downwards. For example, if the Redfish protocol version is 1.3.2, then version 1.3 will be used because 1.3.2 falls within the 1.3 version range. If it is version 1.20, then version 1.4 will be used because 1.20... The version already covers the definitions of all lower version resources. First, resource attributes need to be determined for each version of the Battery resource. Each resource needs to have different pre-defined resource version attributes. Each attribute is defined in the Redfish protocol as the version that the attribute enables. Simply generate the corresponding resource attribute version according to the specification description. Five resource versions need to be generated for Battery resources: Battery-v1.0, Battery-v1.1, Battery-v1.2, Battery-v1.3, and Battery-v1.4. Based on the Redfish data model's definition of Battery resources, this needs to be determined according to the field description information. Taking JSON data as an example, unmarshalling the original JSON data from the device using the corresponding version resource model can complete the protocol conversion. Considering that some manufacturers implement non-standard protocols, the non-standard parts can be customized through the Redfish protocol conversion resource attribute replacement relationship in the policy configuration.
[0102] Step 303: Return the response resource to the upper-layer system.
[0103] In some examples, response resources include resources that respond to resource query requests under the node resource category for querying node resources of the management node, resources that respond to resource query requests under the cluster resource category for cluster resources of the computing device cluster, and / or resources that respond to resource query requests under the device resource category for device resources of each computing device in the computing device cluster.
[0104] When the resource category in the resource query parameters is a node resource category, the response resource includes the Redfish protocol version, the node identifier of the management node, the resource query methods supported by the management node, the device identifiers of each computing device in the computing device cluster, and / or the resource access path. When the resource category in the resource query parameters is a cluster resource category, the response resource includes resources determined based on the target version of the Redfish protocol and the target device cluster resources. When the resource category in the resource query parameters is a device resource category, the response resource includes resources determined based on the target version of the Redfish protocol and the target device resources. Accordingly, after obtaining any of the above response resources, the response resource can be returned to the upper-layer system through the Redfish interface.
[0105] The resource query method provided in this embodiment obtains a resource query request sent by the upper-layer system, generates a response resource in response to the resource query request based on the resource query parameters in the resource query request and the interface protocol of the Redfish interface, and returns the response resource to the upper-layer system. In this way, the resource format of the computing device is converted according to the requirements of different versions of the Redfish protocol, so that the resource of the computing device can conform to the requirements of each version of the Redfish protocol. Based on the introduction of the Redfish protocol into the management node, it can respond to the interface call of the upper-layer system and return resources that conform to the requirements of the target version of the Redfish protocol.
[0106] Corresponding to the embodiments of the aforementioned resource query method, this application also provides embodiments of a resource query device. Figure 5 A resource query device provided in the embodiments of this application, such as Figure 5 As shown, the resource query device 500 includes a request acquisition module 501, a response resource generation module 502, and a response resource return module 503.
[0107] The request retrieval module 501 is used to retrieve resource query requests sent by the upper-layer system; The response resource generation module 502 is used to generate response resources that respond to the resource query request based on the request type of the resource query request and the interface protocol of the Redfish interface. The response resource return module 503 is used to return the response resource to the upper-layer system.
[0108] In another possible implementation, the response resource generation module 502 is used to generate a response resource in response to the resource query request based on the interface protocol when the resource category in the resource query parameters is a node resource category used to query the node resources of the management node; the response resource includes the protocol version of the Redfish protocol, the node identifier of the management node, the resource query methods supported by the management node, the device identifiers and / or resource access paths of each computing device in the computing device cluster.
[0109] In another possible implementation, the response resource generation module 502 is used to, when the resource category in the resource query parameters is a cluster resource category for querying cluster resources of the computing device cluster, query the target device cluster resources corresponding to the device identifier and the resource type to be queried in the resource storage module of the management node according to the device identifier and the resource type to be queried in the resource query parameters; and write the target device resources into the resource generation template corresponding to the target version of the Redfish protocol to obtain the response resource.
[0110] In another possible implementation, the response resource generation module 502 is used to, when the resource category in the resource query parameters is a device resource category used to query the device resources of each computing device in the computing device cluster, query the target device resource corresponding to the device identifier and the resource link in the resource storage module according to the device identifier and resource link of the device to be queried in the resource query parameters; and write the target device resource into the resource generation template corresponding to the target version of the Redfish protocol to obtain the response resource.
[0111] In another possible implementation, the response resource generation module 502 is used to write the target device data into the data generation template corresponding to the target version of the Redfish protocol to obtain intermediate data; and replace the preset fields in the intermediate data according to the response resource generation configuration to obtain the response data.
[0112] In another possible implementation, the method further includes: if the initial configuration includes an interface protocol version configuration, the version of the interface protocol in the interface protocol version configuration is used as the target version; if the initial configuration does not include an interface protocol version configuration, the target version of the interface protocol of the Redfish interface is determined according to the preset protocol version of the interface protocol.
[0113] In another possible implementation, the method further includes: obtaining the user's initial configuration in the management node; the initial configuration includes at least one of the following: resource acquisition configuration, interface protocol version configuration, response resource generation configuration, and resource type matching configuration; wherein, the resource acquisition configuration is used to instruct the management node to acquire raw device resources from each computing device in the computing device cluster; the interface protocol version configuration is used to indicate the protocol version corresponding to the interface protocol of the Redfish interface; the response resource generation configuration is used to instruct the generation of response resources; and the resource type matching configuration is used to indicate the resource type of each computing device in the computing device cluster.
[0114] In another possible implementation, the method further includes: acquiring the original device resources of each computing device in the computing device cluster according to the resource acquisition configuration; wherein the original device resources include original resource links and original device resources; matching a preset resource type with the original device resources to obtain a resource type that matches the original device resources; updating the original resource links based on the updated device identifiers of each computing device generated according to the device identifier configuration to obtain updated resource links, and updating the original device resources based on the generated updated resource links of each computing device to obtain updated device resources; and storing the updated device identifiers, the original device resources, the resource type that matches the original device resources, and the updated device resources including the updated resource links and the updated device resources in a resource storage module.
[0115] The beneficial technical effects corresponding to the above-described exemplary embodiment of the resource query device 500 can be found in the corresponding beneficial technical effects in the above-described method embodiment section, and will not be repeated here.
[0116] Figure 6 This is a schematic diagram of a computing device provided for some embodiments of this application. In some embodiments, the computing device may be a server, a terminal device, etc. The computing device includes a multi-core processor and a memory. The multi-core processor includes multiple processor cores; the memory is configured to store one or more programs. When the one or more programs are executed by the multi-core processor, the multi-core processor implements the resource query method in the above embodiments.
[0117] like Figure 6 As shown, device 600 includes a multi-core processor 601 and memory 602. Exemplarily, computing device 600 may also include a communications interface 603 and a communications bus 604.
[0118] The multi-core processor 601, memory 602, and communication interface 603 communicate with each other via communication bus 604. Communication interface 603 is used to communicate with other network elements such as clients or other servers.
[0119] In some examples, a multi-core processor 601 is used to execute program 605, specifically performing the relevant steps in the resource query method embodiments described above. Specifically, program 605 may include program code comprising computer-executable instructions.
[0120] For example, the multi-core processor 601 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement some embodiments of this application. The computing device 600 may include multi-core processors, which may be of the same type, such as one or more CPUs; or they may be multi-core processors of different types, such as one or more CPUs and one or more ASICs.
[0121] In some examples, memory 602 is used to store program 605. Memory 602 may include high-speed RAM memory, and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0122] Specifically, program 605 can be called by multi-core processor 601 to enable computing device 600 to perform resource query method operations.
[0123] Some embodiments of this application provide a computer-readable storage medium storing at least one executable instruction that, when executed on a computing device 600, causes the computing device 600 to perform the resource query method described in the above embodiments.
[0124] Specifically, the executable instructions can be used to cause the computing device 600 to perform master station communication methods or master station module deployment methods. For example, the computer-readable storage medium can be a read-only memory (ROM), random access memory (RAM), compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.
[0125] The beneficial effects achievable by the readable storage medium provided in some embodiments of this application can be referred to the beneficial effects in the corresponding resource query methods provided above, and will not be repeated here. In addition to the methods, apparatus, and devices described above, embodiments of this application may also provide a computer program product, including computer program instructions, which, when executed by a processor, cause the processor to perform the steps in the resource query methods of the various embodiments of this application described in the above method embodiment section.
[0126] Computer program products can be written in any combination of one or more programming languages to perform the operations of the embodiments of this application. These programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0127] Furthermore, embodiments of this application may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps in the resource query methods of various embodiments of this application described in the above-described method embodiment section.
[0128] Computer-readable storage media may take the form of any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, but is not limited to, systems, apparatuses, or devices that are electrical, magnetic, optical, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0129] The basic principles of this application have been described above with reference to specific embodiments. However, the advantages, benefits, and effects mentioned in this application are merely examples and not limitations, and should not be considered as essential features of each embodiment of this application. Furthermore, the specific details of the above embodiments are for illustrative and facilitative purposes only, and are not limitations. These details do not restrict this application from being implemented using the aforementioned specific details.
[0130] Those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
[0131] Furthermore, the embodiments described above are merely specific embodiments of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made based on the technical solution of this application should be included within the scope of protection of this application.
Claims
1. A resource query method, characterized in that, A management node applied to a computing device cluster, the management node being configured with a Redfish interface, the method comprising: Obtain resource query requests sent by the upper-layer system; Based on the resource query parameters in the resource query request and the interface protocol of the Redfish interface, generate a response resource to respond to the resource query request; Return the response resource to the upper-layer system.
2. The resource query method according to claim 1, characterized in that, The step of generating a response resource in response to the resource query request based on the resource query parameters in the resource query request and the interface protocol of the Redfish interface includes: If the resource category in the resource query parameters is a node resource category used to query the node resources of the management node, a response resource is generated based on the interface protocol to respond to the resource query request. The response resources include the protocol version of the Redfish protocol, the node identifier of the management node, the resource query methods supported by the management node, and the device identifiers and / or resource access paths of each computing device in the computing device cluster.
3. The resource query method according to claim 1, characterized in that, The step of generating a response resource in response to the resource query request based on the resource query parameters in the resource query request and the interface protocol of the Redfish interface includes: When the resource category in the resource query parameters is a cluster resource category used to query the cluster resources of the computing device cluster, the target device cluster resources corresponding to the device identifier and the resource type to be queried are queried in the resource storage module of the management node according to the device identifier of the device to be queried and the resource type to be queried in the resource query parameters. The target device resources are written into the resource generation template corresponding to the target version of the Redfish protocol to obtain the response resources.
4. The resource query method according to any one of claims 1 to 3, characterized in that, The step of generating a response resource in response to the resource query request based on the resource query parameters in the resource query request and the interface protocol of the Redfish interface includes: When the resource category in the resource query parameters is the device resource category used to query the device resources of each computing device in the computing device cluster, the target device resource corresponding to the device identifier and the resource link is queried in the resource storage module according to the device identifier and resource link of the device to be queried in the resource query parameters. The target device resources are written into the resource generation template corresponding to the target version of the Redfish protocol to obtain the response resources.
5. The resource query method according to any one of claims 3 or 4, characterized in that, The step of writing the target device resources into the resource generation template corresponding to the target version of the Redfish protocol to obtain the response resources includes: The target device data is written into the data generation template corresponding to the target version of the Redfish protocol to obtain intermediate data; The response data is obtained by replacing the preset fields in the intermediate data according to the response resource generation configuration.
6. The resource query method according to any one of claims 3 or 4, characterized in that, The method further includes: If the initial configuration includes an interface protocol version configuration, the version of the interface protocol in the interface protocol version configuration shall be used as the target version; If the interface protocol version configuration is not included in the initial configuration, the target version of the Redfish interface protocol is determined according to the preset protocol version of the interface protocol.
7. The resource query method according to any one of claims 1 to 6, characterized in that, The method further includes: Obtain the user's initial configuration in the management node; the initial configuration includes at least one of the following: resource acquisition configuration, interface protocol version configuration, response resource generation configuration, and resource type matching configuration; The resource acquisition configuration is used to instruct the management node to acquire raw device resources from each computing device in the computing device cluster; the interface protocol version configuration is used to indicate the protocol version corresponding to the interface protocol of the Redfish interface; the response resource generation configuration is used to instruct the generation of response resources; and the resource type matching configuration is used to indicate the resource type of each computing device in the computing device cluster.
8. The resource query method according to claim 7, characterized in that, The method further includes: According to the resource acquisition configuration, the original device resources of each computing device in the computing device cluster are acquired; wherein, the original device resources include original resource links and original device resources; The preset resource type is matched with the original device resource to obtain the resource type that matches the original device resource; Based on the updated device identifiers of each computing device generated according to the device identifier configuration, the original resource links are updated to obtain updated resource links, and based on the generated updated resource links of each computing device, the original device resources are updated to obtain updated device resources; The updated device identifier, the original device resource, the resource type matching the original device resource, the updated device resource containing the updated resource link, and the updated device resource are stored in the resource storage module.
9. A computer-readable storage medium storing a computer program that, when executed by a processor, implements the resource query method according to any one of claims 1-8.
10. A computing device, characterized in that, include: One or more processors; and The memory is configured to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the resource query method according to any one of claims 1-8.
