CN115941546A - System interface monitoring method and device, electronic equipment and storage medium - Google Patents

System interface monitoring method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115941546A
CN115941546A CN202211511506.XA CN202211511506A CN115941546A CN 115941546 A CN115941546 A CN 115941546A CN 202211511506 A CN202211511506 A CN 202211511506A CN 115941546 A CN115941546 A CN 115941546A
Authority
CN
China
Prior art keywords
interface
state code
preset
index list
monitoring
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.)
Granted
Application number
CN202211511506.XA
Other languages
Chinese (zh)
Other versions
CN115941546B (en
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.)
Chongqing Changan Automobile Co Ltd
Original Assignee
Chongqing Changan Automobile 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 Chongqing Changan Automobile Co Ltd filed Critical Chongqing Changan Automobile Co Ltd
Priority to CN202211511506.XA priority Critical patent/CN115941546B/en
Publication of CN115941546A publication Critical patent/CN115941546A/en
Application granted granted Critical
Publication of CN115941546B publication Critical patent/CN115941546B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The present application relates to the field of computer application technologies, and in particular, to a method and an apparatus for monitoring a system interface, an electronic device, and a storage medium, where the method includes: acquiring measurement data of all system interfaces, wherein the measurement data comprises interface state codes; updating a preset measurement index list according to the measurement data, and detecting whether an interface state code of a system interface in the preset measurement index list is a target state code; if the interface state code is detected to be the target state code, the system interface corresponding to the interface state code is judged to be an abnormal interface, and the abnormal type of the abnormal interface is determined according to the actual type of the target state code. Therefore, the problems that when the systems are interacted in an interface mode, interface monitoring is not achieved, the problems of related systems are caused due to the fact that the interfaces are in problems, the positioning problem is long in time, the repairing cost is high and the like are solved.

Description

System interface monitoring method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer application technologies, and in particular, to a method and an apparatus for monitoring a system interface, an electronic device, and a storage medium.
Background
With the continuous development of the intelligent technology, the system is more and more complex and huge, one system is composed of a plurality of modules, the system can be a component of a larger system which is subordinate to the system, the systems are interdependent, and the interaction between the systems is usually performed in an interface mode for reasons of safety, convenience in maintenance, convenience in use and the like, for example, a portal system calls an interface of an attendance system to display attendance information, and the portal system calls an interface of a process management system and the like.
At present, the interface state of each system is not monitored and managed, the reasons for the abnormal interface are many, such as server abnormality, address configuration error and the like, if the abnormal interface occurs, the system calling the interface will have some problems, usually, the time spent for positioning the system problem is longer, and the cost for repairing the problem is too high.
Disclosure of Invention
The application provides a monitoring method and device for system interfaces, electronic equipment and a storage medium, and aims to solve the problems that when systems are interacted in an interface mode, interface monitoring is not achieved, the problems of related systems are caused by the problems of interfaces, the positioning problem time is long, the repair cost is high and the like.
An embodiment of a first aspect of the present application provides a method for monitoring a system interface, including the following steps: acquiring measurement data of all system interfaces, wherein the measurement data comprises interface state codes; updating a preset measurement index list according to the measurement data, and detecting whether an interface state code of a system interface in the preset measurement index list is a target state code; if the interface state code is detected to be the target state code, judging that a system interface corresponding to the interface state code is an abnormal interface, and determining the abnormal type of the abnormal interface according to the actual type of the target state code.
According to the technical means, the measurement index list can be updated according to the measurement data of the system interface, whether the state code of the system interface in the list is the target state code or not is detected, whether the interface is abnormal or not and the type of the abnormal interface are judged, the system interface is monitored, the time for finding the problem is shortened, the cost for processing the problem is reduced, and the working efficiency of the system is improved.
Optionally, the detecting whether the interface status code of the system interface in the preset metric index list is a target status code includes: monitoring the interface state code of each system interface in the preset measurement index list by using a monitoring index program of preset monitoring software, and judging that the interface state code is the target state code if the target state code is captured when the target state code is captured.
According to the technical means, the state code of the system interface can be monitored through the monitoring index program of the monitoring software, and automatic monitoring and automatic capture of the target state code are achieved.
Optionally, the metric data further includes an interface name, an interface tag, and an interface description, and the updating a preset metric index list according to the metric data includes: judging whether the measurement data is stored in the preset measurement index list or not according to the interface name; if the interface label and the interface description are not stored in the preset measurement index list, the interface label and the interface description are stored in a preset data structure, the label value of the preset measurement index list is updated according to the preset data structure, and the data value of the preset measurement index list is updated according to the interface state code.
According to the technical means, the embodiment of the application can realize automatic updating of the measurement index list by judging whether the interface name exists in the measurement index list, and can realize monitoring of multiple interfaces in the system.
Optionally, judging whether the metric data is stored in the preset metric index list according to the interface name includes: reading a storage catalog of the measurement data; traversing all files in the storage directory to obtain a file list; traversing the content of each file in the file list, reading the interface name in the file line by line, if the interface name exists in the preset measurement index list, judging that the measurement data is stored in the preset measurement index list, otherwise, judging that the measurement data is not stored in the preset measurement index list.
According to the technical means, the embodiment of the application judges whether the measurement data of the system interface exists in the measurement index list according to the interface name so as to monitor various system interfaces in the following process.
An embodiment of a second aspect of the present application provides a monitoring apparatus for a system interface, including: the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring measurement data of all system interfaces, and the measurement data comprises interface state codes; the detection module is used for updating a preset measurement index list according to the measurement data and detecting whether an interface state code of a system interface in the preset measurement index list is a target state code or not; and the judging module is used for judging that the system interface corresponding to the interface state code is an abnormal interface if the interface state code is detected to be the target state code, and determining the abnormal type of the abnormal interface according to the actual type of the target state code.
Optionally, the detection module is further configured to: monitoring the interface state code of each system interface in the preset measurement index list by using a monitoring index program of preset monitoring software, and judging that the interface state code is the target state code if the target state code is captured when the target state code is captured.
Optionally, the metric data further includes an interface name, an interface tag, and an interface description, and the detection module is further configured to: judging whether the measurement data is stored in the preset measurement index list or not according to the interface name; if the interface label and the interface description are not stored in the preset measurement index list, the interface label and the interface description are stored in a preset data structure, the label value of the preset measurement index list is updated according to the preset data structure, and the data value of the preset measurement index list is updated according to the interface state code.
Optionally, the detection module is further configured to include: reading a storage catalog of the measurement data; traversing all files in the storage directory to obtain a file list; traversing the content of each file in the file list, reading the interface name in the file line by line, if the interface name exists in the preset measurement index list, judging that the measurement data is stored in the preset measurement index list, otherwise, judging that the measurement data is not stored in the preset measurement index list.
An embodiment of a third aspect of the present application provides an electronic device, including: a memory, a processor and a computer program stored in the memory and running on the processor, wherein the processor executes the program to realize the monitoring method of the system interface according to the above embodiment.
A fourth aspect of the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor, so as to implement the monitoring method for a system interface according to the foregoing embodiment.
Therefore, the application has at least the following beneficial effects:
(1) According to the embodiment of the application, the measurement index list can be updated according to the measurement data of the system interface, whether the state code of the system interface in the list is the target state code or not is detected, and whether the interface is abnormal or not and the type of the abnormality is judged, so that the system interface is monitored, the time for finding the problem is shortened, the cost for processing the problem is reduced, and the working efficiency of the system is improved.
(2) According to the embodiment of the application, the state code of the system interface can be monitored through the monitoring index program of the monitoring software, so that automatic monitoring and automatic capture of the target state code are realized.
(3) According to the embodiment of the application, whether the interface name exists in the measurement index list or not can be judged, the measurement index list can be automatically updated, and monitoring on multiple interfaces in the system can be achieved.
(4) The embodiment of the application can judge whether the measurement data of the system interface exists in the measurement index list according to the interface name so as to monitor various system interfaces in the following process.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a flowchart of a monitoring method for a system interface according to an embodiment of the present application;
FIG. 2 is a flow chart of a method for monitoring a system interface according to an embodiment of the present application;
FIG. 3 is an exemplary diagram of a monitoring device of a system interface provided in accordance with an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application.
A monitoring method, an apparatus, an electronic device, and a storage medium of a system interface according to embodiments of the present application are described below with reference to the accompanying drawings. The method comprises the steps that the state of a service interface is monitored, and the measurement information exposed by a user-defined exporter is collected in a grabbing mode, so that the state of the service is monitored. Therefore, the problems that when the systems are interacted in an interface mode, the problem of the interface is caused, the problem of the related system is caused, the problem positioning time is long, the repairing cost is high and the like are solved.
Specifically, fig. 1 is a schematic flowchart of a monitoring method for a system interface according to an embodiment of the present disclosure.
As shown in fig. 1, the monitoring method of the system interface includes the following steps:
in step S101, metric data of all system interfaces is obtained, where the metric data includes an interface status code.
The measurement data includes an interface status code, an interface name, an interface tag, an interface description, and the like.
The interface status code may include 200, 404, 500, etc. Different interface status codes represent different interface statuses, 200 represents that the server successfully provided the requested page, 404 represents that the server did not find the requested page, and 600 represents that the server encountered an error and failed to complete the request.
In step S102, the preset metric index list is updated according to the metric data, and whether an interface status code of a system interface in the preset metric index list is a target status code is detected.
The preset measurement index list is a file list for storing measurement data.
Wherein, the target state code refers to the state code displayed when the interface is abnormal.
It can be understood that, in the embodiment of the present application, the preset metric index list may be updated according to the metric data of the system interface, and whether the interface status code of the system interface is the target status code may be queried in the list.
In the embodiment of the present application, updating the preset metric index list according to the metric data includes: judging whether the measurement data is stored in a preset measurement index list or not according to the interface name; if the preset measurement index list is not stored, the interface label and the interface description are stored in a preset data structure, the label value of the preset measurement index list is updated according to the preset data structure, and the data value of the preset measurement index list is updated according to the interface state code.
The preset data structure refers to a mode of storing an interface tag and an interface description, and may be set to provide a Gauge data structure for a third-party library of Prometheus, which is not limited herein.
It should be noted that, as the system is continuously iterated, the number of interfaces may increase, and the status codes of the interfaces may also change due to different reasons, a third library of Prometheus provides a data structure Gauge suitable for such a scenario, and the Gauge represents a single value that may dynamically change, and may increase or decrease, so that the measurement index data may be stored in the Gauge data using the Gauge data structure in a scenario in which the interface status changes continuously.
It can be understood that, in the embodiment of the present application, whether data has been stored in the metric index list or not may be determined according to an interface name, when the interface name does not exist in the preset metric index list, the interface tag and the interface description are stored in the preset data structure, and the tag value and the data value of the preset metric index list are updated.
In the embodiment of the present application, determining whether the metric data is stored in the preset metric index list according to the interface name includes: reading a storage catalog of the measurement data; traversing all files in the storage directory to obtain a file list; traversing the content of each file in the file list, reading the interface names in the files line by line, if the interface names exist in the preset measurement index list, judging that the measurement data are stored in the preset measurement index list, otherwise, judging that the measurement data are not stored in the preset measurement index list.
It can be understood that, in the embodiment of the present application, for the storage directory of the metric data, files under the storage metric index directory are traversed, a file list is obtained, contents in a single file are traversed, interface names in the files are read line by line, and whether the metric data is already stored in the metric index list is determined by the interface names.
It should be noted that, the present application may traverse the preset measurement index list for multiple times, determine whether the interface name exists in the preset measurement list at regular intervals, and update the tag value and the data value if the interface name exists in the preset measurement list. The fixed time may be set to 10s, which is not limited to this, and the data value is the status code.
In this embodiment of the present application, detecting whether an interface status code of a system interface in a preset metric index list is a target status code includes: monitoring the interface state code of each system interface in the preset measurement index list by using a monitoring index program of preset monitoring software, and judging that the interface state code is the target state code if the target state code is captured when the target state code is captured.
The preset monitoring software is used for monitoring the interface state and can be set to be promethenus.
The monitoring index program of the preset monitoring software is a self-defined monitoring index program exporter.
It should be noted that the monitoring indicator program needs to be run on one server, the server may be linux, and a third-party library for implementing the coding language environment Python and Prometheus required by the monitoring indicator program is installed on the server.
It can be understood that, in the embodiment of the present application, the monitoring indicator program in the monitoring software may be used to monitor the interface status code of each system interface in the measurement indicator list, capture the target status code, and if the target status code is captured, determine that the interface status code is the target status code.
Taking the target status code as 404 as an example, the reporter of Promethenus is used to monitor the interface status code of the system a interface, and Promethenus is used to capture the interface status code with the status code of 404.
In step S103, if it is detected that the interface status code is the target status code, it is determined that the system interface corresponding to the interface status code is an abnormal interface, and an abnormal type of the abnormal interface is determined according to an actual type of the target status code.
It can be understood that, in the embodiment of the present application, when the interface status code is detected to be abnormal, the interface is judged to be abnormal, and the type of the abnormal interface is judged according to the type of the status code.
Specifically, in the method for monitoring the system interface according to the embodiment, a business department of a research and development team outputs a measurement index to a specified directory according to a standard (interface name | tag | interface state code | description); secondly, the operation and maintenance personnel background starts a monitoring index program to process the measurement indexes, and finally the program is exposed to Prometous for grabbing. An instance of this procedure may be configured on the Prometheus monitor side to listen to, for example: http:// xx.xx.xx.xx.xx: port/metrics.
It should be noted that, the monitoring method for the system interface according to the foregoing embodiment may not only monitor the interface state, but also obtain the access amount of the page, and when the measurement data is output to the specified directory, the Prometheus may also capture, for example, output: a page | env = prod |500 intagli the amount of access of the a page. The exporter can obtain page access measurement data under the polling directory, and Prometheus captures the data exposed by the exporter, so that the access amount of a production (prod) environment of the A page is 500.
The following describes a monitoring method of a system interface by using a specific embodiment, and the steps shown in fig. 2 are as follows:
step 1, applying for a linux server for monitoring the operation of an index program (exporter).
And 2, installing a coding language environment (python) and a third-party library of Prometheus required by realizing the program on the server.
And 3, traversing files stored in the measurement index directory aiming at the storage directory of the measurement data to obtain a file list.
And 4, traversing the contents in the single file according to the file list obtained in the last step, reading the interface names in the file line by line, judging whether the data is stored in the measurement index list or not through the interface names, and storing the interface names and the label names in the Gauge data structure and the measurement index list when the interface names do not exist in the measurement index list.
And 5, traversing the file again, judging whether the interface name exists in the measurement index list every 10 seconds, and if so, updating the tag value and the data value, wherein the data value is the state code in the scene.
And 6, exposing the port of the program to a promethenus server for monitoring.
And 7, when the Promethenus grabbing interface state codes are error codes such as 404 and 500, sending a message to inform corresponding personnel of paying attention.
In summary, the embodiment of the present application can realize automatic monitoring of the interface state, and one interface has a plurality of state codes to represent different states: 200 (the server successfully served the requested page); 404 (the server cannot find the requested web page); 500 The method comprises the steps of outputting interface names, interface state codes, labels and descriptions of the services to a directory as measurement data, collecting the measurement data through a self-defined monitoring index program, continuously processing the monitoring data, namely continuously monitoring the state codes of the interfaces, continuously monitoring newly generated interface measurement data to generate measurement indexes, finally exposing the monitoring index program to Prometheus to find out, finding out abnormal state codes with the state of 404 or 500 and the like through configuring matching rules after the Prometheus grabs the application indexes, and sending the abnormal state codes to relevant personnel to pay attention to the processing in time. The problem that a plurality of interfaces of the system are more and the interfaces are not monitored is solved to a great extent, the working efficiency is greatly improved, and the stability and the usability of the system are ensured.
According to the monitoring method of the system interface provided by the embodiment of the application, the measurement index list can be updated according to the measurement data of the system interface, whether the state code of the system interface in the list is the target state code or not is detected, and whether the interface is abnormal or not and the type of the abnormality are judged, so that the monitoring of the system interface is realized, the time for finding the problem is reduced, the cost for processing the problem is reduced, and the working efficiency of the system is improved; the state code of the system interface can be monitored through a monitoring index program of the monitoring software, so that automatic monitoring and automatic capture of the target state code are realized; the automatic updating of the measurement index list can be realized by judging whether the interface name exists in the measurement index list, and the monitoring of multiple interfaces in the system can be realized; whether the measurement data of the system interface exists in the measurement index list can be judged according to the interface name so as to monitor various system interfaces in the following process.
Next, a monitoring apparatus of a system interface according to an embodiment of the present application is described with reference to the drawings.
Fig. 3 is a block diagram illustrating a monitoring apparatus of a system interface according to an embodiment of the present application.
As shown in fig. 3, the monitoring apparatus 10 of the system interface includes: the device comprises an acquisition module 100, a detection module 200 and a judgment module 300.
The obtaining module 100 is configured to obtain metric data of all system interfaces, where the metric data includes an interface status code; the detection module 200 is configured to update a preset measurement index list according to the measurement data, and detect whether an interface status code of a system interface in the preset measurement index list is a target status code; the determining module 300 is configured to determine that the system interface corresponding to the interface status code is an abnormal interface if it is detected that the interface status code is the target status code, and determine an abnormal type of the abnormal interface according to an actual type of the target status code.
In this embodiment of the application, the detection module 200 is further configured to: monitoring the interface state code of each system interface in the preset measurement index list by using a monitoring index program of preset monitoring software, and judging that the interface state code is the target state code if the target state code is captured when the target state code is captured.
In this embodiment of the present application, the measurement data further includes an interface name, an interface tag, and an interface description, and the detection module 200 is further configured to: judging whether the measurement data is stored in a preset measurement index list or not according to the interface name; if the preset measurement index list is not stored, the interface label and the interface description are stored in a preset data structure, the label value of the preset measurement index list is updated according to the preset data structure, and the data value of the preset measurement index list is updated according to the interface state code.
In this embodiment of the application, the detection module 200 is further configured to include: reading a storage catalog of the measurement data; traversing all files in the storage directory to obtain a file list; traversing the content in each file in the file list, reading the interface names in the files line by line, if the interface names exist in the preset measurement index list, judging that the measurement data is stored in the preset measurement index list, otherwise, judging that the measurement data is not stored in the preset measurement index list.
It should be noted that the foregoing explanation on the embodiment of the monitoring method for a system interface is also applicable to the monitoring apparatus for a system interface of this embodiment, and is not described herein again.
According to the monitoring device of the system interface provided by the embodiment of the application, the measurement index list can be updated according to the measurement data of the system interface, whether the state code of the system interface in the list is the target state code or not is detected, and whether the interface is abnormal or not and the type of the abnormality are judged, so that the monitoring of the system interface is realized, the time for finding the problem is reduced, the cost for processing the problem is reduced, and the working efficiency of the system is improved; the state code of the system interface can be monitored through a monitoring index program of the monitoring software, so that automatic monitoring and automatic capture of the target state code are realized; the automatic updating of the measurement index list can be realized by judging whether the interface name exists in the measurement index list, and the monitoring of multiple interfaces in the system can be realized; whether the measurement data of the system interface exists in the measurement index list can be judged according to the interface name so as to monitor various system interfaces in the following process.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device may include:
memory 401, processor 402, and computer programs stored on memory 401 and executable on processor 402.
The processor 402 implements the method of monitoring the system interface provided in the above embodiments when executing the program.
Further, the electronic device further includes:
a communication interface 403 for communication between the memory 401 and the processor 402.
A memory 401 for storing computer programs operable on the processor 402.
The Memory 401 may include a high-speed RAM (Random Access Memory) Memory, and may also include a non-volatile Memory, such as at least one disk Memory.
If the memory 401, the processor 402 and the communication interface 403 are implemented independently, the communication interface 403, the memory 401 and the processor 402 may be connected to each other through a bus and perform communication with each other. The bus may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 4, but this does not indicate only one bus or one type of bus.
Optionally, in a specific implementation, if the memory 401, the processor 402, and the communication interface 403 are integrated on a chip, the memory 401, the processor 402, and the communication interface 403 may complete mutual communication through an internal interface.
Processor 402 may be a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement embodiments of the present Application.
Embodiments of the present application also provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the above method for monitoring a system interface.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or N embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "N" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more N executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of implementing the embodiments of the present application.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a programmable gate array, a field programmable gate array, or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.

Claims (10)

1. A method for monitoring a system interface, comprising the steps of:
acquiring measurement data of all system interfaces, wherein the measurement data comprises interface state codes;
updating a preset measurement index list according to the measurement data, and detecting whether an interface state code of a system interface in the preset measurement index list is a target state code;
if the interface state code is detected to be the target state code, the system interface corresponding to the interface state code is judged to be an abnormal interface, and the abnormal type of the abnormal interface is determined according to the actual type of the target state code.
2. The method of claim 1, wherein the detecting whether the interface status code of the system interface in the preset metric indicator list is a target status code comprises:
monitoring the interface state code of each system interface in the preset measurement index list by using a monitoring index program of preset monitoring software, and judging that the interface state code is the target state code if the target state code is captured when the target state code is captured.
3. The method of claim 1, wherein the metric data further includes an interface name, an interface tag, and an interface description, and wherein updating a preset metric index list based on the metric data comprises:
judging whether the measurement data is stored in the preset measurement index list or not according to the interface name;
if the interface label and the interface description are not stored in the preset measurement index list, the interface label and the interface description are stored in a preset data structure, the label value of the preset measurement index list is updated according to the preset data structure, and the data value of the preset measurement index list is updated according to the interface state code.
4. The method of claim 3, wherein determining whether the metric data is stored in the predetermined metric list according to the interface name comprises:
reading a storage catalog of the measurement data;
traversing all files in the storage directory to obtain a file list;
traversing the content of each file in the file list, reading the interface name in the file line by line, if the interface name exists in the preset measurement index list, judging that the measurement data is stored in the preset measurement index list, otherwise, judging that the measurement data is not stored in the preset measurement index list.
5. A system interface monitoring apparatus, comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring measurement data of all system interfaces, and the measurement data comprises interface state codes;
the detection module is used for updating a preset measurement index list according to the measurement data and detecting whether an interface state code of a system interface in the preset measurement index list is a target state code or not;
and the judging module is used for judging that the system interface corresponding to the interface state code is an abnormal interface if the interface state code is detected to be the target state code, and determining the abnormal type of the abnormal interface according to the actual type of the target state code.
6. The apparatus of claim 5, wherein the detection module is further configured to:
monitoring the interface state code of each system interface in the preset measurement index list by using a monitoring index program of preset monitoring software, and judging that the interface state code is the target state code if the target state code is captured when the target state code is captured.
7. The apparatus of claim 5, wherein the metric data further comprises an interface name, an interface tag, and an interface description, and wherein the detection module is further configured to:
judging whether the measurement data is stored in the preset measurement index list or not according to the interface name;
if the interface label and the interface description are not stored in the preset measurement index list, the interface label and the interface description are stored in a preset data structure, the label value of the preset measurement index list is updated according to the preset data structure, and the data value of the preset measurement index list is updated according to the interface state code.
8. The apparatus of claim 7, wherein the detection module is further configured to:
reading a storage catalog of the measurement data;
traversing all files in the storage directory to obtain a file list;
traversing the content of each file in the file list, reading the interface name in the file line by line, if the interface name exists in the preset measurement index list, judging that the measurement data is stored in the preset measurement index list, otherwise, judging that the measurement data is not stored in the preset measurement index list.
9. An electronic device, comprising: memory, processor and computer program stored on the memory and executable on the processor, the processor executing the program to implement the method of monitoring a system interface according to any one of claims 1 to 4.
10. A computer-readable storage medium, on which a computer program is stored, which program is executable by a processor for implementing a method for monitoring a system interface according to any one of claims 1 to 4.
CN202211511506.XA 2022-11-29 2022-11-29 Monitoring method and device of system interface, electronic equipment and storage medium Active CN115941546B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211511506.XA CN115941546B (en) 2022-11-29 2022-11-29 Monitoring method and device of system interface, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211511506.XA CN115941546B (en) 2022-11-29 2022-11-29 Monitoring method and device of system interface, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115941546A true CN115941546A (en) 2023-04-07
CN115941546B CN115941546B (en) 2024-06-14

Family

ID=86648361

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211511506.XA Active CN115941546B (en) 2022-11-29 2022-11-29 Monitoring method and device of system interface, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115941546B (en)

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8195890B1 (en) * 2006-08-22 2012-06-05 Sawyer Law Group, P.C. Method for maintaining cache coherence using a distributed directory with event driven updates
CN104636256A (en) * 2015-02-17 2015-05-20 中国农业银行股份有限公司 Memory access abnormity detecting method and memory access abnormity detecting device
US20170205255A1 (en) * 2014-07-17 2017-07-20 Infibra Technologies S.R.L. Method and apparatus for measuring a distributed physical value of an optical device under test
CN107423110A (en) * 2017-05-31 2017-12-01 郑州云海信息技术有限公司 A kind of virtual machine method of real-time and its device based on libvirt
CN108134708A (en) * 2016-12-01 2018-06-08 腾讯科技(深圳)有限公司 The method and apparatus for monitoring third party's interface
CN108829560A (en) * 2018-06-01 2018-11-16 平安科技(深圳)有限公司 Data monitoring method, device, computer equipment and storage medium
CN110716866A (en) * 2019-09-06 2020-01-21 中国平安财产保险股份有限公司 Code quality scanning method and device, computer equipment and storage medium
CN110798376A (en) * 2019-10-09 2020-02-14 苏宁云计算有限公司 Interface testing method and device, computer equipment and storage medium
CN111651318A (en) * 2020-04-30 2020-09-11 中国平安财产保险股份有限公司 Prometheus-based interface monitoring method and device, computer equipment and storage medium
CN111796978A (en) * 2020-06-29 2020-10-20 苏州好玩友网络科技有限公司 Interface detection method, device, system, equipment and storage medium
US20210133015A1 (en) * 2019-11-01 2021-05-06 Splunk Inc. In a microservices-based application, mapping distributed error stacks across multiple dimensions
US20210133014A1 (en) * 2019-11-01 2021-05-06 Splunk Inc. Tracking error propagation across microservices based applications using distributed error stacks
WO2021129024A1 (en) * 2019-12-24 2021-07-01 中兴通讯股份有限公司 Method for recognizing state of communication device, and communication system and storage medium
CN113312263A (en) * 2021-06-07 2021-08-27 维沃移动通信(杭州)有限公司 Anomaly monitoring method and device
US20220027379A1 (en) * 2020-07-21 2022-01-27 Observe, Inc. Data capture and visualization system providing temporal data relationships
CN115277355A (en) * 2022-07-30 2022-11-01 重庆长安汽车股份有限公司 Method, device, equipment and medium for processing state code data of monitoring system

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8195890B1 (en) * 2006-08-22 2012-06-05 Sawyer Law Group, P.C. Method for maintaining cache coherence using a distributed directory with event driven updates
US20170205255A1 (en) * 2014-07-17 2017-07-20 Infibra Technologies S.R.L. Method and apparatus for measuring a distributed physical value of an optical device under test
CN104636256A (en) * 2015-02-17 2015-05-20 中国农业银行股份有限公司 Memory access abnormity detecting method and memory access abnormity detecting device
CN108134708A (en) * 2016-12-01 2018-06-08 腾讯科技(深圳)有限公司 The method and apparatus for monitoring third party's interface
CN107423110A (en) * 2017-05-31 2017-12-01 郑州云海信息技术有限公司 A kind of virtual machine method of real-time and its device based on libvirt
CN108829560A (en) * 2018-06-01 2018-11-16 平安科技(深圳)有限公司 Data monitoring method, device, computer equipment and storage medium
CN110716866A (en) * 2019-09-06 2020-01-21 中国平安财产保险股份有限公司 Code quality scanning method and device, computer equipment and storage medium
CN110798376A (en) * 2019-10-09 2020-02-14 苏宁云计算有限公司 Interface testing method and device, computer equipment and storage medium
US20210133015A1 (en) * 2019-11-01 2021-05-06 Splunk Inc. In a microservices-based application, mapping distributed error stacks across multiple dimensions
US20210133014A1 (en) * 2019-11-01 2021-05-06 Splunk Inc. Tracking error propagation across microservices based applications using distributed error stacks
WO2021129024A1 (en) * 2019-12-24 2021-07-01 中兴通讯股份有限公司 Method for recognizing state of communication device, and communication system and storage medium
CN111651318A (en) * 2020-04-30 2020-09-11 中国平安财产保险股份有限公司 Prometheus-based interface monitoring method and device, computer equipment and storage medium
CN111796978A (en) * 2020-06-29 2020-10-20 苏州好玩友网络科技有限公司 Interface detection method, device, system, equipment and storage medium
US20220027379A1 (en) * 2020-07-21 2022-01-27 Observe, Inc. Data capture and visualization system providing temporal data relationships
CN113312263A (en) * 2021-06-07 2021-08-27 维沃移动通信(杭州)有限公司 Anomaly monitoring method and device
CN115277355A (en) * 2022-07-30 2022-11-01 重庆长安汽车股份有限公司 Method, device, equipment and medium for processing state code data of monitoring system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
MATTI HOLOPAINEN: "Monitoring Container Environment with Prometheus and Grafana", METROPOLIA UNIVERSITY OF APPLIED SCIENCES, 5 March 2021 (2021-03-05) *
熊喵君的博客: "理解Prometheus的基本数据类型及应用(基础篇)-Prometheus介绍及基础应用", pages 1 - 2, Retrieved from the Internet <URL:https://pandaychen.github.io/2020/04/11/PROMETHEUS-METRICS-INTRO/> *
黄静;陈秋燕;: "基于Prometheus + Grafana实现企业园区信息化PaaS平台监控", 数字通信世界, no. 09, 1 September 2020 (2020-09-01) *

Also Published As

Publication number Publication date
CN115941546B (en) 2024-06-14

Similar Documents

Publication Publication Date Title
CN110661659B (en) Alarm method, device and system and electronic equipment
CN112486629B (en) Micro-service state detection method, micro-service state detection device, electronic equipment and storage medium
CN109710439B (en) Fault processing method and device
CN112699007A (en) Method, system, network device and storage medium for monitoring machine performance
CN115499302A (en) Monitoring method and device of business system, readable storage medium and electronic equipment
CN109818808B (en) Fault diagnosis method and device and electronic equipment
CN111654405B (en) Method, device, equipment and storage medium for fault node of communication link
CN113590172A (en) Code file publishing method, device, equipment and storage medium
CN115941546B (en) Monitoring method and device of system interface, electronic equipment and storage medium
CN113765687A (en) Fault alarm method, device, equipment and storage medium of server
CN112416731B (en) Stability monitoring method and device applied to block chain system
CN115643200A (en) Abnormity detection method, abnormity detection device, electronic equipment and medium
CN114500249A (en) Root cause positioning method and device
CN113886122A (en) System operation exception handling method, device, equipment and storage medium
CN114116128A (en) Method, device, equipment and storage medium for fault diagnosis of container instance
US10296967B1 (en) System, method, and computer program for aggregating fallouts in an ordering system
CN112291805A (en) OMC system monitoring method, device, equipment and readable storage medium
CN117421337B (en) Data acquisition method, device, equipment and computer readable medium
CN110909378A (en) Automatic detection method and device, storage medium and electronic equipment
CN116599581B (en) Reliability assessment method, device, equipment and medium for optical fiber sensing network
CN111737132B (en) Method, system, electronic device and storage medium for issuing project code data
CN109656776B (en) Completeness inspection method and equipment for abnormal monitoring of computer system
CN117950901A (en) Abnormal root cause positioning method, equipment, medium and product
CN114911672A (en) Data processing method and device
CN112433915A (en) Data monitoring method based on distributed performance monitoring tool and related device

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