CN109189770B - Space release method and system for storage medium - Google Patents

Space release method and system for storage medium Download PDF

Info

Publication number
CN109189770B
CN109189770B CN201810925085.2A CN201810925085A CN109189770B CN 109189770 B CN109189770 B CN 109189770B CN 201810925085 A CN201810925085 A CN 201810925085A CN 109189770 B CN109189770 B CN 109189770B
Authority
CN
China
Prior art keywords
storage
data
backup
piece
space
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810925085.2A
Other languages
Chinese (zh)
Other versions
CN109189770A (en
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.)
Sichuan Hongmei Intelligent Technology Co Ltd
Original Assignee
Sichuan Hongmei Intelligent 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 Sichuan Hongmei Intelligent Technology Co Ltd filed Critical Sichuan Hongmei Intelligent Technology Co Ltd
Priority to CN201810925085.2A priority Critical patent/CN109189770B/en
Publication of CN109189770A publication Critical patent/CN109189770A/en
Application granted granted Critical
Publication of CN109189770B publication Critical patent/CN109189770B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a method and a system for releasing a storage space, wherein the method comprises the following steps: acquiring attribute information corresponding to a storage database by using backup storage equipment; the storage database comprises a data space with a first data capacity, and at least one piece of picture data with a second data capacity is stored in the data space; the second data capacity is not greater than the first data capacity; the backup storage device establishes communication connection with the storage database according to the attribute information; storing the at least one piece of picture data in the storage database to the backup storage device by using the established communication connection; releasing the data space of a first data capacity in the storage database; constructing a target data space of a second data capacity corresponding to the at least one piece of picture data; and storing the at least one piece of picture data to the target data space. The scheme reduces the resource occupancy rate of the server.

Description

Space release method and system for storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and a system for releasing a space of a storage medium.
Background
Along with the rapid development of the internet of things, the intellectualization of the household appliances is more and more popularized. The intelligent household appliance can store real-time information such as the working state of the intelligent household appliance, so that a user can know the information of the intelligent household appliance at any time through a mobile phone or an electronic screen.
In order to store the real-time information of the intelligent household appliance, the background server is generally provided with a fixed storage partition, such as a MongoDB database. The MongoDB database has larger storage space so as to ensure that the picture data of the intelligent household electrical appliance can be stored in time.
However, after deleting the picture data in the MongoDB database, the server resources occupied by the MongoDB database are not reduced. For example, the total data space of the background server is 100G, and the preset data space of the MongoDB database is 50G, even if only 1G of real-time data is stored in the MongoDB database, the real-time data still occupies the 50G resources of the background server. Therefore, the MongoDB database occupies more server resources.
Disclosure of Invention
The embodiment of the invention provides a space release method and a space release system for a storage medium, which can reduce server resources occupied by a storage database.
In a first aspect, an embodiment of the present invention provides a method for releasing a storage space, including:
acquiring attribute information corresponding to a storage database by using backup storage equipment; the storage database comprises a data space with a first data capacity, and at least one piece of picture data with a second data capacity is stored in the data space; the second data capacity is not greater than the first data capacity;
the backup storage device establishes communication connection with the storage database according to the attribute information;
storing the at least one piece of picture data in the storage database to the backup storage device by using the established communication connection;
releasing the data space of a first data capacity in the storage database;
constructing a target data space of a second data capacity corresponding to the at least one piece of picture data;
and storing the at least one piece of picture data to the target data space.
Alternatively,
the storing of the at least one piece of picture data of the second data capacity in the data space comprises:
at least one storage folder is arranged in the data space; each storage folder corresponds to an intelligent household appliance;
respectively storing the at least one piece of picture data in the corresponding storage folders according to the intelligent household appliance to which each piece of picture data belongs;
the storing the at least one piece of picture data in the storage database to the backup storage device by using the established communication connection includes:
acquiring each storage folder from the storage database by using the backup storage device according to the communication connection;
and forming corresponding backup storage data in the backup storage device according to the acquired storage folder.
Alternatively,
after the obtaining, by the backup storage device, each storage folder from the storage database according to the communication connection, and before the releasing the data space with the first data capacity in the storage database, further includes:
determining the total number of first files corresponding to each storage folder in a storage database and the size of each file corresponding to each storage folder;
determining the total number of second files corresponding to backup folders in the backup storage data and the size of each file corresponding to the backup folder;
according to the total number of the first files, the total number of the second files and the file sizes corresponding to the storage folders and the backup folders respectively, carrying out accuracy verification on the backup storage data;
when the verification passes, performing the freeing of the data space of the first data capacity in the storage database.
Alternatively,
the verifying the accuracy of the backup storage data according to the total number of the first files, the total number of the second files, and the file sizes corresponding to the storage folders and the backup folders, respectively, includes:
determining whether the total number of the first files is equal to the total number of the second files, if so, calculating the accuracy of the backup storage data according to the file size of each storage folder and the file size of the corresponding backup folder by using the following calculation formula;
when the accuracy is smaller than a preset threshold value, determining that the backup storage data passes accuracy verification;
Figure BDA0001765164960000031
wherein y characterizes the accuracy, xiCharacterizing a file size, x, of an ith one of the storage foldersjThe file size of a backup folder corresponding to the ith storage folder is represented, n represents the total number of the first files, and a is a preset constant.
Alternatively,
the storing the at least one piece of picture data to the target data space includes:
transmitting the at least one piece of picture data into the target data space through a scp transmission instruction;
and carrying out accuracy verification on the at least one piece of picture data, storing the at least one piece of picture data when the verification is passed, and otherwise, deleting the at least one piece of picture data and executing the scp transmission instruction to transmit the at least one piece of picture data to the target data space.
In a second aspect, an embodiment of the present invention provides a storage space releasing system, including: the system comprises a backup storage device, a storage database and a processing module; wherein the content of the first and second substances,
the storage database comprises a data space with a first data capacity, and at least one piece of picture data with a second data capacity is stored in the data space; the second data capacity is not greater than the first data capacity;
the backup storage device is used for acquiring the attribute information corresponding to the storage database; establishing communication connection with the storage database according to the attribute information; acquiring the at least one piece of picture data from the storage database by using the communication connection, and storing the at least one piece of picture data;
the processing module is used for releasing the data space with the first data capacity in the storage database; constructing a target data space of a second data capacity corresponding to the at least one piece of picture data; and storing the at least one piece of picture data to the target data space.
Alternatively,
at least one storage folder is arranged in the data space of the storage database; each storage folder corresponds to an intelligent household appliance;
the storage database is used for respectively storing the at least one piece of picture data into the corresponding storage folders according to the intelligent household appliance to which each piece of picture data belongs;
the backup storage device is used for acquiring each storage folder from the storage database according to the communication connection; and forming corresponding backup storage data according to the acquired storage folder.
Alternatively,
the backup storage device is further configured to determine a total number of first files corresponding to each storage folder in a storage database, and a file size corresponding to each storage folder; determining the total number of second files corresponding to backup folders in the backup storage data and the size of each file corresponding to the backup folder; and according to the total number of the first files, the total number of the second files and the file sizes respectively corresponding to the storage folders and the backup folders, carrying out accuracy verification on the backup storage data, and triggering the processing module when the verification is passed.
Alternatively,
the backup storage device is used for determining whether the total number of the first files is equal to the total number of the second files, and if so, calculating the accuracy of the backup storage data according to the file size of each storage folder and the file size of the corresponding backup folder by using the following calculation formula; when the accuracy is smaller than a preset threshold value, determining that the backup storage data passes accuracy verification;
Figure BDA0001765164960000051
wherein y characterizes the accuracy, xiCharacterizing a file size, x, of an ith one of the storage foldersjThe file size of a backup folder corresponding to the ith storage folder is represented, n represents the total number of the first files, and a is a preset constant.
Alternatively,
the processing module is used for transmitting the at least one piece of picture data to the target data space through an scp transmission instruction; and carrying out accuracy verification on the at least one piece of picture data, storing the at least one piece of picture data when the verification is passed, and otherwise, deleting the at least one piece of picture data and executing the scp transmission instruction to transmit the at least one piece of picture data to the target data space.
The embodiment of the invention provides a space release method and a space release system for a storage medium. And then, the established communication connection is utilized to acquire the picture data in the storage database so as to backup the picture data. And then releasing the data space with the first data capacity in the storage database, reconstructing a target data space with a second data capacity corresponding to the picture data, and storing the picture data backed up in the backup storage device into the target data space. Because the constructed target data space corresponds to the data capacity of the picture data, the resources occupied by the target data space are the resources actually occupied by the picture data, and the data space which is divided into the storage database in advance but does not store the picture data is released, so that the occupancy rate of server resources is reduced.
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 introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart of a method for releasing a storage space according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for releasing a storage space according to another embodiment of the present invention;
fig. 3 is a schematic structural diagram of a storage space releasing system 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 and more complete, the technical solutions in the embodiments of the present invention will be 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, and based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts belong to the scope of the present invention.
As shown in fig. 1, an embodiment of the present invention provides … …, the method may include the steps of:
as shown in fig. 1, an embodiment of the present invention provides a storage space releasing method, which may include the following steps:
step 101: acquiring attribute information corresponding to a storage database by using backup storage equipment; the storage database comprises a data space with a first data capacity, and at least one piece of picture data with a second data capacity is stored in the data space; the second data capacity is not greater than the first data capacity;
step 102: the backup storage device establishes communication connection with the storage database according to the attribute information;
step 103: storing the at least one piece of picture data in the storage database to the backup storage device by using the established communication connection;
step 104: releasing the data space of a first data capacity in the storage database;
step 105: constructing a target data space of a second data capacity corresponding to the at least one piece of picture data;
step 106: and storing the at least one piece of picture data to the target data space.
In the above embodiment, the backup storage device establishes a communication connection with the storage database by acquiring the attribute information of the storage database. And then, the established communication connection is utilized to acquire the picture data in the storage database so as to backup the picture data. And then releasing the data space with the first data capacity in the storage database, reconstructing a target data space with a second data capacity corresponding to the picture data, and storing the picture data backed up in the backup storage device into the target data space. Because the constructed target data space corresponds to the data capacity of the picture data, the resources occupied by the target data space are the resources actually occupied by the picture data, and the data space which is divided into the storage database in advance but does not store the picture data is released, so that the occupancy rate of server resources is reduced.
In an embodiment of the present invention, the storing at least one piece of picture data with a second data capacity in the data space includes:
at least one storage folder is arranged in the data space; each storage folder corresponds to an intelligent household appliance;
respectively storing the at least one piece of picture data in the corresponding storage folders according to the intelligent household appliance to which each piece of picture data belongs;
specific embodiments of step 103 may include:
acquiring each storage folder from the storage database by using the backup storage device according to the communication connection;
and forming corresponding backup storage data in the backup storage device according to the acquired storage folder.
For example, the intelligent refrigerator can automatically take pictures of food in the refrigerator when the door is opened and closed every time, so that the pictures can be analyzed through an intelligent recognition technology at a later stage, and corresponding recipe recommendation can be provided according to the food in the refrigerator. Photos taken by intelligent refrigerators of different users are stored in different storage folders in a background server. For example, a photo of the smart refrigerator a is stored in the storage folder a, and a photo of the smart refrigerator B is stored in the storage folder B. After the backup storage device establishes communication connection with the storage database, the backup storage device acquires each storage folder from the storage database to acquire the picture data stored in the storage folder, and stores the picture data in the backup storage device to form backup storage data. The storage folders are used for storing the picture data of different intelligent household appliances respectively, so that the management of the picture data of different intelligent household appliances is facilitated.
In an embodiment of the present invention, after the obtaining, by using the backup storage device, each storage folder from the storage database according to the communication connection, before step 104, the method may further include:
determining the total number of first files corresponding to each storage folder in a storage database and the size of each file corresponding to each storage folder;
determining the total number of second files corresponding to backup folders in the backup storage data and the size of each file corresponding to the backup folder;
according to the total number of the first files, the total number of the second files and the file sizes corresponding to the storage folders and the backup folders respectively, carrying out accuracy verification on the backup storage data;
when the verification passes, performing the freeing of the data space of the first data capacity in the storage database.
Specifically, the verifying the accuracy of the backup storage data according to the total number of the first files, the total number of the second files, and the file sizes corresponding to the storage folders and the backup folders, respectively, includes:
determining whether the total number of the first files is equal to the total number of the second files, if so, calculating the accuracy of the backup storage data according to the file size of each storage folder and the file size of the corresponding backup folder by using the following calculation formula;
when the accuracy is smaller than a preset threshold value, determining that the backup storage data passes accuracy verification;
Figure BDA0001765164960000081
wherein y represents the accuracy, x _ i represents the file size of the ith storage folder, x _ j represents the file size of the backup folder corresponding to the ith storage folder, n represents the total number of the first files, and a is a preset constant.
Since the process of releasing the data space in the storage database deletes the picture data stored in the data space, the picture data is verified before the data space is released in order to ensure the integrity and accuracy of the picture data. Specifically, the number of the backup folders in the backup storage file is determined to be the same as the number of the storage folders by determining the number of the storage folders and the size of each storage folder, and the determination that the sizes of the corresponding folders are the same indicates that the backup storage data passes the accuracy check, at this time, the picture data in the storage database can be deleted, that is, the data space of the storage database is released.
In an embodiment of the present invention, the detailed implementation of step 106 may include:
transmitting the at least one piece of picture data into the target data space through a scp transmission instruction;
and carrying out accuracy verification on the at least one piece of picture data, storing the at least one piece of picture data when the verification is passed, and otherwise, deleting the at least one piece of picture data and executing the scp transmission instruction to transmit the at least one piece of picture data to the target data space.
Taking the storage database as the MongoDB database as an example, if the MongoDB database is set in the server A, releasing the on-line storage database is to delete the MongoDB database. And then, the picture data in the backup storage device needs to be uploaded to the server A again, and the server has difficulty in directly accessing the local backup storage device, so that the picture data is transmitted by adopting the scp, and specific commands can be scp-i// media/mongo _ back// new-P-r/media/mongo _ back/mongo DBback/imgDb root @. The MongoDB database corresponding to the data capacity of the picture data can be reconstructed in the server A, the target data space of the reconstructed MongoDB database is the second data capacity, at the moment, the picture data is reintroduced into the MongoDB database, the number of files corresponding to the picture data and the size of each file are checked to be correct, if yes, the picture data is successfully reintroduced, and if not, the picture data is retransmitted from the backup storage device. Therefore, the accuracy of the imported picture data can be ensured, and errors such as data error loss in the storage space releasing process are avoided.
The storage space releasing method provided by the embodiment of the present invention is described in detail below by taking an example in which a storage database MongoDB database is provided on a server a, and as shown in fig. 2, the method may include the following steps:
step 201: installing a MongoDB program on the backup storage device, constructing a local MongoDB library on the backup storage device according to the MongoDB program, and defining a backup catalog under the MongoDB program installation catalog.
The backup storage device may be a local server, a mobile hard disk, or both. Since the picture data stored in the MongoDB database is in the MongoDB format, installing the MongoDB program on the backup storage device can facilitate viewing and using the picture data on the backup storage device.
Step 202: the backup storage device acquires the attribute information of the server A, and establishes communication connection with the server A by using the attribute information.
For example, the backup storage device may establish a communication connection with the server a by acquiring attribute information such as an IP address or a port number of the server a.
Step 203: and the backup storage equipment is connected with the MongoDB database in the server A according to the established communication connection, acquires at least one piece of picture data in the MongoDB database, and stores the acquired picture data in a backup directory.
The specific command of the step can be mongodump-h. multidot. multidot. -. portport-d imgddb-o/media/mongo _ back/mongo dbback. Here, imgDb is the MongoDB database in the server a, and mongoddbback is the local data reading directory set in step 201, and the backed-up file will exist in this directory.
Step 204: and restoring the picture data under the backup catalog to a local MongoDB library, and determining the number and the size of files corresponding to the picture data in the local MongoDB library.
The process of restoring the picture data under the backup catalog to the local MongoDB library can be realized by the following commands: mongorestore-port 9999/media/mongo _ back/MongoDBback.
Step 205: deleting the MongoDB database in the server A when the number and the size of the files in the local MongoDB database are the same as those of the MongoDB database in the server A.
Step 206: and restoring the picture data in the backup storage device to the server A, reconstructing a target MongoDB database corresponding to the data capacity of the picture data in the server A, and importing the picture data into the target MongoDB database.
Since server a cannot directly access the local server content, the scp direct transfer is used, and the/mongorestore command cannot be used. The specific command may be: scp-i// media/mongo _ back/. times.times.new-P. times.r/media/mongo _ back/MongoDBback/imgDb root.
In the embodiment, based on the fact that the MongoDB database cannot release the storage space after deleting the data, the operation of backing up the data in the local server and initializing the online database is adopted. Meanwhile, the local backup data is migrated to the online server, so that the space release and data restoration operation of the target database are realized. The problem that the storage medium of the MongoDB database effectively releases space after deleting data is solved, the storage space of a server is saved, the operation and maintenance cost is reduced, and meanwhile, the data is effectively backed up.
As shown in fig. 3, an embodiment of the present invention provides a storage space releasing system, including: a backup storage device 301, a storage database 302, and a processing module 303; wherein the content of the first and second substances,
the storage database 302 comprises a data space with a first data capacity, and at least one piece of picture data with a second data capacity is stored in the data space; the second data capacity is not greater than the first data capacity;
the backup storage device 301 is configured to obtain attribute information corresponding to the storage database 302; establishing communication connection with the storage database 302 according to the attribute information; acquiring the at least one piece of picture data from the storage database 302 by using the communication connection, and storing the at least one piece of picture data;
the processing module 303, configured to release the data space of the first data capacity in the storage database 302; constructing a target data space of a second data capacity corresponding to the at least one piece of picture data; and storing the at least one piece of picture data to the target data space.
In an embodiment of the present invention, at least one storage folder is disposed in the data space of the storage database 302; each storage folder corresponds to an intelligent household appliance;
the storage database 302 is configured to store the at least one piece of picture data in the corresponding storage folders according to the intelligent appliance to which each piece of picture data belongs;
the backup storage device 301 is configured to obtain each storage folder from the storage database 302 according to the communication connection; and forming corresponding backup storage data according to the acquired storage folder.
In an embodiment of the present invention, the backup storage device 301 is further configured to determine a total number of first files corresponding to each storage folder in the storage database 302, and a size of each file corresponding to each storage folder; determining the total number of second files corresponding to backup folders in the backup storage data and the size of each file corresponding to the backup folder; and according to the total number of the first files, the total number of the second files, and the file sizes corresponding to the storage folders and the backup folders, performing accuracy verification on the backup storage data, and when the verification passes, triggering the processing module 303.
In an embodiment of the present invention, the backup storage device 301 is configured to determine whether the total number of the first files is equal to the total number of the second files, and if so, calculate an accuracy of the backup storage data according to a file size of each storage folder and a file size of a corresponding backup folder by using the following calculation formula; when the accuracy is smaller than a preset threshold value, determining that the backup storage data passes accuracy verification;
Figure BDA0001765164960000121
wherein y characterizes the accuracy, xiCharacterizing a file size, x, of an ith one of the storage foldersjThe file size of a backup folder corresponding to the ith storage folder is represented, n represents the total number of the first files, and a is a preset constant.
In an embodiment of the present invention, the processing module 303 is configured to transmit the at least one piece of picture data into the target data space through a scp transmission instruction; and carrying out accuracy verification on the at least one piece of picture data, storing the at least one piece of picture data when the verification is passed, and otherwise, deleting the at least one piece of picture data and executing the scp transmission instruction to transmit the at least one piece of picture data to the target data space.
Because the information interaction, execution process, and other contents between the units in the device are based on the same concept as the method embodiment of the present invention, specific contents may refer to the description in the method embodiment of the present invention, and are not described herein again.
Embodiments of the present invention provide a readable medium, which includes an execution instruction, and when a processor of a storage controller executes the execution instruction, the storage controller executes a method provided in any one of the above embodiments of the present invention.
An embodiment of the present invention provides a storage controller, including: a processor, a memory, and a bus; the memory is used for storing execution instructions, the processor is connected with the memory through the bus, and when the storage controller runs, the processor executes the execution instructions stored in the memory, so that the storage controller executes the method provided by any one of the above embodiments of the invention.
In summary, the above embodiments of the present invention have at least the following advantages:
1. in the embodiment of the invention, the backup storage device establishes communication connection with the storage database by acquiring the attribute information of the storage database. And then, the established communication connection is utilized to acquire the picture data in the storage database so as to backup the picture data. And then releasing the data space with the first data capacity in the storage database, reconstructing a target data space with a second data capacity corresponding to the picture data, and storing the picture data backed up in the backup storage device into the target data space. Because the constructed target data space corresponds to the data capacity of the picture data, the resources occupied by the target data space are the resources actually occupied by the picture data, and the data space which is divided into the storage database in advance but does not store the picture data is released, so that the occupancy rate of server resources is reduced.
2. In the embodiment of the invention, the number of the storage folders and the size of each storage folder are determined, whether the number of the backup folders in the backup storage file is the same as the number of the storage folders is determined, whether the sizes of the corresponding folders are the same is determined, if the numbers of the backup folders are the same, the backup storage data pass accuracy verification, and at the moment, the picture data in the storage database is deleted, namely, the data space of the storage database is released, so that the completeness and the accuracy of the picture data are favorably ensured.
3. In the embodiment of the invention, the storage space can not be released after the data is deleted based on the MongoDB database, so that the backup is carried out on a local server, and the online database is initialized. And then, migrating the local backup data to an online server to realize space release and data restoration operation of the target database. The problem that the storage medium of the MongoDB database effectively releases space after deleting data is solved, the storage space of a server is saved, the operation and maintenance cost is reduced, and meanwhile, the data is effectively backed up.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a" does not exclude the presence of other similar elements in a process, method, article, or apparatus that comprises the element.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it is to be noted that: the above description is only a preferred embodiment of the present invention, and is only used to illustrate the technical solutions of the present invention, and not to limit the protection scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (8)

1. A method for freeing storage space, comprising:
acquiring attribute information corresponding to a storage database by using backup storage equipment; the storage database comprises a data space with a first data capacity, and at least one piece of picture data with a second data capacity is stored in the data space; the second data capacity is not greater than the first data capacity;
the backup storage device establishes communication connection with the storage database according to the attribute information;
storing the at least one piece of picture data in the storage database to the backup storage device by using the established communication connection;
releasing the data space of a first data capacity in the storage database;
constructing a target data space of a second data capacity corresponding to the at least one piece of picture data;
storing the at least one piece of picture data to the target data space;
wherein the storing the at least one piece of picture data to the target data space comprises:
transmitting the at least one piece of picture data into the target data space through a scp transmission instruction;
and carrying out accuracy verification on the at least one piece of picture data, storing the at least one piece of picture data when the verification is passed, and otherwise, deleting the at least one piece of picture data and re-executing the scp transmission instruction to transmit the at least one piece of picture data to the target data space.
2. The method of claim 1,
the storing of the at least one piece of picture data of the second data capacity in the data space comprises:
at least one storage folder is arranged in the data space; each storage folder corresponds to an intelligent household appliance;
respectively storing the at least one piece of picture data in the corresponding storage folders according to the intelligent household appliance to which each piece of picture data belongs;
the storing the at least one piece of picture data in the storage database to the backup storage device by using the established communication connection includes:
acquiring each storage folder from the storage database by using the backup storage device according to the communication connection;
and forming corresponding backup storage data in the backup storage device according to the acquired storage folder.
3. The method of claim 2,
after the obtaining, by the backup storage device, each storage folder from the storage database according to the communication connection, and before the releasing the data space with the first data capacity in the storage database, further includes:
determining the total number of first files corresponding to each storage folder in a storage database and the size of each file corresponding to each storage folder;
determining the total number of second files corresponding to backup folders in the backup storage data and the size of each file corresponding to the backup folder;
according to the total number of the first files, the total number of the second files and the file sizes corresponding to the storage folders and the backup folders respectively, carrying out accuracy verification on the backup storage data;
when the verification passes, performing the freeing of the data space of the first data capacity in the storage database.
4. The method of claim 3,
the verifying the accuracy of the backup storage data according to the total number of the first files, the total number of the second files, and the file sizes corresponding to the storage folders and the backup folders, respectively, includes:
determining whether the total number of the first files is equal to the total number of the second files, if so, calculating the accuracy of the backup storage data according to the file size of each storage folder and the file size of the corresponding backup folder by using the following calculation formula;
when the accuracy is smaller than a preset threshold value, determining that the backup storage data passes accuracy verification;
Figure FDA0002841729610000021
wherein y characterizes the accuracy, xiCharacterizing a file size, x, of an ith one of the storage foldersjThe file size of a backup folder corresponding to the ith storage folder is represented, n represents the total number of the first files, and a is a preset constant.
5. A storage space releasing system, comprising: the system comprises a backup storage device, a storage database and a processing module; wherein the content of the first and second substances,
the storage database comprises a data space with a first data capacity, and at least one piece of picture data with a second data capacity is stored in the data space; the second data capacity is not greater than the first data capacity;
the backup storage device is used for acquiring the attribute information corresponding to the storage database; establishing communication connection with the storage database according to the attribute information; acquiring the at least one piece of picture data from the storage database by using the communication connection, and storing the at least one piece of picture data;
the processing module is used for releasing the data space with the first data capacity in the storage database; constructing a target data space of a second data capacity corresponding to the at least one piece of picture data; storing the at least one piece of picture data to the target data space;
the processing module is used for transmitting the at least one piece of picture data into the target data space through a scp transmission instruction; and carrying out accuracy verification on the at least one piece of picture data, storing the at least one piece of picture data when the verification is passed, and otherwise, deleting the at least one piece of picture data and re-executing the scp transmission instruction to transmit the at least one piece of picture data to the target data space.
6. The space release system of claim 5,
at least one storage folder is arranged in the data space of the storage database; each storage folder corresponds to an intelligent household appliance;
the storage database is used for respectively storing the at least one piece of picture data into the corresponding storage folders according to the intelligent household appliance to which each piece of picture data belongs;
the backup storage device is used for acquiring each storage folder from the storage database according to the communication connection; and forming corresponding backup storage data according to the acquired storage folder.
7. The space release system of claim 6,
the backup storage device is further configured to determine a total number of first files corresponding to each storage folder in a storage database, and a file size corresponding to each storage folder; determining the total number of second files corresponding to backup folders in the backup storage data and the size of each file corresponding to the backup folder; and according to the total number of the first files, the total number of the second files and the file sizes respectively corresponding to the storage folders and the backup folders, carrying out accuracy verification on the backup storage data, and triggering the processing module when the verification is passed.
8. The space release system of claim 7,
the backup storage device is used for determining whether the total number of the first files is equal to the total number of the second files, and if so, calculating the accuracy of the backup storage data according to the file size of each storage folder and the file size of the corresponding backup folder by using the following calculation formula; when the accuracy is smaller than a preset threshold value, determining that the backup storage data passes accuracy verification;
Figure FDA0002841729610000041
wherein y characterizes the accuracy, xiCharacterizing a file size, x, of an ith one of the storage foldersjThe file size of a backup folder corresponding to the ith storage folder is represented, n represents the total number of the first files, and a is a preset constant.
CN201810925085.2A 2018-08-14 2018-08-14 Space release method and system for storage medium Active CN109189770B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810925085.2A CN109189770B (en) 2018-08-14 2018-08-14 Space release method and system for storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810925085.2A CN109189770B (en) 2018-08-14 2018-08-14 Space release method and system for storage medium

Publications (2)

Publication Number Publication Date
CN109189770A CN109189770A (en) 2019-01-11
CN109189770B true CN109189770B (en) 2021-03-30

Family

ID=64921776

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810925085.2A Active CN109189770B (en) 2018-08-14 2018-08-14 Space release method and system for storage medium

Country Status (1)

Country Link
CN (1) CN109189770B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106776846A (en) * 2016-11-28 2017-05-31 桂林远望智能通信科技有限公司 A kind of method and system for discharging database space

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4683546B2 (en) * 2005-07-15 2011-05-18 国立大学法人 東京大学 Database reorganization method and database reorganization system
US8856187B2 (en) * 2008-02-07 2014-10-07 International Business Machines Corporation Data management for data aggregation

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106776846A (en) * 2016-11-28 2017-05-31 桂林远望智能通信科技有限公司 A kind of method and system for discharging database space

Also Published As

Publication number Publication date
CN109189770A (en) 2019-01-11

Similar Documents

Publication Publication Date Title
EP3030966B1 (en) Virtual computing instance migration
US10019180B1 (en) Snapshot data operation request processing
US9471610B1 (en) Scale-out of data that supports roll back
RU2598991C2 (en) Data recovery client for moveable client data
CN111901294A (en) Method for constructing online machine learning project and machine learning system
US20210133040A1 (en) System and method for indexing image backups
CN104246767A (en) Telemetry system for a cloud synchronization system
US9971563B2 (en) Systems and methods for low interference logging and diagnostics
US10467424B2 (en) File system content based security
US10620866B1 (en) Representation-based partitioning of distributed computing environments
US20170366697A1 (en) Suggesting image files for deletion based on image file parameters
US11494403B2 (en) Method and apparatus for storing off-chain data
CN107580032B (en) Data processing method, device and equipment
WO2018067415A1 (en) Automatically uploading image files based on image capture context
US20160205183A1 (en) Method and aparatus for backing up data and electronic device
US10503713B1 (en) Criterion-based retention of data object versions
CN114138549A (en) Data backup and recovery method based on kubernets system
CN108459910A (en) A kind of method and apparatus for deleting resource
US10289493B1 (en) Data snapshot analysis systems and techniques
US10481983B1 (en) Snapshot clustering techniques for multipart volumes
CN114328029A (en) Backup method and device of application resources, electronic equipment and storage medium
CN109726039B (en) Method and apparatus for managing virtual machines
CN109189770B (en) Space release method and system for storage medium
CN109522177A (en) A kind of task daily record processing system, method and device
CN112286457A (en) Object deduplication method and device, electronic equipment and machine-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
GR01 Patent grant
GR01 Patent grant