CN115509861A - Process monitoring method, system, computer device and storage medium - Google Patents

Process monitoring method, system, computer device and storage medium Download PDF

Info

Publication number
CN115509861A
CN115509861A CN202211210086.1A CN202211210086A CN115509861A CN 115509861 A CN115509861 A CN 115509861A CN 202211210086 A CN202211210086 A CN 202211210086A CN 115509861 A CN115509861 A CN 115509861A
Authority
CN
China
Prior art keywords
configuration file
monitored process
monitored
information
configuration
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
CN202211210086.1A
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202211210086.1A priority Critical patent/CN115509861A/en
Publication of CN115509861A publication Critical patent/CN115509861A/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/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

Abstract

The application relates to a process monitoring method, a system, a computer device and a storage medium. The method is applied to an operating system and comprises the following steps: acquiring configuration information of a monitored process, generating a configuration file stored in a preset path, and blocking the monitored process based on the configuration file until the configuration file in the preset path is deleted, wherein the number of the monitored process is at least one; traversing the configuration files under the preset path to generate a configuration file linked list, and deleting the configuration files under the preset path when accessing the configuration files in the configuration file linked list so as to realize the normal operation of the monitored process; and acquiring the process information of the monitored process, and processing the monitored process according to a preset process exception processing rule when the process information of the monitored process is abnormal or the process information of the monitored process cannot be acquired.

Description

Process monitoring method, system, computer device and storage medium
Technical Field
The present application relates to the field of process monitoring technologies, and in particular, to a process monitoring method, a process monitoring system, a computer device, and a storage medium.
Background
The server is the core of the whole network system and computer platform, and many important data are stored on the server. The baseboard management controller acts as a server housekeeper and may utilize sensors to monitor the status of a computer, network server, or other hardware driven device. The stability and robustness of the baseboard management controller affects the stability and robustness of the entire server system. Therefore, it is necessary to monitor the processes of the bmc and the os.
In the prior art, the current process monitoring of a substrate management controller and even a whole operating system is limited to single watchdog monitoring, the whole operating system is reset when the watchdog is overtime, or only the dog feeding process is monitored, and the whole system can still normally continue to operate as long as the dog feeding process is normal by default. In an actual application scenario, however, the running-off of a certain process does not necessarily represent the running-off of the whole system, and even does not represent the abnormal situation of the dog feeding process; meanwhile, the feeding process is normal, and does not mean that every process is normal. However, in the prior art, when a certain process is abnormal, the whole operating system is reset blindly, so that the whole system stops working immediately, a lot of important data are lost by the operating system, and a technician cannot obtain abnormal data and analyze the reason for the abnormality of the operating system.
In summary, the conventional method for monitoring the bmc and the os process has the following drawbacks: 1. the flexibility is poor, and the monitoring process cannot be dynamically added or deleted; 2. the compatibility is poor, and the characteristics of different functional processes cannot be adaptively monitored; 3. the monitoring period is fixed; 4. the exception handling mode is single; 5. the maintainability is poor, and abnormal data information cannot be obtained.
Therefore, it is urgently needed to provide a process monitoring method, a system, a computer device and a storage medium which can solve the technical defects.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a process monitoring method, a system, and a computer device, which can implement adaptive flexible processing on a monitored process with abnormal process information.
In one aspect, a process monitoring method is provided, where the method is applied to an operating system, and the method includes:
acquiring configuration information of a monitored process, generating a configuration file stored in a preset path, and blocking the monitored process based on the configuration file until the configuration file in the preset path is deleted, wherein the number of the monitored process is at least one;
traversing the configuration files under the preset path to generate a configuration file linked list, and deleting the configuration files under the preset path when accessing the configuration files in the configuration file linked list so as to realize the normal operation of the monitored process;
and acquiring the process information of the monitored process, and processing the monitored process according to a preset process exception handling rule when the process information of the monitored process is abnormal or cannot be acquired.
In one embodiment, the method further comprises: allocating a monitoring thread to the monitored process, and if the monitoring thread learns that the operating system resources are insufficient, sending asynchronous notification information to a queue of the monitored process, so that the monitored process sends a resource exception handling request when detecting the asynchronous notification information, wherein the handling request carries the asynchronous notification information; and acquiring the process information of the monitored process based on the asynchronous notification information according to the processing request, and processing the monitored process according to a preset process exception processing rule when the process information of the monitored process is abnormal or the process information of the monitored process cannot be acquired.
In one embodiment, the method further comprises: periodically traversing the configuration file under the preset path; acquiring configuration information of the configuration file, and judging whether the monitored process is an existing monitored process based on the configuration file when the configuration information of the configuration file is changed; if the monitored process is the existing monitored process, updating the configuration file under the preset path based on the configuration file changed by the configuration information; and if the monitored process is not the existing monitored process, adding the configuration file with the changed configuration information into the configuration file linked list.
In one embodiment, acquiring the configuration information of the monitored process, and generating the configuration file stored in the preset path includes: obtaining configuration information of the monitored process, wherein the configuration information comprises: the method comprises the following steps of (1) process name, process identifier, action command, starting timestamp, monitoring requirement, keep-alive mode, keep-alive period and dependency relationship; generating a configuration file based on the configuration information, and naming the configuration file by the process name; and storing the configuration file to the preset path, wherein the preset path is at least one.
In one embodiment, when the process information of the monitored process is abnormal, processing the monitored process according to a preset process exception handling rule includes: when the process information of the monitored process is abnormal, acquiring the abnormal information of the monitored process, and generating a log according to the abnormal information; after the log is generated, judging whether the configuration information of the monitored process comprises a dependency relationship; when the configuration information of the monitored process includes a dependency relationship, processing the process having the dependency relationship with the monitored process, and after the process having the dependency relationship with the monitored process is processed, processing the monitored process according to a preset process exception handling rule, where the preset process exception handling rule includes resetting the monitored process or resetting the operating system.
In one embodiment, when traversing the configuration file under the preset path and generating the configuration file linked list, the method further includes: when the preset path is not one, generating a preset path linked list based on the preset path; sequentially acquiring configuration files under a preset path in the preset path linked list one by one, and generating a configuration file linked list based on the configuration files; or acquiring the configuration file under the preset path according to the preset priority of the monitored process, and generating a configuration file linked list based on the configuration file.
In one embodiment, before the obtaining the configuration information of the monitored process and generating the configuration file stored in the preset path, the method further includes: initializing a watchdog and starting the monitored process.
In another aspect, a process monitoring system is provided, the system is applied to an operating system, and the system includes:
the device comprises a configuration information acquisition unit, a configuration information acquisition unit and a monitoring unit, wherein the configuration information acquisition unit is used for acquiring configuration information of a monitored process, generating a configuration file stored in a preset path, and blocking the monitored process based on the configuration file until the configuration file in the preset path is deleted, and the number of the monitored process is at least one;
the configuration file linked list generating unit is in communication connection with the configuration information acquiring unit and is used for traversing the configuration files under the preset path to generate a configuration file linked list, and when the configuration files in the configuration file linked list are accessed, the configuration files under the preset path are deleted to realize the normal operation of the monitored process;
and the exception handling unit is used for acquiring the process information of the monitored process, and when the process information of the monitored process is abnormal or the process information of the monitored process cannot be acquired, the monitored process is handled according to a preset process exception handling rule.
In another aspect, a computer device is provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements the following steps when executing the computer program:
acquiring configuration information of a monitored process, generating a configuration file stored in a preset path, and blocking the monitored process based on the configuration file until the configuration file in the preset path is deleted, wherein the number of the monitored process is at least one;
traversing the configuration files under the preset path to generate a configuration file linked list, and deleting the configuration files under the preset path when accessing the configuration files in the configuration file linked list so as to realize the normal operation of the monitored process;
and acquiring the process information of the monitored process, and processing the monitored process according to a preset process exception processing rule when the process information of the monitored process is abnormal or the process information of the monitored process cannot be acquired.
In yet another aspect, a computer-readable storage medium is provided, having stored thereon a computer program which, when executed by a processor, performs the steps of:
acquiring configuration information of a monitored process, generating a configuration file stored in a preset path, and blocking the monitored process based on the configuration file until the configuration file in the preset path is deleted, wherein the number of the monitored process is at least one;
traversing the configuration files under the preset path to generate a configuration file linked list, and deleting the configuration files under the preset path when accessing the configuration files in the configuration file linked list so as to realize the normal operation of the monitored process;
and acquiring the process information of the monitored process, and processing the monitored process according to a preset process exception processing rule when the process information of the monitored process is abnormal or the process information of the monitored process cannot be acquired.
The process monitoring method, the process monitoring system, the computer equipment and the storage medium are applied to an operating system, and the method comprises the following steps: acquiring configuration information of a monitored process, generating a configuration file stored in a preset path, and blocking the monitored process based on the configuration file until the configuration file in the preset path is deleted, wherein the number of the monitored process is at least one; traversing the configuration files under the preset path to generate a configuration file linked list, and deleting the configuration files under the preset path when accessing the configuration files in the configuration file linked list so as to realize the normal operation of the monitored process; and acquiring the process information of the monitored process, and processing the monitored process according to a preset process exception handling rule when the process information of the monitored process is abnormal or cannot be acquired. The process monitoring method has the following beneficial effects: 1. the monitoring on a certain process can be dynamically added or removed, and the flexibility is high; 2. the interaction mode of the monitored process and the monitoring process of the operating system is not limited, and the method is compatible with various keep-alive detection methods and has good compatibility; 3. the individual adaptability adjustment can be carried out on the monitoring period of the monitored process regardless of the period of the watchdog, and the flexibility of the monitoring period is high; 4. the method can select a proper processing method based on the process state of the monitored process, and does not need to directly restart the whole operating system as long as one monitored process has a problem like the traditional method, and the exception handling method is various; 5. when the process information of the monitored process is abnormal, the abnormal process information is collected for improvement of a subsequent system.
Drawings
FIG. 1 is a diagram of an application environment of a process monitoring method in one embodiment;
FIG. 2 is a flow diagram illustrating a process monitoring method according to one embodiment;
FIG. 3 is a flow diagram that illustrates a method for process monitoring, according to one embodiment;
FIG. 4 is a flow diagram illustrating a process monitoring method according to one embodiment;
FIG. 5 is a block diagram of a process monitoring system in one embodiment;
FIG. 6 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The process monitoring method provided by the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The monitored process set to be monitored by the terminal 102 is sent to the server 104. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.
In one embodiment, as shown in fig. 2, a process monitoring method is provided, where the method is applied to an operating system, and the operating system is disposed in the server 104, and is described by applying the method to the server example in fig. 1, including the following steps:
and starting a system monitoring process by the baseboard management controller, and initializing the watchdog.
Starting a monitored process of a substrate manager, forming a configuration file by the monitored process according to configuration information of the monitored process, writing the configuration file into a preset path by using a process name as a file name of the configuration file, and blocking the monitored process based on the generated configuration file until the configuration file in the preset path is deleted, wherein the configuration information comprises: process name, process identifier, action command, start timestamp, monitoring requirements, keep-alive mode, keep-alive period, and dependency relationship. Specifically, the action command includes a start command, a stop command, a restart command, and the like; the starting time stamp comprises the first starting time of the monitored process, namely after the configuration file is deleted, the monitored process can reset the starting time of the monitored process, and the system monitoring process can update the configuration file linked list with the time stamp of the configuration information of the read configuration file for calculating the subsequent interaction time; the monitoring requirement is whether the monitored process needs to be monitored or not, when the monitored process needs to be monitored temporarily or the monitoring is removed temporarily, the monitoring requirement field is modified and then the monitoring requirement configuration information is generated again, and the system monitoring process reads the configuration file in the next monitoring period and updates the configuration file to the configuration file linked list; the keep-alive mode is an interaction mechanism of the monitored process and the system monitoring process to confirm whether the monitored process is still in a normal state, and the keep-alive mode comprises but is not limited to interaction of pipelines, messages, files and a shared memory; the keep-alive period is how often the monitored process expects itself to be monitored, that is, how often the monitored process interacts with the system monitoring process; the dependency relationship indicates whether the monitored process depends on other services, and if the monitored process depends on other services, the process which depends on the monitored process is executed and processed before the monitored process is processed according to the preset process exception processing rule. It should be understood that the configuration file described herein is generated by the monitored process, and the configuration file linked list is generated, modified and updated by the system monitoring process.
And the baseboard management controller traverses the configuration files under the preset path based on the system monitoring process to generate a configuration file linked list, and deletes the configuration files under the preset path every time one configuration file is accessed.
After detecting that the configuration file for blocking the monitored process is deleted, the monitored process starts to operate normally, and indicates the activity state of the monitored process to the system monitoring process according to the keep-alive mode and the keep-alive period in the corresponding configuration information;
the system monitoring process selects a corresponding processing mode based on the keep-alive mode, the keep-alive period and the monitoring requirement (namely whether the monitored process needs to be monitored or not within a certain period of time), and monitors the monitored process according to the corresponding keep-alive mode and the keep-alive period if the monitored process is displayed in the configuration information.
And the system monitoring process monitors whether the monitored process is dead or not based on the keep-alive mode and the keep-alive period of the monitored process, namely when monitoring that the process information of the monitored process is abnormal, the monitored process is processed according to the process abnormity processing rule. It should be understood that the preset process exception handling rule may be stored in the configuration file of the monitored process in advance, or an index relationship between the process exception handling rule and the monitored process may be established, and the process exception handling rule is not directly stored in the configuration file of the monitored process.
The system monitoring process traverses the configuration file linked list, and checks whether the configuration files in the configuration file linked list and the configuration information of the configuration files are updated or not; if the configuration file in the configuration file linked list is updated, judging whether the monitored process corresponding to the configuration file is an existing monitored process or not based on the configuration file; if the monitored process is the existing monitored process, updating the configuration file under the preset path based on the configuration file changed by the configuration information; and if the monitored process is not the existing monitored process, adding the configuration file with the changed configuration information into the configuration file linked list.
Based on the process monitoring method, the stability of the baseboard management controller can be improved, the resource consumption when the process is abnormal is reduced, the flexibility and the diversity of process processing are improved, and the robustness of the baseboard management controller is further realized.
In one embodiment, as shown in fig. 3, a process monitoring method is provided, where the method is applied to an operating system, and the version and category of the operating system are not limited, and the method includes:
acquiring configuration information of a monitored process, generating a configuration file stored in a preset path, and blocking the monitored process based on the configuration file until the configuration file in the preset path is deleted, wherein the number of the monitored process is at least one;
traversing the configuration files under the preset path to generate a configuration file linked list, and deleting the configuration files under the preset path when accessing the configuration files in the configuration file linked list so as to realize the normal operation of the monitored process;
and acquiring the process information of the monitored process, and processing the monitored process according to a preset process exception handling rule when the process information of the monitored process is abnormal or cannot be acquired.
In one embodiment, as shown in fig. 4, the method further comprises: distributing a monitoring thread for the monitored process, and if the monitoring thread learns that the operating system resources are insufficient, sending asynchronous notification information to a queue of the monitored process so as to enable the monitored process to send a resource exception handling request when detecting the asynchronous notification information, wherein the handling request carries the asynchronous notification information; and acquiring the process information of the monitored process based on the asynchronous notification information according to the processing request, and processing the monitored process according to a preset process exception processing rule when the process information of the monitored process is abnormal or the process information of the monitored process cannot be acquired.
In one embodiment, the method further comprises: periodically traversing the configuration file under the preset path; acquiring configuration information of the configuration file, and judging whether the monitored process is an existing monitored process based on the configuration file when the configuration information of the configuration file is changed; if the monitored process is the existing monitored process, updating the configuration file under the preset path based on the configuration file with the changed configuration information; and if the monitored process is not the existing monitored process, adding the configuration file with the changed configuration information into the configuration file linked list.
In one embodiment, acquiring the configuration information of the monitored process, and generating the configuration file stored in the preset path includes: obtaining configuration information of the monitored process, wherein the configuration information comprises: the method comprises the following steps of (1) process name, process identifier, action command, starting timestamp, monitoring requirement, keep-alive mode, keep-alive period and dependency relationship; generating a configuration file based on the configuration information, and naming the configuration file by the process name; and storing the configuration file to the preset path, wherein the preset path is at least one.
In one embodiment, when the process information of the monitored process is abnormal, processing the monitored process according to a preset process exception handling rule includes: when the process information of the monitored process is abnormal, acquiring the abnormal information of the monitored process, and generating a log according to the abnormal information; after the log is generated, judging whether the configuration information of the monitored process comprises a dependency relationship; when the configuration information of the monitored process comprises a dependency relationship, processing the process having the dependency relationship with the monitored process, and after the process having the dependency relationship with the monitored process is processed, processing the monitored process according to a preset process exception handling rule, wherein the preset process exception handling rule comprises resetting the monitored process or resetting the operating system.
In one embodiment, when traversing the configuration file in the preset path and generating the configuration file linked list, the method further includes: when the preset path is not one, generating a preset path linked list based on the preset path; sequentially acquiring configuration files under a preset path in the preset path linked list one by one, and generating a configuration file linked list based on the configuration files; or acquiring the configuration file under the preset path according to the preset priority of the monitored process, and generating a configuration file linked list based on the configuration file.
In one embodiment, before the obtaining the configuration information of the monitored process and generating the configuration file stored in the preset path, the method further includes: initializing a watchdog and starting the monitored process.
It should be understood that although the various steps in the flow charts of fig. 3-4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. 3-4 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of performance of which is not necessarily sequential, but may be performed in turn or alternating with other steps or at least portions of sub-steps or stages of other steps.
In one embodiment, as shown in FIG. 5, there is provided a process control system comprising: the system comprises a configuration information acquisition unit, a configuration file linked list generation unit and an exception handling unit, wherein:
the device comprises a configuration information acquisition unit, a configuration information acquisition unit and a monitoring unit, wherein the configuration information acquisition unit is used for acquiring configuration information of a monitored process, generating a configuration file stored in a preset path, and blocking the monitored process based on the configuration file until the configuration file in the preset path is deleted, and the number of the monitored process is at least one;
the configuration file linked list generating unit is in communication connection with the configuration information acquiring unit and is used for traversing the configuration files under the preset path to generate a configuration file linked list, and when the configuration files in the configuration file linked list are accessed, the configuration files under the preset path are deleted to realize the normal operation of the monitored process;
and the exception handling unit is used for acquiring the process information of the monitored process, and when the process information of the monitored process is abnormal or the process information of the monitored process cannot be acquired, the monitored process is handled according to a preset process exception handling rule.
In one embodiment, the system further comprises: a thread allocation unit and a resource exception handling request sending unit; the thread allocation unit is used for allocating monitoring threads to the monitored process; a resource exception handling request sending unit, configured to send asynchronous notification information to a queue of the monitored process if the monitoring thread learns that the operating system resources are insufficient, so that the monitored process sends a resource exception handling request when detecting the asynchronous notification information, where the handling request carries the asynchronous notification information; and the exception handling unit is used for acquiring the process information of the monitored process based on the asynchronous notification information according to the processing request, and when the process information of the monitored process is abnormal or cannot be acquired, processing the monitored process according to a preset process exception handling rule.
In one embodiment, the system further includes a traversal unit, configured to periodically traverse the configuration file under the preset path; the configuration information obtaining unit is further configured to obtain configuration information of the configuration file, and when the configuration information of the configuration file is changed, determine whether the monitored process is an existing monitored process based on the configuration file; if the monitored process is the existing monitored process, updating the configuration file under the preset path based on the configuration file with the changed configuration information; and if the monitored process is not the existing monitored process, adding the configuration file with the changed configuration information into the configuration file linked list.
In one embodiment, the configuration file linked list generating unit is further configured to obtain configuration information of the monitored process, where the configuration information includes: the method comprises the following steps of (1) process name, process identifier, action command, starting timestamp, monitoring requirement, keep-alive mode, keep-alive period and dependency relationship; generating a configuration file based on the configuration information, and naming the configuration file by the process name; and storing the configuration file to the preset path, wherein the preset path is at least one.
In one embodiment, the exception handling unit is further configured to, when the process information of the monitored process is abnormal, obtain abnormal information of the monitored process, and generate a log according to the abnormal information; after the log is generated, judging whether the configuration information of the monitored process comprises a dependency relationship; when the configuration information of the monitored process includes a dependency relationship, processing the process having the dependency relationship with the monitored process, and after the process having the dependency relationship with the monitored process is processed, processing the monitored process according to a preset process exception handling rule, where the preset process exception handling rule includes resetting the monitored process or resetting the operating system.
In one embodiment, the configuration file linked list generating unit is further configured to generate a preset path linked list based on the preset path when the preset path is not one; sequentially acquiring configuration files under a preset path in the preset path linked list one by one, and generating a configuration file linked list based on the configuration files; or, according to the preset priority of the monitored process, acquiring the configuration file under the preset path, and generating a configuration file linked list based on the configuration file.
In one embodiment, the system further includes an initialization starting unit, configured to initialize the watchdog to start the monitored process.
For the specific definition of the process monitoring system, reference may be made to the above definition of the process monitoring method, which is not described herein again. The various modules in the process monitoring system described above may be implemented in whole or in part in software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent of a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 6. The computer device comprises a processor, a memory, a network interface, a display screen and an input device which are connected through a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program to run on the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a process monitoring method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 6 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
acquiring configuration information of a monitored process, generating a configuration file stored in a preset path, and blocking the monitored process based on the configuration file until the configuration file in the preset path is deleted, wherein the number of the monitored process is at least one;
traversing the configuration files under the preset path to generate a configuration file linked list, and deleting the configuration files under the preset path when accessing the configuration files in the configuration file linked list so as to realize the normal operation of the monitored process;
and acquiring the process information of the monitored process, and processing the monitored process according to a preset process exception handling rule when the process information of the monitored process is abnormal or cannot be acquired.
In one embodiment, the processor when executing the computer program further performs the steps of:
distributing a monitoring thread for the monitored process, and if the monitoring thread learns that the operating system resources are insufficient, sending asynchronous notification information to a queue of the monitored process so as to enable the monitored process to send a resource exception handling request when detecting the asynchronous notification information, wherein the handling request carries the asynchronous notification information; and acquiring the process information of the monitored process based on the asynchronous notification information according to the processing request, and processing the monitored process according to a preset process exception processing rule when the process information of the monitored process is abnormal or the process information of the monitored process cannot be acquired.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
periodically traversing the configuration file under the preset path; acquiring configuration information of the configuration file, and judging whether the monitored process is an existing monitored process or not based on the configuration file when the configuration information of the configuration file is changed; if the monitored process is the existing monitored process, updating the configuration file under the preset path based on the configuration file with the changed configuration information; and if the monitored process is not the existing monitored process, adding the configuration file with the changed configuration information into the configuration file linked list.
In one embodiment, the processor when executing the computer program further performs the steps of:
obtaining configuration information of the monitored process, wherein the configuration information comprises: the method comprises the following steps of (1) process name, process identifier, action command, starting timestamp, monitoring requirement, keep-alive mode, keep-alive period and dependency relationship; generating a configuration file based on the configuration information, and naming the configuration file by the process name; and storing the configuration file to the preset path, wherein the preset path is at least one.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
when the process information of the monitored process is abnormal, acquiring the abnormal information of the monitored process, and generating a log according to the abnormal information; after the log is generated, judging whether the configuration information of the monitored process comprises a dependency relationship; when the configuration information of the monitored process includes a dependency relationship, processing the process having the dependency relationship with the monitored process, and after the process having the dependency relationship with the monitored process is processed, processing the monitored process according to a preset process exception handling rule, where the preset process exception handling rule includes resetting the monitored process or resetting the operating system.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
when the preset path is not one, generating a preset path linked list based on the preset path; sequentially acquiring configuration files under a preset path in the preset path linked list one by one, and generating a configuration file linked list based on the configuration files; or, according to the preset priority of the monitored process, acquiring the configuration file under the preset path, and generating a configuration file linked list based on the configuration file.
In one embodiment, the processor when executing the computer program further performs the steps of:
initializing a watchdog and starting the monitored process.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, performs the steps of:
acquiring configuration information of a monitored process, generating a configuration file stored in a preset path, and blocking the monitored process based on the configuration file until the configuration file in the preset path is deleted, wherein the number of the monitored process is at least one;
traversing the configuration files under the preset path to generate a configuration file linked list, and deleting the configuration files under the preset path when accessing the configuration files in the configuration file linked list so as to realize the normal operation of the monitored process;
and acquiring the process information of the monitored process, and processing the monitored process according to a preset process exception processing rule when the process information of the monitored process is abnormal or the process information of the monitored process cannot be acquired.
In one embodiment, the computer program when executed by the processor further performs the steps of:
distributing a monitoring thread for the monitored process, and if the monitoring thread learns that the operating system resources are insufficient, sending asynchronous notification information to a queue of the monitored process so as to enable the monitored process to send a resource exception handling request when detecting the asynchronous notification information, wherein the handling request carries the asynchronous notification information; and acquiring the process information of the monitored process based on the asynchronous notification information according to the processing request, and processing the monitored process according to a preset process exception processing rule when the process information of the monitored process is abnormal or the process information of the monitored process cannot be acquired.
In one embodiment, the computer program when executed by the processor further performs the steps of:
periodically traversing the configuration file under the preset path; acquiring configuration information of the configuration file, and judging whether the monitored process is an existing monitored process based on the configuration file when the configuration information of the configuration file is changed; if the monitored process is the existing monitored process, updating the configuration file under the preset path based on the configuration file changed by the configuration information; and if the monitored process is not the existing monitored process, adding the configuration file with the changed configuration information into the configuration file linked list.
In one embodiment, the computer program when executed by the processor further performs the steps of:
obtaining configuration information of the monitored process, wherein the configuration information comprises: the method comprises the following steps of (1) process name, process identifier, action command, starting timestamp, monitoring requirement, keep-alive mode, keep-alive period and dependency relationship; generating a configuration file based on the configuration information, and naming the configuration file by the process name; and storing the configuration file to the preset path, wherein the preset path is at least one.
In one embodiment, the computer program when executed by the processor further performs the steps of:
when the process information of the monitored process is abnormal, acquiring the abnormal information of the monitored process, and generating a log according to the abnormal information; after the log is generated, judging whether the configuration information of the monitored process comprises a dependency relationship; when the configuration information of the monitored process comprises a dependency relationship, processing the process having the dependency relationship with the monitored process, and after the process having the dependency relationship with the monitored process is processed, processing the monitored process according to a preset process exception handling rule, wherein the preset process exception handling rule comprises resetting the monitored process or resetting the operating system.
In one embodiment, the computer program when executed by the processor further performs the steps of:
when the preset path is not one, generating a preset path linked list based on the preset path; sequentially acquiring configuration files under a preset path in the preset path linked list one by one, and generating a configuration file linked list based on the configuration files; or, according to the preset priority of the monitored process, acquiring the configuration file under the preset path, and generating a configuration file linked list based on the configuration file.
In one embodiment, the computer program when executed by the processor further performs the steps of:
initializing a watchdog and starting the monitored process.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by hardware instructions of a computer program, which may be stored in a non-volatile computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct Rambus Dynamic RAM (DRDRAM), and Rambus Dynamic RAM (RDRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, and these are all within the scope of protection of the present application. Therefore, the protection scope of the present patent application shall be subject to the appended claims.

Claims (10)

1. A process monitoring method is applied to an operating system, and comprises the following steps:
acquiring configuration information of a monitored process, generating a configuration file stored in a preset path, and blocking the monitored process based on the configuration file until the configuration file in the preset path is deleted, wherein the number of the monitored process is at least one;
traversing the configuration files under the preset path to generate a configuration file linked list, and deleting the configuration files under the preset path when accessing the configuration files in the configuration file linked list so as to realize the normal operation of the monitored process;
and acquiring the process information of the monitored process, and processing the monitored process according to a preset process exception handling rule when the process information of the monitored process is abnormal or cannot be acquired.
2. The process monitoring method of claim 1, further comprising:
distributing a monitoring thread for the monitored process, and if the monitoring thread learns that the operating system resources are insufficient, sending asynchronous notification information to a queue of the monitored process so as to enable the monitored process to send a resource exception handling request when detecting the asynchronous notification information, wherein the handling request carries the asynchronous notification information;
and acquiring the process information of the monitored process based on the asynchronous notification information according to the processing request, and processing the monitored process according to a preset process exception processing rule when the process information of the monitored process is abnormal or the process information of the monitored process cannot be acquired.
3. The process monitoring method of claim 2, further comprising:
periodically traversing the configuration file under the preset path;
acquiring configuration information of the configuration file, and judging whether the monitored process is an existing monitored process or not based on the configuration file when the configuration information of the configuration file is changed;
if the monitored process is the existing monitored process, updating the configuration file under the preset path based on the configuration file with the changed configuration information;
and if the monitored process is not the existing monitored process, adding the configuration file with the changed configuration information into the configuration file linked list.
4. The process monitoring method according to claim 3, wherein obtaining the configuration information of the monitored process and generating the configuration file stored under the preset path comprises:
obtaining configuration information of the monitored process, wherein the configuration information comprises: the method comprises the following steps of (1) process name, process identifier, action command, starting timestamp, monitoring requirement, keep-alive mode, keep-alive period and dependency relationship;
generating a configuration file based on the configuration information, and naming the configuration file by the process name;
and storing the configuration file to the preset path, wherein the preset path is at least one.
5. The process monitoring method according to claim 4, wherein when the process information of the monitored process is abnormal, processing the monitored process according to a preset process exception handling rule includes:
when the process information of the monitored process is abnormal, acquiring the abnormal information of the monitored process, and generating a log according to the abnormal information;
after the log is generated, judging whether the configuration information of the monitored process comprises a dependency relationship;
when the configuration information of the monitored process includes a dependency relationship, processing the process having the dependency relationship with the monitored process, and after the process having the dependency relationship with the monitored process is processed, processing the monitored process according to a preset process exception handling rule, where the preset process exception handling rule includes resetting the monitored process or resetting the operating system.
6. The process monitoring method according to claim 5, wherein when traversing the configuration file under the preset path and generating a configuration file linked list, the method further comprises:
when the preset path is not one, generating a preset path linked list based on the preset path;
sequentially acquiring configuration files under a preset path in the preset path linked list one by one, and generating a configuration file linked list based on the configuration files;
or the like, or, alternatively,
and acquiring the configuration file under the preset path according to the preset priority of the monitored process, and generating a configuration file linked list based on the configuration file.
7. The process monitoring method according to any one of claims 1 to 6, wherein before the configuration information of the monitored process is acquired and the configuration file stored in the preset path is generated, the method further comprises: initializing a watchdog and starting the monitored process.
8. A process monitoring system for use with an operating system, the system comprising:
the device comprises a configuration information acquisition unit, a configuration information acquisition unit and a monitoring unit, wherein the configuration information acquisition unit is used for acquiring configuration information of a monitored process, generating a configuration file stored in a preset path, and blocking the monitored process based on the configuration file until the configuration file in the preset path is deleted, and the number of the monitored process is at least one;
the configuration file linked list generating unit is in communication connection with the configuration information acquiring unit and is used for traversing the configuration files under the preset path to generate a configuration file linked list, and when the configuration files in the configuration file linked list are accessed, the configuration files under the preset path are deleted to realize the normal operation of the monitored process;
and the exception handling unit is used for acquiring the process information of the monitored process, and when the process information of the monitored process is abnormal or the process information of the monitored process cannot be acquired, the monitored process is handled according to a preset process exception handling rule.
9. A computer arrangement comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 7 when executing the computer program.
10. A computer storage medium on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202211210086.1A 2022-09-30 2022-09-30 Process monitoring method, system, computer device and storage medium Pending CN115509861A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211210086.1A CN115509861A (en) 2022-09-30 2022-09-30 Process monitoring method, system, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211210086.1A CN115509861A (en) 2022-09-30 2022-09-30 Process monitoring method, system, computer device and storage medium

Publications (1)

Publication Number Publication Date
CN115509861A true CN115509861A (en) 2022-12-23

Family

ID=84507172

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211210086.1A Pending CN115509861A (en) 2022-09-30 2022-09-30 Process monitoring method, system, computer device and storage medium

Country Status (1)

Country Link
CN (1) CN115509861A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116991596A (en) * 2023-09-28 2023-11-03 北京安华金和科技有限公司 Process keep-alive processing method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116991596A (en) * 2023-09-28 2023-11-03 北京安华金和科技有限公司 Process keep-alive processing method and system
CN116991596B (en) * 2023-09-28 2023-12-26 北京安华金和科技有限公司 Process keep-alive processing method and system

Similar Documents

Publication Publication Date Title
US8407688B2 (en) Methods and apparatus for storing and transmitting historical configuration data associated with information technology assets
WO2019179026A1 (en) Electronic device, method for automatically generating cluster access domain name, and storage medium
CN109739482B (en) Service logic execution system and method based on dynamic language
CN101895540B (en) For the system and method that application service process is guarded
CN108834086B (en) Method and device for sending short message, computer equipment and storage medium
CN110365762B (en) Service processing method, device, equipment and storage medium
CN111698283B (en) Management and control method, device, equipment and storage medium of distributed cluster host
CN108446172B (en) Data calling method and device, computer equipment and storage medium
CN112612988A (en) Page processing method and device, computer equipment and storage medium
CN110557398B (en) Service request control method, device, system, computer equipment and storage medium
CN115509861A (en) Process monitoring method, system, computer device and storage medium
CN110990132B (en) Asynchronous task processing method and device, computer equipment and storage medium
CN110866011B (en) Data table synchronization method and device, computer equipment and storage medium
CN114531477A (en) Method and device for configuring functional components, computer equipment and storage medium
US10223407B2 (en) Asynchronous processing time metrics
US20070174836A1 (en) System for controlling computer and method therefor
CN111966701A (en) Metadata updating method, device, equipment and storage medium
CN111399999A (en) Computer resource processing method and device, readable storage medium and computer equipment
CN108429780B (en) Data calling system and method between associated systems
CN111176986A (en) Thread script debugging method and device, computer equipment and storage medium
CN114157582A (en) Switch port state monitoring method and device and network communication system
CN114172903A (en) Node capacity expansion method, device, equipment and medium of slarm scheduling system
CN112162780A (en) Application operation control method and device and electronic equipment
CN110879757A (en) Restarting method and device for abnormal operation of client and computer equipment
US11868769B1 (en) Automatically determining and modifying environments for running microservices in a performant and cost-effective manner

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