Process management method and device, electronic equipment and storage medium
By using a global process identifier management method, the problem of distinguishing and managing processes with the same name in a virtualization unit is solved, and efficient resource management and stable operation of multiple virtualization units are achieved.
Patent Information
- Application Number
- CN202511128396.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-12
- Publication Date
- 2025-12-05
AI Technical Summary
Existing technologies cannot effectively distinguish and manage processes with the same name in multiple virtualization units, leading to resource waste and management difficulties.
By using a global process identifier, combined with a virtualization unit identifier and a process identifier, process registration, resource consumption index collection, and runtime status management can be achieved, distinguishing processes from different virtualization units.
This system enables the simultaneous management of processes within multiple virtualization units in a monitoring system, effectively distinguishing and managing processes with the same name, optimizing resource utilization, and ensuring the stable operation of virtualization units.
Smart Images

Figure CN121070541A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present specification relates to the technical field of computer networks, and particularly relates to a process management method and device, an electronic device and a storage medium. BACKGROUND
[0002] Physical device virtualization abstracts physical device resources into multiple virtualization units (virtual machines or containers). At this time, not only physical hardware resources are independent, but also process resources and forwarding table entries at the software level are independent, so as to ensure the independent running of each virtualization unit.
[0003] In related technologies, each virtualization unit independently manages the processes in the virtualization environment thereof. However, this is relatively wasteful of resources for a physical device.
[0004] Since the conventional process management method generally identifies a process according to a process name, it will not be applicable to simultaneously managing processes in multiple virtualization units, and cannot be directly applied to a scenario of simultaneously managing processes in multiple virtualization units. Because if a physical device is virtualized into multiple virtualization units, each virtualization unit corresponds to an independent namespace, and there may be processes with the same name in different virtualization units, at this time, only according to the process name, the processes with the same name in different virtualization units cannot be effectively distinguished. SUMMARY
[0005] To overcome the problems in the related art, the present specification provides a process management method and device, an electronic device and a storage medium.
[0006] According to a first aspect of an embodiment of the present specification, a process management method is provided, the method being applied to a monitoring system, the monitoring system being used for simultaneously managing processes in multiple virtualization units, and the method comprising:
[0007] receiving registration information of a process in a virtualization unit, and registering the process into the monitoring system according to the registration information; the registration information comprising a global process identifier, the global process identifier being composed of an identifier of the virtualization unit and an identifier allocated by the virtualization unit for the process;
[0008] determining a location of the process according to the global process identifier, and collecting a resource consumption indicator of a resource currently used by the process;
[0009] managing a running state of the process according to the resource consumption indicator.
[0010] According to a second aspect of an embodiment of the present specification, a process management device is provided, the device being applied to a monitoring system, the monitoring system being used for simultaneously managing processes in multiple virtualization units, and the device comprising:
[0011] The process registration module is configured to receive registration information of a process in a virtualization unit, and register the process into the monitoring system according to the registration information; the registration information comprises a global process identifier, and the global process identifier is composed of an identifier of the virtualization unit and an identifier allocated to the process by the virtualization unit;
[0012] The index collection module is configured to determine a location of the process according to the global process identifier, and collect a resource consumption index of a resource currently used by the process;
[0013] The running state management module is configured to manage a running state of the process according to the resource consumption index.
[0014] According to a third aspect of the embodiments of the present specification, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method according to the first aspect when executing the program.
[0015] According to a fourth aspect of the embodiments of the present specification, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the program is executed by a processor to implement the steps of the method according to the first aspect.
[0016] The technical solutions provided by the embodiments of the present specification can include the following beneficial effects:
[0017] In the embodiments of the present specification, after receiving the registration information of the processes in each virtualization unit, the processes are registered into the monitoring system, and the registration information comprises a global process identifier, and the global process identifier is composed of an identifier of the virtualization unit and an identifier allocated to the process by the virtualization unit. Since the global process identifier comprises the identifier of the virtualization unit, different virtualization units can be distinguished, and the identifier of the process can be used to distinguish the same process in the same virtualization unit. Therefore, by combining the identifier of the virtualization unit and the identifier allocated to the process, the processes in different virtualization units can be distinguished, so that the location of the process can be determined, the resource consumption index of the resource currently used by the process can be collected, and the running state of the process can be managed according to the resource consumption index.
[0018] It can be seen that the present solution can effectively distinguish the processes in different virtualization units, so that the processes in multiple virtualization units can be simultaneously managed in the monitoring system.
[0019] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present specification. BRIEF DESCRIPTION OF DRAWINGS
[0020] The accompanying drawings, which are incorporated herein and constitute part of this specification, illustrate embodiments consistent with the description and serve to explain the principles of the description.
[0021] Figure 1 is a scenario diagram of process management according to an example embodiment of the description.
[0022] Figure 2 is a flowchart of a process management method according to an example embodiment of the description.
[0023] Figure 3 is a flowchart of a registration process according to an example embodiment of the description.
[0024] Figure 4 is a flowchart of process management according to an example embodiment of the description.
[0025] Figure 5 is a structural diagram of an electronic device according to an example embodiment of the description.
[0026] Figure 6 is a block diagram of a process management apparatus according to an example embodiment of the description. DETAILED DESCRIPTION
[0027] The example embodiments will be described in detail herein with reference to the accompanying drawings. The following description is presented for the purpose of describing exemplary embodiments consistent with the description, and is not intended to limit the description. Rather, it is intended to describe some aspects of the description in detail, and the example embodiments described in the following detailed description do not represent all embodiments consistent with the description.
[0028] The terminology used in the present description is for the purpose of describing particular embodiments only and is not intended to be limiting of the present description. As used in the present description and the appended claims, the singular forms "a," "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0029] It should be understood that although the terms first, second, third, etc., may be used in this specification to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this specification, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0030] Physical device virtualization abstracts physical device resources into multiple virtualization units (virtual machines or containers). In this way, not only are physical hardware resources independent, but also software-level process resources and forwarding table entries are independent, thereby ensuring the independent operation of each virtualization unit.
[0031] In related technologies, each virtualization unit independently manages processes within its own virtualization environment. However, this is relatively wasteful of resources for physical devices.
[0032] Traditional process management methods, which typically identify processes by their names, are unsuitable for managing processes across multiple virtualization units simultaneously. This is because if a physical device is virtualized into multiple virtualization units, each corresponding to an independent namespace, processes with the same name may exist in different virtualization units. In such cases, relying solely on process names is insufficient to effectively distinguish between processes with the same name in different virtualization units.
[0033] To address the aforementioned technical problems, this specification provides a process management method for simultaneously managing processes in multiple virtualization units.
[0034] like Figure 1 As shown, multiple virtualization units 102, 103, and 104 are virtualized on physical device 10. Physical device 10 can be a general-purpose server, network device (such as a router or switch), etc. Virtualization methods can include KVM, OVC, and other virtualization technologies. This solution does not impose any restrictions on the virtualization method.
[0035] Each virtualization unit independently runs process 1, process 2, and process n, etc. Process resources are isolated between virtualization units. Processes with the same functionality can run across different virtualization units. For example, virtualization unit 102 and virtualization unit 103 can run the same SSH process. Due to different namespaces, the namespace of a process cannot be obtained solely based on its process name or process PID during process management. For example, virtualization unit 102 and virtualization unit 103 might assign the same PID to SSH, and both processes might have the process name SSH.
[0036] The monitoring system 101 can be used to manage processes in multiple virtualization units simultaneously. For example, the monitoring system 101 can be used to manage processes in virtualization unit 102, virtualization unit 103 and virtualization unit 104 simultaneously.
[0037] For example, the virtualization unit 102 sends registration information to the monitoring system 101. The monitoring system 101 registers the virtualization unit 102 according to the registration information and monitors the running status of the processes in the virtualization unit 102. If a process runs abnormally, the system can resolve the abnormality by restarting or terminating the process.
[0038] The embodiments described in this specification will now be described in detail.
[0039] like Figure 2 As shown, Figure 2 This is a flowchart illustrating a process management method according to an exemplary embodiment, which can be applied to... Figure 1 The monitoring system 101 includes steps 201-203:
[0040] Step 201: Receive the registration information of the process in the virtualization unit, and register the process to the monitoring system according to the registration information; the registration information includes a global process identifier, which is composed of the identifier of the virtualization unit and the identifier assigned to the process by the virtualization unit.
[0041] Step 202: Determine the location of the process based on the global process identifier, and collect the resource consumption index of the resources currently used by the process.
[0042] Step 203: Manage the running status of the process according to the resource consumption indicators.
[0043] For example, when a virtualization unit starts a process, if it determines that the process needs to be monitored, it can write a global process identifier into the registration information and send the registration information to the monitoring system. After receiving the process registration information from the virtualization unit, the monitoring system can register the process with the monitoring system based on the registration information. For example, the data format of the global process identifier can be virtualization unit identifier-process name-process PID. The process name and process PID can be collectively referred to as the identifier assigned to the process by the virtualization unit.
[0044] The monitoring system can determine which virtualization unit the process to be monitored is on based on the global process identifier, then collect the resource consumption indicators of the resources currently used by the process, and manage the running status of the process based on the resource consumption indicators.
[0045] For example, the resource can be a CPU resource, a memory resource, a network bandwidth resource, a disk I / O resource, etc. The resource consumption index of the resource can correspondingly be a CPU occupancy rate, a memory usage rate, a network bandwidth, a disk I / O usage rate, etc.
[0046] When the monitoring system collects the resource consumption index of the resource currently used by the process, the monitoring system can be preset with the index to be collected, for example, which resource consumption index needs to be collected for different types of processes. Then, according to the type of the current process, the resource consumption index of the resource currently used by the process is collected.
[0047] Of course, the virtualization unit can also write the resource and the corresponding resource consumption index into the registration information and send it to the monitoring system. The monitoring system can collect the registered resource consumption index according to the indication. The virtualization unit actively writes the resource and the resource consumption index into the registration information and sends it to the monitoring system, and the monitoring system collects the index on demand, which can enable each virtualization unit to independently define the resource consumption index of the process monitored by the virtualization unit, without the global coordination of the monitoring system.
[0048] When the monitoring system manages the running state of the process according to the resource consumption index, the process can be restarted or terminated when the resource consumption index indicates that the process is running abnormally. Of course, when the process is found to be abnormal, the registration information of the process can also be updated, and the abnormal log or notification can be sent to the server.
[0049] In this embodiment, after receiving the registration information of the process in each virtualization unit, the registration information is registered in the monitoring system, and the global process identifier is included in the registration information. The global process identifier is composed of the identifier of the virtualization unit and the identifier allocated by the virtualization unit for the process. Since the global process identifier includes the identifier of the virtualization unit, different virtualization units can be distinguished, and the identifier of the process can be used to distinguish the same process in the same virtualization unit. Therefore, by combining the identifier of the virtualization unit and the identifier allocated by the virtualization unit for the process, the processes of different virtualization units can be distinguished, so that the position of the process can be determined, the resource consumption index of the resource currently used by the process can be collected, and the running state of the process can be managed according to the resource consumption index.
[0050] It can be seen that the present scheme can effectively distinguish the processes of different virtualization units, so that the processes in multiple virtualization units can be simultaneously managed in the monitoring system.
[0051] In an embodiment, the registration information can further include resource types of resources used by the process and resource thresholds corresponding to the resource types. When collecting the resource consumption indicators of the resources used by the process, the resource consumption indicators of the resources used by the process corresponding to the resource types can be collected. When managing the running state of the process according to the resource consumption indicators, the process can be restarted when the resource consumption indicators are not less than the resource thresholds.
[0052] For example, the registration information can include registration data virtualization unit identifier-process name-process PID-first resource type-resource threshold-i-th resource type-resource threshold-n-th resource type-resource threshold. Taking the sshd process as an example, it can be specifically represented as OVC1-sshd-21-CPU-80%-Mem-50%. The meaning represented thereby is that the virtualization unit identifier is OVC, the process name is sshd, the process PID is 21, the resource threshold of the resource of the resource type CPU is 80%, and the resource threshold of the resource of the resource type memory is 50%.
[0053] Then, when the control system collects the resource consumption indicators of the resources used by the process, it will only collect the resource consumption indicators of the CPU and the memory indicated in the registration data, and will not collect resource consumption indicators of other types. After collecting the resource consumption indicators, if the resource consumption indicators are not less than the resource thresholds, it indicates that the running of the process may be abnormal, and the process is restarted. Alternatively, if the resource consumption indicators are multiple, if any resource consumption indicator is not less than the resource threshold corresponding thereto, the process is restarted. For example, if the resource consumption indicator of the CPU is not less than 80% or the resource consumption indicator of the memory is not less than 50%, the process is restarted. Of course, in addition to restarting the process, the registration information can be updated or an abnormal log can be sent after restarting the process.
[0054] In the embodiment, the virtualization unit can make the monitoring system collect resource consumption indicators on demand, such as collecting only the resource consumption indicators specified by the virtualization unit, by notifying the monitoring system of the types of the resource consumption indicators and the resource thresholds in the registration information. In addition, the monitoring system can make a targeted threshold judgment, and can quickly respond even if the virtualization unit adjusts the resource thresholds.
[0055] For some key processes, if a fixed resource threshold is used and the process is directly restarted when the threshold is exceeded, it may seem efficient, but it can cause data loss of the key process or cause the service to be unavailable during the process restart. In this regard, dynamic resource adjustment can be performed on these key processes, for example, more resources can be allocated when the resource consumption indicator is greater than the resource threshold.
[0056] However, due to limited system resources, the monitoring requirement cannot be relaxed unlimitedly, and in the case that the resource consumption index of the key process is greater than the resource threshold, it can be further judged whether the overall resource operation of the virtualization unit is abnormal. If there is no abnormality, it indicates that the key process does not seriously affect the operation of the virtualization unit; if there is an abnormality, the key process has seriously affected the operation of the virtualization unit, and the key process still needs to be restarted at this time.
[0057] To this end, in order to distinguish between key processes that require dynamic resource adjustment and non-key processes that do not require dynamic resource adjustment, for a key process, a dynamic resource adjustment identifier can be written in the registration information.
[0058] The control system can judge whether the registration information contains a dynamic resource adjustment identifier. In the case that the registration information contains a dynamic resource adjustment identifier, if the resource consumption index is not less than the resource threshold, the resource allocation of the process is adjusted, and more resources are allocated to the process, such as adjusting the CPU time slice of the process or adjusting the process priority for scheduling. If the overall resource operation of the virtualization unit is abnormal after adjusting the resource allocation of the process, the process is restarted.
[0059] In the embodiment, for a process that requires dynamic resource adjustment, when it is judged that the resource consumption index is not less than the resource threshold, it is not directly judged as abnormal and then abnormal processing is performed, but the resource allocation of the process is dynamically adjusted to ensure that the key process is not affected by short-term resource fluctuations. If the overall resource operation of the virtualization unit is abnormal after adjustment, the process is restarted. Thus, the overall operation stability of the virtualization unit is ensured while the stability of the key process operation is ensured.
[0060] Since the resource check of a specific process can not be universal, the resource threshold check cannot accurately detect the abnormal state of the process. For example, even if the resource consumption index of the resource used by the process is less than the resource threshold, the process can still have an abnormality. For example, a database transaction thread is deadlocked and cannot respond to requests but the resource is normal. Therefore, the process can be checked for abnormality by means of a callback check function.
[0061] In an embodiment, for a process that needs to check the running state of the process by means of a callback check function, a check function can be written in the registration information corresponding to the process, and the check function is used to check whether the running state of the process is abnormal.
[0062] The monitoring system can judge whether the registration information contains a check function. If the registration information contains a check function and the resource consumption index is less than the resource threshold, the process is checked by calling the check function. In the case that the check result indicates that the running state of the process is abnormal, the process is restarted. If the registration information contains a check function and the resource consumption index is greater than the resource threshold, the process is restarted.
[0063] In the embodiment, the running state of the process is checked by the callback checking function, which is a supplement to the traditional resource threshold monitoring, and can check the abnormality that cannot be captured by the resource threshold.
[0064] Each thread constituting each core is equivalent to a virtual CPU, denoted as VCPU. In order to reasonably use the performance of all CPUs, the VCPU where the process is located can be distinguished according to the function of the process, so as to prevent the performance from being affected by the process CPU switching. Therefore, some VCPUs can be pre-set as the binding VCPUs of the high real-time processes, some VCPUs can be pre-set as the binding VCPUs of the high resource consumption processes, and some mutually influencing scheduling processes can be allocated to different VCPUs to prevent mutual influence in scheduling in one VCPU.
[0065] The processes bound in some VCPUs need to respond to services in real time, and such processes need to be probed more frequently. The processes bound in some VCPUs consume more resources, and such processes do not have high real-time requirements, but consume more CPU or memory resources. Such processes do not need to be probed so frequently.
[0066] In an embodiment, the type of the virtual CPU bound with the process can be determined, and the corresponding collection frequency is determined according to the type. When collecting the resource consumption indicators of the resources used by the process and corresponding to the resource type, the resource consumption indicators of the resources used by the process and corresponding to the resource type can be collected according to the collection frequency corresponding to the type of the virtual CPU bound with the process.
[0067] For each collected resource consumption indicator, it is determined whether the running state of the process is abnormal according to the resource consumption indicator, and the number of exceptions is accumulated in the case of abnormality. If the number of exceptions is greater than the number threshold, the running of the process is terminated.
[0068] In the embodiment, the type of the virtual CPU bound with the process is distinguished, and the resource consumption indicators of the process are collected according to the collection frequency corresponding to the different types. For example, low-frequency collection is set for high resource consumption processes, and high-frequency collection is set for high real-time processes. By adjusting the collection frequency on demand, the monitoring accuracy can be ensured while reducing the resource load.
[0069] The process that appears abnormal can be solved by restarting the process, and for the process that is still frequently abnormal after being restarted for multiple times, a safe termination operation is performed to ensure that the entire virtualization unit will not be caused to crash at the system level due to the process abnormality.
[0070] In an embodiment, if the process corresponding to the global process identifier does not exist, it indicates that the process exits abnormally, and the process is restarted.
[0071] In an embodiment, asFigure 3 As shown, Figure 3 This is a flowchart illustrating a registration process according to an exemplary embodiment, comprising the following steps:
[0072] Receive registration information from the virtualization unit's process.
[0073] Parsing the registration information can yield one or more registration data items, such as the global process identifier, dynamic resource adjustment identifier, resource type, resource threshold corresponding to the resource type, and check function.
[0074] If the registration information contains a dynamic resource adjustment identifier, it is determined that the process's resources need dynamic adjustment, and the resources that need dynamic adjustment are recorded according to the parsed resource type. Otherwise, it is determined that the process does not need dynamic resource adjustment.
[0075] If the registration information contains a check function, it is determined that the process has registered a check function, and the function pointer for that check function is recorded for callback in the check process.
[0076] The recorded information is registered to the corresponding check list, with different check lists corresponding to different sampling frequencies. For example, the check list corresponding to the type of VCPU can be determined based on the VCPU to which the process is bound.
[0077] In one embodiment, such as Figure 4 As shown, Figure 4 This is a flowchart illustrating process management according to an exemplary embodiment, including steps 401-413:
[0078] Step 401: Determine the target process to be checked from the check list.
[0079] Step 402: Determine if the target process exists. If not, proceed to step 411; if yes, proceed to step 403.
[0080] Step 403: Obtain the resource type and its corresponding resource threshold for all resources.
[0081] Step 404: Determine whether all resources exceed the resource threshold. If none exceed the threshold, proceed to step 407. If the resource consumption index of any resource exceeds its corresponding resource threshold, proceed to step 405.
[0082] Step 405: Determine whether the resources support dynamic adjustment. If not, proceed to step 409; otherwise, dynamically adjust the resources of the target process, such as adjusting the CPU time slice of the process or adjusting the scheduling priority of the process, and proceed to step 406.
[0083] Step 406: determining whether the overall resource of the virtualization unit where the target process is located is normal, if yes, jumping to step 407; otherwise, jumping to step 409.
[0084] Step 407: determining whether a check function is registered, if yes, jumping to step 408; otherwise, jumping to step 413.
[0085] Step 408: calling the check function, and determining whether the check function checks the abnormality of the target process, if yes, jumping to step 409; otherwise, jumping to step 413.
[0086] Step 409: determining whether the number of times of abnormality is not less than a threshold, if yes, jumping to step 412; otherwise, jumping to step 410.
[0087] Step 410: increasing the number of times of abnormality by 1.
[0088] Step 411: restarting the target process. Optionally, the registration information can be updated and the abnormality log can be sent.
[0089] Step 412: terminating the target process. Optionally, the abnormality log can be sent.
[0090] Step 413: ending the check of the target process.
[0091] Corresponding to the embodiments of the foregoing method, the specification also provides embodiments of an apparatus and a terminal to which the apparatus is applied.
[0092] Figure 5 is a structural schematic diagram of an electronic device according to an exemplary embodiment of the specification. As shown in Figure 5 , at the hardware level, the electronic device 500 includes a processor 502, an internal bus 504, a network interface 506, a memory 508, and a non-volatile memory 510, and of course can also include other hardware required by a business. One or more embodiments of the specification can be implemented in a software manner, such as reading a corresponding computer program from the non-volatile memory 510 into the memory 508 by the processor 502 and then running. Of course, in addition to the software implementation manner, one or more embodiments of the specification do not exclude other implementation manners, such as a logic device or a combination of software and hardware, and so on, that is, the execution subject of the following processing flow is not limited to each logic module, and can also be hardware or a logic device.
[0093] Figure 6 is a block diagram of a process management apparatus according to an exemplary embodiment of the specification. As shown in Figure 6 , the apparatus can be applied to the electronic device 500 as shown in Figure 5 to implement the technical solutions of the specification. The apparatus includes:
[0094] The process registration module 602 is configured to receive registration information of a process in a virtualization unit, and register the process in the monitoring system according to the registration information; the registration information comprises a global process identifier, and the global process identifier is composed of an identifier of the virtualization unit and an identifier allocated by the virtualization unit to the process.
[0095] The index collection module 604 is configured to determine a location of the process according to the global process identifier, and collect a resource consumption index of a resource currently used by the process.
[0096] The running state management module 606 is configured to manage a running state of the process according to the resource consumption index.
[0097] Optionally, the registration information further comprises a resource type of a resource used by the process, and a resource threshold corresponding to the resource type. The index collection module 604 is specifically configured to collect a resource consumption index of the resource corresponding to the resource type used by the process. The running state management module 606 is specifically configured to restart the process if the resource consumption index is not less than the resource threshold.
[0098] Optionally, the process registration module 602 is further configured to determine whether the registration information comprises a dynamic resource adjustment identifier. The running state management module 606 is specifically configured to, in a case where the registration information comprises the dynamic resource adjustment identifier, adjust resource allocation of the process if the resource consumption index is not less than the resource threshold, and restart the process if an overall resource of the virtualization unit is abnormal.
[0099] Optionally, the apparatus further comprises a checking module configured to determine whether the registration information comprises a checking function, the checking function being configured to check whether a running state of the process is abnormal; the checking function is called to check the process if the registration information comprises the checking function and the resource consumption index is less than the resource threshold; and the process is restarted in a case where a checking result indicates that the running state of the process is abnormal.
[0100] Optionally, the index collection module 604 is specifically configured to collect the resource consumption index of the resource corresponding to the resource type used by the process according to a collection frequency corresponding to a type of a virtual CPU bound to the process. The apparatus further comprises a process termination module configured to, for each collected resource consumption index, determine whether a running state of the process is abnormal according to the resource consumption index, and accumulate an abnormal number of times in a case where the running state is abnormal; and terminate running of the process if the abnormal number of times is greater than a number threshold.
[0101] Optionally, the apparatus further comprises a collection frequency determining module configured to determine the type of the virtual CPU bound to the process, and determine the corresponding collection frequency according to the type.
[0102] Optionally, the running state management module 606 is further configured to restart the process if the process corresponding to the global process identifier does not exist.
[0103] The implementation process of the functions and roles of the modules in the apparatus is specifically described in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0104] For the device embodiment, since it basically corresponds to the method embodiment, the related parts can be referred to the part of the method embodiment. The device embodiments described above are only illustrative, and the modules described as separate components can or can not be physically separated, and the components displayed as modules can or can not be physical modules, that is, they can be located in one place or distributed on multiple network modules. According to the actual needs, some or all of the modules can be selected to achieve the purpose of the scheme of the present specification. Those skilled in the art can understand and implement it without creative labor.
[0105] The present specification also provides a computer readable storage medium having a computer program stored thereon, wherein the program is executed by a processor to implement the steps of the process management method provided in the present application.
[0106] Specifically, the computer readable medium suitable for storing computer program instructions and data includes all forms of non-volatile memory, media and memory devices, including semiconductor memory devices (such as EPROM, EEPROM and flash memory devices), magnetic disks (such as internal hard disks or removable disks), magneto-optical disks, and CD ROM and DVD-ROM disks.
[0107] The present specification also provides a computer program product comprising computer program / instructions, wherein the computer program / instructions are executed by a processor to implement the steps of the process management method.
Claims
1. A process management method, characterized in that, The method is applied to a monitoring system that simultaneously manages processes in multiple virtualization units, and the method includes: The system receives registration information of processes in the virtualization unit and registers the processes to the monitoring system based on the registration information. The registration information includes a global process identifier, which is composed of the identifier of the virtualization unit and the identifier assigned to the process by the virtualization unit. The location of the process is determined based on the global process identifier, and the resource consumption index of the resources currently used by the process is collected. The running status of the process is managed based on the resource consumption indicators.
2. The method according to claim 1, characterized in that, The registration information also includes the resource types used by the process, and the resource thresholds corresponding to those resource types. The resource consumption indicators collected for the resources used by the process include: Collect resource consumption metrics for the resources used by the process that correspond to the resource type; Managing the running status of the process based on the resource consumption indicators includes: If the resource consumption index is not less than the resource threshold, then the process is restarted.
3. The method according to claim 2, characterized in that, The method further includes: Determine whether the registration information contains a dynamic resource adjustment identifier; The step of restarting the process if the resource consumption index is not less than the resource threshold includes: If the resource consumption index is not less than the resource threshold when a dynamic resource adjustment flag is included, the resource allocation of the process is adjusted. If the overall resources of the virtualization unit malfunction, the process will be restarted.
4. The method according to claim 2, characterized in that, The method further includes: Determine whether the registration information contains a check function, which is used to check whether the running state of the process is abnormal; If the registration information contains a check function and the resource consumption index is less than the resource threshold, then the check function is invoked to check the process; If the inspection results indicate that the process is running abnormally, the process will be restarted.
5. The method according to claim 2, characterized in that, The collection of resource consumption indicators for the resources used by the process corresponding to the resource type includes: Collect resource consumption indicators of the resources used by the process corresponding to the resource type according to the collection frequency corresponding to the type of virtual CPU bound to the process; The method further includes: For each resource consumption metric collected, determine whether the process's running status is abnormal based on the current resource consumption metric, and accumulate the number of abnormalities if abnormalities are found. If the number of anomalies exceeds a threshold, the process will be terminated.
6. The method according to claim 5, characterized in that, The method further includes: Determine the type of virtual CPU bound to the process, and determine the corresponding sampling frequency based on the type.
7. The method according to claim 1, characterized in that, The method further includes: If the process corresponding to the global process identifier does not exist, then the process is restarted.
8. A process management device, characterized in that, The device is used in a monitoring system for simultaneously managing processes in multiple virtualization units, and the device includes: A process registration module is used to receive registration information of processes in the virtualization unit and register the processes to the monitoring system according to the registration information; the registration information includes a global process identifier, which is composed of the identifier of the virtualization unit and the identifier assigned to the process by the virtualization unit; The indicator acquisition module is used to determine the location of the process based on the global process identifier and to collect the resource consumption indicators of the resources currently used by the process. The running status management module is used to manage the running status of the process based on the resource consumption indicators.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the steps of the method as described in any one of claims 1-7.