CN115858149A - Resource information acquisition method, device, equipment and storage medium - Google Patents

Resource information acquisition method, device, equipment and storage medium Download PDF

Info

Publication number
CN115858149A
CN115858149A CN202211468707.6A CN202211468707A CN115858149A CN 115858149 A CN115858149 A CN 115858149A CN 202211468707 A CN202211468707 A CN 202211468707A CN 115858149 A CN115858149 A CN 115858149A
Authority
CN
China
Prior art keywords
resource information
information acquisition
acquisition request
item
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211468707.6A
Other languages
Chinese (zh)
Inventor
吕建冲
黄洪
高丰
王娜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nettrix Information Industry Beijing Co Ltd
Original Assignee
Nettrix Information Industry Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nettrix Information Industry Beijing Co Ltd filed Critical Nettrix Information Industry Beijing Co Ltd
Priority to CN202211468707.6A priority Critical patent/CN115858149A/en
Publication of CN115858149A publication Critical patent/CN115858149A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a resource information acquisition method, a resource information acquisition device, resource information acquisition equipment and a storage medium, and relates to the technical field of servers. The method comprises the following steps: analyzing the resource information acquisition request, and determining a functional interface associated with the resource information acquisition request; acquiring at least one item of resource information of a server through a functional interface; and under the condition that the resource information acquisition request contains the query parameters, screening at least one item of resource information based on the query parameters to obtain target resource information. According to the technical scheme of the embodiment of the invention, the client can search the required resource information in a mode of defining the query parameters, so that the convenience of querying the resource information of the server is improved.

Description

Resource information acquisition method, device, equipment and storage medium
Technical Field
The present invention relates to the technical field of servers, and in particular, to a method, an apparatus, a device, and a storage medium for acquiring resource information.
Background
With the rapid development of computer technology, servers are widely used in daily life and work scenes. Servers of different manufacturers often have different hardware configurations and software written for the hardware configurations, which results in the software not being applicable across platforms.
Aiming at the problems, each large server manufacturer customizes an Intelligent Platform Management Interface (IPMI), but because the IPMI is mostly single-point service and has poor expansibility and other limitations, the Redfish Management standard is developed.
The Redfish Management standard is a specification and a structure of a Desktop system Management Task group (DMTF for short), and the Redfish technology is to manage corresponding Management resources through a consistent Interface by issuing an Application Program Interface (API for short). The resources involved in the server resource management process are various, and different links need to be accessed when various resource information needs to be acquired, so that the server resource acquisition operation has high complexity.
Disclosure of Invention
The invention provides a resource information acquisition method, a resource information acquisition device, a resource information acquisition equipment and a storage medium, which are used for solving the problems that a client needs to access different links when acquiring different types of resource information, and the operation is complicated.
According to an aspect of the present invention, there is provided a resource information acquiring method, including:
analyzing the resource information acquisition request, and determining a functional interface associated with the resource information acquisition request;
acquiring at least one item of resource information of a server through the functional interface;
and under the condition that the resource information acquisition request contains the query parameters, screening the at least one item of resource information based on the query parameters to obtain target resource information.
Optionally, the screening the at least one item of resource information based on the query parameter to obtain target resource information includes:
and under the condition that the resource information acquisition request contains a query parameter of an expansion type, expanding the at least one item of resource information based on a target expansion level specified by the query parameter to obtain target resource information. By carrying the expansion type parameter in the resource information acquisition request, the subordinate resource of the resource information can be further acquired, the user does not need to access the subordinate resource again on the basis of inquiring the resource information, and the convenience of the operation of inquiring the resource information by the user is improved.
Optionally, the screening the at least one item of resource information based on the query parameter to obtain target resource information includes:
and under the condition that the resource information acquisition request contains a query parameter of a filtering type, filtering the at least one item of resource information based on a target resource type specified by the query parameter to obtain target resource information. By carrying the filtering type parameter in the resource information acquisition request, the inquired resource information can be further filtered according to the inquiry parameter specified by the user after the plurality of resource information are inquired, so that the resource information required by the user can be obtained.
Optionally, screening the at least one item of resource information based on the query parameter to obtain target resource information, including:
and under the condition that the resource information acquisition request comprises a query parameter of a selection type, selecting resource information associated with a target set from the at least one item of resource information as target resource information based on the target set specified by the query parameter. By carrying the selection type parameter in the resource information acquisition request, the subset specified by the user can be screened out from the inquired multiple resource information, and the resource information inquiry efficiency and the operation convenience are improved.
Optionally, the technical solution of the embodiment of the present invention further includes: and updating the resource information of the server through the resource information monitoring process according to a set time period. And dynamically updating the resource information of the server through the resource information monitoring thread, so that the timeliness of the resource information acquired by the user is ensured.
Optionally, analyzing the resource information obtaining request, and determining a functional interface associated with the resource information obtaining request includes:
analyzing the resource information acquisition request to obtain an interface hash value contained in the resource information acquisition request;
and determining a functional interface associated with the resource information acquisition request in a functional interface list according to the interface hash value. By maintaining the functional interface list, the functional interface associated with the resource information acquisition request can be quickly positioned when the client initiates the resource information acquisition request, and the resource information acquisition efficiency is improved.
Optionally, before analyzing the resource information obtaining request, the method further includes:
initializing each functional interface; the functional interface is used for inquiring at least one item of resource information;
analyzing the configuration file of the server to obtain hardware configuration information of the server;
and initializing the resource information of the server according to the hardware configuration information. In addition, the functional interface and the resource information maintained by the server side are initialized in advance, so that the resource information can be maintained to the corresponding storage space in advance, and compared with a scheme that the resource information is acquired after the user initiates the resource information acquisition request, the time consumed for acquiring the resource information can be reduced.
According to another aspect of the present invention, there is provided a resource information acquiring apparatus including:
the functional interface determining module is used for analyzing the resource information acquisition request and determining a functional interface associated with the resource information acquisition request;
the resource information acquisition module is used for acquiring at least one item of resource information of the server through the functional interface;
and the resource information screening module is used for screening the at least one item of resource information based on the query parameter under the condition that the resource information acquisition request contains the query parameter to obtain target resource information.
Optionally, the resource information screening module is specifically configured to:
and under the condition that the resource information acquisition request contains a query parameter of an expansion type, expanding the at least one item of resource information based on a target expansion level specified by the query parameter to obtain target resource information.
Optionally, the resource information screening module is further specifically configured to:
and under the condition that the resource information acquisition request contains a query parameter of a filtering type, filtering the at least one item of resource information based on a target resource type specified by the query parameter to obtain target resource information.
Optionally, the resource information screening module is further specifically configured to:
and under the condition that the resource information acquisition request comprises a query parameter of a selection type, selecting resource information associated with a target set from the at least one item of resource information as target resource information based on the target set specified by the query parameter.
Optionally, the resource information obtaining apparatus further includes:
and the resource information updating module is used for updating the resource information of the server according to a set time period through the resource information monitoring process.
Optionally, the functional interface determining module is specifically configured to:
analyzing the resource information acquisition request to obtain an interface hash value contained in the resource information acquisition request;
and determining a functional interface associated with the resource information acquisition request in a functional interface list according to the interface hash value.
Optionally, the resource information obtaining apparatus further includes:
the function interface initialization module is used for initializing each function interface before analyzing the resource information acquisition request; the functional interface is used for inquiring at least one item of resource information;
the configuration information acquisition module is used for analyzing the configuration file of the server to obtain the hardware configuration information of the server;
and the resource information initialization module is used for initializing the resource information of the server according to the hardware configuration information.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the resource information acquisition method according to any of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the resource information acquiring method according to any one of the embodiments of the present invention when the computer instructions are executed.
According to the technical scheme of the embodiment of the invention, the resource information acquisition request is analyzed, the functional interface associated with the resource information acquisition request is determined, then the at least one item of resource information of the server side is acquired through the functional interface, and finally the at least one item of resource information is screened based on the query parameter under the condition that the resource information acquisition request contains the query parameter to obtain the target resource information, so that the problems that different links need to be accessed when the client side acquires different types of resource information, the operation is complex and the convenience in acquiring the resource information is improved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a resource information obtaining method according to an embodiment of the present invention;
fig. 2 is a flowchart of a resource information obtaining method according to an embodiment of the present invention;
fig. 3 is a flowchart of a resource information obtaining method according to an embodiment of the present invention;
fig. 4 is a flowchart of a resource information obtaining method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a resource information acquiring apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device implementing the resource information acquisition method according to the embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in other sequences than those illustrated or described herein. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is a flowchart of a resource information obtaining method according to an embodiment of the present invention, where this embodiment is applicable to a case where resource information is queried by setting a query parameter, and the method may be executed by a resource information obtaining apparatus, where the resource information obtaining apparatus may be implemented in a form of hardware and/or software, and the resource information obtaining apparatus may be configured in various general-purpose computing devices, for example, the general-purpose computing device may be a Redfish server. As shown in fig. 1, the method includes:
s110, analyzing the resource information acquisition request, and determining a functional interface associated with the resource information acquisition request.
The resource information is information describing basic performance or operation state of the server. Exemplarily, the resource information is static information such as a manufacturer of the server, a Central Processing Unit (CPU) model, a memory size, and output power; the resource information may also be dynamic information such as the current memory usage rate, CPU usage rate, and CPU temperature of the server.
The resource information acquisition request is a request sent by a Redfish client (hereinafter, referred to as a client) to a Redfish server (hereinafter, referred to as a server) and used for acquiring resource information of the server. The resource information obtaining request is in the form of a Uniform Resource Locator (URL), and includes identification information of the functional interface that the client needs to call, for example, a hash value of the functional interface.
The functional interface is a Representational State Transfer (REST) interface predefined according to actual requirements of a client user, and the internal requirement of the functional interface realizes the acquisition and encapsulation functions of corresponding resource information.
In the embodiment of the invention, after receiving a resource information acquisition request sent by a client, a server firstly analyzes the resource information acquisition request to obtain the identifier of the functional interface contained in the resource information acquisition request, and then determines the functional interface associated with the current resource information acquisition request in a plurality of pre-maintained functional interfaces according to the identifier of the functional interface.
In a specific example, the server receives a resource information acquisition request in a URL form sent by the client, and parses the resource information acquisition request to obtain an interface hash value included in the resource information acquisition request. Further, a function interface matched with the current resource information acquisition request is searched in a function interface list maintained in advance according to the interface hash value.
S120, acquiring at least one item of resource information of the server through the functional interface.
In the embodiment of the invention, after the functional interface matched with the resource information acquisition request is found, at least one item of resource information of the server is inquired by calling the functional interface. Wherein, each functional interface has defined one or more items of resource information that the functional interface can obtain at the time of design. A user can inquire multiple resource information by initiating a resource information acquisition request once, and compared with the mode that different links are required to be accessed when different resource information is inquired in the prior art, the method simplifies the user operation and improves the convenience of inquiring the resource information.
S130, under the condition that the resource information acquisition request contains the query parameters, screening at least one item of resource information based on the query parameters to obtain target resource information.
The query parameter is used for filtering the acquired at least one item of resource information to obtain the resource information actually required by the user, and the query storage can be carried in the resource information acquisition request. Illustratively, the query parameter may be at least one of a filter type, and an expansion type.
In the implementation of the invention, when at least one item of resource information is acquired, the server further judges whether the resource information acquisition request contains the query parameter. And under the condition that the resource information acquisition request contains the query parameters, further screening at least one item of acquired resource information according to the query parameters to obtain target resource information. Specifically, if the query parameter belongs to the selection type, the resource information associated with the target set may be selected as the target resource information from the at least one item of resource information according to the target set specified by the query parameter; if the query parameter belongs to the filtering type, filtering at least one item of resource information according to the filtering condition specified by the query parameter to obtain target resource information; if the query parameter belongs to the expansion type, the corresponding hierarchy expansion can be performed on the acquired resource information according to the expansion hierarchy specified by the query parameter, so as to obtain the target resource information. In addition, under the condition that the resource information acquisition request does not contain the query parameters, the acquired at least one item of resource information can be directly fed back to the client.
After the plurality of items of resource information are acquired through the functional interface, the query parameters in the resource information acquisition request are further read, and the resource information is screened based on the query parameters, so that on one hand, information required by a user can be screened from the plurality of items of resource information, and the convenience of resource query is improved, and on the other hand, compared with a mode of directly reading the query parameters and screening information based on the query parameters and writing the information into the functional interface, the redundancy of codes in the functional interface can be avoided.
In a specific example, the functional interface a is called to query the power output power of each power module at the service end, and then the power output powers of 3 power modules included in the service end are queried. If the resource information acquisition request contains query parameters, the query parameters are of a selection type, the values of the query parameters are a set of two power supply modules, and two power supply output powers matched with the set are selected from the queried 3 power supply output powers as target resource information.
In another specific example, the function interface B is called to query the memory usage rate, the CPU usage rate and the CPU temperature of the server, and then the 3 kinds of resource information are queried. If the resource information acquisition request contains the query parameter, the query parameter is of a filter type, and the value of the query parameter is the memory utilization rate, then the memory utilization rate is filtered out from the queried 3 kinds of resource information to serve as target resource information.
In another specific example, the functional interface C is called to query the memory usage rate of the server, and then secondary links corresponding to 2 memories included in the server are queried. If the resource information acquisition request contains the query parameter, the query parameter is of an expansion (expanded) type, and the value of the query parameter is 2, the acquired secondary link needs to be further expanded to obtain a tertiary link or link content contained in the secondary link as target resource information.
According to the technical scheme of the embodiment of the invention, the resource information acquisition request is analyzed, the functional interface associated with the resource information acquisition request is determined, at least one item of resource information of the server is acquired through the functional interface, and finally, under the condition that the resource information acquisition request contains the query parameter, the at least one item of resource information is screened based on the query parameter to obtain the target resource information, so that the problems that different links need to be accessed when the client side acquires different types of resource information, the operation is complicated are solved, and the resource information acquisition convenience is improved.
Fig. 2 is a flowchart of a resource information obtaining method according to an embodiment of the present invention, and this embodiment further refines on the basis of the above embodiment, and provides specific steps of screening at least one item of resource information based on a query parameter to obtain target resource information. As shown in fig. 2, the method includes:
s210, analyzing the resource information acquisition request, and determining a functional interface associated with the resource information acquisition request.
S220, acquiring at least one item of resource information of the server through the functional interface.
And S230, under the condition that the resource information acquisition request contains the query parameters of the expansion type, expanding at least one item of resource information based on the target expansion level specified by the query parameters to obtain the target resource information.
In the embodiment of the invention, after at least one item of resource information of the server is acquired through the functional interface, whether the resource information acquisition request contains the query parameter is further judged. And if the expansion type query parameters are contained, expanding at least one item of resource information according to a target expansion level appointed by the query parameters to obtain lower-level information of the resource information as target resource information. By carrying the expansion type query parameters in the resource information acquisition request, the resource information of the specified level can be directly acquired without further accessing the subordinate link according to the resource information fed back by the server, thereby simplifying the resource information query operation.
In a specific example, the function interface C is called to query the resource information of the server, the queried result includes secondary links corresponding to 2 hard disks included in the server, and the secondary links point to the hard disk occupancy rates of the hard disks. If the resource information acquisition request does not contain the query parameters, the server directly feeds the 2 secondary links back to the client, and the client needs to access the 2 secondary links respectively to acquire the occupancy rates of the 2 hard disks. If the resource information acquisition request contains the expansion type query parameters and the specified target expansion level is 2, the acquired secondary link can be further expanded based on the query parameters to obtain the hard disk occupancy rate target resource information contained in the secondary link, and finally the disk occupancy rate is directly fed back to the client.
S240, under the condition that the resource information acquisition request contains the query parameters of the filtering type, filtering at least one item of resource information based on the target resource type specified by the query parameters to obtain the target resource information.
In the embodiment of the invention, after at least one item of resource information of the server is acquired through the functional interface, whether the resource information acquisition request contains the query parameter is further judged. And if the query parameters comprise the filtering type, filtering at least one item of resource information according to the target resource type specified by the query parameters, and finally taking the filtered resource information matched with the target resource type as the target resource information. By carrying the query parameters of the filtering type in the resource information acquisition request, the resource information of the type specified by the user can be directly acquired without further searching the resource information required by the user in a plurality of items of resource information fed back by the server, so that the resource information query efficiency is improved.
In a specific example, the functional interface B is called to query the memory usage rate, the CPU usage rate, and the CPU temperature of the server, and then the 3 resource information are queried. If the resource information acquisition request contains the query parameters, the query parameters are of the filtering type, the values of the query parameters are the CPU utilization rate and the CPU temperature, and the CPU utilization rate and the CPU temperature are filtered out from the queried 3 kinds of resource information to serve as target resource information.
And S250, under the condition that the resource information acquisition request contains the query parameters of the selection type, selecting the resource information related to the target set from at least one item of resource information as the target resource information based on the target set specified by the query parameters.
In the embodiment of the invention, after at least one item of resource information of the server is acquired through the functional interface, whether the resource information acquisition request contains the query parameter is further judged. And if the query parameters of the selection type are contained, selecting the resource information associated with the target set from the at least one item of resource information as the target resource information according to the target set specified by the query parameters. By carrying the query parameters of the selected types in the resource information acquisition request, the resource information of the set specified by the user can be directly acquired without further searching the resource information required by the user in a plurality of items of resource information fed back by the server, so that the resource information query efficiency is improved.
In a specific example, the calling functional interface a queries resource information of the server, and the query result includes output powers of 3 power modules included in the server. And if the resource information acquisition request contains the query parameters of the selected type, and the values of the query parameters are the set of two power supply modules, selecting two power supply output powers matched with the set from the queried 3 power supply output powers as target resource information.
According to the technical scheme of the embodiment of the invention, the query parameters of the expansion type, the filtering type or the selection type are added in the resource information acquisition request, and the hierarchy expansion, the filtering or the selection can be carried out on at least one item of resource information queried based on the query parameters to obtain the resource information actually required by the user.
Fig. 3 is a flowchart of a resource information obtaining method according to an embodiment of the present invention, which is further detailed based on the above embodiment, and provides specific steps of parsing a resource information obtaining request, determining a functional interface associated with the resource information obtaining request, and specific steps before parsing the resource information obtaining request. As shown in fig. 3, the method includes:
s310, initializing each functional interface; the functional interface is used for inquiring at least one item of resource information.
In the embodiment of the invention, the server needs to initialize at least one preset functional interface and add the corresponding functional interface into the interface list. And correspondingly storing each functional interface and the interface hash value corresponding to the functional interface in the interface list. The functional interface can be used for inquiring at least one item of resource information, and a user can inquire a plurality of items of resource information by sending a resource information acquisition request aiming at the functional interface.
S320, analyzing the configuration file of the server to obtain the hardware configuration information of the server. In the embodiment of the invention, after the initialization of the functional interface is completed, the configuration file of the server is further analyzed to obtain the hardware configuration information of the server. For example, the configuration file of the server is analyzed to obtain the number of the memories, the number of the hard disks, the number of the CPU modules, the number of the power modules, and the like included in the server.
S330, initializing the resource information of the server according to the hardware configuration information.
In the embodiment of the invention, after the configuration file is analyzed to obtain the hardware configuration information of the server, the resource information of the server is initialized further according to the hardware configuration information. Specifically, a storage resource for storing the resource information, a computing resource for calling the functional interface to query the resource information, and the like may be allocated in advance. Furthermore, various resource information possibly used by the user can be obtained in advance and stored in the pre-allocated storage resources. The resource information is obtained through a serial bus, for example, an I2C bus, and through an internal process running exclusively. The resource information is stored in the pre-respective storage spaces in advance, so that the resource information required by the user can be directly acquired in the storage spaces when the user initiates a resource information acquisition request, and compared with a mode of acquiring the resource after receiving the resource information acquisition request sent by the client, the time consumed by acquiring the resource signal can be reduced. After the initialization of the resource information is completed, the server starts to detect whether the client sends a resource information acquisition request in real time.
Optionally, the technical solution of the embodiment of the present invention further includes: and updating the resource information of the server through the resource information monitoring process according to a set time period.
In this optional embodiment, the server may further run a resource information monitoring process, where the process updates the resource information of the server according to a set time period, and stores the updated resource information in a pre-allocated storage space, so as to ensure timeliness of the resource information acquired by the user.
S340, analyzing the resource information acquisition request to obtain an interface hash value contained in the resource information acquisition request.
And S350, determining a functional interface associated with the resource information acquisition request in the functional interface list according to the interface hash value.
In the embodiment of the invention, after receiving the resource information acquisition request, the server can analyze the resource information acquisition request to obtain the interface hash value contained in the resource information acquisition request. And further acquiring a function interface associated with the resource information acquisition request in a function interface list maintained in advance according to the interface hash value. The resource information acquisition category is maintained in advance, so that the functional interface associated with the resource information acquisition request can be quickly positioned when the client initiates the resource information acquisition request, and the resource information acquisition efficiency is improved.
And S360, acquiring at least one item of resource information of the server through the functional interface.
Optionally, before acquiring at least one item of resource information of the server through the functional interface, the method may further include: and performing identity authentication on the client. For example, by displaying an identity authentication interface to the client, where the interface includes a user name and password input box, after receiving the user name and password input by the client, it is determined whether the current user is legal, and if so, the operation security can be improved by passing the identity authentication.
S370, under the condition that the resource information acquisition request contains the query parameters, screening at least one item of resource information based on the query parameters to obtain target resource information.
According to the technical scheme of the embodiment of the invention, the functional interface maintained by the server and the resource information are initialized in advance, so that the resource information can be maintained to the corresponding storage space in advance, and compared with the scheme of acquiring the resource after a user initiates a resource information acquisition request, the time consumption for acquiring the resource information can be reduced, and the resource information acquisition efficiency is improved. In addition, by maintaining the functional interface list, the functional interface associated with the resource information acquisition request can be conveniently and rapidly positioned when the client initiates the resource information acquisition request, and the resource information acquisition efficiency can be further improved.
Fig. 4 is a flowchart of a resource information obtaining method according to an embodiment of the present invention. As shown in fig. 4, the method includes:
s410, initializing at least one function interface predefined by the Redfish server, and storing the function interface into a function interface list.
S420, analyzing the configuration file of the Redfish server to obtain hardware configuration information, and initializing the resource information of the Refish server based on the hardware configuration information.
And S430, updating the resource information in real time through the resource information monitoring process.
And S440, responding to the resource information acquisition request, and determining a function interface associated with the resource information acquisition request.
And S450, judging whether the Redfish client passes the identity authentication, if so, executing S460, and otherwise, executing S491.
S460, acquiring at least one item of resource information through the functional interface.
S470 determines whether the resource information acquisition request includes the query parameter, if yes, then S480 is executed, and if no, then S491 is executed.
S480, obtaining query parameters of at least one type of expansion (expand) type, filter (filter) type and selection (select) type in the resource information obtaining request.
And S490, screening the resource information based on the query parameters to obtain target resource information.
And S491, feeding back the execution result to the Redfish client.
The resource information acquisition request is analyzed, the functional interface associated with the resource information acquisition request is determined, at least one item of resource information of the server side is acquired through the functional interface, and finally, under the condition that the resource information acquisition request contains the query parameter, the at least one item of resource information is screened based on the query parameter to obtain the target resource information.
Fig. 5 is a schematic structural diagram of a resource information obtaining apparatus according to an embodiment of the present invention. As shown in fig. 5, the apparatus includes:
a functional interface determining module 510, configured to parse the resource information obtaining request, and determine a functional interface associated with the resource information obtaining request;
a resource information obtaining module 520, configured to obtain at least one item of resource information of the server through the functional interface;
a resource information screening module 530, configured to, when the resource information obtaining request includes a query parameter, screen the at least one item of resource information based on the query parameter, to obtain target resource information.
According to the technical scheme of the embodiment of the invention, the resource information acquisition request is analyzed, the functional interface associated with the resource information acquisition request is determined, at least one item of resource information of the server is acquired through the functional interface, and finally, under the condition that the resource information acquisition request contains the query parameter, the at least one item of resource information is screened based on the query parameter to obtain the target resource information, so that the problems that different links need to be accessed when the client side acquires different types of resource information, the operation is complicated are solved, and the resource information acquisition convenience is improved.
Optionally, the resource information screening module 530 is specifically configured to:
and under the condition that the resource information acquisition request contains a query parameter of an expansion type, expanding the at least one item of resource information based on a target expansion level specified by the query parameter to obtain target resource information.
Optionally, the resource information screening module 530 is further specifically configured to:
and under the condition that the resource information acquisition request contains a query parameter of a filtering type, filtering the at least one item of resource information based on a target resource type specified by the query parameter to obtain target resource information.
Optionally, the resource information screening module 530 is further specifically configured to:
and under the condition that the resource information acquisition request comprises a query parameter of a selection type, selecting resource information associated with a target set from the at least one item of resource information as target resource information based on the target set specified by the query parameter.
Optionally, the resource information obtaining apparatus further includes:
and the resource information updating module is used for updating the resource information of the server according to a set time period through the resource information monitoring process.
Optionally, the functional interface determining module 510 is specifically configured to:
analyzing the resource information acquisition request to obtain an interface hash value contained in the resource information acquisition request;
and determining a functional interface associated with the resource information acquisition request in a functional interface list according to the interface hash value.
Optionally, the resource information obtaining apparatus further includes:
the function interface initialization module is used for initializing each function interface before analyzing the resource information acquisition request; the functional interface is used for inquiring at least one item of resource information;
the configuration information acquisition module is used for analyzing the configuration file of the server to obtain the hardware configuration information of the server;
and the resource information initialization module is used for initializing the resource information of the server according to the hardware configuration information.
The resource information acquisition device provided by the embodiment of the invention can execute the resource information acquisition method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
FIG. 6 illustrates a block diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 6, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 executes the respective methods and processes described above, such as the resource information acquisition method.
In some embodiments, the resource information acquisition method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the resource information acquisition method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the resource information acquisition method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A resource information acquisition method is characterized by comprising the following steps:
analyzing the resource information acquisition request, and determining a functional interface associated with the resource information acquisition request;
acquiring at least one item of resource information of a server through the functional interface;
and under the condition that the resource information acquisition request contains the query parameters, screening the at least one item of resource information based on the query parameters to obtain target resource information.
2. The method of claim 1, wherein the screening the at least one item of resource information based on the query parameter to obtain target resource information comprises:
and under the condition that the resource information acquisition request contains a query parameter of an expansion type, expanding the at least one item of resource information based on a target expansion level specified by the query parameter to obtain target resource information.
3. The method of claim 1, wherein the screening the at least one item of resource information based on the query parameter to obtain target resource information comprises:
and under the condition that the resource information acquisition request contains a query parameter of a filtering type, filtering the at least one item of resource information based on a target resource type specified by the query parameter to obtain target resource information.
4. The method according to any one of claims 1-3, wherein screening the at least one item of resource information based on the query parameter to obtain target resource information comprises:
and under the condition that the resource information acquisition request comprises a query parameter of a selection type, selecting resource information associated with a target set from the at least one item of resource information as target resource information based on the target set specified by the query parameter.
5. The method of claim 1, further comprising:
and updating the resource information of the server through the resource information monitoring process according to a set time period.
6. The method of claim 1, wherein parsing the resource information acquisition request to determine the functional interface associated with the resource information acquisition request comprises:
analyzing the resource information acquisition request to obtain an interface hash value contained in the resource information acquisition request;
and determining a functional interface associated with the resource information acquisition request in a functional interface list according to the interface hash value.
7. The method of claim 1, further comprising, prior to parsing the resource information acquisition request:
initializing each functional interface; the functional interface is used for inquiring at least one item of resource information;
analyzing the configuration file of the server to obtain hardware configuration information of the server;
and initializing the resource information of the server according to the hardware configuration information.
8. A resource information acquisition apparatus, comprising:
the functional interface determining module is used for analyzing the resource information acquisition request and determining a functional interface associated with the resource information acquisition request;
the resource information acquisition module is used for acquiring at least one item of resource information of the server through the functional interface;
and the resource information screening module is used for screening the at least one item of resource information based on the query parameters under the condition that the resource information acquisition request contains the query parameters to obtain target resource information.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the resource information acquisition method of any one of claims 1-7.
10. A computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions for causing a processor to implement the resource information acquisition method according to any one of claims 1 to 7 when executed.
CN202211468707.6A 2022-11-22 2022-11-22 Resource information acquisition method, device, equipment and storage medium Pending CN115858149A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211468707.6A CN115858149A (en) 2022-11-22 2022-11-22 Resource information acquisition method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211468707.6A CN115858149A (en) 2022-11-22 2022-11-22 Resource information acquisition method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115858149A true CN115858149A (en) 2023-03-28

Family

ID=85665046

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211468707.6A Pending CN115858149A (en) 2022-11-22 2022-11-22 Resource information acquisition method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115858149A (en)

Similar Documents

Publication Publication Date Title
US20190362016A1 (en) Frequent pattern analysis for distributed systems
CN111949832A (en) Method and device for analyzing dependency relationship of batch operation
US11366821B2 (en) Epsilon-closure for frequent pattern analysis
CN111984505A (en) Operation and maintenance data acquisition engine and acquisition method
CN115392501A (en) Data acquisition method and device, electronic equipment and storage medium
CN113590433B (en) Data management method, data management system, and computer-readable storage medium
CN111352951A (en) Data export method, device and system
CN110874365B (en) Information query method and related equipment thereof
JP6501924B2 (en) Method and server for canceling alert
CN116545905A (en) Service health detection method and device, electronic equipment and storage medium
CN112887113A (en) Method, device and system for processing data
CN115858149A (en) Resource information acquisition method, device, equipment and storage medium
CN115905322A (en) Service processing method and device, electronic equipment and storage medium
CN111885159B (en) Data acquisition method and device, electronic equipment and storage medium
CN113434585A (en) Resource saving method and equipment
CN112667682A (en) Data processing method, data processing device, computer equipment and storage medium
CN112948246B (en) AB test control method, device and equipment of data platform and storage medium
CN114610712A (en) Storage method, query method and related device of equipment identifier
CN115982188A (en) Database global identification generation method and device, electronic equipment and storage medium
CN117520601A (en) Graph database query method and device, storage medium, equipment and product
CN116320010A (en) Message processing method, device, equipment and storage medium
CN116302524A (en) Data processing system, method, electronic equipment and storage medium
CN115525659A (en) Data query method and device, electronic equipment and storage medium
CN117709902A (en) Material input method, device, equipment and medium based on BOM file
CN118312537A (en) Data processing method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination