CN112015698A - Method and device for cleaning mirror image data and electronic equipment - Google Patents

Method and device for cleaning mirror image data and electronic equipment Download PDF

Info

Publication number
CN112015698A
CN112015698A CN202010874494.1A CN202010874494A CN112015698A CN 112015698 A CN112015698 A CN 112015698A CN 202010874494 A CN202010874494 A CN 202010874494A CN 112015698 A CN112015698 A CN 112015698A
Authority
CN
China
Prior art keywords
mirror image
image data
storage space
data
cleaning
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010874494.1A
Other languages
Chinese (zh)
Inventor
贾敬敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202010874494.1A priority Critical patent/CN112015698A/en
Publication of CN112015698A publication Critical patent/CN112015698A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1737Details of further file system functions for reducing power consumption or coping with limited storage space, e.g. in mobile devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Library & Information Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a method and a device for cleaning mirror image data and electronic equipment, wherein the method comprises the following steps: monitoring the storage space occupation amount of the mirror image data in the physical server; and if the occupied storage space of the mirror image data reaches a preset occupied storage space threshold, sending a data cleaning instruction to the physical server so as to clean at least one part of mirror image data in the physical server through the physical server. The method monitors the occupation amount of the storage space of the mirror image data in the physical server in real time, and automatically sends a data cleaning instruction when the occupation threshold is reached, so that the physical server receiving the data cleaning instruction automatically cleans useless mirror image data in the storage space, and compared with a method for manually screening and deleting useless mirror image data in the storage space, the method improves the cleaning efficiency of the mirror image data; meanwhile, compared with the mode that mirror image data is cleaned only when the virtual cloud server cannot run, the mode ensures the normal running of the virtual cloud server.

Description

Method and device for cleaning mirror image data and electronic equipment
Technical Field
The invention relates to the technical field of data cleaning, in particular to a method and a device for cleaning mirror image data and electronic equipment.
Background
The cloud server is a simple and efficient computing service which is safe and reliable, the processing capacity of the computing service can be elastically stretched, the management mode of the computing service is simpler and more efficient than that of a physical server, and a user can rapidly create or release any plurality of cloud servers without purchasing hardware in advance. The cloud server needs to run on a physical server, which may be referred to as a host of the cloud server, and the host needs to provide an image for the cloud server, which may be understood as an operating system.
The cloud server that operates on the host computer can increase or release, and the mirror image that the cloud server that releases used, and the mirror image that the cloud server that is operating used all can remain in the assigned position of host computer, after the mirror image resource that this assigned position kept reaches certain threshold value, the cloud server can't be dispatched and operate in this host computer, at this moment, need the manual screening host computer on the mirror image that needs to be cleared up, then the manual mirror image that needs to be cleared up of deleting, this mode only can the manual mirror image of clearing up when the cloud server can't operate, thereby the normal operating of cloud server has been influenced, and the efficiency of manual mirror image clearing up is lower.
Disclosure of Invention
The invention aims to provide a method and a device for cleaning mirror image data and electronic equipment, so as to ensure the normal operation of a cloud server and improve the cleaning efficiency of the mirror image data.
In a first aspect, an embodiment of the present invention provides a method for cleaning mirror image data, where the method includes: monitoring the storage space occupation amount of the mirror image data in the physical server; the mirror image data is operating system resource data of the virtual cloud server; and if the occupied storage space of the mirror image data reaches a preset occupied volume threshold, sending a data cleaning instruction to the physical server so as to clean at least one part of mirror image data in the physical server through the physical server.
In an optional embodiment, the method further comprises: if the occupation amount of the storage space of the mirror image data reaches a preset occupation amount threshold value, sending alarm information to a specified object; the alarm information is used to indicate: the occupied storage space of the mirror image data in the physical server reaches a preset occupied amount threshold, and at least a part of the mirror image data in the physical server is to be cleaned.
In an optional embodiment, after the step of sending a data cleaning instruction to the physical server to clean at least a part of the mirrored data in the physical server by the physical server if the occupied storage space of the mirrored data reaches the preset occupied storage space threshold, the method further includes: and if the cleaning completion information returned by the physical server is received, sending a successful cleaning message and the current occupied storage space of the mirror image data in the physical server to the specified object.
In a second aspect, an embodiment of the present invention provides a method for cleaning mirror image data, where the method includes: if a data cleaning instruction is received, inquiring mirror image data used by the currently running virtual cloud server and mirror image data stored in a preset storage space; the data clearing instruction is sent when the preset monitoring equipment monitors that the occupancy of the storage space reaches a preset occupancy threshold; the mirror image data is operating system resource data of the virtual cloud server; determining data to be cleaned based on mirror image data used by a currently running virtual cloud server and mirror image data stored in a storage space; and deleting the determined data to be cleaned.
In an optional embodiment, the mirror data stored in the storage space includes: mirror image data in a mirror image using list stored under the specified path address; the step of querying the mirror image data used by the currently running virtual cloud server and the mirror image data stored in the preset storage space includes: calling a preset interface, and inquiring mirror image data used by a currently running virtual cloud server; and inquiring the mirror image using list under the specified path address, and determining the mirror image data in the mirror image using list as the mirror image data stored in the storage space.
In an optional embodiment, the mirror data stored in the storage space includes: mirror image data used by the virtual cloud server running at the historical moment and mirror image data used by the virtual cloud server running at the present moment; the step of determining data to be cleaned based on the mirror image data used by the currently running virtual cloud server and the mirror image data stored in the storage space includes: and determining the mirror image data except the mirror image data used by the currently running virtual cloud server as the data to be cleaned from the mirror image data stored in the storage space.
In an optional implementation manner, after the step of deleting the determined data to be cleaned, the method further includes: and sending cleaning completion information to the preset monitoring equipment so as to send a successful cleaning message and the current occupied amount of the storage space to the specified object through the preset monitoring equipment.
In a third aspect, an embodiment of the present invention provides an apparatus for cleaning mirror image data, where the apparatus includes: the occupancy monitoring module is used for monitoring the occupancy of the storage space of the mirror image data in the physical server; the mirror image data is operating system resource data of the virtual cloud server; and the instruction sending module is used for sending a data cleaning instruction to the physical server to clean at least part of mirror image data in the physical server through the physical server if the occupied amount of the storage space of the mirror image data reaches a preset occupied amount threshold value.
In a fourth aspect, an embodiment of the present invention provides an apparatus for cleaning mirror image data, where the apparatus includes: the instruction receiving module is used for inquiring mirror image data used by the currently running virtual cloud server and mirror image data stored in a preset storage space if a data cleaning instruction is received; the data clearing instruction is sent when the preset monitoring equipment monitors that the occupancy of the storage space reaches a preset occupancy threshold; the mirror image data is operating system resource data of the virtual cloud server; the to-be-cleaned data determining module is used for determining to-be-cleaned data based on the mirror image data used by the currently running virtual cloud server and the mirror image data stored in the storage space; and the data cleaning module is used for deleting the determined data to be cleaned.
In a fifth aspect, an embodiment of the present invention provides an electronic device, which includes a processor and a memory, where the memory stores machine executable instructions capable of being executed by the processor, and the processor executes the machine executable instructions to implement the method for cleaning mirrored data according to any one of the foregoing embodiments.
In a sixth aspect, embodiments of the present invention provide a machine-readable storage medium storing machine-executable instructions, which when invoked and executed by a processor, cause the processor to implement a method for cleaning mirrored data as described in any one of the preceding embodiments.
The embodiment of the invention has the following beneficial effects:
the invention provides a method and a device for cleaning mirror image data and electronic equipment, wherein the occupancy amount of a storage space of the mirror image data in a physical server is monitored through preset monitoring equipment, and the mirror image data is operating system resource data of a virtual cloud server; and if the occupied storage space of the mirror image data reaches a preset occupied storage space threshold, sending a data cleaning instruction to the physical server so as to clean at least one part of mirror image data in the physical server through the physical server. The method can monitor the occupation amount of the storage space of the mirror image data in the physical server in real time, and automatically sends the data cleaning instruction when the occupation threshold is reached, so that the physical server receiving the data cleaning instruction automatically cleans useless mirror image data in the storage space, and compared with a method for manually screening and deleting useless mirror image data in the storage space, the method improves the efficiency of cleaning the mirror image data; meanwhile, the occupied amount of the storage space can be monitored in real time and the cleaning instruction can be automatically triggered in the mode, so that the mirror image data does not need to be cleaned when the virtual cloud server cannot run, and the normal running of the virtual cloud server is ensured.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the invention as set forth above.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a method for cleaning mirror image data according to an embodiment of the present invention;
FIG. 2 is a flowchart of another method for cleaning mirror image data according to an embodiment of the present invention;
FIG. 3 is a flowchart of another method for cleaning mirror image data according to an embodiment of the present invention;
FIG. 4 is a flowchart of another method for cleaning mirror image data according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a device for cleaning mirror image data according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of another apparatus for cleaning mirror image data according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
A cloud server (also referred to as a cloud host) is typically a service process running on a physical server, which may be referred to as a host of the cloud server, and the host may provide an image for the cloud server, and the image is typically a well-made operating system, such as a Linux operating system or a Windows operating system.
Because the cloud servers running on the hosts are frequently increased or released, and the images used by the cloud servers released on the hosts and the cloud servers running on the hosts are all reserved in the designated positions of the hosts, a large amount of image resources can be left in the designated positions of the hosts. When the mirror image resources reserved at the designated position reach a certain threshold value, the cloud server cannot be dispatched to the host machine to operate, at the moment, a person in charge of manually logging in the host machine is required, the mirror images (equivalent to useless mirror images) which need to be cleaned on the host machine are screened, then the mirror images which need to be cleaned are manually deleted, and only when the cloud server cannot operate, the mirror images can be manually cleaned in the mode, so that the normal operation of the cloud server is influenced, and the efficiency of manually cleaning the mirror images is low.
Based on the above problems, embodiments of the present invention provide a method and an apparatus for cleaning mirror image data, and an electronic device. To facilitate understanding of the embodiment, first, a detailed description is given to a method for cleaning mirror image data disclosed in the embodiment of the present invention, where the method is applied to a monitoring device, and a monitoring platform is deployed on the monitoring device, where the monitoring platform may be a Zabbix monitoring platform or other monitoring platforms. The Zabbix monitoring platform is generally an enterprise-level open source solution providing distributed system monitoring and network monitoring functions based on a WEB interface, and can monitor various network parameters, ensure the safe operation of a server system, and provide a flexible notification mechanism to enable a system administrator to quickly locate and solve various problems.
As shown in fig. 1, the method comprises the steps of:
step S102, monitoring the occupation amount of a storage space of mirror image data in a physical server; the mirror image data is operating system resource data of the virtual cloud server.
The physical server is usually a stand-alone server, that is, a physically separate server, and the physical server is configured to include a processor, a hard disk, a memory, a system bus, and the like, and is similar to a general computer architecture, but needs to provide highly reliable services, and thus has high requirements on processing capability, stability, reliability, security, scalability, manageability, and the like. The physical server is a host of a virtual cloud server (corresponding to the cloud server) operating on the physical server.
In specific implementation, a storage space for storing mirror image data is preset in the physical server, the mirror image data used by the virtual cloud server released from the physical server and the mirror image data used by the virtual cloud server running in the physical server are stored in the storage space, and the mirror image data is operating system resource data of the virtual cloud server running on the physical server. In a specific implementation, each virtual cloud server needs to download the image data before running, and the storage space may also be understood as a space in the physical server for the virtual cloud server to provide the downloaded image data. The mirror image data used by each virtual cloud server occupies a certain space of the storage space, but the size of the storage space is fixed, so in order to ensure normal use of the storage space, the monitoring device is required to monitor the occupied amount of the storage space in real time (which is equivalent to the occupied amount of the storage space).
And step S104, if the occupied storage space of the mirror image data reaches a preset occupied storage space threshold, sending a data cleaning instruction to the physical server so as to clean at least one part of mirror image data in the physical server through the physical server.
The occupancy threshold is a value set by a user according to the monitoring requirement, and the value may be 90% of the storage space, may be 10G, and the like. When the monitoring device monitors that the occupied amount of the storage space of the mirror image data reaches the occupied amount threshold, a data cleaning instruction is sent to the physical server, and after the physical server receives the data cleaning instruction, useless mirror image data can be automatically searched from the storage space, and useless mirror image data are deleted, wherein the useless mirror image data are mirror image data which are stored in the storage space and are not used by a currently running virtual cloud server.
The method for cleaning the mirror image data provided by the embodiment of the invention comprises the steps of monitoring the occupancy amount of a storage space of the mirror image data in a physical server through a preset monitoring device, wherein the mirror image data is the resource data of an operating system of a virtual cloud server; and if the occupied storage space of the mirror image data reaches a preset occupied storage space threshold, sending a data cleaning instruction to the physical server so as to clean at least one part of mirror image data in the physical server through the physical server. The method can monitor the occupation amount of the storage space of the mirror image data in the physical server in real time, and automatically sends the data cleaning instruction when the occupation threshold is reached, so that the physical server receiving the data cleaning instruction automatically cleans useless mirror image data in the storage space, and compared with a method for manually screening and deleting useless mirror image data in the storage space, the method improves the efficiency of cleaning the mirror image data; meanwhile, the occupied amount of the storage space can be monitored in real time and the cleaning instruction can be automatically triggered in the mode, so that the mirror image data does not need to be cleaned when the virtual cloud server cannot run, and the normal running of the virtual cloud server is ensured.
The embodiment of the invention also provides another method for cleaning the mirror image data, which is realized on the basis of the method of the embodiment; as shown in fig. 2, the method comprises the steps of:
step S202, monitoring the occupation amount of a storage space of mirror image data in a physical server; the mirror image data is operating system resource data of the virtual cloud server.
Step S204, if the occupation amount of the storage space of the mirror image data reaches a preset occupation amount threshold value, sending alarm information to a specified object, and sending a data cleaning instruction to a physical server so as to clean at least a part of mirror image data in the physical server through the physical server.
The specified object can be a preset data cleaning responsible person; the alarm information is used for indicating: the occupied storage space of the mirror image data in the physical server reaches a preset occupied amount threshold, and at least a part of the mirror image data in the physical server is to be cleaned. During specific implementation, an alarm mail storing alarm information or a short message storing the alarm information can be sent to a mailbox of a responsible person through a preset communication platform (for example, onepiece) so as to remind the responsible person that the occupied amount of the storage space of the mirror image data in the server reaches the occupied amount threshold value and useless mirror image data in the storage space is about to be cleaned.
Step S206, if the cleaning completion information returned by the physical server is received, a message of successful cleaning and the current storage space occupation amount of the mirror image data in the physical server are sent to the specified object.
After the physical server finishes cleaning useless mirror image data in the storage space, cleaning finishing information is returned to the monitoring equipment, so that the monitoring equipment sends a message of successful cleaning and the current occupation amount of the storage space in the physical server to the specified object, the specified object is informed that the useless mirror image data in the physical server is cleaned completely, and the specified object can fully know the current state of the physical server.
The method for cleaning the mirror image data comprises the steps of firstly monitoring the occupation amount of a storage space of the mirror image data in a physical server; if the occupation amount of the storage space of the mirror image data reaches a preset occupation amount threshold value, sending alarm information to a specified object and sending a data cleaning instruction to a physical server so as to clean at least one part of mirror image data in the physical server through the physical server; and if the cleaning completion information returned by the physical server is received, sending a successful cleaning message and the current occupied storage space of the mirror image data in the physical server to the specified object. The method monitors the occupation amount of the storage space in the physical server in real time, and automatically clears useless mirror image data in the physical server when the occupation amount of the storage space reaches the occupation amount threshold value, so that the effect of processing the mirror image data at a high rate and quickly is achieved.
The embodiment of the invention also provides another method for cleaning mirror image data, which is applied to a physical server and comprises the following specific steps as shown in fig. 3:
step S302, if a data cleaning instruction is received, mirror image data used by the currently running virtual cloud server and mirror image data stored in a preset storage space are inquired.
The data clearing instruction is sent when the preset monitoring device monitors that the occupancy of the storage space reaches a preset occupancy threshold. The storage space is a space preset in the physical server and used for storing mirror image data, the mirror image data used by the virtual cloud server released from the physical server and the mirror image data used by the virtual cloud server running in the physical server are stored in the storage space, and the mirror image data is operating system resource data of the virtual cloud server. The currently running virtual cloud server is a running virtual cloud server in the physical servers.
Step S304, determining data to be cleaned based on the mirror image data used by the currently running virtual cloud server and the mirror image data stored in the storage space.
The mirror image data stored in the storage space comprises the mirror image data used by the currently running virtual cloud server and the released mirror image data used by the virtual cloud server, so that the mirror image data stored in the storage space can be screened based on the mirror image data used by the currently running virtual cloud server to obtain the data to be cleaned, namely the released mirror image data used by the virtual cloud server.
And step S306, deleting the determined data to be cleaned.
In the method for cleaning the mirror image data, when a data cleaning instruction is received, the mirror image data used by the currently running virtual cloud server and the mirror image data stored in a preset storage space are inquired; determining data to be cleaned based on the mirror image data used by the currently running virtual cloud server and the mirror image data stored in the storage space; and then deleting the determined data to be cleaned. According to the method, when the data cleaning instruction is received, the physical server automatically screens the data to be cleaned and deletes the data to be cleaned, the mirror image data in the physical server does not need to be manually screened and cleaned, and the cleaning efficiency of the mirror image data is improved.
The embodiment of the invention also provides another method for cleaning the mirror image data, which is realized on the basis of the method of the embodiment; the method mainly describes a specific process of inquiring mirror image data used by a currently running virtual cloud server and mirror image data stored in a preset storage space (realized through the following steps S402-S404), and a specific process of determining data to be cleaned based on the mirror image data used by the currently running virtual cloud server and the mirror image data stored in the storage space (realized through the following step S406); as shown in fig. 4, the method includes the steps of:
step S402, if a data cleaning instruction is received, a preset interface is called, and mirror image data used by the currently running virtual cloud server is inquired.
The preset interface can check mirror image data used by a currently running virtual cloud server on the physical server. In a specific implementation, the preset interface may be a Nova interface, which is generally a computing organization controller in the OpenStack cloud, supports all activities of a life cycle of an instance in the OpenStack cloud, and is also generally a platform responsible for managing computing resources, networks, authentication, and required extensibility.
Step S404, querying a mirror image use list under the specified path address, and determining mirror image data in the mirror image use list as mirror image data stored in the storage space.
In a specific implementation, the mirror data stored in the storage space includes: mirror image data in a mirror image using list stored under the specified path address; the mirror image data stored in the storage space is as follows: mirror data used by a virtual cloud server running at a historical time (equivalent to the released virtual cloud server), and mirror data used by a currently running virtual cloud server. The specified path address is usually a directory address set by the user according to the user's own needs, for example, the directory address may be/vm _ data/openstack/nova/instance/_ base/. The mirror image use list is a list for storing mirror image data under the appointed path address.
Step S406, determining, from the mirror image data stored in the storage space, mirror image data other than the mirror image data used by the currently running virtual cloud server as data to be cleaned.
The mirror image data used by the currently running virtual cloud server is necessary mirror image data and cannot be deleted; the mirror image data used by the virtual cloud server running at the historical moment is useless mirror image data and needs to be cleaned, so that the mirror image data except the mirror image data used by the currently running virtual cloud server can be screened out from the mirror image data stored in the storage space, and the screened mirror image data is used as the data to be cleaned.
And step S408, deleting the determined data to be cleaned.
And step S410, sending cleaning completion information to preset monitoring equipment so as to send a successful cleaning message and the current occupied amount of the storage space to the specified object through the preset monitoring equipment.
After the physical server finishes cleaning the data to be cleaned in the storage space, cleaning completion information is returned to the preset monitoring equipment, so that the preset monitoring equipment sends a message of successful cleaning and the current occupied amount of the storage space in the physical server to the specified object, the specified object is informed that the data to be cleaned in the physical server is cleaned completely, and the specified object can fully know the current state of the physical server.
In some embodiments, a mirror image data cleaning script runs in the physical server, a monitoring device is preset to monitor the occupation amount of a storage space of mirror image data in the physical server in real time, when the occupation amount of the storage space is monitored to reach an occupation amount threshold, warning information is sent to a specified object, and a data cleaning instruction is sent to the physical server to trigger the mirror image data cleaning script; after the mirror image data cleaning script is triggered, the data to be cleaned in the storage space can be automatically cleaned, namely: calling a preset interface to check the mirror image data used by the currently running virtual cloud server in the physical server and the mirror image data stored in the storage space, determining the mirror image data except the mirror image data used by the currently running virtual cloud server from the mirror image data stored in the storage space as data to be cleaned, executing file deletion operation, and deleting the data to be cleaned; after the deletion is completed, the mirror image data cleaning script returns cleaning completion information to the preset monitoring equipment, and after the preset monitoring equipment receives the cleaning completion information, the preset monitoring equipment sends a successful cleaning message and the current occupation amount of the storage space to the specified object.
According to the method for cleaning the mirror image data, if a data cleaning instruction is received, a preset interface is called, the mirror image data used by the currently running virtual cloud server is inquired, and the mirror image data in the mirror image using list under the specified path address is determined as the mirror image data stored in the storage space; determining mirror image data except for mirror image data used by a currently running virtual cloud server from the mirror image data stored in the storage space as data to be cleaned; deleting the determined data to be cleaned; and after the deletion is finished, sending cleaning finishing information to the preset monitoring equipment so as to send a successful cleaning message and the current occupied amount of the storage space to the specified object through the preset monitoring equipment. According to the method, the occupied amount of the storage space in the physical server is automatically monitored through the preset monitoring equipment, and when the occupied amount of the storage space reaches the occupied amount threshold value, a data cleaning instruction is sent to the physical server, so that the physical server can quickly clean the data to be cleaned, the cleaning efficiency of mirror image data is improved, the personnel investment is reduced, and the utilization rate of environmental resources can be improved; meanwhile, the cleaning mode can predict the problems in advance and automatically process the problems, so that the normal operation of the virtual cloud server is ensured.
Corresponding to the embodiment of the method for cleaning the mirror image data shown in fig. 1, an embodiment of the present invention further provides a device for cleaning the mirror image data, as shown in fig. 5, where the device includes:
the occupancy monitoring module 50 is used for monitoring the occupancy of the storage space of the mirror image data in the physical server; the mirror image data is operating system resource data of the virtual cloud server.
And the instruction sending module 51 is configured to send a data cleaning instruction to the physical server to clean at least a part of the mirror image data in the physical server through the physical server if the occupied amount of the storage space of the mirror image data reaches a preset occupied amount threshold.
The image data cleaning device monitors the storage space occupation amount of image data in the physical server through preset monitoring equipment, wherein the image data is operating system resource data of the virtual cloud server; and if the occupied storage space of the mirror image data reaches a preset occupied storage space threshold, sending a data cleaning instruction to the physical server so as to clean at least one part of mirror image data in the physical server through the physical server. The method can monitor the occupation amount of the storage space of the mirror image data in the physical server in real time, and automatically sends the data cleaning instruction when the occupation threshold is reached, so that the physical server receiving the data cleaning instruction automatically cleans useless mirror image data in the storage space, and compared with a method for manually screening and deleting useless mirror image data in the storage space, the method improves the efficiency of cleaning the mirror image data; meanwhile, the occupied amount of the storage space can be monitored in real time and the cleaning instruction can be automatically triggered in the mode, so that the mirror image data does not need to be cleaned when the virtual cloud server cannot run, and the normal running of the virtual cloud server is ensured.
Further, the apparatus further includes an alarm information sending module, configured to: if the occupation amount of the storage space of the mirror image data reaches a preset occupation amount threshold value, sending alarm information to a specified object; the alarm information is used to indicate: the occupied storage space of the mirror image data in the physical server reaches a preset occupied amount threshold, and at least a part of the mirror image data in the physical server is to be cleaned.
Further, the apparatus further includes a cleaning success information sending module, configured to: and if the cleaning completion information returned by the physical server is received, sending a successful cleaning message and the current occupied storage space of the mirror image data in the physical server to the specified object.
The implementation principle and the generated technical effect of the cleaning device for mirror image data provided by the embodiment of the invention are the same as those of the method embodiment, and for brief description, the corresponding content in the method embodiment can be referred to where the embodiment of the device is not mentioned.
Corresponding to the embodiment of the method for cleaning the mirror image data shown in fig. 3, another device for cleaning the mirror image data is further provided in the embodiment of the present invention, as shown in fig. 6, the device includes:
an instruction receiving module 60, configured to query, if a data cleaning instruction is received, mirror image data used by a currently running virtual cloud server and mirror image data stored in a preset storage space; the data clearing instruction is sent when the preset monitoring equipment monitors that the occupancy of the storage space reaches a preset occupancy threshold; the mirror image data is operating system resource data of the virtual cloud server.
And the to-be-cleaned data determining module 61 is configured to determine to-be-cleaned data based on the mirror image data used by the currently running virtual cloud server and the mirror image data stored in the storage space.
And the data cleaning module 62 is configured to delete the determined data to be cleaned.
When a data cleaning instruction is received, the image data used by the currently running virtual cloud server and the image data stored in the preset storage space are inquired by the image data cleaning device; determining data to be cleaned based on the mirror image data used by the currently running virtual cloud server and the mirror image data stored in the storage space; and then deleting the determined data to be cleaned. According to the method, when the data cleaning instruction is received, the physical server automatically screens the data to be cleaned and deletes the data to be cleaned, the mirror image data in the physical server does not need to be manually screened and cleaned, and the cleaning efficiency of the mirror image data is improved.
Specifically, the mirror image data stored in the storage space includes: mirror image data in a mirror image using list stored under the specified path address; an instruction receiving module 60 configured to: if a data cleaning instruction is received, calling a preset interface, and inquiring mirror image data used by the currently running virtual cloud server; and inquiring the mirror image using list under the specified path address, and determining the mirror image data in the mirror image using list as the mirror image data stored in the storage space.
Further, the mirror image data stored in the storage space includes: mirror image data used by the virtual cloud server running at the historical moment and mirror image data used by the virtual cloud server running at the present moment; the to-be-cleaned data determining module 61 is configured to: and determining the mirror image data except the mirror image data used by the currently running virtual cloud server as the data to be cleaned from the mirror image data stored in the storage space.
In a specific implementation, the apparatus further includes a result feedback module, configured to: and sending cleaning completion information to the preset monitoring equipment so as to send a successful cleaning message and the current occupied amount of the storage space to the specified object through the preset monitoring equipment.
The implementation principle and the generated technical effect of the cleaning device for the mirror image data provided by the embodiment of the invention are the same as those of the cleaning method for the mirror image data, and for the sake of brief description, corresponding contents in the foregoing method embodiment can be referred to where the embodiment of the device is not mentioned.
An embodiment of the present invention further provides an electronic device, which is shown in fig. 7, and the electronic device includes a processor 101 and a memory 100, where the memory 100 stores machine executable instructions that can be executed by the processor 101, and the processor 101 executes the machine executable instructions to implement the method for cleaning the mirror image data.
Further, the electronic device shown in fig. 7 further includes a bus 102 and a communication interface 103, and the processor 101, the communication interface 103, and the memory 100 are connected through the bus 102.
The Memory 100 may include a high-speed Random Access Memory (RAM) and may further include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used. The bus 102 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 7, but this does not indicate only one bus or one type of bus.
The processor 101 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 101. The Processor 101 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 100, and the processor 101 reads the information in the memory 100, and completes the steps of the method of the foregoing embodiment in combination with the hardware thereof.
The embodiment of the present invention further provides a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the method for cleaning the mirror image data, and specific implementation may refer to method embodiments, and is not described herein again.
The method and the apparatus for cleaning mirror image data and the computer program product of the electronic device provided by the embodiments of the present invention include a computer-readable storage medium storing a program code, where instructions included in the program code may be used to execute the method described in the foregoing method embodiments, and specific implementation may refer to the method embodiments, and will not be described herein again. The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium.
Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, an electronic device, or a network device) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (11)

1. A method for cleaning mirror image data, which is characterized by comprising the following steps:
monitoring the storage space occupation amount of the mirror image data in the physical server; the mirror image data is operating system resource data of the virtual cloud server;
and if the occupied storage space of the mirror image data reaches a preset occupied storage space threshold, sending a data cleaning instruction to the physical server so as to clean at least one part of mirror image data in the physical server through the physical server.
2. The method of claim 1, further comprising:
if the occupation amount of the storage space of the mirror image data reaches a preset occupation amount threshold value, sending alarm information to a specified object; the alarm information is used for indicating that: the occupied storage space of the mirror image data in the physical server reaches a preset occupied amount threshold, and at least a part of the mirror image data in the physical server is to be cleaned.
3. The method of claim 1, wherein if the occupancy amount of the storage space of the mirror data reaches a preset occupancy amount threshold, sending a data cleaning instruction to the physical server to clean at least a part of the mirror data in the physical server through the physical server, and after the step of:
and if the cleaning completion information returned by the physical server is received, sending a cleaning success message and the current storage space occupation amount of the mirror image data in the physical server to the specified object.
4. A method for cleaning mirror image data, which is characterized by comprising the following steps:
if a data cleaning instruction is received, inquiring mirror image data used by the currently running virtual cloud server and mirror image data stored in a preset storage space; the data clearing instruction is sent when a preset monitoring device monitors that the occupancy of the storage space reaches a preset occupancy threshold; the mirror image data is operating system resource data of the virtual cloud server;
determining data to be cleaned based on the mirror image data used by the currently running virtual cloud server and the mirror image data stored in the storage space;
and deleting the determined data to be cleaned.
5. The method of claim 4, wherein the mirrored data stored in the storage space comprises: mirror image data in a mirror image using list stored under the specified path address;
the step of querying the mirror image data used by the currently running virtual cloud server and the mirror image data stored in the preset storage space includes:
calling a preset interface, and inquiring mirror image data used by a currently running virtual cloud server;
and inquiring a mirror image using list under the specified path address, and determining mirror image data in the mirror image using list as the mirror image data stored in the storage space.
6. The method of claim 4, wherein the mirrored data stored in the storage space comprises: mirror image data used by the virtual cloud server running at the historical moment and mirror image data used by the virtual cloud server running at the present moment;
the step of determining data to be cleaned based on the mirror image data used by the currently running virtual cloud server and the mirror image data stored in the storage space includes:
and determining mirror image data except the mirror image data used by the currently running virtual cloud server from the mirror image data stored in the storage space as the data to be cleaned.
7. The method of claim 4, wherein after the step of deleting the determined data to be cleaned, the method further comprises:
and sending cleaning completion information to the preset monitoring equipment so as to send a successful cleaning message and the current occupied amount of the storage space to the specified object through the preset monitoring equipment.
8. An apparatus for cleaning mirrored data, the apparatus comprising:
the occupancy monitoring module is used for monitoring the occupancy of the storage space of the mirror image data in the physical server; the mirror image data is operating system resource data of the virtual cloud server;
and the instruction sending module is used for sending a data cleaning instruction to the physical server to clean at least part of the mirror image data in the physical server through the physical server if the occupied amount of the storage space of the mirror image data reaches a preset occupied amount threshold value.
9. An apparatus for cleaning mirrored data, the apparatus comprising:
the instruction receiving module is used for inquiring mirror image data used by the currently running virtual cloud server and mirror image data stored in a preset storage space if a data cleaning instruction is received; the data clearing instruction is sent when a preset monitoring device monitors that the occupancy of the storage space reaches a preset occupancy threshold; the mirror image data is operating system resource data of the virtual cloud server;
the to-be-cleaned data determining module is used for determining to-be-cleaned data based on the mirror image data used by the currently running virtual cloud server and the mirror image data stored in the storage space;
and the data cleaning module is used for deleting the determined data to be cleaned.
10. An electronic device comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executing the machine executable instructions to implement the method of cleaning mirrored data as claimed in any one of claims 1 to 7.
11. A machine-readable storage medium having stored thereon machine-executable instructions which, when invoked and executed by a processor, cause the processor to implement the method of cleaning mirrored data of any one of claims 1 to 7.
CN202010874494.1A 2020-08-26 2020-08-26 Method and device for cleaning mirror image data and electronic equipment Pending CN112015698A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010874494.1A CN112015698A (en) 2020-08-26 2020-08-26 Method and device for cleaning mirror image data and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010874494.1A CN112015698A (en) 2020-08-26 2020-08-26 Method and device for cleaning mirror image data and electronic equipment

Publications (1)

Publication Number Publication Date
CN112015698A true CN112015698A (en) 2020-12-01

Family

ID=73502547

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010874494.1A Pending CN112015698A (en) 2020-08-26 2020-08-26 Method and device for cleaning mirror image data and electronic equipment

Country Status (1)

Country Link
CN (1) CN112015698A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116842001A (en) * 2023-08-29 2023-10-03 合肥中科类脑智能技术有限公司 Mirror image data cleaning method and device, electronic equipment and artificial intelligent platform

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102637174A (en) * 2011-02-11 2012-08-15 鸿富锦精密工业(深圳)有限公司 Mirror image file management system and mirror image file management method
CN104035769A (en) * 2014-05-30 2014-09-10 北京金山安全软件有限公司 Processing method and device for space shortage
CN106603725A (en) * 2017-02-03 2017-04-26 济南浪潮高新科技投资发展有限公司 Implementation method for enterprise cloud service virtual mirror image management service
WO2017181830A1 (en) * 2016-04-19 2017-10-26 中兴通讯股份有限公司 Synchronous capacity enlargement method and device for server, and storage medium
CN107544755A (en) * 2017-08-02 2018-01-05 新华三云计算技术有限公司 The control method and device of a kind of reading and writing data
CN107678698A (en) * 2017-10-31 2018-02-09 努比亚技术有限公司 Data cached method for cleaning, server, terminal and computer-readable recording medium
CN108205481A (en) * 2016-12-19 2018-06-26 华为技术有限公司 The container instance creation method and device of application
CN108429768A (en) * 2018-05-29 2018-08-21 新华三云计算技术有限公司 Cloud data analysis service manages system, method and cloud server
CN109343859A (en) * 2018-08-17 2019-02-15 咪咕文化科技有限公司 Information processing method, device and storage medium
CN111090546A (en) * 2019-12-13 2020-05-01 苏州浪潮智能科技有限公司 Method, device and equipment for restarting operating system and readable storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102637174A (en) * 2011-02-11 2012-08-15 鸿富锦精密工业(深圳)有限公司 Mirror image file management system and mirror image file management method
CN104035769A (en) * 2014-05-30 2014-09-10 北京金山安全软件有限公司 Processing method and device for space shortage
WO2017181830A1 (en) * 2016-04-19 2017-10-26 中兴通讯股份有限公司 Synchronous capacity enlargement method and device for server, and storage medium
CN108205481A (en) * 2016-12-19 2018-06-26 华为技术有限公司 The container instance creation method and device of application
CN106603725A (en) * 2017-02-03 2017-04-26 济南浪潮高新科技投资发展有限公司 Implementation method for enterprise cloud service virtual mirror image management service
CN107544755A (en) * 2017-08-02 2018-01-05 新华三云计算技术有限公司 The control method and device of a kind of reading and writing data
CN107678698A (en) * 2017-10-31 2018-02-09 努比亚技术有限公司 Data cached method for cleaning, server, terminal and computer-readable recording medium
CN108429768A (en) * 2018-05-29 2018-08-21 新华三云计算技术有限公司 Cloud data analysis service manages system, method and cloud server
CN109343859A (en) * 2018-08-17 2019-02-15 咪咕文化科技有限公司 Information processing method, device and storage medium
CN111090546A (en) * 2019-12-13 2020-05-01 苏州浪潮智能科技有限公司 Method, device and equipment for restarting operating system and readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
杜小月;: "云计算中服务器虚拟化技术的研究", 技术与市场, no. 03, 15 March 2020 (2020-03-15) *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116842001A (en) * 2023-08-29 2023-10-03 合肥中科类脑智能技术有限公司 Mirror image data cleaning method and device, electronic equipment and artificial intelligent platform

Similar Documents

Publication Publication Date Title
CN111464355A (en) Method and device for controlling expansion capacity of Kubernetes container cluster and network equipment
CN105991458B (en) Load balancing method and load balancing device
CN109788068B (en) Heartbeat state information reporting method, device and equipment and computer storage medium
CN113067875B (en) Access method, device and equipment based on dynamic flow control of micro-service gateway
CN111625841B (en) Virus processing method, device and equipment
CN112165517B (en) Return source detection method and device, storage medium and electronic equipment
EP3522449A1 (en) Service state transition method and device
CN103401764A (en) Method and device for sending mails
CN108111346B (en) Method and device for determining frequent item set in alarm correlation analysis and storage medium
US9641595B2 (en) System management apparatus, system management method, and storage medium
CN112015698A (en) Method and device for cleaning mirror image data and electronic equipment
CN114363334B (en) Cloud system, network configuration method, device and equipment of cloud desktop virtual machine
CN114884840A (en) Application health state checking method and electronic equipment
CN113076112A (en) Database deployment method and device and electronic equipment
CN108460042B (en) Page display method, related equipment and system
CN113423120A (en) Data distribution processing method and device based on private network terminal and electronic equipment
CN111737060A (en) Method and device for processing component exception and electronic equipment
CN108228272B (en) WEB container generation processing method, equipment and server
CN111586171A (en) Server operation method and device, electronic equipment and storage medium
CN109286532B (en) Management method and device for alarm information in cloud computing system
CN113435368B (en) Identification method and device of monitoring data, storage medium and electronic device
CN105975359A (en) Method and device for data cleaning of server and server
CN111177196B (en) Time window aggregation calculation method and device
CN114662102A (en) File processing method and device and storage medium
CN110837431A (en) Service control method, service control device, computer equipment and computer-readable storage medium

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