CN115454576B - Virtual machine process management method and system and electronic equipment - Google Patents
Virtual machine process management method and system and electronic equipment Download PDFInfo
- Publication number
- CN115454576B CN115454576B CN202211201284.1A CN202211201284A CN115454576B CN 115454576 B CN115454576 B CN 115454576B CN 202211201284 A CN202211201284 A CN 202211201284A CN 115454576 B CN115454576 B CN 115454576B
- Authority
- CN
- China
- Prior art keywords
- target
- virtual machine
- protection command
- level
- score
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 536
- 230000008569 process Effects 0.000 title claims abstract description 495
- 238000007726 management method Methods 0.000 title claims abstract description 47
- 238000012163 sequencing technique Methods 0.000 claims abstract description 23
- 238000004364 calculation method Methods 0.000 claims abstract description 15
- 230000004044 response Effects 0.000 claims description 22
- 238000012795 verification Methods 0.000 claims description 10
- 238000012544 monitoring process Methods 0.000 claims description 5
- 238000004590 computer program Methods 0.000 claims description 3
- 238000004891 communication Methods 0.000 description 13
- 238000010586 diagram Methods 0.000 description 9
- 230000004083 survival effect Effects 0.000 description 8
- 230000009286 beneficial effect Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45554—Instruction set architectures of guest OS and hypervisor or native processor differ, e.g. Bochs or VirtualPC on PowerPC MacOS
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5016—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45583—Memory management, e.g. access or allocation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45591—Monitoring or debugging support
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/54—Indexing scheme relating to G06F9/54
- G06F2209/548—Queue
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Abstract
The embodiment of the specification discloses a virtual machine process management method, a system and electronic equipment, which can conveniently and rapidly perform protection setting on processes in a virtual machine. The method comprises the following steps: the virtualization management platform receives a process protection command and forwards the process protection command to a target virtual machine based on rule information in the process protection command; calculating the process score of a target process corresponding to the process protection command in the target virtual machine based on a preset score calculation rule; and sequencing the processes in the target virtual machine according to the process scores, and when the processes need to be terminated to release memory resources, preferentially terminating the processes with the front sequencing. The system comprises a process protection command receiving module, a target process scoring module and a process protection module. The processor in the electronic device implements the virtual machine process management method when executing a program.
Description
Technical Field
The invention relates to the technical field of virtual machines, in particular to a virtual machine process management method, a system and electronic equipment.
Background
And in the cloud computing scheme, the running process on the physical machine is protected, so that the important service process can still survive under the condition of insufficient resources. When the cloud computing scheme relates to the virtual machine, the cloud computing cannot perform protection setting for the process in the virtual machine due to the permission problem, and when the memory resources of the virtual machine are tense, the important process may be terminated.
Some related technologies require logging into a virtual machine to perform setting, which makes high demands on operators in technical expertise. Moreover, the virtual machine is dynamic relative to the physical machine, and is frequently opened and destroyed, so that the virtual machine needs to be frequently logged in and operated one by one aiming at a plurality of processes in the virtual machine, the operation method is complex and tedious, the workload is large, the execution efficiency is low, and the user experience is greatly influenced.
Disclosure of Invention
In view of this, the embodiments of the present disclosure provide a method, a system, and an electronic device for managing a process of a virtual machine, which can conveniently and quickly perform protection setting on a process in the virtual machine.
In a first aspect, embodiments of the present disclosure provide a virtual machine process management method. The method is applied to a virtualization management platform, and comprises the following steps:
the virtualization management platform receives a process protection command and forwards the process protection command to a target virtual machine based on rule information in the process protection command;
calculating the process score of a target process corresponding to the process protection command in the target virtual machine based on a preset score calculation rule;
and sequencing the processes in the target virtual machine according to the process scores, and when the processes need to be terminated to release memory resources, preferentially terminating the processes with the front sequencing.
Optionally, forwarding the process protection command to the target virtual machine based on rule information in the process protection command includes:
sending the process protection command to a message queue service;
monitoring the message queue service by a target host corresponding to the target virtual machine, and acquiring the process protection command from the message queue service;
and the target host machine performs attribution verification on the process protection command according to the rule information, and sends the process protection command to the target virtual machine after verification is passed.
Optionally, the message queue service maintains a plurality of message queues, where a plurality of message queues correspond to a plurality of hosts in the virtualization management platform;
the method further comprises the steps of, after the function interface sends the process protection command to a message queue service:
the message queue service determines the target host corresponding to the virtual machine information in the rule information by analyzing the rule information;
sending the process protection command to the message queue corresponding to the target host;
the target host corresponding to the target virtual machine monitors the message queue service, including:
and the target host monitors the corresponding message queue.
Optionally, the target host performs home verification on the process protection command according to the rule information, including:
the target host compares the virtual machine information with a local virtual machine list to determine whether the target virtual machine corresponding to the virtual machine information is a local virtual machine or not;
and if the target virtual machine is a local virtual machine, checking is passed.
Optionally, the process protection command includes a process level of the target process;
based on a preset scoring calculation rule, calculating a process score of a target process corresponding to the process protection command in the target virtual machine, including:
determining that the process score of the target process takes a minimum value S in response to the process level being advanced min ;
Determining that the process score of the target process takes a maximum value S in response to the process level being low max ;
And determining the process score according to the running memory of the target process and the total memory of the target virtual machine in response to the process grade being the intermediate grade.
Optionally, determining the process score according to the running memory of the target process and the total memory of the target virtual machine includes:
the process scores are as follows:
Score=S min +min(max(β,S max -(S max *Mem)/Mec),S max -1)
wherein Score represents the progress Score, S mmin ,S max Representing the minimum and maximum values of the progress scores, respectively, beta (S min <β<S max ) For intermediate parameters, mem represents the running memory of the target process, and Mec represents the total memory of the target virtual machine.
Optionally, the method for determining the process level includes: setting the process level according to the dynamic priority of the target process;
the setting the process level according to the dynamic priority of the target process includes:
setting the process level to a high or medium level in response to the dynamic priority being highest;
setting the process level to a medium or low level in response to the dynamic priority being lowest;
and setting a process level according to the importance of the target process in response to the dynamic priority being between the highest and lowest.
Optionally, the sorting the multiple processes in the target virtual machine according to the process score, when the process needs to be terminated to release the memory resource, preferentially terminating the process with the highest sorting, including:
sorting the processes according to the process scores from large to small;
when the process needs to be terminated, starting to execute a termination operation from the first process of the sequencing result until the memory resource of the target virtual machine meets the running requirement.
In a second aspect, embodiments of the present disclosure further provide a virtual machine process management system, where the system is applied to a virtualization management platform, and includes:
the process protection command receiving module is used for receiving a process protection command and forwarding the process protection command to a target virtual machine based on rule information in the process protection command;
the target process scoring module is used for calculating the process score of a target process corresponding to the process protection command in the target virtual machine based on a preset score calculation rule; and
and the process protection module is used for sequencing the processes in the target virtual machine according to the process scores, and when the processes need to be terminated to release memory resources, the processes with the front sequencing are preferentially terminated.
In a third aspect, embodiments of the present disclosure further provide a virtual machine process management electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the virtual machine process relationship method as described in the first aspect when executing the program.
From the above, it can be seen that the virtual machine process management method, system and electronic device provided in the embodiments of the present disclosure have the following beneficial technical effects:
the virtual machine management platform receives the process protection command without logging in the virtual machine to operate, so that the operation difficulty of user process protection setting can be greatly reduced. And forwarding the process protection command to a target virtual machine after receiving the process protection command, calculating and determining a process score of a target process according to the process protection command, further sequencing according to the process score, and stopping the process according to a sequencing result when the process is required to be stopped for releasing the memory resource due to resource shortage, and preferentially stopping the process with the front sequencing. By setting the process protection command, the sequence of the last target process in the process sequence can be influenced, so that the sequence of the target process termination is influenced. In such a way, by setting a process protection command, the termination sequence of the target process with high importance or meeting the specific requirement of a user can be ensured to be later, so that the survival rate of the target process is improved, and the protection setting for the target process is realized.
Drawings
The features and advantages of the present invention will be more clearly understood by reference to the accompanying drawings, which are illustrative and should not be construed as limiting the invention in any way, in which:
FIG. 1 is a schematic diagram of a virtual machine process management method provided in one or more alternative embodiments of the present disclosure;
FIG. 2 is a schematic diagram illustrating a method for forwarding a process protection command to a target virtual machine in a virtual machine process management method according to one or more alternative embodiments of the present disclosure;
FIG. 3 is a schematic diagram illustrating a communication architecture of the virtualization platform in a method for managing virtual machine processes according to one or more alternative embodiments of the present disclosure;
FIG. 4 is a schematic diagram illustrating a process score calculation method in a virtual machine process management method according to one or more embodiments of the present disclosure;
FIG. 5 illustrates a schematic diagram of a virtual machine process management system provided by one or more alternative embodiments of the present disclosure;
FIG. 6 illustrates a schematic diagram of a virtual machine process management electronic device provided in one or more alternative embodiments of the present disclosure.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to fall within the scope of the invention.
And in the cloud computing scheme, the running process on the physical machine is protected, so that the important service process can still survive under the condition of insufficient resources. When the cloud computing scheme relates to the virtual machine, the cloud computing cannot perform protection setting for the process in the virtual machine due to the permission problem, and when the memory resources of the virtual machine are tense, the important process may be terminated.
In order to perform protection setting on a process in a virtual machine, some related technologies need to log into the virtual machine to perform setting, which makes high demands on operators in technical expertise. Moreover, the virtual machine is dynamic relative to the physical machine, and is frequently opened and destroyed, and the virtual machine may need to perform protection setting on the process therein after each opening. The method needs to frequently log in the virtual machine and operate one by one aiming at a plurality of processes in the virtual machine, and the operation method is complex and tedious, large in workload and low in execution efficiency, and greatly influences user experience.
Aiming at the problems, the embodiment of the specification aims to provide a process management method for a virtual machine, provide a special function interface to receive a process protection command, avoid a user to log in the virtual machine to operate, and reduce the operation complexity of the user; and scoring the processes in the virtual machine according to the process protection command, and determining the sequence of process termination when resources are tensed by taking the scoring as a basis so as to protect the important processes.
In view of the above object, in one aspect, an embodiment of the present disclosure provides a virtual machine process management method.
As shown in FIG. 1, one or more alternative embodiments of the present description provide a virtual machine process management method. The method is applied to a virtualization management platform, and comprises the following steps:
s1: and the virtualization management platform receives a process protection command and forwards the process protection command to a target virtual machine based on rule information in the process protection command.
In the virtualization platform, a special function interface API may be provided to receive the program protection command. The process protection command may include rule information and the process level. The virtual machine information in the rule information is used for designating a target virtual machine, and the process information in the rule information is used for designating a target process in the target virtual machine. The process level can be flexibly set according to the importance degree of the target process and the actual demands of users.
The virtual machine information may be identity information of the target virtual machine, and the corresponding process information may be identity information of the target process.
The process protection command can be forwarded to a HOST corresponding to the target virtual machine by analyzing the rule information in the process protection command, and then the HOST forwards the process protection command to the target virtual machine.
S2: and calculating the process score of the target process corresponding to the process protection command in the target virtual machine based on a preset score calculation rule.
And in the target virtual machine, according to a preset scoring calculation rule, determining the corresponding process score of the target process according to the process grade calculation in the process protection command. The process grade is set according to the importance degree of the target process and the actual demands of the users, the importance degrees of different processes and the actual demands of the corresponding users are different, and the corresponding process scores determined according to the score calculation rules are different. Thus, the different process scores may reflect the difference in importance of the different processes and the actual needs of the user.
Corresponding process grades are set for the target process in the process protection command, and for a plurality of virtual machines in the virtualized platform, the plurality of processes in each virtual machine have corresponding process grades, and the corresponding process scores of the processes can be calculated and determined correspondingly. In some alternative embodiments, for processes that do not receive the corresponding process protection command, the process level may be selected as a default value.
S3: and sequencing the processes in the target virtual machine according to the process scores, and when the processes need to be terminated to release memory resources, preferentially terminating the processes with the front sequencing.
After determining the process scores of the plurality of the integrated processes, the processes in the target virtual machine can be ranked according to the process scores to generate a process sequence, so that the sequence of the processes in the process sequence is different.
When the memory resources of the target virtual machine cannot meet the requirement that a plurality of processes run simultaneously, part of the processes need to be terminated to release the memory resources, and the sequence of terminating the processes is determined according to the sequencing results of the processes. The top-ranked process may be preferentially terminated while the bottom-ranked process is kept running, in such a way that the bottom-ranked process may be protected.
In some alternative embodiments, when the plurality of processes in the target virtual machine are ranked according to the process score, the plurality of processes in the target virtual machine may be ranked from large to small by the process score. And when the process needs to be terminated, starting to execute termination operation from the first process of the sequencing result, and stopping the memory resource of the target virtual machine to meet the running requirement.
The process scores serving as sequencing basis are calculated and generated according to the process grades in the process protection command. Therefore, by adjusting the process level of the target process, the sequence of the target process in the process sequence can be changed, so that the sequence of the target process termination is affected. In the process protection command, setting the corresponding process level for the target process can affect the termination sequence of the final target process. By the method, the terminating sequence of the target process with high importance or meeting the specific requirements of the user can be guaranteed to be close to the back, so that the survival rate of the target process is improved, and the protection setting for the target process is realized.
As shown in fig. 2, in a method for managing a process of monitoring a virtual machine according to one or more alternative embodiments of the present application, forwarding the process protection command to a target virtual machine based on rule information in the process protection command includes:
s201: and sending the process protection command to a message queue service.
The process protection command may be sent to the message queue service via a remote invocation protocol.
In some alternative embodiments, the message queue service establishes a plurality of message queues named by host names according to registered hosts, wherein the plurality of message queues respectively correspond to the plurality of hosts.
After receiving the process protection command, the message queue service determines a target host corresponding to the virtual machine message in the process protection command by analyzing the rule information in the process protection command. Further, the message queue service sends the process protection command to the message queue corresponding to the target host for storage.
S202: and monitoring the message queue service by a target host corresponding to the target virtual machine, and acquiring the process protection command from the message queue service.
The target host may obtain the process protection command from the message queue service by listening.
In some alternative embodiments, the process protection command may be obtained by the computer-service in the target host listening for the message queue corresponding to the target host in the message queue service.
S203: and the target host machine performs attribution verification on the process protection command according to the rule information, and sends the process protection command to the target virtual machine after verification is passed.
And the target host machine can carry out attribution verification according to the virtual machine information in the process protection command so as to determine whether the host machine contains the target virtual machine appointed by the virtual machine information. After determining that the target virtual machine belongs to the target host, the target host may further send the process protection command to the target virtual machine.
Referring to fig. 3, a schematic diagram of a communication architecture of the virtualization platform according to an embodiment of the present disclosure is shown. In some alternative embodiments, after the computer-service in the target host monitors the process protection command from the message queue service, a home check may be performed for the process protection command. After determining that the target virtual machine belongs to the target host, the computer-service can further verify whether the operating system of the target virtual machine belongs to a supported operating system type, and after the operating system type is also verified to be in compliance with the condition, the computer-service forwards the process protection command to the target virtual machine.
When forwarding the process protection command, the computer-service may first send the process protection command to the agent-service. And establishing connection with the agent service in the target virtual machine by the agent-service, and then sending the process protection command to the agent service. In the target virtual machine, the agent service may further verify whether the target process corresponding to the process information in the process protection command belongs to the target virtual machine.
As shown in fig. 4, in a virtual machine process management method provided in one or more alternative embodiments of the present specification, the process protection command includes a process level of the target process,
based on a preset scoring calculation rule, calculating a process score of a target process corresponding to the process protection command in the target virtual machine, including:
s401: determining that the process score of the target process takes a minimum value S in response to the process level being advanced min 。
S402: determining that the process score of the target process takes a maximum value S in response to the process level being low max 。
S403: and determining the process score according to the running memory of the target process and the total memory of the target virtual machine in response to the process grade being the intermediate grade.
The target process may be scored according to its running memory duty cycle in the target virtual machine. The running memory duty ratio may be determined by calculating a running memory of the target process and a total memory of the target virtual machine.
In some optional embodiments, when determining the process score according to the running memory of the target process and the total memory of the target virtual machine, the process score is:
Score=S min +min(max(β,S max -(S max *Mem)/Mec),S max -1)
wherein Score represents the progress Score, S min ,S max Representing the minimum and maximum values of the progress scores, respectively, beta (S min <β<S max ) For intermediate parameters, mem represents the running memory of the target process, and Mec represents the total memory of the target virtual machine.
Minimum value S of the process score min And maximum S max Can be set to-1000/1000, respectively, and the intermediate parameter beta can be set to 2. The process scores are as follows:
Score=-1000+min(max(2,1000-(1000*Mem)/Mec),999)
taking the process grade of the process A as a middle grade, and taking the total memory 8G of the target virtual machine and the running memory 3G of the process A as examples, calculating the process score of the target process as-375; the process level of the process B is a middle level, and the total memory 8G of the target virtual machine and the running memory 5G of the process B are exemplified, and the corresponding process score is-625. When the process A with the process score of-375 is ranked forward according to the process score from large to small, when the target virtual machine resources are tense, part of the processes in the virtual machine need to be terminated to relieve the resource pressure, the process A ranked forward is easier to be terminated, and compared with the process B with the process score of-625, the process B has higher survival rate compared with the process A. Such a way achieves process protection for process B.
In the virtual machine process management method, the process score corresponding to a target process with a high process grade is set to be the minimum value, and when the target virtual machine resources are tense, the target process is positioned at the last of a process sequence, and the process survival rate is highest; and setting the process score corresponding to the target process with the low process level as the maximum value, and when the resources of the target virtual machine are tense, the target process is positioned at the forefront of the process sequence and is terminated first. For the target process with the intermediate process grade, the process score is determined according to the operating memory ratio, the higher the operating memory ratio is, the higher the protection degree is when resources are tensed, and the higher the corresponding process survival rate is after the positions in the process sequence are located. The method is equivalent to giving different process survival rates to a plurality of processes in the target virtual machine according to the process level and the running memory ratio, so that process protection setting can be realized for the plurality of processes in the target virtual machine.
The process level in the process protection command may be set directly by a user, and may also be determined according to the dynamic priority of the corresponding target process.
In one or more embodiments of the present disclosure, a method for determining a process level of a virtual machine includes: setting the process level according to the dynamic priority of the target process;
the setting the process level according to the dynamic priority of the target process includes:
setting the process level to a high or medium level in response to the dynamic priority being highest;
setting the process level to a medium or low level in response to the dynamic priority being lowest;
and setting a process level according to the importance of the target process in response to the dynamic priority being between the highest and lowest.
In determining the process level of the target process, reference is made to the dynamic priority of the target process. The dynamic priority may be represented by a priority value: and when the dynamic priority is highest, the priority value takes the maximum value, and when the dynamic priority is lowest, the priority value takes the minimum value.
For the case where the dynamic priority is highest, the process level corresponding to the target process may be set to high or medium level, but not to low level. The purpose of this arrangement is to avoid that the target process with the highest dynamic priority is terminated preferentially when the memory resources are strained due to the process level being set to a low level. Accordingly, for the case where the dynamic priority is lowest, the process level corresponding to the target process may be set to a medium level or a low level, but not to a high level. The purpose of this arrangement is to avoid that the target process with the lowest dynamic priority has a high survival rate due to the process level being set to be high, which has an influence on the survival rate of other processes with high priorities.
For the target process with the highest and lowest dynamic priority, the target process is set according to the importance of the target process, and the corresponding process level can be set to be high-level, medium-level or low-level. Typically, the process level of the target process having a dynamic priority between the highest and lowest is set to a medium level.
It should be noted that the method of the embodiments of the present disclosure may be performed by a single device, such as a computer or a server. The method of the embodiment can also be applied to a distributed scene, and is completed by mutually matching a plurality of devices. In the case of such a distributed scenario, one of the devices may perform only one or more steps of the methods of embodiments of the present disclosure, the devices interacting with each other to accomplish the methods.
It should be noted that the foregoing describes some embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments described above and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Based on the same inventive concept, the present disclosure also provides a virtual machine process management system corresponding to the method of any embodiment.
Referring to fig. 5, the virtual machine process management system is applied to a virtualization management platform, and the system includes:
the process protection command receiving module is used for receiving a process protection command and forwarding the process protection command to a target virtual machine based on rule information in the process protection command;
the target process scoring module is used for calculating the process score of a target process corresponding to the process protection command in the target virtual machine based on a preset score calculation rule; and
and the process protection module is used for sequencing the processes in the target virtual machine according to the process scores, and when the processes need to be terminated to release memory resources, the processes with the front sequencing are preferentially terminated.
In one or more embodiments of the present disclosure, in a virtual machine process management system, the process protection command receiving module is further configured to send the process protection command to a message queue service; monitoring the message queue service by a target host corresponding to the target virtual machine, and acquiring the process protection command from the message queue service; and the target host machine performs attribution verification on the process protection command according to the rule information, and sends the process protection command to the target virtual machine after verification is passed.
In a virtual machine process management system provided in one or more alternative embodiments of the present disclosure, the message queue service maintains a plurality of message queues, where a plurality of message queues correspond to a plurality of hosts in the virtualization management platform; the message queue service is further configured to determine the target host corresponding to the virtual machine information in the rule information by parsing the rule information; sending the process protection command to the message queue corresponding to the target host; the target host is further configured to monitor the corresponding message queue.
In the virtual machine process management system provided in one or more optional embodiments of the present disclosure, the target host is further configured to compare the virtual machine information with a local virtual machine list, so as to determine whether the target virtual machine corresponding to the virtual machine information is a local virtual machine; and if the target virtual machine is a local virtual machine, checking is passed.
In one or more embodiments of the present disclosure, a virtual machine process management system is provided, where the process protection command includes a process level of the target process; the target process scoring module is further configured to determine that the process score of the target process takes a minimum value S when the process level is high min The method comprises the steps of carrying out a first treatment on the surface of the When the process level is low, determining that the process score of the target process takes a maximum value S max The method comprises the steps of carrying out a first treatment on the surface of the And when the process grade is a middle grade, determining the process grade according to the running memory of the target process and the total memory of the target virtual machine.
In one or more optional embodiments of the present disclosure, in a virtual machine process management system, the method for calculating a process score includes:
Score=S min +min(max(β,S max -(S max *Mem)/Mec),S max -1)
wherein Score represents the progress Score, S min ,S max Representing the minimum and maximum values of the progress scores, respectively, beta (S min <β<S max ) For intermediate parameters, mem represents the running memory of the target process, and Mec represents the total memory of the target virtual machine.
In one or more embodiments of the present disclosure, a method for determining a process level of a virtual machine includes: setting the process level according to the dynamic priority of the target process; setting the process level to be high or medium when the dynamic priority is highest; setting the process level to be a middle level or a low level when the dynamic priority is the lowest; and setting a process level according to the importance of the target process when the dynamic priority is between the highest and the lowest.
In one or more embodiments of the present disclosure, a virtual machine process management system is provided, where the process protection module is further configured to sort a plurality of the processes from large to small according to the process scores; when the process needs to be terminated, starting to execute a termination operation from the first process of the sequencing result until the memory resource of the target virtual machine meets the running requirement.
For convenience of description, the above devices are described as being functionally divided into various modules, respectively. Of course, the functions of the various modules may be implemented in the same one or more pieces of software and/or hardware when implementing the present disclosure.
The device of the foregoing embodiment is configured to implement the corresponding virtual machine process management method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiment, which is not described herein.
Based on the same inventive concept, the present disclosure also provides an electronic device corresponding to the method of any embodiment, including a memory, a processor, and a computer program stored on the memory and capable of running on the processor, where the processor implements the XX method of any embodiment when executing the program.
Fig. 6 shows a more specific hardware architecture of an electronic device according to this embodiment, where the device may include: a processor 1010, a memory 1020, an input/output interface 1030, a communication interface 1040, and a bus 1050. Wherein processor 1010, memory 1020, input/output interface 1030, and communication interface 1040 implement communication connections therebetween within the device via a bus 1050.
The processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit ), microprocessor, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc. for executing relevant programs to implement the technical solutions provided in the embodiments of the present disclosure.
The Memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory ), static storage device, dynamic storage device, or the like. Memory 1020 may store an operating system and other application programs, and when the embodiments of the present specification are implemented in software or firmware, the associated program code is stored in memory 1020 and executed by processor 1010.
The input/output interface 1030 is used to connect with an input/output module for inputting and outputting information. The input/output module may be configured as a component in a device (not shown) or may be external to the device to provide corresponding functionality. Wherein the input devices may include a keyboard, mouse, touch screen, microphone, various types of sensors, etc., and the output devices may include a display, speaker, vibrator, indicator lights, etc.
Communication interface 1040 is used to connect communication modules (not shown) to enable communication interactions of the present device with other devices. The communication module may implement communication through a wired manner (such as USB, network cable, etc.), or may implement communication through a wireless manner (such as mobile network, WIFI, bluetooth, etc.).
Bus 1050 includes a path for transferring information between components of the device (e.g., processor 1010, memory 1020, input/output interface 1030, and communication interface 1040).
It should be noted that although the above-described device only shows processor 1010, memory 1020, input/output interface 1030, communication interface 1040, and bus 1050, in an implementation, the device may include other components necessary to achieve proper operation. Furthermore, it will be understood by those skilled in the art that the above-described apparatus may include only the components necessary to implement the embodiments of the present description, and not all the components shown in the drawings.
The electronic device of the foregoing embodiment is configured to implement the corresponding virtual machine process management method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiment, which is not described herein.
Based on the same inventive concept, corresponding to any of the above embodiments of the method, the present disclosure further provides a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the virtual machine process management method according to any of the above embodiments.
The computer readable media of the present embodiments, including both permanent and non-permanent, removable and non-removable media, may be used to implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device.
The storage medium of the foregoing embodiments stores computer instructions for causing the computer to execute the virtual machine process management method according to any one of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described herein.
Those of ordinary skill in the art will appreciate that: the discussion of any of the embodiments above is merely exemplary and is not intended to suggest that the scope of the disclosure, including the claims, is limited to these examples; the technical features of the above embodiments or in the different embodiments may also be combined under the idea of the present disclosure, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present disclosure as described above, which are not provided in details for the sake of brevity.
Additionally, well-known power/ground connections to Integrated Circuit (IC) chips and other components may or may not be shown within the provided figures, in order to simplify the illustration and discussion, and so as not to obscure the embodiments of the present disclosure. Furthermore, the devices may be shown in block diagram form in order to avoid obscuring the embodiments of the present disclosure, and this also accounts for the fact that specifics with respect to implementation of such block diagram devices are highly dependent upon the platform on which the embodiments of the present disclosure are to be implemented (i.e., such specifics should be well within purview of one skilled in the art). Where specific details (e.g., circuits) are set forth in order to describe example embodiments of the disclosure, it should be apparent to one skilled in the art that embodiments of the disclosure can be practiced without, or with variation of, these specific details. Accordingly, the description is to be regarded as illustrative in nature and not as restrictive.
While the present disclosure has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of those embodiments will be apparent to those skilled in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
The disclosed embodiments are intended to embrace all such alternatives, modifications and variances which fall within the broad scope of the appended claims. Accordingly, any omissions, modifications, equivalents, improvements, and the like, which are within the spirit and principles of the embodiments of the disclosure, are intended to be included within the scope of the disclosure.
Claims (7)
1. The virtual machine process management method is characterized by being applied to a virtualization management platform; the method comprises the following steps:
the virtualization management platform receives a process protection command and forwards the process protection command to a target virtual machine based on rule information in the process protection command;
calculating the process score of a target process corresponding to the process protection command in the target virtual machine based on a preset score calculation rule;
sequencing a plurality of processes in the target virtual machine according to the process scores, and when the processes need to be terminated to release memory resources, preferentially terminating the processes with the front sequencing;
wherein the process protection command includes a process level of the target process;
the method for determining the process level comprises the following steps: setting the process level according to the dynamic priority of the target process;
the setting the process level according to the dynamic priority of the target process includes:
setting the process level to a high or medium level in response to the dynamic priority being highest;
setting the process level to a medium or low level in response to the dynamic priority being lowest;
setting a process level according to the importance of the target process in response to the dynamic priority being between the highest and lowest;
based on a preset scoring calculation rule, calculating a process score of a target process corresponding to the process protection command in the target virtual machine, including:
determining that the process score of the target process takes a minimum value in response to the process level being high;
Determining that the process score of the target process is at a maximum value in response to the process level being low;
Responding to the process grade as a middle grade, and determining the process grade according to the running memory of the target process and the total memory of the target virtual machine;
the process score determining according to the running memory of the target process and the total memory of the target virtual machine comprises the following steps:
the process scores are as follows:
wherein,representing the processScore, ->Representing the minimum and maximum value of the progress score, respectively,/->Is an intermediate parameter->,/>Running memory representing the target process, +.>And representing the total memory of the target virtual machine.
2. The method of claim 1, wherein forwarding the process protection command to a target virtual machine based on rule information in the process protection command comprises:
sending the process protection command to a message queue service;
monitoring the message queue service by a target host corresponding to the target virtual machine, and acquiring the process protection command from the message queue service;
and the target host machine performs attribution verification on the process protection command according to the rule information, and sends the process protection command to the target virtual machine after verification is passed.
3. The method of claim 2, wherein the message queue service maintains a plurality of message queues, a plurality of the message queues corresponding to a plurality of the hosts in the virtualization management platform;
the method further comprises the following steps after the process protection command is sent to a message queue service:
the message queue service determines the target host corresponding to the virtual machine information in the rule information by analyzing the rule information;
sending the process protection command to the message queue corresponding to the target host;
the target host corresponding to the target virtual machine monitors the message queue service, including:
and the target host monitors the corresponding message queue.
4. The method of claim 3, wherein the target host performs a home check for the process protection command based on the rule information, comprising:
the target host compares the virtual machine information with a local virtual machine list to determine whether the target virtual machine corresponding to the virtual machine information is a local virtual machine or not;
and if the target virtual machine is a local virtual machine, checking is passed.
5. The method of claim 1, wherein the ordering of the plurality of processes in the target virtual machine according to the process score, when a process needs to be terminated to free memory resources, preferentially terminating the process that is ranked first, comprises:
sorting the processes according to the process scores from large to small;
when the process needs to be terminated, starting to execute a termination operation from the first process of the sequencing result until the memory resource of the target virtual machine meets the running requirement.
6. A virtual machine process management system, the system being applied to a virtualization management platform, comprising:
the process protection command receiving module is used for receiving a process protection command and forwarding the process protection command to a target virtual machine based on rule information in the process protection command;
the target process scoring module is used for calculating the process score of a target process corresponding to the process protection command in the target virtual machine based on a preset score calculation rule; and
the process protection module is used for sequencing a plurality of processes in the target virtual machine according to the process scores, and when the processes need to be terminated to release memory resources, the processes with the front sequencing are preferentially terminated;
wherein the process protection command includes a process level of the target process;
the method for determining the process level comprises the following steps: setting the process level according to the dynamic priority of the target process;
the setting the process level according to the dynamic priority of the target process includes:
setting the process level to a high or medium level in response to the dynamic priority being highest;
setting the process level to a medium or low level in response to the dynamic priority being lowest;
setting a process level according to the importance of the target process in response to the dynamic priority being between the highest and lowest;
based on a preset scoring calculation rule, calculating a process score of a target process corresponding to the process protection command in the target virtual machine, including:
determining that the process score of the target process takes a minimum value in response to the process level being high;
Determining that the process score of the target process is at a maximum value in response to the process level being low;
Responding to the process grade as a middle grade, and determining the process grade according to the running memory of the target process and the total memory of the target virtual machine;
the process score determining according to the running memory of the target process and the total memory of the target virtual machine comprises the following steps:
the process scores are as follows:
wherein,representing the progress score->Representing the minimum and maximum value of the progress score, respectively,/->Is an intermediate parameter->,/>Running memory representing the target process, +.>And representing the total memory of the target virtual machine.
7. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 5 when the program is executed by the processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211201284.1A CN115454576B (en) | 2022-09-29 | 2022-09-29 | Virtual machine process management method and system and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211201284.1A CN115454576B (en) | 2022-09-29 | 2022-09-29 | Virtual machine process management method and system and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115454576A CN115454576A (en) | 2022-12-09 |
CN115454576B true CN115454576B (en) | 2024-02-02 |
Family
ID=84308051
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211201284.1A Active CN115454576B (en) | 2022-09-29 | 2022-09-29 | Virtual machine process management method and system and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115454576B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115617533B (en) * | 2022-12-14 | 2023-03-10 | 上海登临科技有限公司 | Process switching management method in heterogeneous computing and computing device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105550040A (en) * | 2015-12-29 | 2016-05-04 | 四川中电启明星信息技术有限公司 | KVM platform based virtual machine CPU resource reservation algorithm |
CN106020937A (en) * | 2016-07-07 | 2016-10-12 | 腾讯科技(深圳)有限公司 | Method, device and system for creating virtual machine |
CN113791867A (en) * | 2021-09-16 | 2021-12-14 | 江苏安超云软件有限公司 | Method and application for adjusting KVM virtual machine service process priority |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9600331B1 (en) * | 2015-08-24 | 2017-03-21 | International Business Machines Corporation | Virtual machine placement in a cloud computing environment based on factors including optimized processor-memory affinity |
-
2022
- 2022-09-29 CN CN202211201284.1A patent/CN115454576B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105550040A (en) * | 2015-12-29 | 2016-05-04 | 四川中电启明星信息技术有限公司 | KVM platform based virtual machine CPU resource reservation algorithm |
CN106020937A (en) * | 2016-07-07 | 2016-10-12 | 腾讯科技(深圳)有限公司 | Method, device and system for creating virtual machine |
WO2018006864A1 (en) * | 2016-07-07 | 2018-01-11 | 腾讯科技(深圳)有限公司 | Method, apparatus and system for creating virtual machine, control device and storage medium |
CN113791867A (en) * | 2021-09-16 | 2021-12-14 | 江苏安超云软件有限公司 | Method and application for adjusting KVM virtual machine service process priority |
Non-Patent Citations (2)
Title |
---|
Virtual Memory Management using Memory Ballooning in OpenStack Cloud Platform;Pranjali P. Deshmukh等;《 IEEE Xplore》;全文 * |
私有云平台上的虚拟机进程安全检测;曹立铭;赵逢禹;;计算机应用研究(05);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN115454576A (en) | 2022-12-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI743458B (en) | Method, device and system for parallel execution of blockchain transactions | |
CN108776934B (en) | Distributed data calculation method and device, computer equipment and readable storage medium | |
US10324754B2 (en) | Managing virtual machine patterns | |
US20130227232A1 (en) | Partition aware quality of service feature | |
US10996997B2 (en) | API-based service command invocation | |
US20180198777A1 (en) | Implementing single sign-on in a transaction processing system | |
US11503109B2 (en) | Processing an operation with a plurality of processing steps | |
US20170185454A1 (en) | Method and Electronic Device for Determining Resource Consumption of Task | |
US11704680B2 (en) | Detecting fraudulent user accounts using graphs | |
CN110244963B (en) | Data updating method and device and terminal equipment | |
CN116848528A (en) | Techniques for automatically configuring minimum cloud service access rights for container applications | |
US10630399B2 (en) | Testing distributed applications that have an established exchange in an advanced message queuing protocol (AMQP) message broker | |
WO2019047708A1 (en) | Resource configuration method and related product | |
TW202027003A (en) | Method and system for accepting blockchain evidence storage transaction | |
CN115454576B (en) | Virtual machine process management method and system and electronic equipment | |
CN108234551B (en) | Data processing method and device | |
US10520929B2 (en) | Techniques for implementing universal commands in a welding or cutting system | |
CN112100613A (en) | Application login control method and device, electronic equipment and storage medium | |
US9628401B2 (en) | Software product instance placement | |
CN110120963B (en) | Data processing method, device, equipment and machine readable medium | |
US20180267914A1 (en) | Device interfacing | |
CN113872951B (en) | Hybrid cloud security policy issuing method and device, electronic equipment and storage medium | |
CN107239272B (en) | Video capture equipment redirection method and device | |
US10523591B2 (en) | Discovering resource availability across regions | |
US11340952B2 (en) | Function performance trigger |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |