CN114218041A - Dynamic process monitoring method, device, equipment and storage medium - Google Patents

Dynamic process monitoring method, device, equipment and storage medium Download PDF

Info

Publication number
CN114218041A
CN114218041A CN202111524156.6A CN202111524156A CN114218041A CN 114218041 A CN114218041 A CN 114218041A CN 202111524156 A CN202111524156 A CN 202111524156A CN 114218041 A CN114218041 A CN 114218041A
Authority
CN
China
Prior art keywords
monitoring
label
target process
tag
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111524156.6A
Other languages
Chinese (zh)
Inventor
谭锦志
蔡亮
王恒芳
李伟
胡麦芳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Qulian Technology Co Ltd
Original Assignee
Hangzhou Qulian Technology 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 Hangzhou Qulian Technology Co Ltd filed Critical Hangzhou Qulian Technology Co Ltd
Priority to CN202111524156.6A priority Critical patent/CN114218041A/en
Publication of CN114218041A publication Critical patent/CN114218041A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3024Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Testing And Monitoring For Control Systems (AREA)

Abstract

The application provides a dynamic process monitoring method, a device, equipment and a computer readable storage medium; the method in the application comprises the following steps: accessing a monitoring label database to obtain a monitoring label of a monitored node; scanning the running process in the monitored node, and determining a target process carrying the monitoring label in the monitored node; and collecting monitoring data of the target process, and determining the process running state of the target process according to the monitoring data. According to the technical scheme, monitoring registration logic does not need to be added in the monitoring system, and the process monitoring stability is improved; meanwhile, decoupling of the monitoring initiator and the monitored node is achieved, complexity of the monitoring system is reduced, reliability of process monitoring is improved, and maintenance cost is reduced.

Description

Dynamic process monitoring method, device, equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for monitoring a dynamic process.
Background
At present, the existing process monitoring method needs to fix registration information to a monitoring system for monitoring before monitoring is initiated frequently or a container, so that the monitoring information is relatively complicated to maintain; secondly, the monitoring initiator needs to notify the monitoring module of the process to be monitored and the monitoring information corresponding to the process through a direct calling or remote calling mode, and the mode of registering and monitoring among the modules through a request or notification mode is unstable, so that the condition of notification delay or failure often exists, and the existing monitoring mode enables the whole process monitoring flow and the monitoring module to be highly coupled, thereby increasing the complexity of the system and improving the maintenance cost.
Disclosure of Invention
The embodiment of the application provides a dynamic process monitoring method, a dynamic process monitoring device, a dynamic process monitoring equipment and a dynamic process monitoring storage medium, and aims to solve the technical problem that process monitoring is unstable due to high coupling of process monitoring and monitoring modules in the prior art.
In one aspect, an embodiment of the present application provides a dynamic process monitoring method, where the dynamic process monitoring method includes the following steps:
accessing a monitoring label database to obtain a monitoring label of a monitored node;
scanning the running process in the monitored node, and determining a target process carrying the monitoring label in the monitored node;
and collecting monitoring data of the target process, and determining the process running state of the target process according to the monitoring data.
In some embodiments of the present application, before accessing the monitoring tag database and obtaining the monitoring tag of the monitored node, the method further includes:
reading process attribute data of the target process;
and writing the process attribute data into a preset tag to obtain a monitoring tag of the target process, and storing the monitoring tag into a preset monitoring tag database.
In some embodiments of the present application, before the obtaining a target process to be monitored in the monitored node and generating a monitoring tag of the target process, the method further includes:
acquiring a target process to be monitored in the monitored node, and generating a monitoring label of the target process;
determining the environmental information of the target process, and determining the injection strategy of the monitoring label according to the environmental information;
and adding the monitoring label to the target process according to the injection strategy.
In some embodiments of the present application, the determining the environmental information of the target process and determining the injection policy of the monitoring tag according to the environmental information includes:
reading the environmental information of the target process, and if the environmental information of the target process is a physical machine environment, determining that a monitoring label injection strategy is a physical machine label injection strategy;
and if the environment information of the target process is a container environment, determining that the monitoring label injection strategy is a container label injection strategy.
In some embodiments of the present application, the adding the monitoring tag to the target process according to the injection policy includes:
determining the monitoring label injection strategy as a physical machine label injection strategy;
and respectively inserting the monitoring tags into any one or more process parameters of the environment variable, the starting parameter and the process name of the target process based on the physical machine tag injection strategy.
In some embodiments of the present application, the adding the monitoring tag to the target process according to the injection policy includes:
determining that the monitoring label injection strategy is a container label injection strategy;
and respectively inserting the monitoring tags into one or more container process parameters in a starting command option, a container name and an environment variable of the target process based on the container tag injection strategy.
In some embodiments of the present application, after collecting the monitoring data of the target process and determining the process running state of the target process according to the monitoring data, the method further includes:
analyzing the monitoring data and determining the running state of the target process;
and if the running state of the target process is the running stop state, deleting the monitoring data and stopping monitoring the target process.
In another aspect, the present application provides a dynamic process monitoring apparatus, including:
the label acquisition module is configured to access the monitoring label database and acquire the monitoring label of the monitored node;
a process scanning module configured to scan an operating process in the monitored node and determine a target process carrying the monitoring tag in the monitored node;
and the process monitoring module is configured to collect monitoring data of the target process and determine the process running state of the target process according to the monitoring data.
On the other hand, the present application further provides a dynamic process monitoring device, which includes:
one or more processors;
a memory; and
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the dynamic process monitoring method.
In another aspect, the present application further provides a computer readable storage medium, on which a computer program is stored, where the computer program is loaded by a processor to execute the steps in the dynamic process monitoring method.
In the application, the monitoring database is accessed to obtain the monitoring labels of all monitored processes in the monitored nodes stored in the monitoring database; after the monitoring label is obtained, the running process in the monitored node is scanned, the target process carrying the monitoring label in the monitored node is determined, the monitoring data of the target process is collected, and the monitoring data is analyzed to obtain the process running state of the target process. Therefore, monitoring registration logic does not need to be added in the monitoring system, and the process monitoring stability is improved; meanwhile, decoupling of the monitoring initiator and the monitored node is achieved, complexity of the monitoring system is reduced, reliability of process monitoring is improved, and maintenance cost is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a scene schematic diagram of a dynamic process monitoring method according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating an embodiment of a dynamic process monitoring method according to the present application;
fig. 3 is a schematic flowchart of an embodiment of injecting a monitoring tag into a target process through an injection policy in the dynamic process monitoring method provided in the embodiment of the present application;
fig. 4 is a schematic flowchart of an embodiment of injecting a tag by a physical machine tag injection policy in the dynamic process monitoring method provided in the embodiment of the present application;
fig. 5 is a schematic flow chart of an embodiment of injecting a monitoring tag in a container tag injection policy in the dynamic process monitoring method provided in the embodiment of the present application;
FIG. 6 is a schematic structural diagram of an embodiment of a dynamic process monitoring apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an embodiment of a dynamic process monitoring apparatus provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the present invention, it is to be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. indicate orientations or positional relationships based on those shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be considered as limiting the present invention. 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, features defined as "first", "second", may explicitly or implicitly include one or more of the described features. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
In this application, the word "exemplary" is used to mean "serving as an example, instance, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments. The following description is presented to enable any person skilled in the art to make and use the invention. In the following description, details are set forth for the purpose of explanation. It will be apparent to one of ordinary skill in the art that the present invention may be practiced without these specific details. In other instances, well-known structures and processes are not shown in detail to avoid obscuring the description of the invention with unnecessary detail. Thus, the present invention is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
At present, the existing process monitoring method needs to fix registration information to a monitoring system for monitoring before monitoring is initiated frequently or a container, so that the monitoring information is relatively complicated to maintain; secondly, the monitoring initiator needs to notify the monitoring module of the process to be monitored and the monitoring information corresponding to the process through a direct calling or remote calling mode, and the mode of registering and monitoring among the modules through a request or notification mode is unstable, so that the condition of notification delay or failure often exists, and the existing monitoring mode enables the whole process monitoring flow and the monitoring module to be highly coupled, thereby increasing the complexity of the system and improving the maintenance cost.
Based on this, the application provides a dynamic process monitoring method, device, equipment and computer readable storage medium, so as to solve the technical problem in the prior art that process monitoring is unstable due to high coupling of process monitoring and monitoring modules.
The dynamic process monitoring method in the embodiment of the invention is applied to a dynamic process monitoring device, the dynamic process monitoring device is arranged in a dynamic process monitoring device, one or more processors, a memory and one or more application programs are arranged in the dynamic process monitoring device, wherein the one or more application programs are stored in the memory and are configured to be executed by the processor to implement the dynamic process monitoring method; the dynamic process monitoring equipment can be an intelligent terminal of each node of the block chain, such as a mobile phone, a tablet computer, an intelligent television, network equipment, an intelligent computer and the like; optionally, the dynamic process monitoring device may also be a server or a service cluster formed by multiple servers.
As shown in fig. 1, fig. 1 is a scene schematic diagram of a dynamic process monitoring method according to an embodiment of the present application, where a dynamic process monitoring scene in the embodiment of the present application includes a dynamic process monitoring device 100 (a dynamic process monitoring apparatus is integrated in the dynamic process monitoring device 100), and a computer-readable storage medium corresponding to the dynamic process monitoring method is run in the dynamic process monitoring device 100 to execute steps of the dynamic process monitoring method.
It should be understood that the dynamic process monitoring device in the dynamic process monitoring method scenario shown in fig. 1, or the devices included in the dynamic process monitoring device, do not constitute a limitation to the embodiment of the present invention, that is, the number of devices and the types of devices included in the dynamic process monitoring device included in the dynamic process monitoring method scenario, or the number of devices and the types of devices included in each device do not affect the overall implementation of the technical solution in the embodiment of the present invention, and may be calculated as an equivalent replacement or a derivative of the technical solution claimed in the embodiment of the present invention.
The dynamic process monitoring apparatus 100 in the embodiment of the present invention is mainly used for: accessing a monitoring label database to obtain a monitoring label of a monitored node;
scanning the running process in the monitored node, and determining a target process carrying the monitoring label in the monitored node;
and collecting monitoring data of the target process, and determining the process running state of the target process according to the monitoring data.
The dynamic process monitoring device 100 in the embodiment of the present invention may be an independent dynamic process monitoring device, such as an intelligent terminal, e.g., a mobile phone, a tablet computer, an intelligent television, a network device, a server, an intelligent computer, or a dynamic process monitoring network or a dynamic process monitoring cluster composed of a plurality of dynamic process monitoring devices.
The embodiments of the present application provide a method, an apparatus, a device, and a computer-readable storage medium for dynamic process monitoring, which are described in detail below.
Those skilled in the art can understand that the application environment shown in fig. 1 is only one of application scenarios related to the solution of the present application, and does not constitute a limitation on the application scenario of the solution of the present application, and other application environments may further include more or less dynamic process monitoring devices than those shown in fig. 1, or a dynamic process monitoring network connection relationship, for example, only one dynamic process monitoring device is shown in fig. 1, and it is understood that the scenario of the dynamic process monitoring method may further include one or more dynamic process monitoring devices, which is not limited herein; the dynamic process monitoring device 100 may also include a memory for storing monitoring data and other data.
It should be noted that the scene diagram of the dynamic process monitoring method shown in fig. 1 is only an example, and the scene of the dynamic process monitoring method described in the embodiment of the present invention is for more clearly illustrating the technical solution of the embodiment of the present invention, and does not limit the technical solution provided by the embodiment of the present invention.
Based on the above scenario of the dynamic process monitoring method, various embodiments of the dynamic process monitoring method disclosed by the present invention are proposed.
As shown in fig. 2, fig. 2 is a schematic flowchart of an embodiment of a dynamic process monitoring method in an embodiment of the present application, where the image processing method includes the following steps 201 to 203:
201. accessing a monitoring label database to obtain a monitoring label of a monitored node;
the dynamic process monitoring method in this embodiment is applied to a dynamic process monitoring device, and the type and number of the dynamic process monitoring device are not specifically limited, that is, the dynamic process monitoring device may be one or more intelligent terminals or servers of each node in a block chain, and in a specific embodiment, the dynamic process monitoring device is an intelligent computer. Optionally, the dynamic process monitoring device may perform dynamic process monitoring for the monitoring initiator node in an actual application scenario; optionally, the dynamic process monitoring device may also be used as a monitored node to receive process monitoring of the monitoring initiator node. Optionally, in other application scenarios, the dynamic process monitoring device may further execute the dynamic process monitoring method of this embodiment to dynamically monitor the local process.
Specifically, when the dynamic process monitoring device is running, a process monitoring request is received, and a triggering mode of the process monitoring request is not specifically limited, that is, the process monitoring request may be actively triggered by a user, for example, the user actively triggers the process monitoring request by interacting with the dynamic process monitoring device through a physical key or a virtual key; in addition, the process monitoring request may also be automatically triggered by the dynamic process monitoring device, for example, the dynamic process monitoring device may preset a timing monitoring process, and automatically trigger the process monitoring request at a preset time point or within a preset time period. The dynamic process monitoring request is an operation request for driving the dynamic process monitoring equipment to monitor one or more target processes to be monitored of the monitored node. Optionally, the monitored node may be a dynamic process monitoring device of another block chain node; optionally, the monitored node may also be a local dynamic process monitoring device, that is, the dynamic process monitoring request may be a monitoring request for monitoring processes of other monitored nodes; a monitoring request may also be a request to monitor a process in the native machine.
Specifically, before acquiring the process monitoring request, the dynamic process monitoring device generates a monitoring tag database in advance, where the monitoring tag data is configured to store monitoring tags of target processes to be monitored in the monitored node. Optionally, the monitoring tag database may be set in the dynamic process monitoring device, and may also be set in a cloud server of the block chain. After generating a monitoring label database, the dynamic process monitoring equipment acquires a target process to be monitored in each monitored node, acquires process attribute data of the target process, integrates the process attribute data to form a monitoring label, and stores the monitoring label in the monitoring label database.
After receiving the process monitoring request, the dynamic process monitoring device accesses a preset monitoring label database to obtain monitoring labels of target processes to be monitored in the monitored nodes. And analyzing the process attribute data carried in the monitoring label to obtain the process attribute data of the target process to be monitored.
202. Scanning the running process in the monitored node, and determining a target process carrying the monitoring label in the monitored node;
specifically, the dynamic process monitoring device acquires a target process to be monitored in a monitored node, integrates and forms a monitoring tag according to process attribute data of each target process, determines an injection strategy of the monitoring tag according to environment information of the target process, and adds the monitoring tag to a corresponding process item in each target process according to different injection strategies of the monitoring tag. The injection strategy of the monitoring label comprises a physical machine label injection strategy and a container label injection strategy, and the label injection areas of label injection of different label injection strategies are different.
After acquiring the monitoring label of each target process to be monitored in the monitored node, the dynamic process monitoring equipment converts the process attribute data carried in the monitoring process into process searching conditions of different process operating environments by analyzing the process attribute data, scans the operating processes in the different operating environments in the monitored node, and determines the target process carrying the monitoring label in the monitored node.
Specifically, the dynamic process monitoring device determines an operating environment of a target process corresponding to the monitoring tag according to the monitoring tag and the process attribute data, scans a tag injection region of each running process in the operating environment after determining the operating environment of the target process, and determines that the running process is the target process to be monitored if the tag injection region in the running process has the corresponding monitoring tag. And if the monitoring label does not exist in the label injection region of the running process, or the monitoring label existing in the label injection region of the running process is not matched with the monitoring label monitored by the process, determining that the running process is a non-target process.
203. And collecting monitoring data of the target process, and determining the process running state of the target process according to the monitoring data.
After the dynamic process monitoring equipment locates the target process to be monitored in the monitored node according to the monitoring label, the monitoring data of the target process is collected, and the process running state of the target process is determined according to the monitoring data.
Specifically, the dynamic process monitoring device calls a data acquisition module to acquire monitoring data of a target process, wherein the monitoring data includes a process identifier, a deployment name and process running data. Optionally, in a specific embodiment, the process running data includes parameters reflecting the running state of the target process, such as a process heartbeat, a CPU occupancy rate, and a CPU occupancy time, and optionally, the dynamic process monitoring device may further perform custom acquisition of the custom monitoring data in the target process according to the process type of the target process.
Specifically, the dynamic process monitoring device determines a process running state of the target process according to the monitoring data, and optionally, the process running state includes a process execution state, a process blocking state, a process ready state, and a stop running state. After the process running state of the target process is determined, the dynamic process monitoring equipment sends process control instructions to the monitored node according to different process running states, and drives the monitored node to execute different monitoring interactive operations according to different process control instructions.
Optionally, the dynamic process monitoring device analyzes the monitoring data, determines that the running state of the target process is a stopped running state according to the process running data in the monitoring data, calls the data acquisition module to delete the original monitoring data, and stops monitoring data acquisition on the target process.
In this embodiment, the dynamic process monitoring device accesses the monitoring database to obtain the monitoring labels of each monitored process in the monitored nodes stored in the monitoring database; after the monitoring label is obtained, the running process in the monitored node is scanned, the target process carrying the monitoring label in the monitored node is determined, the monitoring data of the target process is collected, and the monitoring data is analyzed to obtain the process running state of the target process. Therefore, monitoring registration logic does not need to be added in the monitoring system, and the process monitoring stability is improved; meanwhile, decoupling of the monitoring initiator and the monitored node is achieved, complexity of the monitoring system is reduced, reliability of process monitoring is improved, and maintenance cost is reduced.
As shown in fig. 3, fig. 3 is a schematic flowchart of an embodiment of injecting a monitoring tag into a target process through an injection policy in a dynamic process monitoring method provided in the embodiment of the present application.
In the embodiment of the present application, by determining environment information of a target process, determining different injection strategies of a monitoring tag according to different environment information, and adding the monitoring tag to the target process according to a corresponding injection strategy, specifically, the method includes steps 301 to 303:
301. acquiring a target process to be monitored in the monitored node, and generating a monitoring label of the target process;
302. determining the environmental information of the target process, and determining the injection strategy of the monitoring label according to the environmental information;
303. and adding the monitoring label to the target process according to the injection strategy.
In this embodiment, before performing process monitoring on a monitored node, a dynamic process monitoring device acquires an operating process to be monitored in the monitored node, marks the operating process as a target process, collects process attribute data of the target process, and writes the process attribute data into a preset tag, thereby acquiring a monitoring tag of the target process.
Specifically, after determining a target process to be monitored, the dynamic process monitoring device collects process attribute data of the target process, where the process attribute data includes platform information, environment information, a process type, and a process identifier. And after acquiring the process attribute data, inputting the process attribute data into a preset monitoring template to generate a monitoring label corresponding to the target process.
After acquiring the monitoring label corresponding to the target process, the dynamic process monitoring equipment records the monitoring label into a preset monitoring label database, and simultaneously injects the monitoring label into the corresponding target process according to a corresponding injection strategy.
And the dynamic process monitoring equipment also determines the process running environment of the target process according to the environment information in the process attribute data, wherein the process running environment comprises a physical machine environment and a container environment.
Optionally, if the environment information of the target process is the physical machine environment information, determining that the deployment environment of the target process is the physical machine environment, that is, the target process is deployed in the physical machine environment of the monitored node, determining, by the dynamic process monitoring device, that the injection strategy of the monitoring tag corresponding to the target process is the physical machine tag injection strategy, and adding the generated monitoring tag to the tag injection area corresponding to the target process whose deployment environment is the physical machine according to the physical machine tag injection strategy.
Optionally, if the environment information of the target process is a container environment, determining that the deployment environment of the target process is the container environment, that is, the target process is a virtual container operating environment deployed in the monitored node, and the container operating environment isolates various resources of the target process. Optionally, the container environment may be further divided into a K8s (kubernets) container and a Docker container according to different container service deployment technologies. The dynamic process monitoring device determines that the injection policy of the monitoring tag corresponding to the target process is a container tag injection policy, and optionally, the container tag injection policy may be divided into a K8s container tag injection policy and a Docker container injection policy. And the dynamic process monitoring equipment adds the generated monitoring label to a corresponding label injection area in a target process with a deployment environment of K8s container/Docker container according to a corresponding K8s container label injection strategy/Docker container injection strategy.
The dynamic process monitoring equipment acquires a process monitoring request after injecting a monitoring label into a target process, acquires the monitoring label from a monitoring label database, scans a label injection area of an operating process in a monitored node, judges whether the operating process carries the monitoring label according to the scanning condition of the label injection area, determines the operating process as the target process if the operating process carries the corresponding monitoring label, collects monitoring data of the target process, determines the process operating state of the target process according to the monitoring data, and achieves dynamic monitoring of the target process.
In this embodiment, the dynamic process monitoring device acquires process attribute data of a target process by acquiring the target process to be monitored in a monitored node, generates a monitoring tag of the target process, determines environment information of the target process, determines an injection strategy of the monitoring tag according to a process deployment environment of the target process, and adds the monitoring tag to the target process based on the injection strategy, so that the dynamic process monitoring device can position the target process to be monitored according to the monitoring tag, thereby monitoring the target process, and monitoring the target process without performing logical registration on the process or a container before the monitoring is initiated, thereby improving the flexibility of process monitoring.
As shown in fig. 4, fig. 4 is a schematic flowchart of an embodiment of injecting a tag by a physical machine tag injection policy in the dynamic process monitoring method provided in the embodiment of the present application.
Based on the foregoing embodiments, in some embodiments of the present application, a step of injecting a tag according to a physical machine tag injection policy in a dynamic process monitoring method is specifically described, including steps 401 to 402:
401. determining the monitoring label injection strategy as a physical machine label injection strategy;
402. and respectively inserting the monitoring tags into any one or more process parameters of the environment variable, the starting parameter and the process name of the target process based on the physical machine tag injection strategy.
In this embodiment, after the dynamic process monitoring device generates a corresponding monitoring tag according to the process attribute data of the target process, the dynamic process monitoring device determines the process running environment of the target process according to the environment information in the process attribute data.
Specifically, the dynamic process monitoring device obtains that the environment information of the target process is the physical machine environment information, determines that the deployment environment of the target process is the physical machine environment, that is, the target process is deployed in the physical machine environment of the monitored node, and determines that the injection strategy of the monitoring tag corresponding to the target process is the physical machine tag injection strategy.
Specifically, the tag injection policy of the physical machine defines a tag injection area for adding a monitoring tag to a target process in a physical machine environment, where the tag injection area corresponding to the tag injection policy of the physical machine includes an area where parameters can be customized, such as an environment variable, a start parameter, and a process name of the target process. And the dynamic process monitoring equipment writes the monitoring label into parameters such as an environment variable, a starting parameter, a process name and the like of the target process according to the physical machine label injection strategy.
Specifically, when the dynamic process monitoring device monitors the running process in the physical machine environment according to the monitoring tag, whether a corresponding monitoring tag exists in a region where the parameter can be customized, such as an environment variable, a starting parameter, a process name and the like of each running process deployed in the physical machine environment, and if a corresponding monitoring tag exists in a region where the parameter can be customized, such as the environment variable, the starting parameter, the process name and the like in the running process, the process is determined to be the target process. After the target process is determined, the dynamic process monitoring equipment acquires the monitoring data of the target process, so that the process running state of the target process is determined.
Optionally, in a specific embodiment, the process attribute data obtained by the dynamic process monitoring device is "bf _ devilpop FA _ FA-dkded _ 1232", where bf is platform information, devilpop is environment information, FA _ FA-dkded is a process type, and 1232 is a process label. And the dynamic process monitoring equipment inputs the process attribute data into a preset label to generate a monitoring label (bf-devlop) of the target process (FA-FA-dkded-1232). After the monitoring label [ bf-devlop ] [ FA-FA-dkded-1232 ] is generated, the monitoring label [ bf-devlop ] [ FA-FA-dkded-1232 ] is stored in a monitoring label database, the monitoring label [ bf-devlop ] [ FA-FA-dkded-1232 ] is injected into areas where parameters can be defined by the environment variable, the starting parameter, the process name and the like of a target process according to a physical machine label injection strategy, and in the subsequent process monitoring, areas where parameters can be defined by the environment variable, the starting parameter, the process name and the like of the process are scanned, and whether the monitoring label [ bf-devlop ] [ FA-FA-dkded-1232 ] exists or not is judged, so that the target process is dynamically monitored.
In this embodiment, after determining that the deployment environment of the target process is the physical machine environment, the dynamic process monitoring device selects a physical machine tag injection strategy to add the monitoring tag to an area where parameters can be customized, such as an environment variable, a start parameter, and a process name, in the target process, so that the target process can be dynamically positioned and monitored without performing logical registration on the physical machine process before the monitoring is initiated, and the flexibility of process monitoring is improved.
As shown in fig. 5, fig. 5 is a schematic flow chart of an embodiment of injecting a monitoring tag in a container tag injection policy in the dynamic process monitoring method provided in the embodiment of the present application.
In some embodiments of the present application, a step of injecting a monitoring tag based on a container tag injection policy when a deployment environment of a target process is a container environment is specifically described, including the following steps 501 to 502:
501. determining that the monitoring label injection strategy is a container label injection strategy;
502. and respectively inserting the monitoring tags into one or more container process parameters in a starting command option, a container name and an environment variable of the target process based on the container tag injection strategy.
In this embodiment, after the dynamic process monitoring device generates a corresponding monitoring tag according to the process attribute data of the target process, the dynamic process monitoring device determines the process running environment of the target process according to the environment information in the process attribute data.
Specifically, when the dynamic process monitoring device obtains that the environment information of the target process is container environment information and determines that the deployment environment of the target process is a container environment, it determines that the target process is deployed in a virtual container environment, and the dynamic process monitoring device determines that the injection strategy of the monitoring tag corresponding to the target process is a container tag injection strategy.
Optionally, the dynamic process monitoring device further determines the type of the container environment of the target process, and if the container environment of the target process is a K8s container environment, determines that the injection policy of the monitoring tag is a K8s container tag injection policy; and if the container environment of the target process is a Docker container environment, determining that the injection strategy of the monitoring label is a Docker container label injection strategy.
Specifically, the K8s container label injection policy sets a label injection area for adding a monitoring label to a target label in the K8s container environment, where the label injection area corresponding to the K8s container label injection policy includes an area where the K8s container service deployment in the target process start command item, the container name, and the environment variable can support custom setting parameters. The dynamic process monitoring device adds a monitoring label to the area of the starting command item, the container name, the environment variable and the like in the target process according to the K8s container label injection strategy.
Specifically, the label injection policy of the Docker container sets a label injection region for adding the monitoring label to a target label in the Docker container environment, where the label injection region corresponding to the Docker container label injection policy includes a region where the Docker container service deployment in the target process can support custom setting parameters, such as a start command item, a container name, and an environment variable. And the dynamic process monitoring equipment adds the monitoring label to the areas such as a starting command item, a container name and an environment variable in the target process according to a Docker container label injection strategy.
Specifically, when the dynamic process monitoring device monitors the running process in the container environment according to the monitoring tag, whether a corresponding monitoring tag exists in a region where the parameter can be customized, such as a ring start command item, a container name, an environment variable and the like of each running process deployed in the container environment, and if a corresponding monitoring tag exists in a region where the parameter can be customized, such as the start command item, the container name, the environment variable and the like in the running process, the process is determined to be the target process. After the target process is determined, the dynamic process monitoring equipment acquires the monitoring data of the target process, so that the process running state of the target process is determined.
In this embodiment, after determining that the deployment environment of the target process is a container environment, the dynamic process monitoring device selects a container tag injection strategy to add the monitoring tag to a region where parameters can be defined by itself, such as a start command item, a container name, and an environment variable, in the target process, so that the target process deployed in the container can be dynamically positioned and monitored without performing logical registration on the container name before the monitoring is initiated, and the flexibility and the effectiveness of process monitoring are improved.
In order to better implement the dynamic process monitoring method in the embodiment of the present application, based on the dynamic process monitoring method, an embodiment of the present application further provides a dynamic process monitoring device, as shown in fig. 6, fig. 6 is a schematic structural diagram of an embodiment of the dynamic process monitoring device provided in the embodiment of the present application, where the dynamic process monitoring device 600 includes the following modules 601 to 603:
a tag obtaining module 601 configured to access the monitoring tag database and obtain a monitoring tag of a monitored node;
a process scanning module 602, configured to scan an operating process in the monitored node, and determine a target process carrying the monitoring tag in the monitored node;
the process monitoring module 603 is configured to collect monitoring data of the target process, and determine a process running state of the target process according to the monitoring data.
In some embodiments of the present application, before the dynamic process monitoring apparatus 600 accesses the monitoring tag database and obtains the monitoring tag of the monitored node, the method further includes:
reading process attribute data of the target process;
and writing the process attribute data into a preset tag to obtain a monitoring tag of the target process, and storing the monitoring tag into a preset monitoring tag database.
In some embodiments of the present application, before the dynamic process monitoring apparatus 600 acquires a target process to be monitored in the monitored node and generates a monitoring tag of the target process, the method further includes:
acquiring a target process to be monitored in the monitored node, and generating a monitoring label of the target process;
determining the environmental information of the target process, and determining the injection strategy of the monitoring label according to the environmental information;
and adding the monitoring label to the target process according to the injection strategy.
In some embodiments of the present application, the determining, by the dynamic process monitoring apparatus 600, the environment information of the target process, and determining the injection policy of the monitoring tag according to the environment information includes:
reading the environmental information of the target process, and if the environmental information of the target process is a physical machine environment, determining that a monitoring label injection strategy is a physical machine label injection strategy;
and if the environment information of the target process is a container environment, determining that the monitoring label injection strategy is a container label injection strategy.
In some embodiments of the present application, the adding, by the dynamic process monitoring apparatus 600, the monitoring tag to the target process according to the injection policy includes:
determining the monitoring label injection strategy as a physical machine label injection strategy;
and respectively inserting the monitoring tags into any one or more process parameters of the environment variable, the starting parameter and the process name of the target process based on the physical machine tag injection strategy.
In some embodiments of the present application, the adding, by the dynamic process monitoring apparatus 600, the monitoring tag to the target process according to the injection policy includes:
determining that the monitoring label injection strategy is a container label injection strategy;
and respectively inserting the monitoring tags into one or more container process parameters in a starting command option, a container name and an environment variable of the target process based on the container tag injection strategy.
In some embodiments of the present application, after the dynamic process monitoring apparatus 600 collects monitoring data of the target process and determines a process running state of the target process according to the monitoring data, the method further includes:
analyzing the monitoring data and determining the running state of the target process;
and if the running state of the target process is the running stop state, deleting the monitoring data and stopping monitoring the target process.
In this embodiment, the dynamic process monitoring apparatus accesses the monitoring database to obtain the monitoring labels of each monitored process in the monitored node stored in the monitoring database; after the monitoring label is obtained, the running process in the monitored node is scanned, the target process carrying the monitoring label in the monitored node is determined, the monitoring data of the target process is collected, and the monitoring data is analyzed to obtain the process running state of the target process. Therefore, monitoring registration logic does not need to be added in the monitoring system, and the process monitoring stability is improved; meanwhile, decoupling of the monitoring initiator and the monitored node is achieved, complexity of the monitoring system is reduced, reliability of process monitoring is improved, and maintenance cost is reduced.
Fig. 7 shows that fig. 7 is a schematic structural diagram of an embodiment of the dynamic process monitoring device provided in this embodiment of the present application.
The dynamic process monitoring device integrates any one of the dynamic process monitoring devices provided by the embodiments of the present invention, and the dynamic process monitoring device includes:
one or more processors;
a memory; and
one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor for performing the steps of the dynamic process monitoring method described in any of the above embodiments of the dynamic process monitoring method.
Specifically, the method comprises the following steps: the dynamic process monitoring apparatus may include components such as a processor 701 of one or more processing cores, memory 702 of one or more computer-readable storage media, a power supply 703, and an input unit 704. Those skilled in the art will appreciate that the dynamic process monitoring device configuration shown in FIG. 7 does not constitute a limitation of the dynamic process monitoring device and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. Wherein:
the processor 701 is a control center of the dynamic process monitoring apparatus, connects various parts of the entire dynamic process monitoring apparatus by using various interfaces and lines, and executes various functions and processes data of the dynamic process monitoring apparatus by running or executing software programs and/or modules stored in the memory 702 and calling data stored in the memory 702, thereby performing overall monitoring of the dynamic process monitoring apparatus. Optionally, processor 701 may include one or more processing cores; preferably, the processor 701 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 701.
The memory 702 may be used to store software programs and modules, and the processor 701 executes various functional applications and data processing by operating the software programs and modules stored in the memory 702. The memory 702 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created from use of the dynamic process monitoring apparatus, and the like. Further, the memory 702 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 702 may also include a memory controller to provide the processor 701 with access to the memory 702.
The dynamic process monitoring device further includes a power supply 703 for supplying power to each component, and preferably, the power supply 703 may be logically connected to the processor 701 through a power management system, so as to implement functions of managing charging, discharging, power consumption management, and the like through the power management system. The power supply 703 may also include any component including one or more of a dc or ac power source, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The dynamic process monitoring device may also include an input unit 704, where the input unit 704 may be used to receive entered numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the dynamic process monitoring apparatus may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 701 in the dynamic process monitoring device loads the executable file corresponding to the process of one or more application programs into the memory 702 according to the following instructions, and the processor 701 runs the application program stored in the memory 702, thereby implementing various functions as follows:
accessing a monitoring label database to obtain a monitoring label of a monitored node;
scanning the running process in the monitored node, and determining a target process carrying the monitoring label in the monitored node;
and collecting monitoring data of the target process, and determining the process running state of the target process according to the monitoring data.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed descriptions of other embodiments, and are not described herein again.
In a specific implementation, each unit or structure may be implemented as an independent entity, or may be combined arbitrarily to be implemented as one or several entities, and the specific implementation of each unit or structure may refer to the foregoing method embodiment, which is not described herein again.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
The foregoing describes in detail a dynamic process monitoring method provided in an embodiment of the present application, and the principle and implementation of the present invention are described herein with reference to specific embodiments, and the description of the foregoing embodiments is only used to help understand the method and core ideas of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A dynamic process monitoring method is characterized in that the dynamic process monitoring method comprises the following steps:
accessing a monitoring label database to obtain a monitoring label of a monitored node;
scanning the running process in the monitored node, and determining a target process carrying the monitoring label in the monitored node;
and collecting monitoring data of the target process, and determining the process running state of the target process according to the monitoring data.
2. The dynamic process monitoring method of claim 1, wherein prior to accessing the monitoring tag database to obtain the monitoring tag for the monitored node, the method further comprises:
reading process attribute data of the target process;
and writing the process attribute data into a preset tag to obtain a monitoring tag of the target process, and storing the monitoring tag into a preset monitoring tag database.
3. The dynamic process monitoring method of claim 1, wherein prior to accessing the monitoring tag database to obtain the monitoring tag for the monitored node, the method further comprises:
acquiring a target process to be monitored in the monitored node, and generating a monitoring label of the target process;
determining the environmental information of the target process, and determining the injection strategy of the monitoring label according to the environmental information;
and adding the monitoring label to the target process according to the injection strategy.
4. The dynamic process monitoring method of claim 3, wherein the determining the environmental information of the target process and the determining the injection policy of the monitoring tag according to the environmental information comprises:
reading the environmental information of the target process, and if the environmental information of the target process is a physical machine environment, determining that a monitoring label injection strategy is a physical machine label injection strategy;
and if the environment information of the target process is a container environment, determining that the monitoring label injection strategy is a container label injection strategy.
5. The dynamic process monitoring method of claim 4, wherein the adding the monitoring tag to the target process according to the injection policy comprises:
determining the monitoring label injection strategy as a physical machine label injection strategy;
and respectively inserting the monitoring tags into any one or more process parameters of the environment variable, the starting parameter and the process name of the target process based on the physical machine tag injection strategy.
6. The dynamic process monitoring method of claim 4, wherein the adding the monitoring tag to the target process according to the injection policy comprises:
determining that the monitoring label injection strategy is a container label injection strategy;
and respectively inserting the monitoring tags into one or more container process parameters in a starting command option, a container name and an environment variable of the target process based on the container tag injection strategy.
7. The dynamic process monitoring method according to claim 1, wherein after collecting the monitoring data of the target process and determining the process running state of the target process according to the monitoring data, the method further comprises:
analyzing the monitoring data and determining the running state of the target process;
and if the running state of the target process is the running stop state, deleting the monitoring data and stopping monitoring the target process.
8. A dynamic process monitoring apparatus, comprising:
the label acquisition module is configured to access the monitoring label database and acquire the monitoring label of the monitored node;
a process scanning module configured to scan an operating process in the monitored node and determine a target process carrying the monitoring tag in the monitored node;
and the process monitoring module is configured to collect monitoring data of the target process and determine the process running state of the target process according to the monitoring data.
9. A dynamic process monitoring device, comprising:
one or more processors;
a memory; and
one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the dynamic process monitoring method of any of claims 1 to 7.
10. A computer-readable storage medium, having stored thereon a computer program which is loadable by a processor to carry out the steps of the dynamic process monitoring method of any of claims 1 to 7.
CN202111524156.6A 2021-12-13 2021-12-13 Dynamic process monitoring method, device, equipment and storage medium Pending CN114218041A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111524156.6A CN114218041A (en) 2021-12-13 2021-12-13 Dynamic process monitoring method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111524156.6A CN114218041A (en) 2021-12-13 2021-12-13 Dynamic process monitoring method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114218041A true CN114218041A (en) 2022-03-22

Family

ID=80701894

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111524156.6A Pending CN114218041A (en) 2021-12-13 2021-12-13 Dynamic process monitoring method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114218041A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115878432A (en) * 2023-02-16 2023-03-31 支付宝(杭州)信息技术有限公司 Process monitoring method in computing system and related equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115878432A (en) * 2023-02-16 2023-03-31 支付宝(杭州)信息技术有限公司 Process monitoring method in computing system and related equipment
CN115878432B (en) * 2023-02-16 2023-05-12 支付宝(杭州)信息技术有限公司 Process monitoring method in computing system and related equipment

Similar Documents

Publication Publication Date Title
CN111625383B (en) Process exception event processing method and device, electronic equipment and storage medium
CN113407383B (en) Main and standby system switching method and device, server and main and standby system
CN113157411B (en) Celery-based reliable configurable task system and device
CN105847446B (en) Method, device and system for acquiring network data
CN113238815B (en) Interface access control method, device, equipment and storage medium
CN106095483A (en) The Automation arranging method of service and device
CN114218041A (en) Dynamic process monitoring method, device, equipment and storage medium
CN113849356B (en) Equipment testing method and device, electronic equipment and storage medium
CN113282850A (en) Resource label management method, device, electronic equipment, system and storage medium
CN112667512A (en) Data drive test method, device, equipment and computer readable storage medium
CN102843369B (en) The Network Access Method at UI interface and system
CN115643163A (en) Fault equipment positioning method, device, equipment and storage medium
CN112363940B (en) Data processing method, device, storage medium and server
CN109471829A (en) Recognition methods, identification mould group and the electronic equipment of SD card hot plug
CN115496567A (en) Delivery filing method, device, equipment and storage medium
CN112817514B (en) Content extraction method and device
CN108459942A (en) A kind of data processing method, device and storage medium
CN112835906B (en) Block chain-based data management method, device, system, equipment and medium
CN115190044A (en) Equipment connection state checking method, device, equipment and storage medium
CN114630323A (en) Voice call service processing method and device and computer readable storage medium
CN115220859A (en) Data input mode monitoring method and device, electronic equipment and storage medium
CN115102924B (en) Cluster address switching method and device, computer equipment and storage medium
CN116679948A (en) Application updating method, device, equipment and storage medium
CN113836405B (en) Information query method, device and computer readable storage medium
CN111984722B (en) Block chain data request processing method, device, server and storage medium

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