CN112764995B - Server hardware resource monitoring method, device and medium - Google Patents
Server hardware resource monitoring method, device and medium Download PDFInfo
- Publication number
- CN112764995B CN112764995B CN202110105763.2A CN202110105763A CN112764995B CN 112764995 B CN112764995 B CN 112764995B CN 202110105763 A CN202110105763 A CN 202110105763A CN 112764995 B CN112764995 B CN 112764995B
- Authority
- CN
- China
- Prior art keywords
- plug
- server hardware
- monitoring
- target
- 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.)
- Active
Links
- 238000012544 monitoring process Methods 0.000 title claims abstract description 78
- 238000000034 method Methods 0.000 title claims abstract description 45
- 238000004806 packaging method and process Methods 0.000 claims abstract description 32
- 230000006870 function Effects 0.000 claims description 18
- 238000004590 computer program Methods 0.000 claims description 11
- 230000005540 biological transmission Effects 0.000 claims description 6
- 238000010276 construction Methods 0.000 claims description 5
- 238000005538 encapsulation Methods 0.000 claims description 4
- 238000012806 monitoring device Methods 0.000 claims description 3
- 230000002093 peripheral effect Effects 0.000 abstract description 9
- 230000008859 change Effects 0.000 abstract description 6
- 238000010168 coupling process Methods 0.000 abstract description 5
- 238000005859 coupling reaction Methods 0.000 abstract description 5
- 230000008569 process Effects 0.000 description 16
- 238000010586 diagram Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 238000012986 modification Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 230000005856 abnormality Effects 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 2
- 230000010365 information processing Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 230000006837 decompression Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3051—Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
- G06F9/44526—Plug-ins; Add-ons
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Quality & Reliability (AREA)
- Stored Programmes (AREA)
Abstract
The embodiment of the invention discloses a method, a device and a medium for monitoring server hardware resources, wherein a plug-in is created according to all server hardware names to be monitored so as to obtain a plug-in list; and packaging the corresponding interface for each plug-in according to the set interface packaging rule. When a monitoring request carrying a name identifier is acquired, searching a target plug-in matched with the name identifier from a plug-in list; and calling the target plug-in to monitor the state of the target server hardware, and transmitting the monitoring result to the front-end equipment through the interface corresponding to the target plug-in. And abstracting each server hardware into a plug-in form based on an abstract factory mode, wherein the plug-ins are mutually independent, and a low-coupling and high-cohesion monitoring software architecture is realized. And a universal plug-in interface is set, the front-end equipment and the background monitoring software framework are distinguished, the monitoring software framework of the background is not influenced by the change of the hardware peripheral of the server, and the expansibility and the universality of the monitoring software are improved.
Description
Technical Field
The present invention relates to the field of information processing technologies, and in particular, to a method and an apparatus for monitoring server hardware resources, and a computer-readable storage medium.
Background
With the development of information technologies such as cloud computing and big data, the demand of an information processing system on the performance of a server is higher and higher. In addition to increasing the number of servers for improving the performance of the servers, more and more high-performance hardware peripherals need to be adapted, such as a Solid State Drive (SSD) storage redundancy array extended by a hard Disk (Serial ATA, SATA) interface, and various application acceleration cards such as multimedia codec, network transmission, compression and decompression processing extended by a PCIE interface extended by a high speed Serial computer extended bus standard (PCIE).
However, the increased number of hardware poses a challenge to the stability of the server system, because hardware peripherals produced by different manufacturers and including different models and protocol standards usually have different device driver interfaces. And the device driving version is also continuously maintained and upgraded along with the time, the driving interface and even the hardware peripheral change condition may exist, and in order to monitor the running state of numerous hardware resources in real time, complex server monitoring software needs to be written to uniformly manage the numerous hardware resources.
At present, a common practice is to install different hardware peripherals on a server according to different service requirements, for example, install different PCIE accelerator cards according to different acceleration requirements, and then compile a set of monitoring software dedicated to the service scenario and adapt to an operating system of the server.
Different hardware respectively corresponds to different monitoring modules in monitoring software, the monitoring modules call the equipment driving interface to monitor the hardware state, and the monitoring software main frame executes each monitoring module in turn to monitor the running state of all the hardware. However, the error debugging probability in the early-stage software programming process is high, so that the software development period is long. The monitoring software has poor expandability, and when a hardware manufacturer upgrades a driver to repair a hardware fault, the monitoring module and the monitoring software main frame need to be modified, and the new modification may introduce other problems, such as causing other functional abnormalities of the monitoring module and even directly causing the abnormality of the monitoring software main frame. The monitoring software has poor universality, when the service scene changes greatly and the hardware architecture of the server needs to be modified, most monitoring modules cannot be used due to larger difference of hardware peripherals compared with the prior one, a set of monitoring software needs to be developed again, and all the coding work before is repeated at the moment, so that great repeated labor is caused.
Therefore, how to improve the expansibility and the universality of the monitoring software is a problem to be solved by the technical personnel in the field.
Disclosure of Invention
The embodiment of the invention aims to provide a method and a device for monitoring hardware resources of a server and a computer readable storage medium, which can improve the expansibility and the universality of monitoring software.
In order to solve the above technical problem, an embodiment of the present invention provides a server hardware resource monitoring method, including:
creating plug-ins according to all server hardware names to be monitored to obtain a plug-in list;
packaging corresponding interfaces for each plug-in according to a set interface packaging rule;
when a monitoring request carrying a name identifier is acquired, searching a target plug-in matched with the name identifier from the plug-in list;
calling the target plug-in to monitor the state of the target server hardware, and transmitting the monitoring result to the front-end equipment through an interface corresponding to the target plug-in; and the target server hardware is the server hardware corresponding to the name identifier.
Optionally, the creating a plug-in according to all names of the server hardware to be monitored to obtain a plug-in list includes:
reading all server hardware names to be monitored from the global configuration file;
creating a factory module according to the server hardware name, and creating a product module by using the factory module;
each factory module and the corresponding product module are combined to be used as a plug-in unit; the factory module is used for executing initialization and packaging operations on the product module; the product module is used for monitoring the server hardware.
Optionally, the encapsulating, according to a set interface encapsulation rule, a corresponding interface for each plug-in includes:
setting a corresponding number of interfaces for each plug-in according to the operation type contained by each plug-in; the interface corresponding to each operation type comprises a product creation interface and a character string analysis interface.
Optionally, when the monitoring request carrying the name identifier is obtained, the searching for the target plug-in matching the name identifier from the plug-in list includes:
analyzing the key value pair contained in the monitoring request; wherein each key-value pair comprises a function name and a parameter;
searching a target plug-in corresponding to the function name from the plug-in list;
correspondingly, before the calling the target plug-in to monitor the state of the target server hardware, the method further includes:
and calling a kernel driver to execute the operation corresponding to the parameter on the target server hardware.
Optionally, after encapsulating, according to the set interface encapsulation rule, the corresponding interface for each plug-in, further includes:
according to the obtained server hardware architecture, a configuration file matched with the server hardware architecture is constructed so as to search a target plug-in matched with the configuration file from the plug-in list; wherein, the configuration file includes name identifiers of each server hardware in the server hardware architecture.
Optionally, after the constructing a configuration file matched with the server hardware architecture according to the obtained server hardware architecture, the method further includes:
and when the server hardware architecture is changed, modifying the name identifier of the server hardware recorded in the configuration file according to the changed server hardware.
The embodiment of the application also provides a server hardware resource monitoring device, which comprises a creating unit, an encapsulating unit, a searching unit, a calling unit and a transmission unit;
the creating unit is used for creating plug-ins according to all the names of the server hardware to be monitored so as to obtain a plug-in list;
the packaging unit is used for packaging corresponding interfaces for the plug-ins according to a set interface packaging rule;
the searching unit is used for searching a target plug-in matched with the name identifier from the plug-in list when a monitoring request carrying the name identifier is acquired;
the calling unit is used for calling the target plug-in to monitor the state of the target server hardware;
the transmission unit is used for transmitting the monitoring result to the front-end equipment through the interface corresponding to the target plug-in; and the target server hardware is the server hardware corresponding to the name identifier.
Optionally, the creating unit is configured to read all server hardware names to be monitored from the global configuration file; creating a factory module according to the server hardware name, and creating a product module by using the factory module; each factory module and the corresponding product module are combined to be used as a plug-in unit; the factory module is used for executing initialization and packaging operations on the product module; the product module is used for monitoring the server hardware.
Optionally, the packaging unit is configured to set a corresponding number of interfaces for each of the plug-ins according to an operation type included in each of the plug-ins; the interface corresponding to each operation type comprises a product creation interface and a character string analysis interface.
Optionally, the search unit includes a parsing subunit and a search subunit;
the analysis subunit is used for analyzing the key value pairs contained in the monitoring request; wherein each key-value pair comprises a function name and a parameter;
the searching subunit is configured to search the target plugin corresponding to the function name from the plugin list;
correspondingly, the calling unit is also included before the calling of the target plug-in monitors the state of the target server hardware;
and the calling unit is used for calling the kernel driver to execute the operation corresponding to the parameter on the target server hardware.
Optionally, the system further comprises a file construction unit;
the file construction unit is used for constructing a configuration file matched with the server hardware architecture according to the acquired server hardware architecture so as to search a target plug-in matched with the configuration file from the plug-in list; wherein, the configuration file includes name identifiers of each server hardware in the server hardware architecture.
Optionally, a modification unit is further included;
and the modifying unit is used for modifying the name identifier of the server hardware recorded in the configuration file according to the changed server hardware when the server hardware architecture is changed.
The embodiment of the invention also provides a server hardware resource monitoring device, which comprises:
a memory for storing a computer program;
a processor for executing the computer program to implement the steps of the server hardware resource monitoring method as described in any one of the above.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the server hardware resource monitoring method are implemented as in any one of the above.
According to the technical scheme, the plug-ins are created according to the names of all the server hardware to be monitored so as to obtain a plug-in list; and packaging the corresponding interface for each plug-in according to the set interface packaging rule. By creating plug-ins, a unified management of all types of server hardware that are common can be achieved. And the corresponding interface is set for each plug-in unit, so as to ensure the normal calling of each plug-in unit. The plug-in can realize the state monitoring of the corresponding server hardware. When a monitoring request carrying a name identifier is acquired, a target plug-in matched with the name identifier can be searched from a plug-in list; calling a target plug-in to monitor the state of the target server hardware, and transmitting a monitoring result to the front-end equipment through an interface corresponding to the target plug-in; the target server hardware is the server hardware corresponding to the name identifier. In the technical scheme, the hardware of each server is abstracted into a plug-in form based on an abstract factory mode, and the plug-ins are mutually independent, so that a monitoring software architecture with low coupling and high cohesion is realized. And a universal plug-in interface is set, the front-end equipment and the background monitoring software framework are distinguished, the monitoring software framework of the background is not influenced by the change of the hardware peripheral of the server, and the expansibility and the universality of the monitoring software are improved.
Drawings
In order to illustrate the embodiments of the present invention more clearly, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of a method for monitoring hardware resources of a server according to an embodiment of the present invention;
fig. 2 is a block diagram of a system for monitoring hardware resources of a server based on a plug-in technology according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a server hardware resource monitoring apparatus according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a hardware structure of a server hardware resource monitoring apparatus according to an embodiment of the present invention.
Detailed Description
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 obtained by a person of ordinary skill in the art based on the embodiments of the present invention without any creative work belong to the protection scope of the present invention.
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
Next, a method for monitoring hardware resources of a server according to an embodiment of the present invention is described in detail. Fig. 1 is a flowchart of a server hardware resource monitoring method according to an embodiment of the present invention, where the method includes:
s101: and creating plug-ins according to all the names of the server hardware to be monitored so as to obtain a plug-in list.
In the embodiment of the invention, in order to realize a low-coupling and high-cohesion monitoring software architecture, different server hardware is set into a plug-in form based on an abstract factory mode simulation plug-in technology.
In practical application, all server hardware names to be monitored can be read from the global configuration file; creating a factory module according to the name of the server hardware, and creating a product module by using the factory module; each factory module and the corresponding product module are combined to be used as a plug-in unit; the factory module is used for executing initialization and packaging operations on the product module; the product module is used for monitoring the server hardware.
The server hardware may include a Central Processing Unit (CPU) memory, a hard disk, other expansion hardware, and the like.
The same type of product modules are further packaged into a uniform interface form on the basis of the original equipment driving interface, and a plurality of product modules can be packaged for each server hardware to show various states of monitoring the same equipment.
The initialization processes of different product modules are packaged into different factory modules, so that the situation that the complex hardware initialization process needs to be directly called in a monitoring software main frame when the hardware initialization process to be monitored is complex is avoided.
S102: and packaging the corresponding interface for each plug-in according to the set interface packaging rule.
In the embodiment of the invention, the corresponding number of interfaces can be set for each plug-in according to the operation type contained in each plug-in; the interface corresponding to each operation type comprises a product creation interface and a character string analysis interface.
In the embodiment of the invention, the same type of factory modules can be defined into a uniform interface form, so that the reuse of factory code is facilitated.
S103: and when the monitoring request carrying the name identifier is acquired, searching a target plug-in matched with the name identifier from the plug-in list.
The function of each plug-in is realized by a function, and the name identifier can be a function name. In the embodiment of the present invention, the function name and the parameter involved in the monitoring request may be carried in the form of a key-value pair.
The background service process can analyze the key value pair contained in the monitoring request; wherein each key-value pair comprises a function name and a parameter; searching a target plug-in corresponding to the function name from the plug-in list; and calling the kernel driver to execute the operation corresponding to the parameter on the target server hardware. The target server hardware is the server hardware monitored by the target plug-in. I.e. the target server hardware is the server hardware corresponding to the name identity.
S104: and calling the target plug-in to monitor the state of the target server hardware, and transmitting the monitoring result to the front-end equipment through the interface corresponding to the target plug-in.
In combination with the above description, the function name and the parameter involved in the monitoring request are carried in the form of a key-value pair, and accordingly, the function name and the operation result involved in the monitoring result may also be recorded in the form of a key-value pair.
In the embodiment of the present invention, a front-end device and a background monitoring software framework may be independently configured, and as shown in fig. 2, the monitoring software on a computing platform may include a foreground display process and a background service process. According to different functions to be realized, the foreground display process of the front-end equipment can be divided into two parts, namely monitoring data forwarding and a user interaction interface. The user interaction module in the foreground display process can be used for acquiring the monitoring request and displaying the monitoring state. According to different functions to be realized, the background service process can be divided into three parts of monitoring data forwarding, plug-in scheduling and plug-in registration. The background service process may maintain a plug-in list, where the plug-in list includes a plurality of plug-ins, each plug-in includes a factory module and a product module, and different plug-ins are distinguished by different numbers in fig. 2.
The monitoring data forwarding module in the background service process can be used for communicating with the foreground display process. And the plug-in registration module in the background service process is used for registering the product module and the factory module representing the plug-in the plug-in list through the global configuration file. And the plug-in scheduling module in the background service process is used for processing the monitoring request sent by the foreground display process. And hardware equipment which can be required to be monitored in the equipment list to be monitored. The kernel-state device driver list includes all device drivers of the hardware to be monitored, which are used for controlling the hardware and obtaining the hardware state, and has a one-to-many mapping relationship with the product module, that is, the device driver can provide a plurality of plug-in interfaces for setting/obtaining different device attributes.
According to the technical scheme, the plug-ins are created according to the names of all the server hardware to be monitored so as to obtain a plug-in list; and packaging the corresponding interface for each plug-in according to the set interface packaging rule. By creating plug-ins, a unified management of all types of server hardware that are common can be achieved. And the corresponding interface is set for each plug-in unit, so as to ensure the normal calling of each plug-in unit. The plug-in can realize the state monitoring of the corresponding server hardware. When a monitoring request carrying a name identifier is acquired, a target plug-in matched with the name identifier can be searched from a plug-in list; calling a target plug-in to monitor the state of the target server hardware, and transmitting a monitoring result to the front-end equipment through an interface corresponding to the target plug-in; wherein, the target server hardware identifies the corresponding server hardware for the name. In the technical scheme, the hardware of each server is abstracted into a plug-in form based on an abstract factory mode, and the plug-ins are mutually independent, so that a monitoring software architecture with low coupling and high cohesion is realized. And a universal plug-in interface is set, the front-end equipment and the background monitoring software framework are distinguished, the monitoring software framework of the background is not influenced by the change of the hardware peripheral of the server, and the expansibility and the universality of the monitoring software are improved.
In practical application, a configuration file matched with the server hardware architecture can be constructed according to the acquired server hardware architecture, so that a target plug-in matched with the configuration file can be conveniently searched from a plug-in list; the configuration file comprises name identifiers of server hardware in the server hardware architecture.
When the server hardware architecture changes, a corresponding plug-in is called according to the server hardware contained in the server hardware architecture, so as to monitor each server hardware in the current server hardware architecture. In practical application, when the server hardware architecture is changed, the name identifier of the server hardware recorded in the configuration file can be modified according to the changed server hardware.
By modifying the configuration file, the requirements of different server hardware architectures can be met. When the hardware architecture of the server is changed due to the change of business requirements in the later stage of the project, only the configuration file needs to be modified, and the plug-in corresponding to the configuration file is called from the plug-in list, so that the monitoring software main frame does not need to be modified, and a set of monitoring software does not need to be recompiled, so that the later-stage upgrading and maintaining cost of the software is relatively low.
Fig. 3 is a schematic structural diagram of a server hardware resource monitoring apparatus according to an embodiment of the present invention, including a creating unit 31, an encapsulating unit 32, a searching unit 33, a calling unit 34, and a transmitting unit 35;
the creating unit 31 is configured to create a plug-in according to all server hardware names to be monitored, so as to obtain a plug-in list;
the packaging unit 32 is used for packaging corresponding interfaces for each plug-in according to a set interface packaging rule;
the searching unit 33 is configured to search, when the monitoring request carrying the name identifier is acquired, a target plug-in matching the name identifier from the plug-in list;
the calling unit 34 is used for calling the target plug-in to monitor the state of the target server hardware;
the transmission unit 35 is configured to transmit the monitoring result to the front-end device through the interface corresponding to the target plug-in; the target server hardware is the server hardware corresponding to the name identifier.
Optionally, the creating unit is configured to read all server hardware names to be monitored from the global configuration file; creating a factory module according to the name of the server hardware, and creating a product module by using the factory module; each factory module and the corresponding product module are combined to be used as a plug-in unit; the factory module is used for executing initialization and packaging operations on the product module; the product module is used for monitoring the server hardware.
Optionally, the packaging unit is configured to set a corresponding number of interfaces for each plug-in according to an operation type included in each plug-in; the interface corresponding to each operation type comprises a product creation interface and a character string analysis interface.
Optionally, the search unit includes a parsing subunit and a search subunit;
the analysis subunit is used for analyzing the key value pairs contained in the monitoring request; wherein each key-value pair comprises a function name and a parameter;
the searching subunit is used for searching the target plug-in corresponding to the function name from the plug-in list;
correspondingly, the system also comprises a calling unit before calling the target plug-in to monitor the state of the target server hardware;
and the calling unit is used for calling the kernel driver to execute the operation corresponding to the parameter on the target server hardware.
Optionally, the system further comprises a file construction unit;
the file construction unit is used for constructing a configuration file matched with the server hardware architecture according to the acquired server hardware architecture so as to search a target plug-in matched with the configuration file from the plug-in list; the configuration file comprises name identifiers of server hardware in the server hardware architecture.
Optionally, a modification unit is further included;
and the modifying unit is used for modifying the name identifier of the server hardware recorded in the configuration file according to the changed server hardware when the server hardware architecture is changed.
The description of the features in the embodiment corresponding to fig. 3 may refer to the related description of the embodiment corresponding to fig. 1, and is not repeated here.
According to the technical scheme, the plug-ins are created according to the names of all the server hardware to be monitored so as to obtain a plug-in list; and packaging the corresponding interface for each plug-in according to the set interface packaging rule. By creating plug-ins, a unified management of all types of server hardware that are common can be achieved. And the corresponding interface is set for each plug-in unit, so as to ensure the normal calling of each plug-in unit. The plug-in can realize the state monitoring of the corresponding server hardware. When a monitoring request carrying a name identifier is acquired, a target plug-in matched with the name identifier can be searched from a plug-in list; calling a target plug-in to monitor the state of the target server hardware, and transmitting a monitoring result to front-end equipment through an interface corresponding to the target plug-in; the target server hardware is the server hardware corresponding to the name identifier. In the technical scheme, the hardware of each server is abstracted into a plug-in form based on an abstract factory mode, and the plug-ins are mutually independent, so that a monitoring software architecture with low coupling and high cohesion is realized. And a universal plug-in interface is set, the front-end equipment and the background monitoring software framework are distinguished, the monitoring software framework of the background is not influenced by the change of the hardware peripheral of the server, and the expansibility and the universality of the monitoring software are improved.
Fig. 4 is a schematic diagram of a hardware structure of a server hardware resource monitoring apparatus 40 according to an embodiment of the present invention, including:
a memory 41 for storing a computer program;
a processor 42 for executing a computer program for implementing the steps of the server hardware resource monitoring method according to any of the embodiments described above.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the server hardware resource monitoring method according to any of the above embodiments are implemented.
The foregoing describes a method, an apparatus, and a computer-readable storage medium for monitoring a hardware resource of a server according to embodiments of the present invention in detail. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the apparatus of the embodiment disclosure, since it corresponds to the method of the embodiment disclosure, therefore, the description is simple, and the relevant points can be referred to the description of the method part. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Claims (8)
1. A server hardware resource monitoring method is characterized by comprising the following steps:
creating plug-ins according to all server hardware names to be monitored to obtain a plug-in list; all the plugins in the plugin list are independent;
packaging corresponding interfaces for each plug-in according to a set interface packaging rule;
when a monitoring request carrying a name identifier is acquired, searching a target plug-in matched with the name identifier from the plug-in list;
calling the target plug-in to monitor the state of the target server hardware, and transmitting the monitoring result to the front-end equipment through an interface corresponding to the target plug-in; the target server hardware is the server hardware corresponding to the name identifier;
after the corresponding interface is encapsulated for each plug-in according to the set interface encapsulation rule, the method further comprises the following steps:
according to the obtained server hardware architecture, a configuration file matched with the server hardware architecture is constructed so as to search a target plug-in matched with the configuration file from the plug-in list; the configuration file comprises name identifiers of server hardware in the server hardware architecture;
after the configuration file matched with the server hardware architecture is constructed according to the acquired server hardware architecture, the method further comprises the following steps:
and when the server hardware architecture is changed, modifying the name identifier of the server hardware recorded in the configuration file according to the changed server hardware.
2. The method for monitoring the hardware resources of the server according to claim 1, wherein the creating the plug-in according to all the names of the server hardware to be monitored to obtain the plug-in list comprises:
reading all server hardware names to be monitored from the global configuration file;
creating a factory module according to the server hardware name, and creating a product module by using the factory module;
each factory module and the corresponding product module are combined to be used as a plug-in unit; the factory module is used for executing initialization and packaging operations on the product module; the product module is used for monitoring the server hardware.
3. The method for monitoring the hardware resource of the server according to claim 1, wherein the encapsulating, according to the set interface encapsulation rule, the corresponding interface for each plug-in includes:
setting a corresponding number of interfaces for each plug-in according to the operation type contained by each plug-in; the interface corresponding to each operation type comprises a product creation interface and a character string analysis interface.
4. The method for monitoring the hardware resource of the server according to claim 1, wherein the searching for the target plug-in matching the name identifier from the plug-in list when the monitoring request carrying the name identifier is acquired includes:
analyzing the key value pair contained in the monitoring request; wherein each key-value pair comprises a function name and a parameter;
searching a target plug-in corresponding to the function name from the plug-in list;
correspondingly, before the calling the target plug-in to monitor the state of the target server hardware, the method further includes:
and calling a kernel driver to execute the operation corresponding to the parameter on the target server hardware.
5. A server hardware resource monitoring device is characterized by comprising a creating unit, a packaging unit, a searching unit, a calling unit, a transmission unit, a file constructing unit and a modifying unit;
the creating unit is used for creating plug-ins according to all the names of the server hardware to be monitored so as to obtain a plug-in list; all the plugins in the plugin list are independent;
the packaging unit is used for packaging corresponding interfaces for the plug-ins according to a set interface packaging rule;
the searching unit is used for searching a target plug-in matched with the name identifier from the plug-in list when a monitoring request carrying the name identifier is acquired;
the calling unit is used for calling the target plug-in to monitor the state of the target server hardware;
the transmission unit is used for transmitting the monitoring result to the front-end equipment through the interface corresponding to the target plug-in; the target server hardware is the server hardware corresponding to the name identifier;
the file construction unit is used for constructing a configuration file matched with the server hardware architecture according to the acquired server hardware architecture so as to search a target plug-in matched with the configuration file from the plug-in list; the configuration file comprises name identifiers of server hardware in the server hardware architecture;
and the modifying unit is used for modifying the name identifier of the server hardware recorded in the configuration file according to the changed server hardware when the server hardware architecture is changed.
6. The apparatus according to claim 5, wherein the creating unit is configured to read all names of the server hardware to be monitored from a global configuration file; creating a factory module according to the server hardware name, and creating a product module by using the factory module; each factory module and the corresponding product module are combined to be used as a plug-in unit; the factory module is used for executing initialization and packaging operations on the product module; the product module is used for monitoring the server hardware.
7. A server hardware resource monitoring apparatus, comprising:
a memory for storing a computer program;
a processor for executing said computer program to implement the steps of the server hardware resource monitoring method according to any one of claims 1 to 4.
8. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the server hardware resource monitoring method according to any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110105763.2A CN112764995B (en) | 2021-01-26 | 2021-01-26 | Server hardware resource monitoring method, device and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110105763.2A CN112764995B (en) | 2021-01-26 | 2021-01-26 | Server hardware resource monitoring method, device and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112764995A CN112764995A (en) | 2021-05-07 |
CN112764995B true CN112764995B (en) | 2023-04-07 |
Family
ID=75705823
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110105763.2A Active CN112764995B (en) | 2021-01-26 | 2021-01-26 | Server hardware resource monitoring method, device and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112764995B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113590215B (en) * | 2021-07-15 | 2023-05-12 | 福建星云检测技术有限公司 | Plug-in type upper computer communication method and system |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105491337A (en) * | 2015-12-10 | 2016-04-13 | 公安部交通管理科学研究所 | Universal network video monitoring equipment access method and apparatus based on SDK abstract layer |
CN105656947A (en) * | 2016-03-30 | 2016-06-08 | 深圳市金证科技股份有限公司 | Method, device and system for interaction between transaction middleware and third-party system |
CN106850332A (en) * | 2016-12-12 | 2017-06-13 | 中电科华云信息技术有限公司 | Application dynamic monitoring and controlling method and system based on cloud |
CN107168275A (en) * | 2017-03-23 | 2017-09-15 | 许继集团有限公司 | A kind of relay protection function module automatic identification collocation method and device |
CN108829462A (en) * | 2018-06-21 | 2018-11-16 | 安徽大中润科技有限公司 | A kind of display methods of information, system and plug-in management platform |
CN110308949A (en) * | 2019-06-28 | 2019-10-08 | 深圳市酷开网络科技有限公司 | Implementation method, device and the computer readable storage medium of plug-in unit frame |
CN111143165A (en) * | 2019-12-20 | 2020-05-12 | 深圳前海微众银行股份有限公司 | Monitoring method and device |
CN111596967A (en) * | 2020-04-27 | 2020-08-28 | 中国银联股份有限公司 | Application function configuration method, terminal device, server and storage medium |
-
2021
- 2021-01-26 CN CN202110105763.2A patent/CN112764995B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105491337A (en) * | 2015-12-10 | 2016-04-13 | 公安部交通管理科学研究所 | Universal network video monitoring equipment access method and apparatus based on SDK abstract layer |
CN105656947A (en) * | 2016-03-30 | 2016-06-08 | 深圳市金证科技股份有限公司 | Method, device and system for interaction between transaction middleware and third-party system |
CN106850332A (en) * | 2016-12-12 | 2017-06-13 | 中电科华云信息技术有限公司 | Application dynamic monitoring and controlling method and system based on cloud |
CN107168275A (en) * | 2017-03-23 | 2017-09-15 | 许继集团有限公司 | A kind of relay protection function module automatic identification collocation method and device |
CN108829462A (en) * | 2018-06-21 | 2018-11-16 | 安徽大中润科技有限公司 | A kind of display methods of information, system and plug-in management platform |
CN110308949A (en) * | 2019-06-28 | 2019-10-08 | 深圳市酷开网络科技有限公司 | Implementation method, device and the computer readable storage medium of plug-in unit frame |
CN111143165A (en) * | 2019-12-20 | 2020-05-12 | 深圳前海微众银行股份有限公司 | Monitoring method and device |
CN111596967A (en) * | 2020-04-27 | 2020-08-28 | 中国银联股份有限公司 | Application function configuration method, terminal device, server and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN112764995A (en) | 2021-05-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108566290B (en) | Service configuration management method, system, storage medium and server | |
US9348771B1 (en) | Cloud-based instrument driver system | |
CN110750592B (en) | Data synchronization method, device and terminal equipment | |
CN107025167B (en) | Method and apparatus for data flow analysis using compiler type information in processor trace logs | |
CN112527647B (en) | NS-3-based Raft consensus algorithm test system | |
US20160359923A1 (en) | Method, system and server for self-healing of electronic apparatus | |
CN111897548A (en) | Front-end resource publishing method and device, electronic equipment and computer storage medium | |
CN112906054A (en) | Multi-tenant database isolation method and device and electronic equipment | |
US10552280B2 (en) | In-band monitor in system management mode context for improved cloud platform availability | |
CN111651144B (en) | Satellite-borne driving framework design method based on real-time operating system | |
CN115242894B (en) | Data processing method, device, storage medium and computer equipment | |
CN104468811A (en) | Upgrading method and device | |
CN112764995B (en) | Server hardware resource monitoring method, device and medium | |
CN114116509A (en) | Program analysis method, program analysis device, electronic device, and storage medium | |
US11334461B2 (en) | Distributed application resource determination based on performance metrics | |
CN109189652A (en) | A kind of acquisition method and system of close network terminal behavior data | |
CN114579250A (en) | Method, device and storage medium for constructing virtual cluster | |
WO2023276039A1 (en) | Server management device, server management method, and program | |
CN112464596B (en) | Regression testing method, system, equipment and readable storage medium | |
CN113703339A (en) | Automatic driving simulation method, device, equipment and storage medium | |
CN105160259B (en) | A kind of virtualization vulnerability mining system and method based on fuzz testing | |
US20240223441A1 (en) | Apparatus and method for centralized fault monitoring | |
CN112448854B (en) | Kubernetes complex network policy system and implementation method thereof | |
CN113064797B (en) | Front-end monitoring method and device, electronic equipment and storage medium | |
CN108319500B (en) | Operation method and device of cloud computing system 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |