Cloud host cleaning method and device, computer equipment and storage medium

By obtaining data snapshots and monitoring data of cloud hosts, combining historical pre-cleaning signs, determining and confirming the collection of cloud hosts to be cleaned, and choosing the cleaning method according to the creation method, the problem of inaccurate cloud host cleaning in the existing technology is solved, efficient and accurate cloud host cleaning is achieved, and resource utilization is improved.

CN119806718APending Publication Date: 2025-04-11CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The prior art cannot accurately and efficiently clean up cloud hosts, resulting in low resource utilization and possible data residues.

Method used

By obtaining data snapshots and monitoring data of the cloud host, combining historical pre-cleaning signs, the pre-cleaning signs for the day are determined, and the user confirms the collection of cloud hosts to be cleaned, and finally, different cleaning methods are used to clean it according to the creation method of the cloud host.

Benefits of technology

Improve the accuracy and reliability of cloud host cleaning, reduce miscleaning, ensure the effectiveness and security of cleaning operations, and improve resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806718A_ABST
    Figure CN119806718A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of cloud computing, and discloses a cloud host cleaning method and device, computer equipment and a storage medium, and the method comprises the steps: obtaining a data snapshot of each cloud host, monitoring data of the day and a historical pre-cleaning mark; based on the data snapshot and the monitoring data of the day, determining a pre-cleaning mark of the day; determining a to-be-cleaned cloud host set based on the historical pre-cleaning mark and the current-day pre-cleaning mark; in response to a confirmation operation of the user on the to-be-cleaned cloud host set, obtaining a target cleaned cloud host set; and based on the creation mode of the cloud host, adopting a corresponding cleaning mode to clean the cloud host. According to the method, the accurate target cleaning cloud host set is obtained by obtaining the data snapshot and the monitoring data, determining the cleaning mark of the day, combining with the historical pre-cleaning mark and enabling the user to participate in determination, and then different cleaning methods are adopted according to different creation modes, so that the cloud hosts are cleaned accurately, efficiently and reliably, and the resource utilization rate is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud computing technology, and in particular to a cloud host cleaning method, device, computer equipment and storage medium. Background Art

[0002] With the development of cloud computing, more and more applications are integrated into cloud hosts, and the management requirements for cloud hosts are getting higher and higher, especially in the test environment. Under the condition of limited computing node resources, how to improve resource utilization and meet the resource requirements of the test environment as much as possible. It is easy to consider cleaning up unused cloud hosts.

[0003] At present, cloud hosts that need to be cleaned are usually determined by manually checking the status of cloud hosts one by one, or based on simple cleaning rules, such as no traffic or no activity for a long time. After the cloud host is determined, the cloud host is directly deleted using the underlying command to achieve cloud host cleaning. However, the problem with the above solution is that the cloud host to be cleaned cannot be accurately determined by manual or existing rules, and the related records in the cloud management platform may not be cleaned synchronously when cleaning through the underlying command, resulting in data residue. Summary of the invention

[0004] In view of this, the present invention provides a cloud host cleaning method, apparatus, computer equipment and storage medium to solve the problem of accurately and efficiently cleaning the cloud host.

[0005] In a first aspect, the present invention provides a cloud host cleaning method, the method comprising:

[0006] Get data snapshots, monitoring data for the day, and historical pre-cleaning flags for each cloud host;

[0007] Based on the data snapshot of each cloud host and the monitoring data of the day, determine the pre-cleaning flag of each cloud host on the day;

[0008] Based on the historical pre-cleaning flag of each cloud host and the pre-cleaning flag of the current day, determine the set of cloud hosts to be cleaned;

[0009] In response to a user's confirmation operation on the set of cloud hosts to be cleaned up, a target set of cloud hosts to be cleaned up is obtained, wherein the confirmation operation is used to confirm the cloud hosts that need to be retained;

[0010] For any cloud host in the target cleanup cloud host set, the cloud host is cleaned up using a corresponding cleanup method based on the creation method of the cloud host.

[0011] The cloud host cleaning method provided by the embodiment of the present invention obtains data snapshots and monitoring data of the cloud host, determines the cleaning mark of the day, and combines the historical pre-cleaning mark to better evaluate the long-term performance of the cloud host, avoid misjudgment due to short-term fluctuations, and improve the scientificity and reliability of cleaning decisions. By allowing users to participate in the process of determining the cloud host that needs to be cleaned, the accuracy of cloud host cleaning is further improved, and the erroneous cleaning caused by system misjudgment is reduced. Finally, an accurate target cleaning cloud host set is obtained, and then different cleaning methods are adopted based on the different creation methods of the cloud hosts in the target cleaning cloud host set, so as to ensure the effectiveness and safety of the cleaning operation, realize accurate, efficient and reliable cleaning of cloud hosts, and improve resource utilization.

[0012] In an optional implementation, based on the data snapshot of each cloud host and the monitoring data of the day, determining the pre-cleaning flag of each cloud host on the day includes:

[0013] For any cloud host, determine the growth rate of each data in the monitoring data of the cloud host on the day relative to the data snapshot corresponding to the data;

[0014] If the growth rates of all data in the monitoring data of the day are less than the preset growth rate, the pre-cleaning flag of the day is set to the cleaning state, and the cleaning state indicates that the cloud host needs to be cleaned;

[0015] Alternatively, if the growth rate corresponding to any data in the monitoring data of the day is not less than the preset growth rate, the pre-cleaning flag of the day is set to the non-cleaning state.

[0016] The cloud host cleaning method provided in the embodiment of the present invention calculates the growth rate of monitoring data relative to the data snapshot. The growth rate can reflect the trend of cloud host performance changes, thereby more accurately evaluating the changes between the current state and the initial state of the cloud host and avoiding misjudgments caused by static data. When the growth rates of all monitoring data are lower than the preset growth rate, it indicates that the cloud host is currently in a low load state, which may be a manifestation of resource waste or failure, and needs to be cleaned up, which can avoid resource waste and improve the overall performance of the system. When the growth rate of any monitoring data is not less than the preset growth rate, it indicates that the cloud host may be in a high load state, which may be a normal business peak or a temporary increase in demand. At this time, cleaning should not be performed to avoid affecting business operations. By preliminarily determining the cloud hosts that need to be cleaned up based on the growth rate, the accuracy of cleaning up the cloud hosts is improved.

[0017] In an optional implementation, determining a set of cloud hosts to be cleaned up based on a historical pre-cleaning flag of each cloud host and a pre-cleaning flag of the current day includes:

[0018] For any cloud host, based on the historical pre-cleaning flag of the cloud host and the pre-cleaning flag of the current day, determine the number of times the pre-cleaning flag is in the cleaning state within a preset time;

[0019] When the number of times is equal to the preset number threshold, the cloud host is added to the set of cloud hosts to be cleaned up;

[0020] Alternatively, when the number is less than a preset number threshold, the number of times the pre-cleaning flag of the next cloud host is in the cleaning state within a preset time is continuously determined until all cloud hosts are traversed.

[0021] The cloud host cleaning method provided in the embodiment of the present invention determines the number of times the cloud host is in a cleaning state by considering a historical pre-cleaning flag. When the number is equal to a preset number threshold, it indicates that the cloud host has persistent problems or resource waste and needs to be cleaned up, thereby reducing erroneous cleaning caused by accidental factors and improving the accuracy and reliability of cloud host cleaning.

[0022] In an optional implementation, in response to a user's confirmation operation on a set of cloud hosts to be cleaned up, obtaining a target set of cloud hosts to be cleaned up includes:

[0023] All cloud hosts in the set of cloud hosts to be cleaned up that have not been confirmed by the user are determined as the set of target cloud hosts to be cleaned up.

[0024] The cloud host cleaning method provided in the embodiment of the present invention allows users to participate in the process of cleaning cloud hosts, and the users further screen the cloud host set to be cleaned. If the user does not confirm the cloud host, it indicates that the user believes that the cloud host does not need to be retained and can be cleaned, thereby obtaining the final target cleanup cloud host set, which further improves the accuracy of cleaning cloud hosts.

[0025] In an optional implementation, for any cloud host in the target cleanup cloud host set, before cleaning the cloud host using a corresponding cleaning method based on the creation method of the cloud host, the method further includes:

[0026] For any cloud host in the target cleanup cloud host set, query the cloud host from the cloud management platform database;

[0027] If the cloud host can be found in the cloud management platform database, determine that the cloud host is created through the cloud management platform;

[0028] Alternatively, when the cloud host cannot be found in the cloud management platform database, it is determined that the cloud host is created through an underlying command.

[0029] The cloud host cleaning method provided in the embodiment of the present invention can verify whether the cloud host is created by the cloud management platform by querying the cloud management platform database, so that the corresponding cleaning method can be selected when cleaning the cloud host, thereby improving the efficiency and security of the cleaning operation.

[0030] In an optional implementation, for any cloud host in the target cleanup cloud host set, the cloud host is cleaned up using a corresponding cleanup method based on the creation method of the cloud host, including:

[0031] If the cloud host is created by using the underlying command, use the underlying command to delete the cloud host;

[0032] If the cloud host is created through the cloud management platform, use the underlying command to delete the cloud host and call the cloud management platform cleanup interface to clean up residual data.

[0033] The cloud host cleaning method provided in the embodiment of the present invention selects a corresponding cleaning method according to the creation method of the cloud host. When the cloud host is created by the underlying command, the underlying command is used for cleaning. When the cloud host is created by the cloud management platform, the underlying command is used for cleaning and then the interface is called for cleaning, thereby improving the reliability of the cleaning decision and realizing the thorough cleaning of the cloud host.

[0034] In a second aspect, the present invention provides a cloud host cleaning device, the device comprising:

[0035] The acquisition module is used to obtain data snapshots of each cloud host, monitoring data for the day, and historical pre-cleaning flags;

[0036] A first determination module is used to determine a pre-cleaning flag for each cloud host on the day based on a data snapshot of each cloud host and monitoring data of the day;

[0037] A second determination module is used to determine a set of cloud hosts to be cleaned up based on a historical pre-cleaning flag of each cloud host and a pre-cleaning flag of the current day;

[0038] A third determination module is used to obtain a target cleanup cloud host set in response to a user's confirmation operation on the set of cloud hosts to be cleaned up, wherein the confirmation operation is used to confirm the cloud hosts that need to be retained;

[0039] The cleaning module is used to clean up any cloud host in the target cleanup cloud host set by using a corresponding cleaning method based on the creation method of the cloud host.

[0040] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the cloud host cleanup method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0041] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the cloud host cleanup method of the first aspect or any corresponding embodiment thereof.

[0042] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the cloud host cleanup method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0044] Figure 1 is a flow chart of a cloud host cleaning method according to an embodiment of the present invention;

[0045] Figure 2 is a flow chart of another cloud host cleaning method according to an embodiment of the present invention;

[0046] Figure 3 is a flow chart of determining a target cleanup cloud host set according to an embodiment of the present invention;

[0047] Figure 4 is a flowchart of another cloud host cleanup according to an embodiment of the present invention;

[0048] Figure 5 is a structural block diagram of a cloud host cleaning device according to an embodiment of the present invention;

[0049] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0051] Under the condition of limited computing node resources, how to improve resource utilization by cleaning up cloud hosts to meet the resource requirements of the test environment is a problem that needs to be solved. At present, it is usually necessary to manually check the status of cloud hosts one by one, or to determine the cloud hosts that need to be cleaned based on simple cleaning rules. Then, the cloud host is deleted directly using the underlying command. However, the problem with the above scheme is that the cloud host to be cleaned cannot be accurately determined by manual or existing rules, and the relevant records in the cloud management platform may not be cleaned synchronously when cleaning through the underlying command, resulting in data residue. The cloud host cleaning method provided in an embodiment of the present invention can accurately determine the cloud host that needs to be cleaned, and adopt different cleaning methods according to the different creation methods of the cloud host, so as to ensure the effectiveness and security of the cleaning operation, realize accurate, efficient and reliable cleaning of the cloud host, and improve resource utilization.

[0052] According to an embodiment of the present invention, a cloud host cleanup method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0053] In this embodiment, a cloud host cleaning method is provided. Figure 1 is a flow chart of a cloud host cleaning method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0054] Step S101, obtain the data snapshot of each cloud host, the monitoring data of the day and the historical pre-cleaning mark. Specifically, since the node resource conditions are limited and some cloud hosts are in a low-load state, these cloud hosts can be cleaned up in order to improve resource utilization. Therefore, it is first necessary to determine the cloud host to be cleaned up. A monitoring program is pre-installed in each cloud host, and the monitoring program records data snapshots when the cloud host is initially created, including CPU (Central Processing Unit) usage, memory usage, disk capacity, program processes, number of network connections, and SSH (Secure Shell, Secure Shell Protocol) / MSTSC (Microsoft Terminal Services Client, Microsoft Terminal Services Client) session data. At the same time, the monitoring program obtains the monitoring data of the day at the end of each day, and the monitoring data is consistent with the data type in the data snapshot. Assuming that today is November 20, the pre-cleaning marks of November 18 and November 19 can be obtained as historical pre-cleaning marks. Optionally, the time period selection when obtaining the historical pre-cleaning mark can be set by yourself, but it must be continuous with the day. If a cloud host is initially determined to need to be cleaned up on a certain day, the pre-cleaning flag will be set to the cleanup state. If it is determined that it does not need to be cleaned up, the pre-cleaning flag will be set to the non-cleaning state. By obtaining the data snapshot and monitoring data of the cloud host and combining it with the historical pre-cleaning flag, the long-term performance of the cloud host can be better evaluated, avoiding misjudgments caused by short-term fluctuations, and improving the scientificity and reliability of cleaning decisions.

[0055] Step S102, based on the data snapshot of each cloud host and the monitoring data of the day, determine the pre-cleaning mark of each cloud host for the day. Specifically, since the data snapshot and the monitoring data of the day are obtained at different times for the same type of data, the changes of each type of data in the monitoring data relative to the initial data snapshot can be determined through the data snapshot and the monitoring data of the day to indicate the resource usage of the cloud host, and then it can be preliminarily determined whether the cloud host needs to be cleaned, that is, the pre-cleaning mark of the day can be determined.

[0056] Step S103, based on the historical pre-cleaning flag of each cloud host and the pre-cleaning flag of the day, determine the set of cloud hosts to be cleaned. Specifically, by combining the historical pre-cleaning flag of each cloud host and the pre-cleaning flag of the day, evaluate the long-term performance of the cloud host, and obtain the set of hosts to be cleaned, so as to improve the accuracy and reliability of cloud host cleaning.

[0057] Step S104, in response to the user's confirmation operation on the set of cloud hosts to be cleaned up, a target set of cloud hosts to be cleaned up is obtained, and the confirmation operation is used to confirm the cloud hosts that need to be retained. Specifically, the set of cloud hosts to be cleaned up is sent to the user for confirmation by the user. For example, if the user believes that a certain cloud host in the set of cloud hosts to be cleaned up does not need to be cleaned up, the cloud host can be retained by the confirmation operation on the cloud host. According to the user's confirmation result, the final target set of cloud hosts to be cleaned up is generated, which further improves the accuracy of cloud host cleaning.

[0058] Step S105, for any cloud host in the target cleanup cloud host set, the cloud host is cleaned using a corresponding cleaning method based on the creation method of the cloud host. Specifically, since the cloud host can be created through an underlying command or a cloud management platform, if the same cleaning method is used for these two creation methods, residual data may be generated, resulting in a poor cleaning effect. Therefore, the embodiment of the present invention improves the reliability and accuracy of cloud host cleaning by using different cleaning methods based on different creation methods, and at the same time, thoroughly cleans the cloud host, thereby achieving efficient cleaning of the cloud host.

[0059] The cloud host cleaning method provided by the embodiment of the present invention obtains data snapshots and monitoring data of the cloud host, determines the cleaning mark of the day, and combines the historical pre-cleaning mark to better evaluate the long-term performance of the cloud host, avoid misjudgment due to short-term fluctuations, and improve the scientificity and reliability of cleaning decisions. By allowing users to participate in the process of determining the cloud host that needs to be cleaned, the accuracy of cloud host cleaning is further improved, and the erroneous cleaning caused by system misjudgment is reduced. Finally, an accurate target cleaning cloud host set is obtained, and then different cleaning methods are adopted based on the different creation methods of the cloud hosts in the target cleaning cloud host set, so as to ensure the effectiveness and safety of the cleaning operation, realize accurate, efficient and reliable cleaning of cloud hosts, and improve resource utilization.

[0060] In this embodiment, a cloud host cleaning method is provided. Figure 2 is a flow chart of another cloud host cleaning method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0061] Step S201, obtain the data snapshot of each cloud host, the monitoring data of the day and the historical pre-cleaning flag. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0062] Step S202, based on the data snapshot of each cloud host and the monitoring data of the day, determine the pre-cleaning flag of each cloud host on the day.

[0063] Specifically, the above step S202 includes:

[0064] Step S2021, for any cloud host, determine the growth rate of each data in the monitoring data of the cloud host on the day relative to the data snapshot corresponding to the data. Specifically, taking the CPU usage and memory usage in the monitoring data of any cloud host as an example, the CPU usage of the cloud host obtained in step S201 on the day is 32%, and the memory usage is 51%, while the CPU usage in the data snapshot of the cloud host when it was initially created is 30%, and the memory usage is 50%. Based on the above data, it can be obtained that the growth rate of CPU usage is 6.67%, and the growth rate of memory usage is 2%. Among them, the calculation formula of the growth rate is: Growth rate = (monitoring data of the day - data snapshot) / data snapshot * 100%.

[0065] Step S2022, if the growth rates of all data in the monitoring data of the day are less than the preset growth rate, the pre-cleaning flag of the day is set to the cleaning state, and the cleaning state indicates that the cloud host needs to be cleaned. Specifically, taking the preset growth rate of 5% as an example, if the growth rate of each data in the monitoring data of the day is less than 5%, the cloud host may be in a low load state. In order to improve resource utilization, the cloud host can be cleaned to release resources, so the pre-cleaning flag of the cloud host can be set to the cleaning state.

[0066] Alternatively, in step S2023, if the growth rate corresponding to any data in the monitoring data of the day is not less than the preset growth rate, the pre-cleaning flag of the day is set to the uncleaning state. Specifically, if the growth rate of any data in the monitoring data is not less than 5%, for example, the growth rate of the above-mentioned CPU usage is 6.67%, it indicates that the cloud host may be under a high load state, which may be a normal business peak or a temporary increase in demand. At this time, cleaning should not be performed to avoid affecting business operations. By preliminarily determining the cloud hosts that need to be cleaned based on the growth rate of the monitoring data, the accuracy of cleaning the cloud hosts is improved.

[0067] Step S203: determining a set of cloud hosts to be cleaned up based on the historical pre-cleaning flag of each cloud host and the pre-cleaning flag of the current day.

[0068] Specifically, the above step S203 includes:

[0069] Step S2031, for any cloud host, based on the historical pre-cleaning flag of the cloud host and the pre-cleaning flag of the day, determine the number of times the pre-cleaning flag is in the cleaning state within the preset time. Specifically, in order to improve the accuracy of determining the cloud host that needs to be cleaned, the long-term resource usage of the cloud host can be considered, so the set of cloud hosts to be cleaned can be determined in combination with the pre-cleaning flags of the cloud hosts in the historical time period. Assuming that today is November 20, the historical pre-cleaning flags of any cloud host are the pre-cleaning flag of November 19, the pre-cleaning flag of November 18, and the pre-cleaning flag of November 17. Among them, the pre-cleaning flags of November 20, November 19, and November 18 are in the cleaning state, and the pre-cleaning flag of November 17 is in the uncleaned state. Taking the preset time period of 3 days as an example, that is, determining the number of times the pre-processing flag of the cloud host is in the cleaning state within 3 days, the number is obtained as 3.

[0070] Step S2032, when the number of times is equal to the preset number of times threshold, the cloud host is added to the set of cloud hosts to be cleaned up. Specifically, assuming that the preset number of times threshold is 3, the number of times determined in the above step S2031 is 3, when the two values ​​are equal, it is preliminarily determined that the cloud host needs to be cleaned up, and the cloud host is added to the set of cloud hosts to be cleaned up.

[0071] Alternatively, in step S2033, when the number is less than the preset number threshold, the number of times the pre-cleaning flag of the next cloud host is in the clean state within the preset time is continued to be judged until all cloud hosts are traversed. Specifically, assuming that the pre-cleaning flags on November 20 and November 19 are in the clean state, and the pre-cleaning flag on November 18 is in the non-clean state, that is, the number of times the pre-cleaning flag of the cloud host is in the clean state within the preset time period is 2, which is less than the preset number threshold 3, then the cloud host can be temporarily not cleaned, and the process returns to step S2031 to continue to judge the number corresponding to the next cloud host until all cloud hosts are traversed once to obtain the final set of cloud hosts to be cleaned. By considering the historical pre-cleaning flag, the number of times the cloud host is in the clean state is determined, and when the number is equal to the preset number threshold, it indicates that the cloud host has a persistent problem or resource waste and needs to be cleaned, which can reduce the mistaken cleaning caused by accidental factors and improve the accuracy of the cleaning operation.

[0072] Step S204, in response to the user's confirmation operation on the cloud host set to be cleaned up, a target cloud host set to be cleaned up is obtained, and the confirmation operation is used to confirm the cloud hosts that need to be retained.

[0073] Specifically, the above step S204 includes:

[0074] Step S2041, all cloud hosts in the set of cloud hosts to be cleaned that have not been confirmed by the user are determined as the target cleanup cloud host set. Specifically, since the set of cloud hosts to be cleaned is preliminarily determined based on the resource usage of the cloud hosts over a period of time, in order to further improve the accuracy of cloud host cleaning, these cloud hosts can be further screened by the user. More specifically, the set of cloud hosts to be cleaned is sent to the user terminal, and the user can select cloud hosts that do not need to be cleaned from the set of cloud hosts to be cleaned for confirmation. Then, the cloud hosts that have been confirmed by the user are removed from the set of cloud hosts to be cleaned to obtain the final target cleanup cloud host set.

[0075] In some optional embodiments, Figure 3 is a flow chart of determining a target cleanup cloud host set according to an embodiment of the present invention, such as Figure 3 As shown, for any cloud host, the growth rate of the monitoring data is determined based on the monitoring data and data snapshots of the cloud host. Then, it is determined whether the growth rate of each data in the monitoring data is less than the preset growth rate. If so, the pre-cleaning flag is set to the cleaning state. If the growth rate of any data is not less than the preset growth rate, the pre-cleaning flag is set to the uncleaned state. Then, based on the historical pre-cleaning flag and the pre-cleaning flag of the cloud host, the number of times the pre-cleaning flag is in the cleaning state within the preset time period is determined. Then, it is determined whether the number is equal to the preset number threshold. If so, the cloud host is added to the set of cloud hosts to be cleaned. If less, the number of times the next cloud host is determined ( Figure 3 Then, the cloud host set to be cleaned is sent to the user, and based on the user's confirmation operation, a target cloud host set to be cleaned is obtained.

[0076] Step S205, for any cloud host in the target cleanup cloud host set, query the cloud host from the cloud management platform database. Specifically, since there are two ways to create a cloud host, that is, to create it through the underlying command or to create it through the cloud management platform, in order to improve the cleaning effect, different creation methods can use different cleaning methods, so it is necessary to first determine the creation method of each cloud host in the target cleanup cloud host set. If the cloud host is created by calling the cloud management platform interface, the cloud management platform database will store relevant data, so it can be queried from the cloud management platform database.

[0077] Step S206, if the cloud host can be found in the cloud management platform database, determine that the cloud host is created through the cloud management platform. Specifically, if the cloud host can be found in the cloud management platform database, the cloud host is created by calling an interface of the cloud management platform.

[0078] Step S207, if the cloud host cannot be found in the cloud management platform database, determine that the cloud host is created by the underlying command. Specifically, if the cloud host cannot be found in the cloud management platform database, the cloud host is not created by calling the cloud management platform interface, but is directly created by the underlying command.

[0079] Step S208: for any cloud host in the target cleanup cloud host set, clean up the cloud host using a corresponding cleanup method based on the creation method of the cloud host.

[0080] Specifically, the above step S208 includes:

[0081] Step S2081, when the cloud host is created by a bottom-level command, the cloud host is deleted by using the bottom-level command. Specifically, the creation method of each cloud host in the target cleanup cloud host set is determined through the above steps S205 to S207, so the corresponding cleanup method can be directly used to clean up the cloud host in step S208. For cloud hosts created by bottom-level commands, they can be directly deleted by bottom-level commands.

[0082] Step S2082, when the cloud host is created through the cloud management platform, the cloud host is deleted using the underlying command, and the cloud management platform cleanup interface is called to clean up the residual data. Specifically, for the cloud host created by calling the cloud management platform interface, after being deleted through the underlying command, since the cloud host still stores relevant data in the cloud management platform database, it is also necessary to clean up the residual data by calling the cloud management platform cleanup interface. By using different methods for cleaning according to different cloud host creation methods, the cleaning is more thorough, the cleaning effect is improved, and the resource utilization rate is improved.

[0083] In some optional embodiments, Figure 4 is a flowchart of another cloud host cleaning according to an embodiment of the present invention. Figure 4 As shown, for any cloud host in the target cleanup cloud host set, query the cloud host from the cloud management platform database. If the cloud host can be queried, the cloud host is created by calling the cloud management platform interface. First use the underlying command to delete it, and then call the cloud management platform cleanup interface to clean up the residual data. If the cloud host cannot be queried, the cloud host is created by the underlying command, and then directly use the underlying command to delete it.

[0084] The cloud host cleaning method provided by the embodiment of the present invention obtains data snapshots and monitoring data of the cloud host, determines the cleaning mark of the day, and combines the historical pre-cleaning mark to better evaluate the long-term performance of the cloud host, avoid misjudgment due to short-term fluctuations, and improve the scientificity and reliability of cleaning decisions. By allowing users to participate in the process of determining the cloud host that needs to be cleaned, the accuracy of cloud host cleaning is further improved, and the erroneous cleaning caused by system misjudgment is reduced. Finally, an accurate target cleaning cloud host set is obtained, and then different cleaning methods are adopted based on the different creation methods of the cloud hosts in the target cleaning cloud host set, so as to ensure the effectiveness and safety of the cleaning operation, realize accurate, efficient and reliable cleaning of cloud hosts, and improve resource utilization.

[0085] In this embodiment, a cloud host cleaning device is also provided, which is used to implement the above embodiments and preferred implementations, and will not be repeated here. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0086] This embodiment provides a cloud host cleaning device, such as Figure 5 As shown, including:

[0087] The acquisition module 501 is used to obtain the data snapshot of each cloud host, the monitoring data of the day and the historical pre-cleaning flag.

[0088] The first determination module 502 is used to determine the pre-cleaning flag of each cloud host on the day based on the data snapshot of each cloud host and the monitoring data of the day.

[0089] The second determining module 503 is used to determine a set of cloud hosts to be cleaned up based on the historical pre-cleaning flag of each cloud host and the pre-cleaning flag of the current day.

[0090] The third determination module 504 is used to obtain a target cleanup cloud host set in response to a user's confirmation operation on the set of cloud hosts to be cleaned up, wherein the confirmation operation is used to confirm the cloud hosts that need to be retained.

[0091] The cleaning module 505 is used to clean up any cloud host in the target cleanup cloud host set by using a corresponding cleaning method based on the creation method of the cloud host.

[0092] In some optional implementations, the first determining module 502 includes:

[0093] The first determining unit is used to determine, for any cloud host, a growth rate of each data in the monitoring data of the cloud host on the day relative to a data snapshot corresponding to the data.

[0094] The first setting unit is used to set the pre-cleaning flag of the day to a cleaning state if the growth rates corresponding to all data in the monitoring data of the day are less than a preset growth rate. The cleaning state indicates that the cloud host needs to be cleaned.

[0095] Alternatively, the second setting unit is used to set the pre-cleaning flag of the day to a non-cleaning state if the growth rate corresponding to any data in the monitoring data of the day is not less than a preset growth rate.

[0096] In some optional implementations, the second determining module 503 includes:

[0097] The second determining unit is used to determine, for any cloud host, the number of times the pre-cleaning flag is in a cleaning state within a preset time based on the historical pre-cleaning flag of the cloud host and the pre-cleaning flag of the day.

[0098] The third determining unit is configured to add the cloud host to the set of cloud hosts to be cleaned up when the number of times is equal to a preset number threshold.

[0099] Alternatively, the traversal unit is used to continue to judge the number of times the pre-cleaning flag of the next cloud host is in the cleaning state within a preset time when the number is less than a preset number threshold, until all cloud hosts are traversed.

[0100] In some optional implementations, the third determining module 504 includes:

[0101] The fourth determining unit is used to determine all cloud hosts in the set of cloud hosts to be cleaned up that have not been confirmed by the user as a set of target cloud hosts to be cleaned up.

[0102] In some optional implementations, before the cleaning module 505, the device further includes:

[0103] The query module is used to query the cloud host from the cloud management platform database for any cloud host in the target cleanup cloud host set.

[0104] The first creation module is used to determine that the cloud host is created through the cloud management platform when the cloud host can be queried in the cloud management platform database.

[0105] Alternatively, the second creation module is used to determine that the cloud host is created through underlying commands when the cloud host cannot be queried in the cloud management platform database.

[0106] In some optional implementations, the cleaning module 505 includes:

[0107] The first cleaning unit is used to delete the cloud host by using the underlying command when the cloud host is created by the underlying command.

[0108] The second cleaning unit is used to delete the cloud host by using the bottom layer command and call the cloud management platform cleaning interface to clean up the residual data when the cloud host is created through the cloud management platform.

[0109] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0110] The cloud host cleaning device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0111] The embodiment of the present invention also provides a computer device having the above Figure 5 The cloud host cleanup device is shown.

[0112] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.

[0113] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0114] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0115] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0116] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0117] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0118] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0119] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0120] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A cloud host cleaning method, characterized in that: The method comprises: Get data snapshots, monitoring data for the day, and historical pre-cleaning flags for each cloud host; Based on the data snapshot of each cloud host and the monitoring data of the day, determine the pre-cleaning flag of each cloud host on the day; Based on the historical pre-cleaning flag of each cloud host and the pre-cleaning flag of the current day, determine the set of cloud hosts to be cleaned; In response to a user's confirmation operation on the set of cloud hosts to be cleaned up, a target set of cloud hosts to be cleaned up is obtained, wherein the confirmation operation is used to confirm the cloud hosts that need to be retained; For any cloud host in the target cleanup cloud host set, the cloud host is cleaned up using a corresponding cleanup method based on the creation method of the cloud host.

2. The method according to claim 1, characterized in that The step of determining the pre-cleaning flag for each cloud host on the day based on the data snapshot of each cloud host and the monitoring data of the day includes: For any cloud host, determine the growth rate of each data in the monitoring data of the cloud host on the day relative to the data snapshot corresponding to the data; If the growth rates corresponding to all data in the monitoring data of the day are less than the preset growth rate, the pre-cleaning flag of the day is set to the cleaning state, and the cleaning state indicates that the cloud host needs to be cleaned; Alternatively, if the growth rate corresponding to any data in the monitoring data of the day is not less than the preset growth rate, the pre-cleaning flag of the day is set to a non-cleaning state.

3. The method according to claim 2, characterized in that The step of determining a set of cloud hosts to be cleaned based on the historical pre-cleaning flag of each cloud host and the pre-cleaning flag of the current day includes: For any cloud host, based on the historical pre-cleaning flag of the cloud host and the pre-cleaning flag of the current day, determine the number of times the pre-cleaning flag is in a cleaning state within a preset time; When the number of times is equal to a preset number threshold, adding the cloud host to the set of cloud hosts to be cleaned up; Alternatively, when the number is less than the preset number threshold, the number of times the pre-cleaning flag of the next cloud host is in the cleaning state within the preset time is continuously judged until all cloud hosts are traversed.

4. The method according to claim 1, characterized in that: The step of obtaining a target cleanup cloud host set in response to a user's confirmation operation on the to-be-cleaned cloud host set includes: All cloud hosts in the set of cloud hosts to be cleaned up that have not been confirmed by the user are determined as the set of target cloud hosts to be cleaned up.

5. The method according to claim 1, characterized in that Before cleaning any cloud host in the target cleanup cloud host set using a corresponding cleaning method based on the creation method of the cloud host, the method further includes: For any cloud host in the target cleanup cloud host set, query the cloud host from the cloud management platform database; In a case where the cloud host can be found in the cloud management platform database, determining that the cloud host is created through the cloud management platform; When the cloud host cannot be found in the cloud management platform database, it is determined that the cloud host is created by an underlying command.

6. The method according to claim 5, characterized in that For any cloud host in the target cleanup cloud host set, based on the creation method of the cloud host, a corresponding cleanup method is used to clean up the cloud host, including: In the case where the cloud host is created by a bottom-level command, the cloud host is deleted by using the bottom-level command; Alternatively, when the cloud host is created through a cloud management platform, the cloud host is deleted using an underlying command, and a cloud management platform cleanup interface is called to clean up residual data.

7. A cloud host cleaning device, characterized in that: The device comprises: The acquisition module is used to obtain data snapshots of each cloud host, monitoring data for the day, and historical pre-cleaning flags; A first determination module is used to determine a pre-cleaning flag for each cloud host on the day based on a data snapshot of each cloud host and monitoring data of the day; A second determination module is used to determine a set of cloud hosts to be cleaned up based on a historical pre-cleaning flag of each cloud host and a pre-cleaning flag of the current day; A third determination module is used to obtain a target cleanup cloud host set in response to a user's confirmation operation on the to-be-cleaned cloud host set, wherein the confirmation operation is used to confirm the cloud hosts that need to be retained; The cleaning module is used to clean up any cloud host in the target cleanup cloud host set by using a corresponding cleaning method based on the creation method of the cloud host.

8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the cloud host cleaning method according to any one of claims 1 to 6 by executing the computer instructions.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the cloud host cleaning method according to any one of claims 1 to 6.

10. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to enable a computer to execute the cloud host cleaning method according to any one of claims 1 to 6.