Process monitoring method and device, computer equipment, readable storage medium and program product

By obtaining and monitoring the resource status information of the CDN service node component process, determining the abnormal process and restoring it according to preset policies, the problem of unbalanced resource occupation of CDN service nodes and the inability to recover quickly is solved, and automatic monitoring and recovery is realized, reducing the failure rate and operation and maintenance costs.

CN119597582APending Publication Date: 2025-03-11CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411712877.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

The lack of resource occupancy of various components in the CDN service nodes leads to unbalanced resource allocation, which may cause service abnormalities or machine failures, and the problem of traditional monitoring and alarm services being unable to recover quickly.

Method used

By obtaining the resource status information of the corresponding process of the target component, including resource occupation information and process status, periodically collecting and monitoring, after determining process exceptions, restore processing according to preset processing strategies, such as closing or rebuilding the process.

Benefits of technology

Automatic monitoring and recovery of abnormal processes is realized, failure rate and operation and maintenance costs are reduced, and overall service quality is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597582A_ABST
    Figure CN119597582A_ABST
Patent Text Reader

Abstract

The invention relates to a process monitoring method and device, computer equipment, a readable storage medium and a program product. Resource state information of a process corresponding to a target component is obtained, and the resource state information comprises at least one of periodically collected resource occupation information and process states of the process corresponding to the target component; and under the condition that the process is determined to be abnormal according to the resource state information, the process is recovered according to the preset processing strategy, so that the abnormal process is automatically monitored and recovered, the fault rate and the operation and maintenance cost can be effectively reduced, and the overall service quality is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a process monitoring method, apparatus, computer equipment, readable storage medium and program product. Background Art

[0002] With the development of computer technology, CDN (Content Delivery Network) technology has been widely used. CDN technology can be used to build a huge cluster network, which can include several service nodes scattered across the country or even important regions around the world.

[0003] In traditional technologies, various functional components and internal and external service components that support CDN services need to be deployed on the server of each service node, such as gateway services, cache services, log services, monitoring and alarm services, etc. The more components there are, the more intense the competition for hardware resources on the machine, among which CPU (Central Processing Unit), memory and disk are the key competitive resources.

[0004] Since the resource usage of each component is irregular and constantly changing, it is difficult to achieve balanced resource allocation for each component without affecting each other. If a component suddenly occupies a large amount of resources abnormally, it may cause insufficient resources for other components, resulting in service abnormalities or even failure of the entire machine. However, CDN services have very high requirements for service quality and basically have zero tolerance for failures. Therefore, how to effectively monitor the operation process of CDN services to avoid failures is an urgent problem that needs to be solved. Summary of the invention

[0005] Based on this, it is necessary to provide a process monitoring method, device, computer equipment, computer-readable storage medium and computer program product that can effectively monitor the service operation process in response to the above technical problems.

[0006] In a first aspect, the present application provides a process monitoring method, the method comprising:

[0007] Acquire resource status information of a process corresponding to a target component, wherein the resource status information includes at least one of resource occupancy information and process status of the process corresponding to the target component that are periodically collected;

[0008] When it is determined that the process is abnormal according to the resource status information, the process is restored according to a preset processing strategy.

[0009] In one of the embodiments, when the process is determined to be abnormal according to the resource status information, the process is recovered according to a preset processing strategy, including: if the process state of the process is determined to be a zombie state according to the resource status information, then the process is determined to be abnormal; and the process is closed or rebuilt according to the preset processing strategy to recover the process.

[0010] In one of the embodiments, the method further includes: periodically sending a process detection instruction to the target component, the process detection instruction is used to instruct the target component to broadcast to the corresponding process so that the process generates a marker file according to the broadcast; determining the process state of the process according to the marker file, the process state including a normal state or a zombie state; or, detecting a marker file generated by the process corresponding to the target component based on a preset timing period, and determining the process state of the process according to the marker file.

[0011] In one of the embodiments, determining the process status of the process based on the marker file includes: determining that the process status of the process is a normal state based on the process corresponding to the marker file; and determining that the process status of the process is a zombie state when it is determined that there is a process in the process corresponding to the target component that has not generated a marker file for a set period of time.

[0012] In one of the embodiments, when it is determined that the process is abnormal based on the resource status information, the process is recovered according to a preset processing strategy, including: storing the resource occupancy information of the process corresponding to the target component that is periodically collected in a first data set; the resource occupancy information includes at least one of CPU occupancy information or memory occupancy information; if the resource occupancy information of the process reaches a first threshold condition, the resource occupancy information of the process is synchronously stored in a second data set, and the resource occupancy information of the process within a first set time period is synchronously recorded in the second data set; if it is determined that the resource occupancy information of the process reaches a second threshold condition based on the second data set, a first alarm information is generated, and the first alarm information is used to indicate that the process is suspected to be abnormal; if it is determined that the resource occupancy information of the process reaches a third threshold condition based on the second data set, the process is determined to be abnormal; and the process is closed or rebuilt according to the preset processing strategy to recover the process.

[0013] In one of the embodiments, after closing or rebuilding the process according to a preset processing strategy, the method further includes: generating a second alarm message, wherein the second alarm message is used to indicate that the process has been restored; and deleting resource occupancy information of the process from the second data set.

[0014] In a second aspect, the present application provides a process monitoring device, the device comprising:

[0015] An information acquisition module, used to acquire resource status information of a process corresponding to a target component, wherein the resource status information includes at least one of resource occupancy information and process status of the process corresponding to the target component that are periodically collected;

[0016] The process processing module is used to restore the process according to a preset processing strategy when it is determined that the process is abnormal according to the resource status information.

[0017] In a third aspect, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0018] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.

[0019] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.

[0020] The above-mentioned process monitoring method, apparatus, computer equipment, computer-readable storage medium and computer program product obtain resource status information of the process corresponding to the target component, wherein the resource status information includes at least one of resource occupancy information and process status of the process corresponding to the target component that are periodically collected; and when it is determined that the process is abnormal based on the resource status information, the process is recovered according to a preset processing strategy, thereby realizing automatic monitoring and recovery of abnormal processes, and can effectively reduce failure rates and operation and maintenance costs, and improve overall service quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments of the present application or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0022] Figure 1 A schematic diagram of a process monitoring method in one embodiment;

[0023] Figure 2 A schematic diagram of a process flow of recovery steps for a process in one embodiment;

[0024] Figure 3 It is a flowchart of the steps of restoring a process in another embodiment;

[0025] Figure 4 is a structural block diagram of a process monitoring device in one embodiment;

[0026] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0027] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0028] Since CDN services have very high requirements for service quality and basically have zero tolerance for faults, various unpredictable problems will inevitably occur during the operation of software and hardware. In traditional technology, each service node of CDN will install various monitoring and alarm services to understand the operation status of the machine in real time and whether resources are used normally. Traditional monitoring has the granularity of the whole machine and self-monitoring implemented within some components. When an abnormality occurs, the alarm service will notify relevant personnel to investigate and handle it. However, traditional monitoring and alarm services can only monitor and alarm, but cannot quickly recover and solve problems. For example, when unknown zombie processes appear in key components during the evening peak or early morning, it is easy to cause configuration updates to fail. At this time, if the personnel do not handle the alarm in time, it will lead to a large number of customer complaints the next day.

[0029] There are also many service components in CDN that are based on open source openresty / nginx (openresty is a high-performance web platform based on nginx and lua; nginx is a lightweight web server / reverse proxy server and email proxy server) to implement various customer business functions. Among them, nginx is a multi-process. Except for shared memory, the CPU usage and worker memory usage of each process are independent, and the processes do not affect each other. However, when a process is abnormal, such as triggering a deep hidden dead loop that causes the process to continue to occupy 100% of the CPU, malicious memory application or memory application without release causes the process to occupy very high memory, and unknown problems cause zombie processes, etc., such abnormalities will cause the process to be unable to provide external services, and because its resource usage exceeds the normal range, or the zombie process will cause the entire component to be unable to reload and update, which will cause other service problems.

[0030] Based on this, an embodiment of the present application provides a process monitoring method, which targets service components with multiple processes like nginx, and performs exception monitoring and recovery based on process granularity. It obtains resource status information of the process corresponding to the target component, wherein the resource status information includes at least one of the resource occupancy information and process status of the process corresponding to the target component collected periodically; and when it is determined that the process is abnormal based on the resource status information, the process is recovered according to a preset processing strategy, thereby realizing automatic monitoring and recovery of abnormal processes, and can effectively reduce failure rates and operation and maintenance costs, and improve overall service quality.

[0031] In one embodiment, Figure 1 As shown, a process monitoring method is provided, which is applied to a computer device. Specifically, the computer device can be a terminal or a server, which is not limited in this embodiment. In this embodiment, the method can include the following steps:

[0032] Step 102: Obtain resource status information of the process corresponding to the target component.

[0033] Among them, the target component may be a relevant functional component or service component that supports CDN business and needs to be monitored for abnormalities. Specifically, the target component may be a multi-process service component similar to nginx. The resource status information includes at least one of the resource occupancy information and process status of the process corresponding to the target component that is periodically collected. The process status may be a specific state of the process, such as a normal state or a zombie state. The resource occupancy information includes, but is not limited to, CPU occupancy information or memory occupancy information. The CPU occupancy information may be the CPU occupancy size or the CPU occupancy rate. The memory occupancy information may be the memory occupancy size or the memory occupancy rate.

[0034] In this embodiment, the computer device may periodically collect at least one of resource occupancy information and process status of processes corresponding to relevant functional components or service components that require abnormal monitoring, so as to obtain resource status information of processes corresponding to target components.

[0035] Step 104: When it is determined that the process is abnormal according to the resource status information, the process is restored according to a preset processing strategy.

[0036] Among them, the process abnormality may refer to abnormal resource consumption of the process, or may refer to abnormal process state of the process. Specifically, whether the resource consumption is abnormal can be judged based on the resource occupation information of the process and the preset analysis strategy. For example, the preset analysis strategy may be a preset resource occupation threshold. When the resource occupation information of a process reaches the preset resource occupation threshold, it indicates that its resource consumption is abnormal, and thus the corresponding process can be determined to be abnormal.

[0037] Whether the process state is abnormal can be determined based on the process state of the process. Specifically, when the process state of the process is a dead state, it means that the process state is abnormal, so the process can be determined to be abnormal. The preset processing strategy can be a pre-set method for processing the abnormal process to restore it.

[0038] In this embodiment, the computer device can analyze whether each process has an abnormality based on a preset analysis strategy and the resource status information of the target component corresponding to the process obtained in the above steps, and if it is determined that the process is abnormal, further restore the process according to the preset processing strategy.

[0039] In the above process monitoring method, by obtaining the resource status information of the process corresponding to the target component, when the process is determined to be abnormal based on the resource status information, the process is restored according to the preset processing strategy, thereby realizing automatic monitoring and recovery of the abnormal process, and can effectively reduce the failure rate and operation and maintenance costs, and improve the overall service quality.

[0040] In an exemplary embodiment, taking the resource status information as the process status as an example, Figure 2 As shown, in step 104, when it is determined that the process is abnormal according to the resource status information, the process is restored according to a preset processing strategy, which may specifically include:

[0041] Step 202: Periodically detect the marker file of the process corresponding to the target component.

[0042] The marker file is a data file generated by a process and can be used to identify the process status. Specifically, the marker file may be pid.timestamp.

[0043] In one scenario, the computer device may periodically send a process detection instruction to the target component, wherein the process detection instruction is used to instruct the target component to broadcast to the corresponding process so that the process generates a marker file according to the broadcast. Therefore, the computer device may periodically detect the marker file of the process corresponding to the target component, and determine the process state of the process according to the marker file.

[0044] In another scenario, a timer can be set inside the target component so that the process corresponding to the target component can generate a marker file according to the timing period of the timer. The computer device can periodically detect the marker file of the process corresponding to the target component and determine the process state of the process according to the marker file.

[0045] Step 204, determine whether the marker file of the process is missing.

[0046] If the marker file of the process is not missing during each detection, it means that the process state is normal, and the process returns to step 202 to continue detecting the marker file of the process. If the marker file of a process is missing during a certain detection cycle, it means that the process may be a zombie process, that is, the process state of the process may be a zombie state, and step 206 is executed to determine whether to trigger the processing strategy.

[0047] Step 206, determining whether a processing strategy is triggered.

[0048] The processing strategy may be a pre-set method for processing an abnormal process to restore it. In this embodiment, the corresponding processing strategy is triggered only when the process is determined to be abnormal, that is, when the process state of the process is determined to be a dead state.

[0049] Specifically, if the processing strategy is not triggered, step 208 is executed to generate the first alarm information. If the processing strategy is triggered, step 210 is executed to perform recovery processing on the process according to the processing strategy.

[0050] In this embodiment, whether to trigger the processing strategy can be determined based on whether the process is abnormal. Specifically, when the computer device periodically detects the marker file of the process corresponding to the target component, if the marker file of a certain process is not detected in a continuous set period (such as 5 consecutive periods, 10 consecutive periods, etc.), it can be determined that the process state of the process is a zombie state, that is, it can be determined that the process is abnormal, so step 210 can be executed.

[0051] In one scenario, in order to report the monitored anomalies in a timely manner, a continuous period shorter than the above-mentioned continuous set period (such as 2 periods, 3 periods, etc.) can also be set. Then, when the computer device periodically detects the marker file of the process corresponding to the target component, if the marker file of a certain process is not detected in the set continuous period such as 2 periods or 3 periods, step 208 can be executed to generate the first alarm information, so as to report the abnormal situation in a timely manner.

[0052] Step 208: Generate first warning information.

[0053] The first warning information is used to indicate that the process is suspected to be abnormal, that is, the process may be a zombie process. In this embodiment, the computer device can notify the first warning information to relevant personnel via SMS, email or other communication methods, thereby realizing timely reporting of the abnormality so that relevant personnel can check it in time.

[0054] Step 210: Recover the process according to the processing strategy.

[0055] Specifically, the computer device can close or rebuild the process according to the preset processing strategy to restore the process. In addition, a second alarm message can be generated, and the second alarm message is used to indicate that the process has been restored. The computer device can notify the relevant personnel of the second alarm message via SMS, email or other communication methods, so as to realize timely reporting of the processing situation.

[0056] Step 212, clearing historical process data.

[0057] Specifically, after the computer device performs recovery processing on the abnormal process according to the processing strategy, it can also compare the existing process with the process data, thereby clearing the historical process data of the process that no longer exists.

[0058] In the above embodiment, by monitoring the process status of the process corresponding to the target component and combining internal and external judgment and processing, a more accurate and flexible process status judgment can be achieved, and abnormal situations can be reported in time based on the alarm mechanism, and individual abnormal processes that affect the overall service can be promptly handled based on the preset processing strategy, or components can be rebuilt to achieve the purpose of timely restoration of services, thereby improving service quality and stability and reducing operation and maintenance costs.

[0059] In an exemplary embodiment, taking the resource status information as the resource occupancy information of a process as an example, Figure 3 As shown, in step 104, when it is determined that the process is abnormal according to the resource status information, the process is restored according to a preset processing strategy, which may specifically include:

[0060] Step 302: Store the periodically collected resource occupancy information of the process corresponding to the target component into a first data set.

[0061] The resource occupancy information may be the CPU occupancy information or the memory occupancy information of the process. Specifically, the resource occupancy information of the process may include the component name of the component to which the process belongs, the process number, the current acquisition timestamp, the CPU occupancy information or the memory occupancy information of the process. In this embodiment, the CPU occupancy information is the CPU occupancy rate, and the memory occupancy information is the memory occupancy size.

[0062] In this embodiment, the computer device can periodically (eg, every 30 seconds) collect resource occupancy information of the target component corresponding process and store it in the first data set. The first data set is a data storage unit for storing resource occupancy information of all target component corresponding processes.

[0063] In one scenario, the first data set may also be a data set for recording the sliding window data set in the last 10 minutes. The 10-minute sliding window data set can be backed up regularly so that subsequent investigators can accurately locate the anomaly, solve the problem as soon as possible, and reduce the workload of filtering data.

[0064] Step 304, determine whether the process is in the second data set.

[0065] The second data set is a data storage unit for synchronously storing resource occupancy information of suspected abnormal processes. In this embodiment, each time the resource occupancy information of the process corresponding to the target component is collected and stored in the first data set, it is determined whether the process is recorded in the second data set. If the process is recorded in the second data set, step 306 is executed to synchronously record the resource occupancy information of the process in the second data set. If the process is not recorded in the second data set, step 308 is executed to determine whether the resource occupancy information of the process reaches the first threshold condition.

[0066] Step 306: synchronously record the resource occupancy information of the process in the second data set.

[0067] Specifically, if the process is recorded in the second data set, the resource occupancy information of the process collected this time is synchronously recorded in the second data set.

[0068] Step 308: Determine whether the resource usage information of the process reaches a first threshold condition.

[0069] The first threshold condition may be a pre-configured condition for recording the process into the second data set, which may specifically be a CPU occupancy rate threshold or a memory occupancy size threshold. The specific threshold size may be set based on the actual scenario.

[0070] In this embodiment, the CPU occupancy rate threshold is 100%, and the memory occupancy size threshold can be the size obtained by (total memory / number of processes) × the set multiple. In this embodiment, 50G is taken as an example. Specifically, if the process is not recorded in the second data set, it is further determined whether the resource occupancy information of the process collected this time reaches the first threshold condition, that is, it is determined whether the CPU occupancy rate of the process collected this time reaches 100%, or it is determined whether the memory occupancy size of the process collected this time reaches 50G. If it is determined that the resource occupancy information of the process collected this time reaches the first threshold condition, step 306 is executed to synchronously store the resource occupancy information of the process to the second data set, and synchronously record the resource occupancy information of the process within the first set time (such as 5 minutes) in the second data set. If it is determined that the resource occupancy information of the process collected this time does not reach the first threshold condition, it returns to step 302, and continues to collect the resource occupancy information of the process corresponding to the target component and store it in the first data set.

[0071] Step 310: determine whether the resource occupancy information of the process reaches a second threshold condition according to the second data set.

[0072] Among them, the second threshold condition can be a pre-configured condition for alarm notification. Specifically, it can be the proportion of resource occupancy information of the corresponding process in the first set time period (such as 5 minutes) in the second data set that reaches the first threshold condition, such as 50%. Specifically, the threshold condition can be set based on the actual scenario, and this embodiment is not limited to this. Specifically, if it is determined according to the second data set that the resource occupancy information of the process reaches the second threshold condition, step 312 is executed to generate the first alarm information. If it is determined according to the second data set that the resource occupancy information of the process does not reach the second threshold condition, return to step 302, continue to collect the resource occupancy information of the process corresponding to the target component and store it in the first data set.

[0073] For example, if the CPU occupancy rate of a certain process reaches 100% in the resource occupancy information for 5 minutes in the second data set, it can be determined that the resource occupancy information of the process reaches the second threshold condition.

[0074] Alternatively, if the memory usage size of a certain process reaches 50G and accounts for 50% of the resource usage information in the second data set for 5 minutes, it can be determined that the resource usage information of the process reaches the second threshold condition.

[0075] Step 312: Generate first warning information.

[0076] Specifically, if it is determined according to the second data set that the resource usage information of the process reaches the second threshold condition, a first alarm information is generated. The first alarm information is used to indicate that the process is suspected to be abnormal. In this embodiment, the computer device can notify the relevant personnel of the first alarm information through SMS, email or other communication methods, so as to realize timely reporting of the abnormality, so that the relevant personnel can check it in time.

[0077] Step 314: determine whether the resource usage information of the process reaches a third threshold condition according to the second data set.

[0078] Among them, the third threshold condition can be a pre-configured condition for triggering the processing strategy. Specifically, it can be the proportion of resource occupancy information of the corresponding process in the second set time period (such as 10 minutes) in the second data set that reaches the first threshold condition, such as 50%. Specifically, the threshold condition can be set based on the actual scenario, and this embodiment is not limited to this. Specifically, if it is determined according to the second data set that the resource occupancy information of the process reaches the third threshold condition, the process is determined to be abnormal, and step 316 is executed to close or rebuild the process according to the preset processing strategy. If it is determined according to the second data set that the resource occupancy information of the process does not reach the third threshold condition, return to step 302, continue to collect the resource occupancy information of the process corresponding to the target component and store it in the first data set.

[0079] For example, if the CPU occupancy rate of a certain process reaches 100% in the resource occupancy information for 10 minutes in the second data set, accounting for 50%, it can be determined that the resource occupancy information of the process reaches the third threshold condition.

[0080] Alternatively, if the memory usage size of a certain process reaches 50G and accounts for 50% of the resource usage information in the second data set for 10 minutes, it can be determined that the resource usage information of the process reaches the third threshold condition.

[0081] Step 316: close or rebuild the process according to the preset processing strategy.

[0082] Specifically, if it is determined according to the second data set that the resource occupancy information of the process reaches the third threshold condition, the process is determined to be abnormal, and the process is closed or rebuilt according to a preset processing strategy to recover the process.

[0083] Step 318: Generate second warning information.

[0084] Specifically, after the process is closed or rebuilt according to the preset processing strategy based on the above steps, a second alarm information may be generated. The second alarm information is used to indicate that the process has been restored. The computer device may notify the relevant personnel of the second alarm information via SMS, email or other communication methods, so as to realize timely reporting of the processing situation.

[0085] Step 320, clearing historical process data.

[0086] Specifically, after the computer device recovers the abnormal process according to the processing strategy, it can also compare the existing process with the process data, thereby clearing the historical process data of the no longer existing process. For example, the resource occupancy information of the processed process can be deleted from the second data set.

[0087] In the above embodiment, by monitoring the resource usage information of the process corresponding to the target component, abnormal situations are reported in a timely manner based on the alarm mechanism, and individual abnormal processes that affect the overall service are promptly handled based on the preset processing strategy, or the components are rebuilt to achieve the purpose of timely restoration of services, so as to achieve rapid restoration of services through automatic detection mechanism processing, improve service quality and stability, and reduce operation and maintenance costs.

[0088] It is understandable that the above-mentioned various threshold conditions and processing strategies can be configured according to actual scenarios, and this embodiment is not limited to this.

[0089] In one scenario, you can customize monitoring strategies based on different components (such as customizing collection frequency, data analysis solutions, custom processing strategies and alarm information for different components), and trigger processing strategies that meet component characteristics and do not affect services in the event of an exception. The bottom layer provides basic template analysis functions, and the upper layer implements a visual configuration platform. The process analysis configuration parameters and processing strategies of each component are adjusted according to actual conditions, thereby reducing the repeated development workload of each component for abnormal process monitoring functions, achieving a rapid recovery mechanism for abnormal processes, improving service quality and stability, reducing customer complaints, reducing the urgency of event processing, and reducing operation and maintenance costs.

[0090] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0091] Based on the same inventive concept, the embodiment of the present application also provides a process monitoring device for implementing the process monitoring method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more process monitoring device embodiments provided below can refer to the limitations on the process monitoring method above, and will not be repeated here.

[0092] In an exemplary embodiment, Figure 4 As shown, a process monitoring device is provided, including: an information acquisition module 402 and a process processing module 404, wherein:

[0093] An information acquisition module 402 is used to acquire resource status information of a process corresponding to a target component, wherein the resource status information includes at least one of resource occupancy information and process status of the process corresponding to the target component that are periodically collected;

[0094] The process processing module 404 is used to recover the process according to a preset processing strategy when it is determined that the process is abnormal according to the resource status information.

[0095] In an exemplary embodiment, the process processing module is specifically used to: if the process state of the process is determined to be a zombie state according to the resource state information, then determine that the process is abnormal; and close or rebuild the process according to a preset processing strategy to recover the process.

[0096] In an exemplary embodiment, the process processing module is specifically used to: periodically send a process detection instruction to the target component, the process detection instruction is used to instruct the target component to broadcast to the corresponding process, so that the process generates a marker file according to the broadcast; determine the process status of the process according to the marker file, and the process status includes a normal state or a zombie state; or, detect the marker file generated by the corresponding process of the target component based on a preset timing period, and determine the process status of the process according to the marker file.

[0097] In an exemplary embodiment, the process processing module is specifically used to: determine that the process status of the process is a normal state based on the process corresponding to the marker file; when it is determined that there is a process in the process corresponding to the target component that has not generated a marker file for a set period of time, determine that the process status of the process is a zombie state.

[0098] In an exemplary embodiment, the process processing module is specifically used to: store the periodically collected resource occupancy information of the process corresponding to the target component into a first data set; the resource occupancy information includes at least one of CPU occupancy information or memory occupancy information; if the resource occupancy information of the process reaches a first threshold condition, synchronously store the resource occupancy information of the process into a second data set, and synchronously record the resource occupancy information of the process within a first set time period in the second data set; if it is determined according to the second data set that the resource occupancy information of the process reaches a second threshold condition, generate a first alarm information, and the first alarm information is used to indicate that the process is suspected to be abnormal; if it is determined according to the second data set that the resource occupancy information of the process reaches a third threshold condition, determine that the process is abnormal; close or rebuild the process according to a preset processing strategy to restore the process.

[0099] In an exemplary embodiment, the process processing module is further specifically used to: generate second alarm information, where the second alarm information is used to indicate that the process has been restored; and delete resource occupancy information of the process from the second data set.

[0100] Each module in the above process monitoring device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0101] In an exemplary embodiment, a computer device is provided, the internal structure of which can be shown as follows: Figure 5 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile 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 operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a process monitoring method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0102] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0103] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0104] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0105] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0106] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0107] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0108] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0109] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A process monitoring method, characterized in that: The method comprises: Acquire resource status information of a process corresponding to a target component, wherein the resource status information includes at least one of resource occupancy information and process status of the process corresponding to the target component that are periodically collected; When it is determined that the process is abnormal according to the resource status information, the process is restored according to a preset processing strategy.

2. The method according to claim 1, characterized in that When it is determined according to the resource status information that the process is abnormal, recovering the process according to a preset processing strategy, including: If it is determined according to the resource status information that the process status of the process is a zombie state, then determining that the process is abnormal; The process is closed or rebuilt according to a preset processing strategy to recover the process.

3. The method according to claim 2, characterized in that The method further comprises: Periodically sending a process detection instruction to the target component, the process detection instruction is used to instruct the target component to broadcast to the corresponding process, so that the process generates a marker file according to the broadcast; determining the process state of the process according to the marker file, the process state including a normal state or a zombie state; or, A marker file generated by a process corresponding to the target component based on a preset timing period is detected, and a process state of the process is determined according to the marker file.

4. The method according to claim 3, characterized in that Determining the process state of the process according to the marker file includes: Based on the process corresponding to the marker file, determining that the process state of the process is a normal state; When it is determined that there is a process in the process corresponding to the target component that has not generated a marker file for a set period of time, it is determined that the process state of the process is a zombie state.

5. The method according to any one of claims 1 to 4, characterized in that: When it is determined according to the resource status information that the process is abnormal, recovering the process according to a preset processing strategy, including: storing the periodically collected resource occupancy information of the process corresponding to the target component into a first data set; the resource occupancy information includes at least one of CPU occupancy information or memory occupancy information; If the resource occupation information of the process reaches a first threshold condition, the resource occupation information of the process is synchronously stored in a second data set, and the resource occupation information of the process within a first set time period is synchronously recorded in the second data set; If it is determined according to the second data set that the resource usage information of the process reaches a second threshold condition, generating first alarm information, where the first alarm information is used to indicate that the process is suspected to be abnormal; If it is determined according to the second data set that the resource occupancy information of the process reaches a third threshold condition, then determining that the process is abnormal; The process is closed or rebuilt according to a preset processing strategy to recover the process.

6. The method according to claim 5, characterized in that After closing or rebuilding the process according to the preset processing strategy, the method further includes: generating second warning information, wherein the second warning information is used to indicate that the process has been restored; and The resource occupation information of the process is deleted from the second data set.

7. A process monitoring device, characterized in that: The device comprises: An information acquisition module, used to acquire resource status information of a process corresponding to a target component, wherein the resource status information includes at least one of resource occupancy information and process status of the process corresponding to the target component that are periodically collected; The process processing module is used to restore the process according to a preset processing strategy when it is determined that the process is abnormal according to the resource status information.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Internet of Things data acquisition method and device, storage medium and electronic equipment

    CN120956771A

  • Exception handling method and device based on suspension system and computer equipment

    CN121084888A