CN112181938B - Database cleaning method, device and computer readable storage medium - Google Patents

Database cleaning method, device and computer readable storage medium Download PDF

Info

Publication number
CN112181938B
CN112181938B CN201910605673.2A CN201910605673A CN112181938B CN 112181938 B CN112181938 B CN 112181938B CN 201910605673 A CN201910605673 A CN 201910605673A CN 112181938 B CN112181938 B CN 112181938B
Authority
CN
China
Prior art keywords
database
data
threshold value
disk space
space occupied
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
CN201910605673.2A
Other languages
Chinese (zh)
Other versions
CN112181938A (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.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201910605673.2A priority Critical patent/CN112181938B/en
Publication of CN112181938A publication Critical patent/CN112181938A/en
Application granted granted Critical
Publication of CN112181938B publication Critical patent/CN112181938B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/217Database tuning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0674Disk device
    • G06F3/0676Magnetic disk device

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a database cleaning method, a database cleaning device and a computer readable storage medium, and belongs to the technical field of computers. The method comprises the following steps: when the size of the disk space occupied by the database is larger than a first threshold value, if the data volume in the database is larger than or equal to a second threshold value, executing a first cleaning command, wherein the first cleaning command is used for recovering the disk space occupied by invalid data stored in the database; and if the data amount in the database is smaller than the second threshold value, executing a second cleaning command, wherein the second cleaning command is used for releasing the disk space occupied by the failure data stored in the database and the disk space occupied by the database in an idle state. The first cleaning command does not influence the normal use of the database, and the second cleaning command is executed when the data volume in the database is smaller, so that the execution efficiency of the second cleaning command is high, and the great influence on service operation during cleaning the database can be effectively avoided.

Description

Database cleaning method, device and computer readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a database cleaning method, a database cleaning device, and a computer readable storage medium.
Background
A database is a collection of data used to store data, which may generate some stale data during operation. For example, after deleting or updating the data in the database, the data that has been deleted or the data that has been outdated after being updated in the database is not physically deleted from the database, but remains in the database as invalid data. Thus, it is often necessary to clean up the stale data stored in the database so that the disk space that such stale data occupies can be reused.
Currently, when the size of the disk space occupied by the database does not reach a set threshold, a vacuum command is executed to recover the disk space occupied by the failure data stored in the database. When the size of the disk space occupied by the database reaches a set threshold, executing a vacuum full command to release the disk space occupied by the failure data stored in the database and the disk space occupied by the database in an idle state.
However, the vacuum full command is to copy the effective data in the original data table to another new data table, delete the original data table, and replace the original data table with the new data table. In this case, the data in the database is not available and the disk space taken up by the database will double in size when the vacuum full command is executed. At this time, if the execution efficiency of the vacuum full command is low, service interruption is very easy to be caused, and service operation is seriously affected.
Disclosure of Invention
The embodiment of the application provides a database cleaning method, a database cleaning device and a computer readable storage medium, which can solve the problem that the operation of a service is seriously influenced when a database is cleaned in the related technology. The technical scheme is as follows:
in one aspect, a database cleaning method is provided, the method including:
when the size of the disk space occupied by the database is larger than a first threshold value, if the data volume in the database is larger than or equal to a second threshold value, executing a first cleaning command, wherein the first cleaning command is used for recycling the disk space occupied by invalid data stored in the database;
And when the size of the disk space occupied by the database is larger than a first threshold value, if the data volume in the database is smaller than a second threshold value, executing a second cleaning command, wherein the second cleaning command is used for releasing the disk space occupied by the invalid data stored in the database and the disk space occupied by the database in an idle state.
Optionally, the method further comprises:
And executing the first cleaning command when the size of the disk space occupied by the database is smaller than or equal to the first threshold value.
Optionally, the method further comprises:
Receiving a data insertion request, wherein the data insertion request is used for requesting to insert data into the database;
Rejecting the data from being inserted into the database when the size of the disk space occupied by the database is greater than or equal to a third threshold value or when the data amount in the database is greater than or equal to a fourth threshold value;
And when the size of the disk space occupied by the database is smaller than the third threshold value and the data volume in the database is smaller than the fourth threshold value, inserting the data into the database, wherein the third threshold value is larger than the first threshold value, and the fourth threshold value is larger than the second threshold value.
Optionally, the method further comprises:
receiving a task data insertion request, wherein the task data insertion request is used for requesting to insert task data into the database;
When the size of the disk space occupied by the database is larger than or equal to a third threshold value, or when the number of task data in the database is larger than or equal to a fifth threshold value, rejecting the task data from being inserted into the database;
and when the size of the disk space occupied by the database is smaller than the third threshold value and the number of task data in the database is smaller than the fifth threshold value, inserting the task data into the database, wherein the third threshold value is larger than the first threshold value.
Optionally, the method further comprises:
and executing the first cleaning command every a first reference time length.
Optionally, the database stores task data and status data of the task data, and the method further includes:
Pulling the task data from the database;
executing the task data;
And deleting the state data of the task data stored in the database when the task data is executed.
Optionally, the first cleaning command is a vacuum command, and the second cleaning command is a vacuum full command.
In one aspect, a database cleaning apparatus is provided, the apparatus comprising:
The first execution module is used for executing a first cleaning command when the size of the disk space occupied by the database is larger than a first threshold value and if the data volume in the database is larger than or equal to a second threshold value, wherein the first cleaning command is used for recovering the disk space occupied by invalid data stored in the database;
And the second execution module is used for executing a second cleaning command when the size of the disk space occupied by the database is larger than a first threshold value and if the data volume in the database is smaller than a second threshold value, wherein the second cleaning command is used for releasing the disk space occupied by the failure data stored in the database and the disk space occupied by the database and in an idle state.
Optionally, the apparatus further comprises:
And the third execution module is used for executing the first cleaning command when the size of the disk space occupied by the database is smaller than or equal to the first threshold value.
Optionally, the apparatus further comprises:
The first receiving module is used for receiving a data insertion request, wherein the data insertion request is used for requesting to insert data into the database;
The first rejecting module is used for rejecting the data to be inserted into the database when the size of the disk space occupied by the database is larger than or equal to a third threshold value or when the data amount in the database is larger than or equal to a fourth threshold value;
And the first inserting module is used for inserting the data into the database when the size of the disk space occupied by the database is smaller than the third threshold value and the data volume in the database is smaller than the fourth threshold value, wherein the third threshold value is larger than the first threshold value and the fourth threshold value is larger than the second threshold value.
Optionally, the apparatus further comprises:
the second receiving module is used for receiving a task data insertion request, wherein the task data insertion request is used for requesting to insert task data into the database;
The second rejecting module is used for rejecting the task data to be inserted into the database when the size of the disk space occupied by the database is larger than or equal to a third threshold value or when the number of the task data in the database is larger than or equal to a fifth threshold value;
and the second inserting module is used for inserting the task data into the database when the size of the disk space occupied by the database is smaller than the third threshold value and the number of the task data in the database is smaller than the fifth threshold value, and the third threshold value is larger than the first threshold value.
Optionally, the apparatus further comprises:
And the fourth execution module is used for executing the first cleaning command once every a first reference time length.
Optionally, the database stores task data and status data of the task data, and the apparatus further includes:
The pulling module is used for pulling the task data from the database;
A fifth execution module for executing the task data;
And the deleting module is used for deleting the state data of the task data stored in the database when the task data is executed.
Optionally, the first cleaning command is a vacuum command, and the second cleaning command is a vacuum full command.
In one aspect, a database cleaning apparatus is provided, the apparatus comprising:
A processor and a memory;
the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the database cleaning method.
In one aspect, a computer readable storage medium is provided, in which instructions are stored which, when executed, perform the database cleaning method described above.
The technical scheme provided by the embodiment of the application at least has the following beneficial effects:
And when the size of the disk space occupied by the database is larger than a first threshold value, executing a first cleaning command if the data volume in the database is larger than or equal to a second threshold value, wherein the first cleaning command is used for recovering the disk space occupied by the failure data stored in the database. Because the first cleaning command does not affect the normal use of the database, cleaning the database at this time does not affect the operation of the service. And when the size of the disk space occupied by the database is larger than a first threshold value, if the data volume in the database is smaller than a second threshold value, executing a second cleaning command, wherein the second cleaning command is used for releasing the disk space occupied by the failure data stored in the database and the disk space occupied by the database in an idle state. Because the data volume in the database is smaller, the second cleaning command can be quickly cleaned through the copying table when being executed, so that the higher execution efficiency of the second cleaning command can be ensured, and the greater influence on service operation caused by the execution of the second cleaning command can be effectively avoided.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a database cleaning method according to an embodiment of the present application;
FIG. 2 is a flowchart of another database cleaning method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a database cleaning device according to an embodiment of the present application;
FIG. 4 is a schematic diagram of another database cleaning apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of another database cleaning device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings.
Fig. 1 is a flowchart of a database cleaning method according to an embodiment of the present application. Referring to fig. 1, the method includes:
Step 101: and judging whether the size of the disk space occupied by the database is larger than a first threshold value.
It should be noted that the database is a data set for storing data, for example, the database may be a postgresql database, a mysql database, or the like. The data stored in the database comprises effective data and invalid data, wherein the invalid data is old data generated after operations such as deleting and updating the data in the database, namely the invalid data is deleted data, updated and time-lapse data and the like, and the invalid data is not physically deleted from the database before cleaning, but remains in the database.
Additionally, disk space occupied by the database may be allocated by the operating system. When data is inserted into the database, the data can be inserted into the disk space in an idle state in the disk space occupied by the database, or the operating system allocates a new disk space for the database first and then inserts the data into the newly allocated disk space. As such, as data is continually inserted into a database, the disk space occupied by the database becomes larger and larger.
Furthermore, the first threshold may be preset, where the first threshold is a disk space size threshold for determining whether to directly execute the first cleaning command. For example, the first threshold may be 3GB (Gigabyte gigabytes) or the like.
It is noted that step 101 may be performed once every second reference period, and the second reference period may be set in advance. That is, in practical application, the database cleaning method provided by the embodiment of the application may be executed once at intervals to clean the database.
When the amount of disk space occupied by the database is less than or equal to the first threshold, the following step 102 may be continued to clean the database. When the amount of disk space occupied by the database is greater than the first threshold, steps 103-105 may continue to be performed to clean the database.
Step 102: and executing a first cleaning command when the size of the disk space occupied by the database is smaller than or equal to a first threshold value.
It should be noted that, the first cleaning command is used to recycle the disk space occupied by the failure data stored in the database, that is, the first cleaning command may clean the failure data stored in the database, so that the disk space occupied by the failure data is in an idle state, so that the disk space occupied by the database in the idle state may be used again to store new data. That is, the first purge command is used to logically reclaim disk space occupied by the failure data stored in the database. The execution of the first cleaning command does not affect the normal use of the database, i.e. the operations of adding, deleting, changing, querying, etc. of the data in the database. For example, the first purge command may be a vacuum command or the like.
In addition, when the size of the disk space occupied by the database is smaller than or equal to the first threshold value, the disk space occupied by the database is not very large, so that only the first cleaning command can be executed to clean the database. In this case, the size of the disk space occupied by the database is unchanged, and only the invalid data stored in the disk space occupied by the database is cleaned, so that the disk space originally occupied by the invalid data in the database is in an idle state, and new data can be stored by using the disk space in the idle state.
Step 103: when the size of the disk space occupied by the database is larger than a first threshold value, judging whether the data volume in the database is smaller than a second threshold value.
It should be noted that the second threshold may be set in advance, where the second threshold is a data amount threshold for determining whether to directly execute the second cleaning command. For example, the second threshold may be 5000 or the like.
In addition, when the size of the disk space occupied by the database is greater than the first threshold, it indicates that the disk space occupied by the database is relatively large, so that it is required to determine whether to execute the first cleaning command or the second cleaning command to clean the database based on the data amount in the database.
Furthermore, the second cleaning command is used for releasing the disk space occupied by the invalid data stored in the database and the disk space occupied by the database in an idle state, that is, the second cleaning command not only can clean the invalid data stored in the database, but also can return the disk space occupied by the invalid data to the operating system, and can also return the disk space occupied by the database in the idle state to the operating system, so that the subsequent operating system can reallocate the disk spaces. That is, the second purge command is used to physically release the disk space occupied by the failure data stored in the database and the disk space occupied by the database in an idle state. For example, the second purge command may be a vacuum full command or the like.
It should be noted that, when the second cleaning command is executed, an exclusive lock is executed, and during the execution of the second cleaning command, the database cannot be normally used, i.e. operations such as adding, deleting, changing, querying, etc. of data in the database cannot be performed. In addition, the second cleaning command is usually to copy the table to copy the valid data in the original data table to another new data table, and then delete the original data table, and replace the original data table with the new data table, so that the size of the disk space occupied by the database will be doubled when the second cleaning command is executed. And thus the execution efficiency of the second cleaning command may affect the service operation experience. If the execution efficiency of the second cleaning command is low, the data in the database cannot be used and the disk space occupied by the database is doubled during the execution of the second cleaning command, so that service interruption is very easy to cause and service operation is seriously affected.
When the amount of data in the database is greater than or equal to the second threshold, the following step 104 may be continued to clean the database. When the amount of data in the database is less than the second threshold, the following step 105 may be continued to clean the database.
Step 104: and executing the first cleaning command when the data amount in the database is greater than or equal to the second threshold.
Since the amount of data in the database is greater than or equal to the second threshold, indicating that the amount of data in the database is greater, a first purge command may be executed to purge the database. Because the first cleaning command does not affect the normal use of the database, cleaning the database at this time does not affect the operation of the service.
Step 105: and executing a second cleaning command when the data volume in the database is smaller than a second threshold.
When the amount of data in the database is less than the second threshold, it is indicated that the amount of data in the database is less. However, the disk space occupied by the database is larger at this time, which means that the disk space occupied by the database is in a relatively large space in an idle state, so that the second cleaning command can be executed to release the disk space occupied by the invalid data stored in the database and the disk space occupied by the database in an idle state. Under the condition, as the data volume in the database is smaller, the second cleaning command can be quickly cleaned through the copying table when being executed, so that the higher execution efficiency of the second cleaning command can be ensured, and the greater influence of the execution of the second cleaning command on service operation can be effectively avoided.
It should be noted that in the embodiment of the present application, whether to execute the first cleaning command may be determined according to the size of the disk space occupied by the database and the data amount in the database, and in order to clean the database in time, the first cleaning command may be also executed periodically. For example, the first cleaning command may be executed once every first reference time period.
It should be noted that the first reference time period may be set in advance, and the setting of the first reference time period may be achieved by adjusting parameters of the database. For example, when the database is a postgresql database and the first cleaning command is a vacuum command, the adjustment of the execution frequency of the vacuum command may be implemented by correspondingly adjusting the parameters in the postgresql. Conf of the configuration file of the postgresql database, that is, the adjustment of the first reference time length may be implemented, for example, the parameters related to the execution frequency of the vacuum command, such as the parameters of the points-segments, shared-buffers, etc. in the configuration file postgresql. Conf, may be adjusted greatly, so as to increase the execution frequency of the vacuum command, that is, increase the first reference time length.
Another point to note is that the database may have task data and status data for the task data stored therein. For task data stored in the database, the task data may be pulled from the database and executed at regular time. In pulling task data from the database and executing, the state data of the task data stored in the database may be updated, which may include unexecuted, waiting, running, completed, error, etc.
In the related art, each time the state of task data is changed, the state data of the task data stored in the database is updated once. For example, when task data in a database is not pulled, state data of the task data stored in the database may be unexecuted; after the task data in the database is pulled and added into a waiting queue, the state data of the task data stored in the database is updated to be waiting; when the task data is taken out from the waiting queue and executed, the state data of the task data stored in the database is updated to be running; after the task data is executed, the state data of the task data stored in the database is updated to be completed, or when the task data is executed in error, the state data of the task data stored in the database is updated to be in error. That is, in the related art, the state data of the task data stored in the database is always required to be updated during the state change of the task data. After the state data of the task data stored in the database is updated to be completed, a period of time is required to delete the state data of the task data. Thus, when the task data volume is large, a large amount of failure data is generated in the process of updating the state data of the task data, and the accumulation of the failure data is very easy to cause the expansion of the data in the database.
In the embodiment of the application, the task data can be pulled from the database and then executed, and when the execution of the task data is completed, the state data of the task data stored in the database is not required to be updated, but the state data of the task data stored in the database can be directly deleted. Therefore, the updating times of the state data stored in the database can be reduced, and excessive failure data caused by updating the state data for multiple times is avoided. Particularly, when the task data is data (such as picture data) with higher execution speed, the state data of the task data stored in the database does not need to be updated when the task data is executed; when the task data is data (such as video data) with a slower execution speed, the state data of the task data stored in the database can be updated to be running when the task data is executed. In other words, in the embodiment of the present application, for task data with a higher execution speed, the state data of the task data stored in the database is only never executed until one state update is waited, and for task data with a lower execution speed, the state data of the task data stored in the database is updated from execution until waiting and from waiting until running.
Further, the expansion of data in the database can be avoided by controlling the data insertion of the database, and specifically, the following two possible implementations can be included:
a first possible implementation: receiving a data insertion request for requesting insertion of data into the database; rejecting the data from being inserted into the database when the size of the disk space occupied by the database is greater than or equal to a third threshold or when the amount of data in the database is greater than or equal to a fourth threshold; and inserting the data into the database when the size of the disk space occupied by the database is smaller than a third threshold value and the data amount in the database is smaller than a fourth threshold value.
It should be noted that the third threshold may be preset, and the third threshold may be the size of the largest disk space occupied by the database, and the third threshold may be greater than the first threshold, for example, the third threshold may be 5GB.
In addition, the fourth threshold may be preset, and the fourth threshold may be the data amount that the database can store at most, and the fourth threshold may be greater than the second threshold, for example, the fourth threshold may be 20 ten thousand.
It should be noted that, when the size of the disk space occupied by the database is greater than or equal to the third threshold, it indicates that the disk space occupied by the database is already large, so that the data may be refused to be inserted into the database at this time, so as to avoid expanding the data of the database after the data is inserted. When the amount of data in the database is greater than or equal to the fourth threshold, it is indicated that the amount of data in the database is already large, and thus insertion of the data into the database may be denied at this time to avoid causing expansion of the data of the database after insertion of the data.
In addition, when the size of the disk space occupied by the database is smaller than the third threshold value and the data volume in the database is smaller than the fourth threshold value, the data volume in the database is not very large, and the data volume in the database is not very large, so that the data can be normally inserted into the database at the moment.
A second possible implementation: receiving a task data insertion request, wherein the task data insertion request is used for requesting to insert task data into the database; when the size of the disk space occupied by the database is larger than or equal to a third threshold value, or when the number of task data in the database is larger than or equal to a fifth threshold value, refusing to insert the task data into the database; and when the size of the disk space occupied by the database is smaller than a third threshold value and the number of task data in the database is smaller than a fifth threshold value, inserting the task data into the database.
It should be noted that, the third threshold may be preset, and the third threshold may be a size of a disk space that can be occupied by the database at a maximum, and the third threshold may be greater than the first threshold.
In addition, the fifth threshold may be preset, and the fifth threshold may be the maximum number of task data pieces that can be stored in the database.
It should be noted that, when the size of the disk space occupied by the database is greater than or equal to the third threshold, it indicates that the disk space occupied by the database is already large, so that the task data may be refused to be inserted into the database at this time, so as to avoid data expansion of the database after the task data is inserted. When the number of task data in the database is greater than or equal to the fifth threshold, it indicates that a plurality of task data are already stored in the database, so that the task data can be refused to be inserted into the database at this time, so as to avoid data expansion of the database after the task data are inserted.
In addition, when the size of the disk space occupied by the database is smaller than the third threshold and the number of task data in the database is smaller than the fifth threshold, the fact that the disk space occupied by the database is not very large and fewer pieces of task data are stored in the database is indicated, so that the task data can be normally inserted into the database at the moment.
Notably, task data is often data related to the execution of a task, i.e., task data is often present with a corresponding task. When the task data is refused to be inserted into the database, the operation of the task corresponding to the task data is interrupted, so that the task can be prevented from generating new task data to try to be inserted into the database after the task continues to operate, and further the data expansion of the database can be effectively avoided.
For ease of understanding, the database cleaning method described above is illustrated below in conjunction with FIG. 2. Referring to fig. 2, the database cleaning method may be performed by a scheduling service, which is a service for receiving tasks, storing tasks, and assigning tasks, and the scheduling service typically performs asynchronous tasks.
When the client submits an asynchronous task to a task receiving interface (such as a webservice interface and a restful interface) of the scheduling service, the scheduling service firstly judges whether the size of the disk space occupied by the database is larger than or equal to a third threshold value and judges whether the data volume in the database is larger than or equal to a fourth threshold value. When the size of the disk space occupied by the database is greater than or equal to a third threshold value, or when the data amount in the database is greater than or equal to a fourth threshold value, the scheduling service refuses to insert the task data of the asynchronous task into the database; when the size of the disk space occupied by the database is smaller than a third threshold value and the data volume in the database is smaller than a fourth threshold value, the scheduling service inserts the task data of the asynchronous task into the database.
Meanwhile, the internal thread of the scheduling service can judge whether the size of the disk space occupied by the database is smaller than or equal to a first threshold value or not at regular time. And executing a first cleaning command when the size of the disk space occupied by the database is smaller than or equal to a first threshold value. When the size of the disk space occupied by the database is larger than a first threshold, the internal thread continues to judge whether the data volume in the database is larger than or equal to a second threshold. If the data amount in the database is greater than or equal to a second threshold, executing a first cleaning command; if the amount of data in the database is less than a second threshold, a second purge command is executed.
For example, the first threshold is 3GB, the second threshold is 5000, the third threshold is 5GB, the fourth threshold is 20 ten thousand, the first clear command is a vacuum command, and the second clear command is a vacuum full command.
When the client submits an asynchronous task to the scheduling service, the scheduling service firstly judges whether the size of the disk space occupied by the database is larger than or equal to 5GB and judges whether the data volume in the database is larger than or equal to 20 ten thousand. Assuming that the disk space occupied by the database is 3GB and the data amount in the database is 10 ten thousand, the scheduling service inserts the task data of the asynchronous task into the database.
Meanwhile, the internal thread of the scheduling service can regularly judge whether the size of the disk space occupied by the database is smaller than or equal to 3GB. Assuming that the size of the disk space occupied by the database is 3GB at this time, a vacuum command is executed to clean the database.
When the speed of pulling task data from the database is slow and the speed of inserting task data into the database is fast, the amount of data in the database increases. Until the data volume in the database exceeds 20 ten thousand and the disk space occupied by the database exceeds 3GB, the scheduling service refuses to reinsert data into the database at the moment, and at the moment, the internal thread determines that the disk space occupied by the database is greater than or equal to 3GB, so that whether the data volume in the database is less than 5000 can be continuously judged. Since the amount of data in the database exceeds 20 tens of thousands, a vacuum command is also executed to clean the database.
When task data in the database is gradually pulled, and disk space occupied by failure data stored in the database is recovered after executing a vacuum command, the data volume in the database is reduced. Until the data volume in the database is less than 5000, executing a vacuum full command to perform lock table cleaning on the database. Because the data volume in the database is small at this time, the execution efficiency of the vacuum full command is high, so that the great influence on service operation can be effectively avoided.
In the embodiment of the application, when the size of the disk space occupied by the database is larger than a first threshold value, if the data volume in the database is larger than or equal to a second threshold value, executing a first cleaning command, wherein the first cleaning command is used for recovering the disk space occupied by the invalid data stored in the database. Because the first cleaning command does not affect the normal use of the database, cleaning the database at this time does not affect the operation of the service. And when the size of the disk space occupied by the database is larger than a first threshold value, if the data volume in the database is smaller than a second threshold value, executing a second cleaning command, wherein the second cleaning command is used for releasing the disk space occupied by the failure data stored in the database and the disk space occupied by the database in an idle state. Because the data volume in the database is smaller, the second cleaning command can be quickly cleaned through the copying table when being executed, so that the higher execution efficiency of the second cleaning command can be ensured, and the greater influence on service operation caused by the execution of the second cleaning command can be effectively avoided.
Fig. 3 is a schematic structural diagram of a database cleaning device according to an embodiment of the present application. Referring to fig. 3, the apparatus includes: a first execution module 301 and a second execution module 302.
The first execution module 301 is configured to execute a first cleaning command when the size of the disk space occupied by the database is greater than a first threshold, and the first cleaning command is used to recycle the disk space occupied by the failure data stored in the database if the data size in the database is greater than or equal to a second threshold;
And the second execution module 302 is configured to execute a second cleaning command when the size of the disk space occupied by the database is greater than the first threshold, if the data amount in the database is less than the second threshold, where the second cleaning command is used to release the disk space occupied by the failure data stored in the database and the disk space occupied by the database in an idle state.
Optionally, the apparatus further comprises:
and the third execution module is used for executing the first cleaning command when the size of the disk space occupied by the database is smaller than or equal to the first threshold value.
Optionally, the apparatus further comprises:
The first receiving module is used for receiving a data insertion request, wherein the data insertion request is used for requesting to insert data into the database;
The first rejecting module is used for rejecting to insert the data into the database when the size of the disk space occupied by the database is larger than or equal to a third threshold value or when the data amount in the database is larger than or equal to a fourth threshold value;
the first inserting module is used for inserting the data into the database when the size of the disk space occupied by the database is smaller than a third threshold value and the data volume in the database is smaller than a fourth threshold value, wherein the third threshold value is larger than the first threshold value, and the fourth threshold value is larger than the second threshold value.
Optionally, the apparatus further comprises:
The second receiving module is used for receiving a task data insertion request, wherein the task data insertion request is used for requesting to insert task data into the database;
The second rejecting module is used for rejecting the task data to be inserted into the database when the size of the disk space occupied by the database is larger than or equal to a third threshold value or when the number of the task data in the database is larger than or equal to a fifth threshold value;
The second inserting module is used for inserting the task data into the database when the size of the disk space occupied by the database is smaller than a third threshold value and the number of the task data in the database is smaller than a fifth threshold value, and the third threshold value is larger than the first threshold value.
Optionally, the apparatus further comprises:
and the fourth execution module is used for executing the first cleaning command once every the first reference time length.
Optionally, the database stores task data and status data of the task data, and the apparatus further includes:
The pulling module is used for pulling the task data from the database;
the fifth execution module is used for executing the task data;
And the deleting module is used for deleting the state data of the task data stored in the database when the task data is executed.
Optionally, the first cleaning command is a vacuum command and the second cleaning command is a vacuum full command.
In the embodiment of the application, when the size of the disk space occupied by the database is larger than a first threshold value, if the data volume in the database is larger than or equal to a second threshold value, executing a first cleaning command, wherein the first cleaning command is used for recovering the disk space occupied by the invalid data stored in the database. Because the first cleaning command does not affect the normal use of the database, cleaning the database at this time does not affect the operation of the service. And when the size of the disk space occupied by the database is larger than a first threshold value, if the data volume in the database is smaller than a second threshold value, executing a second cleaning command, wherein the second cleaning command is used for releasing the disk space occupied by the failure data stored in the database and the disk space occupied by the database in an idle state. Because the data volume in the database is smaller, the second cleaning command can be quickly cleaned through the copying table when being executed, so that the higher execution efficiency of the second cleaning command can be ensured, and the greater influence on service operation caused by the execution of the second cleaning command can be effectively avoided.
It should be noted that: in the database cleaning device provided in the above embodiment, only the division of the above functional modules is used for illustration, and in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the database cleaning device and the database cleaning method provided in the foregoing embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 4 is a schematic structural diagram of a database cleaning device according to an embodiment of the present invention. Referring to fig. 4, the apparatus may be a terminal 400, and the terminal 400 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion picture expert compression standard audio plane 3), an MP4 (Moving Picture Experts Group Audio Layer IV, motion picture expert compression standard audio plane 4) player, a notebook computer, or a desktop computer. The terminal 400 may also be referred to by other names as user equipment, portable terminal, laptop terminal, desktop terminal, etc.
In general, the terminal 400 includes: a processor 401 and a memory 402.
Processor 401 may include one or more processing cores such as a 4-core processor, an 8-core processor, etc. The processor 401 may be implemented in at least one hardware form of DSP (DIGITAL SIGNAL Processing), FPGA (Field-Programmable gate array), PLA (Programmable Logic Array ). Processor 401 may also include a main processor, which is a processor for processing data in an awake state, also called a CPU (Central Processing Unit ), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 401 may be integrated with a GPU (Graphics Processing Unit, image processor) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 401 may also include an AI (ARTIFICIAL INTELLIGENCE ) processor for processing computing operations related to machine learning.
Memory 402 may include one or more computer-readable storage media, which may be non-transitory. Memory 402 may also include high-speed random access memory as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 402 is used to store at least one instruction for execution by processor 401 to implement the database cleaning method provided by the method embodiments of the present application.
In some embodiments, the terminal 400 may further optionally include: a peripheral interface 403 and at least one peripheral. The processor 401, memory 402, and peripheral interface 403 may be connected by a bus or signal line. The individual peripheral devices may be connected to the peripheral device interface 403 via buses, signal lines or a circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 404, a touch display 405, a camera 406, audio circuitry 407, a positioning component 408, and a power supply 409.
Peripheral interface 403 may be used to connect at least one Input/Output (I/O) related peripheral to processor 401 and memory 402. In some embodiments, processor 401, memory 402, and peripheral interface 403 are integrated on the same chip or circuit board; in some other embodiments, either or both of processor 401, memory 402, and peripheral interface 403 may be implemented on separate chips or circuit boards, as the application is not limited in this regard.
The Radio Frequency circuit 404 is configured to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuitry 404 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 404 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 404 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, etc. The radio frequency circuitry 404 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (WIRELESS FIDELITY ) networks. In some embodiments, the radio frequency circuit 404 may further include NFC (NEAR FIELD Communication) related circuits, which is not limited by the present application.
The display screen 405 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 405 is a touch display screen, the display screen 405 also has the ability to collect touch signals at or above the surface of the display screen 405. The touch signal may be input as a control signal to the processor 401 for processing. At this time, the display screen 405 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display 405 may be one and disposed on the front panel of the terminal 400; in other embodiments, the display 405 may be at least two, and disposed on different surfaces of the terminal 400 or in a folded design; in still other embodiments, the display 405 may be a flexible display disposed on a curved surface or a folded surface of the terminal 400. Even more, the display screen 405 may be arranged in an irregular pattern that is not rectangular, i.e. a shaped screen. The display screen 405 may be made of materials such as an LCD (Liquid CRYSTAL DISPLAY) and an OLED (Organic Light-Emitting Diode).
The camera assembly 406 is used to capture images or video. Optionally, camera assembly 406 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal and the rear camera is disposed on the rear surface of the terminal. In some embodiments, the at least two rear cameras are any one of a main camera, a depth camera, a wide-angle camera and a tele camera, so as to realize that the main camera and the depth camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting and Virtual Reality (VR) shooting function or other fusion shooting functions. In some embodiments, camera assembly 406 may also include a flash. The flash lamp can be a single-color temperature flash lamp or a double-color temperature flash lamp. The dual-color temperature flash lamp refers to a combination of a warm light flash lamp and a cold light flash lamp, and can be used for light compensation under different color temperatures.
The audio circuit 407 may include a microphone and a speaker. The microphone is used for collecting sound waves of users and environments, converting the sound waves into electric signals, and inputting the electric signals to the processor 401 for processing, or inputting the electric signals to the radio frequency circuit 404 for realizing voice communication. For the purpose of stereo acquisition or noise reduction, a plurality of microphones may be respectively disposed at different portions of the terminal 400. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is used to convert electrical signals from the processor 401 or the radio frequency circuit 404 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, audio circuit 407 may also include a headphone jack.
The location component 408 is used to locate the current geographic location of the terminal 400 to enable navigation or LBS (Location Based Service, location-based services). The positioning component 408 may be a positioning component based on the United states GPS (Global Positioning System ), the Beidou system of China, the Granati system of Russia, or the Galileo system of the European Union.
The power supply 409 is used to power the various components in the terminal 400. The power supply 409 may be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When power supply 409 comprises a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the terminal 400 further includes one or more sensors 410. The one or more sensors 410 include, but are not limited to: acceleration sensor 411, gyroscope sensor 412, pressure sensor 413, fingerprint sensor 414, optical sensor 415, and proximity sensor 416.
The acceleration sensor 411 may detect the magnitudes of accelerations on three coordinate axes of the coordinate system established with the terminal 400. For example, the acceleration sensor 411 may be used to detect components of gravitational acceleration on three coordinate axes. The processor 401 may control the touch display screen 405 to display a user interface in a lateral view or a longitudinal view according to the gravitational acceleration signal acquired by the acceleration sensor 411. The acceleration sensor 411 may also be used for the acquisition of motion data of a game or a user.
The gyro sensor 412 may detect a body direction and a rotation angle of the terminal 400, and the gyro sensor 412 may collect a 3D motion of the user to the terminal 400 in cooperation with the acceleration sensor 411. The processor 401 may implement the following functions according to the data collected by the gyro sensor 412: motion sensing (e.g., changing UI according to a tilting operation by a user), image stabilization at shooting, game control, and inertial navigation.
The pressure sensor 413 may be disposed at a side frame of the terminal 400 and/or at a lower layer of the touch display 405. When the pressure sensor 413 is disposed at a side frame of the terminal 400, a grip signal of the terminal 400 by a user may be detected, and the processor 401 performs a left-right hand recognition or a shortcut operation according to the grip signal collected by the pressure sensor 413. When the pressure sensor 413 is disposed at the lower layer of the touch display screen 405, the processor 401 controls the operability control on the UI interface according to the pressure operation of the user on the touch display screen 405. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
The fingerprint sensor 414 is used to collect a fingerprint of the user, and the processor 401 identifies the identity of the user based on the fingerprint collected by the fingerprint sensor 414, or the fingerprint sensor 414 identifies the identity of the user based on the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, the user is authorized by the processor 401 to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying for and changing settings, etc. The fingerprint sensor 414 may be provided at the front, rear, or side of the terminal 400. When a physical key or vendor Logo is provided on the terminal 400, the fingerprint sensor 414 may be integrated with the physical key or vendor Logo.
The optical sensor 415 is used to collect the ambient light intensity. In one embodiment, the processor 401 may control the display brightness of the touch display screen 405 according to the ambient light intensity collected by the optical sensor 415. Specifically, when the intensity of the ambient light is high, the display brightness of the touch display screen 405 is turned up; when the ambient light intensity is low, the display brightness of the touch display screen 405 is turned down. In another embodiment, the processor 401 may also dynamically adjust the shooting parameters of the camera assembly 406 according to the ambient light intensity collected by the optical sensor 415.
The proximity sensor 416, also referred to as a distance sensor, is typically disposed on the front panel of the terminal 400. The proximity sensor 416 is used to collect the distance between the user and the front of the terminal 400. In one embodiment, when the proximity sensor 416 detects a gradual decrease in the distance between the user and the front face of the terminal 400, the processor 401 controls the touch display 405 to switch from the bright screen state to the off screen state; when the proximity sensor 416 detects that the distance between the user and the front surface of the terminal 400 gradually increases, the processor 401 controls the touch display screen 405 to switch from the off-screen state to the on-screen state.
Those skilled in the art will appreciate that the structure shown in fig. 4 is not limiting of the terminal 400 and may include more or fewer components than shown, or may combine certain components, or may employ a different arrangement of components.
Fig. 5 is a schematic structural diagram of a database cleaning device according to an embodiment of the present application. Referring to fig. 5, the apparatus may be a server 500, where the server 500 may have a relatively large difference due to different configurations or performances, and may include one or more CPUs 501 and one or more memories 502, where at least one instruction is stored in the memories 502, and the at least one instruction is loaded and executed by the processor 501 to implement the database cleaning method in the foregoing embodiment. Of course, the server 500 may also have a wired or wireless network interface, a keyboard, an input/output interface, and other components for implementing the functions of the device, which are not described herein.
In an exemplary embodiment, a computer readable storage medium, such as a memory, comprising instructions executable by a processor in a computer device to perform the database cleaning method of the above-described embodiments is also provided. For example, the computer readable storage medium may be a ROM (read-Only Memory), a RAM (random access Memory ), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk, an optical data storage device, and the like.
It is noted that the computer readable storage medium mentioned in the present application may be a non-volatile storage medium, in other words, a non-transitory storage medium.
It should be understood that all or part of the steps to implement the above-described embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The computer instructions may be stored in the computer-readable storage medium described above.
The above embodiments are not intended to limit the present application, and any modifications, equivalent substitutions, improvements, etc. within the spirit and principle of the present application should be included in the scope of the present application.

Claims (13)

1. A method of database cleaning, the method comprising:
when the size of the disk space occupied by the database is larger than a first threshold value, if the data volume in the database is larger than or equal to a second threshold value, executing a first cleaning command, wherein the first cleaning command is a vacuum command, and the first cleaning command is used for recycling the disk space occupied by invalid data stored in the database;
And when the size of the disk space occupied by the database is larger than a first threshold, if the data volume in the database is smaller than a second threshold, executing a second cleaning command, wherein the second cleaning command is a vacuum full command, and the second cleaning command is used for releasing the disk space occupied by invalid data stored in the database and the disk space occupied by the database and in an idle state.
2. The method of claim 1, wherein the method further comprises:
And executing the first cleaning command when the size of the disk space occupied by the database is smaller than or equal to the first threshold value.
3. The method of claim 1, wherein the method further comprises:
Receiving a data insertion request, wherein the data insertion request is used for requesting to insert data into the database;
Rejecting the data from being inserted into the database when the size of the disk space occupied by the database is greater than or equal to a third threshold value or when the data amount in the database is greater than or equal to a fourth threshold value;
And when the size of the disk space occupied by the database is smaller than the third threshold value and the data volume in the database is smaller than the fourth threshold value, inserting the data into the database, wherein the third threshold value is larger than the first threshold value, and the fourth threshold value is larger than the second threshold value.
4. The method of claim 1, wherein the method further comprises:
receiving a task data insertion request, wherein the task data insertion request is used for requesting to insert task data into the database;
When the size of the disk space occupied by the database is larger than or equal to a third threshold value, or when the number of task data in the database is larger than or equal to a fifth threshold value, rejecting the task data from being inserted into the database;
and when the size of the disk space occupied by the database is smaller than the third threshold value and the number of task data in the database is smaller than the fifth threshold value, inserting the task data into the database, wherein the third threshold value is larger than the first threshold value.
5. The method of claim 1, wherein the method further comprises:
and executing the first cleaning command every a first reference time length.
6. The method of claim 1, wherein the database has stored therein task data and status data for the task data, the method further comprising:
Pulling the task data from the database;
executing the task data;
And deleting the state data of the task data stored in the database when the task data is executed.
7. A database cleaning apparatus, the apparatus comprising:
The first execution module is used for executing a first cleaning command when the size of the disk space occupied by the database is larger than a first threshold value and if the data volume in the database is larger than or equal to a second threshold value, wherein the first cleaning command is a vacuum command and is used for recycling the disk space occupied by invalid data stored in the database;
And the second execution module is used for executing a second cleaning command when the size of the disk space occupied by the database is larger than a first threshold value and if the data volume in the database is smaller than a second threshold value, wherein the second cleaning command is a vacuum full command and is used for releasing the disk space occupied by the failure data stored in the database and the disk space occupied by the database in an idle state.
8. The apparatus of claim 7, wherein the apparatus further comprises:
And the third execution module is used for executing the first cleaning command when the size of the disk space occupied by the database is smaller than or equal to the first threshold value.
9. The apparatus of claim 7, wherein the apparatus further comprises:
The first receiving module is used for receiving a data insertion request, wherein the data insertion request is used for requesting to insert data into the database;
The first rejecting module is used for rejecting the data to be inserted into the database when the size of the disk space occupied by the database is larger than or equal to a third threshold value or when the data amount in the database is larger than or equal to a fourth threshold value;
And the first inserting module is used for inserting the data into the database when the size of the disk space occupied by the database is smaller than the third threshold value and the data volume in the database is smaller than the fourth threshold value, wherein the third threshold value is larger than the first threshold value and the fourth threshold value is larger than the second threshold value.
10. The apparatus of claim 7, wherein the apparatus further comprises:
the second receiving module is used for receiving a task data insertion request, wherein the task data insertion request is used for requesting to insert task data into the database;
The second rejecting module is used for rejecting the task data to be inserted into the database when the size of the disk space occupied by the database is larger than or equal to a third threshold value or when the number of the task data in the database is larger than or equal to a fifth threshold value;
and the second inserting module is used for inserting the task data into the database when the size of the disk space occupied by the database is smaller than the third threshold value and the number of the task data in the database is smaller than the fifth threshold value, and the third threshold value is larger than the first threshold value.
11. The apparatus of claim 7, wherein the apparatus further comprises:
And the fourth execution module is used for executing the first cleaning command once every a first reference time length.
12. The apparatus of claim 7, wherein the database has stored therein task data and status data for the task data, the apparatus further comprising:
The pulling module is used for pulling the task data from the database;
A fifth execution module for executing the task data;
And the deleting module is used for deleting the state data of the task data stored in the database when the task data is executed.
13. A computer readable storage medium having instructions stored therein which, when executed, perform the method of any of claims 1-6.
CN201910605673.2A 2019-07-05 2019-07-05 Database cleaning method, device and computer readable storage medium Active CN112181938B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910605673.2A CN112181938B (en) 2019-07-05 2019-07-05 Database cleaning method, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910605673.2A CN112181938B (en) 2019-07-05 2019-07-05 Database cleaning method, device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN112181938A CN112181938A (en) 2021-01-05
CN112181938B true CN112181938B (en) 2024-06-14

Family

ID=73915355

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910605673.2A Active CN112181938B (en) 2019-07-05 2019-07-05 Database cleaning method, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112181938B (en)

Family Cites Families (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5740395A (en) * 1992-10-30 1998-04-14 Intel Corporation Method and apparatus for cleaning up a solid state memory disk storing floating sector data
US8521789B2 (en) * 2003-05-27 2013-08-27 Oracle International Corporation Undrop objects and dependent objects in a database system
US7865658B2 (en) * 2007-12-31 2011-01-04 Sandisk Il Ltd. Method and system for balancing host write operations and cache flushing
WO2012070144A1 (en) * 2010-11-26 2012-05-31 株式会社日立製作所 Database management method, database management apparatus, and recording medium
US9053166B2 (en) * 2012-12-10 2015-06-09 Microsoft Technology Licensing, Llc Dynamically varying the number of database replicas
US8965857B2 (en) * 2012-12-28 2015-02-24 Sybase, Inc. Method and system to avoid space bloating during run-time compression
CN105338027B (en) * 2014-07-30 2019-01-25 杭州海康威视***技术有限公司 Carry out the method, system and device of video data cloud storage
CN105760553A (en) * 2016-03-25 2016-07-13 北京奇虎科技有限公司 Data management method and device
CN106484562B (en) * 2016-09-14 2019-08-23 Oppo广东移动通信有限公司 A kind of data transmission processing method and terminal device
CN106503260B (en) * 2016-11-18 2020-04-28 北京奇虎科技有限公司 Method and device for improving effective storage space of database
CN108287835B (en) * 2017-01-09 2022-06-21 腾讯科技(深圳)有限公司 Data cleaning method and device
US11036590B2 (en) * 2017-03-02 2021-06-15 Salesforce.Com, Inc. Reducing granularity of backup data over time
US10671525B2 (en) * 2017-06-21 2020-06-02 International Business Machines Corporation Space reclamation in data deduplication storage systems
CN107368563B (en) * 2017-06-30 2021-02-23 北京奇虎科技有限公司 Database data deleting method and device, electronic equipment and storage medium
CN109391647B (en) * 2017-08-04 2021-08-17 杭州海康威视***技术有限公司 Storage resource recovery method, device and system
CN108153882A (en) * 2017-12-26 2018-06-12 中兴通讯股份有限公司 A kind of data processing method and device
CN109271381A (en) * 2018-08-21 2019-01-25 中国平安人寿保险股份有限公司 Processing method, device, computer equipment and the storage medium of test data table
CN109739843A (en) * 2018-12-26 2019-05-10 篱笆墙网络科技有限公司 Block chain data read-write method, system, equipment and storage medium
CN109871411B (en) * 2019-02-18 2023-05-09 Oppo广东移动通信有限公司 Method, device, electronic equipment and medium for synchronizing data
CN109960686B (en) * 2019-03-26 2021-07-20 北京百度网讯科技有限公司 Log processing method and device for database

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SQLite 在嵌入式认证授权***中的应用;王盛义等;信息技术与标准化;第51-54页 *
数据库日常维护工作分析;阮宏一;湖北第二师范学院学报;第25卷(第02期);第46-48页 *

Also Published As

Publication number Publication date
CN112181938A (en) 2021-01-05

Similar Documents

Publication Publication Date Title
CN108304265B (en) Memory management method, device and storage medium
CN108762881B (en) Interface drawing method and device, terminal and storage medium
CN110147380B (en) Data updating method, device, server and storage medium
CN108132790B (en) Method, apparatus and computer storage medium for detecting a garbage code
CN110119305B (en) Task execution method and device, computer equipment and storage medium
CN113127181A (en) Memory management method, device and storage medium
CN110673944B (en) Method and device for executing task
CN110968815B (en) Page refreshing method, device, terminal and storage medium
CN111813322B (en) Storage pool creation method, device, equipment and storage medium
CN111666076B (en) Layer adding method, device, terminal and storage medium
CN111459410B (en) Memory space allocation method and device, electronic equipment and storage medium
CN112181915B (en) Method, device, terminal and storage medium for executing service
CN110032421B (en) Method and device for managing atlas in memory, terminal and storage medium
CN111275607A (en) Interface display method and device, computer equipment and storage medium
CN115344537A (en) Storage space allocation method and device, file system and storage medium
CN113301422B (en) Method, terminal and storage medium for acquiring video cover
CN112181938B (en) Database cleaning method, device and computer readable storage medium
CN113408989B (en) Automobile data comparison method and device and computer storage medium
CN111708669B (en) Analysis method, device, equipment and storage medium for system operation
CN116842047A (en) Cache updating method, device, equipment and computer readable storage medium
CN116932418A (en) Memory garbage recycling method and device, computer equipment and storage medium
CN109189525B (en) Method, device and equipment for loading sub-page and computer readable storage medium
CN111523876A (en) Payment mode display method, device and system and storage medium
CN111190751A (en) Task processing method and device based on song list, computer equipment and storage medium
CN111400544B (en) Video data storage method, device, equipment and 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