CN110187836B - Data deleting method and device, computer and storage medium - Google Patents

Data deleting method and device, computer and storage medium Download PDF

Info

Publication number
CN110187836B
CN110187836B CN201910457514.2A CN201910457514A CN110187836B CN 110187836 B CN110187836 B CN 110187836B CN 201910457514 A CN201910457514 A CN 201910457514A CN 110187836 B CN110187836 B CN 110187836B
Authority
CN
China
Prior art keywords
data
identifier
time
importance
identification
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
CN201910457514.2A
Other languages
Chinese (zh)
Other versions
CN110187836A (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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201910457514.2A priority Critical patent/CN110187836B/en
Publication of CN110187836A publication Critical patent/CN110187836A/en
Application granted granted Critical
Publication of CN110187836B publication Critical patent/CN110187836B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/0629Configuration or reconfiguration of storage systems
    • G06F3/0631Configuration or reconfiguration of storage systems by allocating resources to storage systems
    • 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/0653Monitoring storage devices or systems
    • 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

Abstract

The embodiment of the invention provides a data deleting method, a data deleting device, a computer and a storage medium, wherein the data deleting method comprises the following steps: acquiring the identifier expiration time of the data with the importance identifier as a first identifier, wherein the first identifier is as follows: the identification which represents that the data is important data is monitored whether the acquired identification expiration time is earlier than the current time, if so, the importance identification of the data corresponding to the acquired identification expiration time is changed into a second identification, wherein the second identification is as follows: an identifier indicating that the data is non-essential data; and selecting the data corresponding to the second identifier as pre-deleted data, and deleting the data aiming at the pre-deleted data. By adopting the scheme provided by the embodiment of the invention to delete the data, the operation process of deleting the data can be simplified, and the efficiency of deleting the data can be improved.

Description

Data deleting method and device, computer and storage medium
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a data deletion method, apparatus, computer, and storage medium.
Background
With the rapid development of internet technology, more and more data are transmitted through the internet, and more data are stored in the servers of the internet. Due to the limited storage space of the server, when the data stored in the server is excessive, a part of the data needs to be deleted to release the storage space, so that new data can be stored in the server.
In the prior art, a method generally adopted when deleting data is as follows: the important data with higher importance and the non-important data with lower importance are respectively stored in different storage spaces, for example, the important data and the non-important data are respectively stored in different disks or different disk partitions, and data are selected from the storage spaces for storing the non-important data to be deleted, so that the important data are ensured not to be deleted by mistake.
However, the inventor finds that the prior art has at least the following problems in the process of implementing the invention: since the amount of important data in the server changes frequently, in order to make the important data have sufficient storage space, the storage space needs to be reallocated periodically, and the important data and the non-important data need to be stored in the reallocated storage space, which results in frequent reallocation of the storage space and frequent restoration of the data, thereby making the operation process of data deletion more cumbersome and less efficient.
Disclosure of Invention
Embodiments of the present invention provide a data deletion method, apparatus, computer, and storage medium, so as to simplify an operation process of data deletion and improve efficiency of data deletion. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a data deleting method, where the method includes:
acquiring the identifier expiration time of data with the importance identifier as a first identifier, wherein the importance identifier represents whether the data is important data, and the first identifier is as follows: an identifier indicating that the data is important data;
monitoring whether the acquired identifier expiration time is earlier than the current time;
if the time is earlier than the preset time, changing the importance identifier of the data corresponding to the acquired identifier expiration time into a second identifier, wherein the second identifier is as follows: an identifier indicating that the data is non-essential data;
selecting data corresponding to the second identifier as pre-deletion data;
and deleting data aiming at the pre-deleted data.
Optionally, before the step of obtaining the identifier expiration time of the data with the importance identifier being the first identifier, the method further includes:
after the data is downloaded, adding an importance mark for the data, and setting an identification expiration time for the importance mark.
Optionally, after the step of downloading the data, the method further includes:
storing the downloaded data, wherein a mapping table is correspondingly arranged on a disk for storing the downloaded data, and the mapping table comprises: the identification of the data stored in the disk, the importance identification of the data and the identification expiration time of the importance identification;
after the step of adding the importance identifier to the data and setting an identifier expiration time for the importance identifier, the method further comprises:
and recording the added importance identification and the identification expiration time of the importance identification into a mapping table corresponding to a disk for storing the downloaded data.
Optionally, obtaining an identifier expiration time of the data with the importance identifier as the first identifier includes:
acquiring the latest accessed time and preset effective duration of the data with the importance identifier as the first identifier, wherein the latest accessed time is as follows: the time at which the data was last accessed;
and determining the sum of the latest accessed time and the preset effective time of the data with the importance identified as the first identifier as the identifier expiration time of the data with the importance identified as the first identifier.
Optionally, the deleting data for the pre-deleted data includes:
acquiring the latest accessed time of the pre-deleted data, wherein the latest accessed time is as follows: the time at which the data was last accessed;
and determining data to be deleted from the pre-deletion data according to the acquired latest accessed time, and deleting the determined data.
In a second aspect, an embodiment of the present invention provides a data deleting device, where the device includes:
a time acquisition unit configured to acquire an identifier expiration time of data whose importance identifier indicates whether the data is important data, the first identifier being: an identifier indicating that the data is important data;
the time monitoring unit is used for monitoring whether the acquired identifier expiration time is earlier than the current time;
an identifier modification unit, configured to change, when a monitoring result of the time monitoring unit is yes, the importance identifier of the data corresponding to the acquired identifier expiration time into a second identifier, where the second identifier is: an identifier indicating that the data is non-essential data;
the data selection unit is used for selecting the data corresponding to the second identifier as pre-deletion data;
and the data deleting unit is used for deleting the data aiming at the pre-deleted data.
Optionally, the apparatus further comprises:
and the data setting unit is used for adding an importance identifier for the data after the data is downloaded, and setting identifier expiration time for the importance identifier.
Optionally, the apparatus further comprises:
the data storage unit is used for storing the downloaded data, wherein a mapping table is correspondingly arranged on a magnetic disk for storing the downloaded data, and the mapping table comprises: the identification of the data stored in the disk, the importance identification of the data and the identification expiration time of the importance identification;
and the information recording unit is used for recording the added importance identifier and the identifier expiration time of the importance identifier into a mapping table corresponding to a disk for storing the downloaded data.
Optionally, the time obtaining unit includes:
a time and duration obtaining subunit, configured to obtain a latest access time and a preset valid duration of the data with the importance identifier as the first identifier, where the latest access time is: the time at which the data was last accessed;
and the identification expiration time determining subunit is used for determining the importance as the sum of the latest accessed time of the data with the first identification and the preset effective duration as the identification expiration time of the data with the importance as the first identification.
Optionally, the data deleting unit includes:
a time obtaining subunit, configured to obtain a latest accessed time of the pre-deletion data, where the latest accessed time is: the time at which the data was last accessed;
and the data deleting subunit is used for determining data to be deleted from the pre-deleted data according to the acquired latest accessed time and deleting the determined data.
In a third aspect, an embodiment of the present invention provides a computer, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the bus; the memory is used for storing a computer program; the processor is configured to execute the program stored in the memory to implement the method steps of the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored in the storage medium, and when the computer program is executed by a processor, the computer program implements the steps described in the first aspect.
In a fifth aspect, an embodiment of the present invention provides a computer program product containing instructions, which when run on a computer, causes the computer to execute the video recommendation method according to the first aspect.
When deleting data, when the identifier expiration time of the data of which the importance identifier is a first identifier is earlier than the current time, the importance identifier of the monitored data is changed into a second identifier, because the first identifier is the identifier indicating that the data is important data and the second identifier is the identifier indicating that the data is non-important data, after the data is marked with the first identifier or the second identifier, whether the data is important data can be judged according to the importance identifier, when the identifier expiration time of the data corresponding to the first identifier is earlier than the current time, the data is no longer important data, at the moment, the importance identifier of the data is changed from the first identifier to the second identifier, namely, the data is changed from the important data to the non-important data, and when deleting the data, the data corresponding to the second identifier is deleted, namely, the deletion is carried out aiming at the non-important data, thereby ensuring that the important data is not deleted by mistake.
The technical scheme provided by the embodiment of the invention distinguishes the important data and the non-important data by the importance identification, and the important data and the non-important data do not need to be respectively stored in different storage spaces, so that the redistribution of the storage spaces is not needed, and the data does not need to be stored again, thereby simplifying the operation process of deleting the data and improving the efficiency of deleting the data.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a schematic flowchart of a data deleting method according to an embodiment of the present invention;
fig. 2 is another schematic flow chart of a data deleting method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a data deleting device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
In order to simplify the operation process of data deletion and improve the efficiency of data deletion, the embodiment of the invention provides a data deletion method, a data deletion device, a computer and a storage medium.
The following first introduces a data deletion method provided in an embodiment of the present invention.
It should be noted that the data deletion method provided by the embodiment of the present invention can be applied to the internet technology industry. Such as audio, video websites or applications, literature query websites or applications, and the like. An execution main body of the data deletion method provided by the embodiment of the present invention may be a computer, which may be a desktop computer, a portable computer, an intelligent mobile terminal, a server, and the like, and specifically, for example, the execution main body of the data deletion method provided by the embodiment of the present invention may be a Content Delivery Network (CDN) cache server.
In an implementation manner, an application scenario of the technical solution provided by the embodiment of the present invention may be: and after the data management platform generates new data and synchronously stores the new data to the video CDN cache server, the video CDN cache server deletes the stored data.
As shown in fig. 1, the data deleting method provided in the embodiment of the present invention includes the following steps:
s110: acquiring the identifier expiration time of data with the importance identifier as a first identifier, wherein the importance identifier represents whether the data is important data, and the first identifier is as follows: indicating that the data is an identification of important data.
In the embodiment of the present invention, the data downloaded by the computer may be data carrying an importance identifier and identifier expiration time, at this time, the importance identifier and identifier expiration time of the data are stored locally in the computer, and the computer may obtain the identifier expiration time of the data of which the importance identifier is the first identifier from the local storage.
The importance mark may be a mark represented by a numerical value, and in this case, the first mark may be a numerical value, for example, the first mark is a numerical value such as "1", "0", "2", or the like. The importance mark may be a mark represented by letters, and in this case, the first mark may be letters, for example, the first mark may be letters such as "a", "b", and the like. The specific form of the importance mark and the first mark is not particularly limited in the embodiments of the present invention.
Data corresponding to the hot topic, video data corresponding to videos with the crown names and the like can be determined to be important data, and the data can be distinguished from non-important data after the first identification is added to the data.
In the embodiment of the present invention, the computer may obtain the identifier expiration time of the data whose importance identifier is the first identifier in any one of the following manners:
acquiring identifier expiration time of data with an importance identifier as a first identifier according to a first preset time interval; the first preset time interval may be determined according to the update speed of the data, the storage condition of the computer, and the like, for example, when the update speed of the data is fast, the first preset time interval may be set to be a shorter time interval, and when the occupancy rate of the storage of the computer is high, the first preset time interval may be set to be a shorter time interval. For example, the first preset time interval may be 30 minutes, 1 hour, 1 day, etc., and the embodiment of the present invention is not particularly limited.
When the specific time is reached, the identification expiration time of the data with the importance identification as the first identification; the specific time may be, for example, a fixed time of each day, for example, 12:00 and 01:00 of each day, or a fixed time of each week, for example, 01:00 of each day, and a person skilled in the art may determine the specific time of the specific time according to practical situations, and the embodiment of the present invention is not particularly limited.
When a time acquisition instruction is received, acquiring identifier expiration time of data with an importance identifier as a first identifier; the time obtaining instruction may be an instruction input by an operator at the computer and received by the computer, or the time obtaining instruction may be an instruction received by the computer and sent from another device, which is not particularly limited in the embodiment of the present invention.
When the storage occupancy rate is monitored to reach a preset proportion, acquiring the identifier expiration time of the data with the importance identifier as the first identifier; the predetermined ratio may be any one of 3/5-4/5, or other values not greater than 1.
And acquiring the identifier expiration time of the data with the importance identifier as the first identifier in real time.
S120: monitoring whether the acquired identification expiration time is earlier than the current time.
S130: if the monitoring result in step S120 is yes, the importance identifier of the data corresponding to the acquired identifier expiration time is changed to a second identifier, where the second identifier is: indicating that the data is an identification of non-essential data.
The second identifier is: an identifier different from the first identifier. For example, when the importance indicator is an indicator represented by a numerical value and the first indicator is "1", the second indicator may be a numerical value such as "0", "2", or "3", or may be another numerical value. When the importance labels are letters and the first label is "a", the second label may be "b", "c", "d", and the like. The first and second identifiers may also be identified by different forms of symbols, respectively, for example, the first identifier is represented by a numerical value and the second identifier is represented by a letter. In the embodiment of the present invention, the first identifier may be different from the second identifier, and a specific form of the importance identifier is not particularly limited in the embodiment of the present invention.
S140: and selecting the data corresponding to the second identification as pre-deleted data.
S150: and deleting the data aiming at the pre-deleted data.
And deleting the data aiming at the pre-deleted data, namely deleting the data in the pre-deleted data when the data are deleted. In the embodiment of the invention, the computer can select data from the pre-deleted data to delete, so that the deleted data is more targeted.
When the data is deleted, the first identifier is an identifier indicating that the data is important data, and the second identifier is an identifier indicating that the data is non-important data, when the first identifier or the second identifier is marked on the data, whether the data is important data or not can be judged according to the importance identifier, when the expiration time of the identifier of the data with the importance identifier as the first identifier is monitored to be earlier than the current time, the data is no longer important data, at the moment, the importance identifier of the data is changed from the first identifier to the second identifier, namely, the data is changed from the important data to the non-important data, and when the data is deleted, the data corresponding to the second identifier is deleted, namely, the non-important data is deleted, so that the important data is not deleted by mistake. The technical scheme provided by the embodiment of the invention distinguishes the important data and the non-important data by the importance identification, and the important data and the non-important data do not need to be respectively stored in different storage spaces, so that the redistribution of the storage spaces is not needed, and the data does not need to be stored again, thereby simplifying the operation process of deleting the data and improving the efficiency of deleting the data.
In one embodiment, as shown in fig. 2, before step S110, the method may further include the following step S160:
s160: after the data is downloaded, an importance identifier is added to the data, and an identifier expiration time is set for the importance identifier.
When the data downloaded by the computer is data which does not carry the importance identifier and the identifier expiration time, or the importance identifier and the identifier expiration time carried by the data downloaded by the computer do not meet the preset requirements, the computer may add the importance identifier to the data after the data is downloaded, and set the identifier expiration time for the importance identifier. Therefore, the importance identification of the data and the identification expiration time of the data can be successfully acquired by the computer.
In one embodiment, as shown in fig. 2, after the step of downloading the data in step S160, the method may further include the following step S170:
s170: storing the downloaded data, wherein a mapping table is correspondingly arranged on a disk for storing the downloaded data, and the mapping table comprises: the identification of the data stored in the disk, the importance identification of the data and the identification expiration time of the importance identification;
after step S160, the method further includes the following step S180:
s180: and recording the added importance identification and the identification expiration time of the importance identification into a mapping table corresponding to a disk for storing the downloaded data.
In this embodiment, the computer may store the downloaded data in a magnetic disk. The identifier of the data may be a unique identifier of the data, the identifier of the data may be "121 b60c 99a446f7.f4v", for example, and the identifier of the data may be other identifiers for marking and identifying the data.
In this embodiment, the identifier of the stored data, the importance identifier added to the stored data, and the identifier expiration time of the importance identifier of the stored data may be recorded in a mapping table corresponding to a disk storing the downloaded data.
In the embodiment, after the importance identifier and the identifier expiration time of the data are recorded in the mapping table corresponding to the disk storing the data, the data can be inquired and deleted through the mapping table, so that the data can be inquired more quickly, the data deleting efficiency is improved, and the application range and the expandability of the data deleting method of the embodiment of the invention can be improved.
In the embodiment of the present invention, a thread may be allocated to each mapping table, and the thread is used to perform operations such as modifying, inserting, querying, deleting, and the like of data. And one thread is independently allocated to each mapping table, so that the phenomenon that a plurality of threads operate the mapping tables at the same time can be reduced, and the phenomenon that the probability of unavailability of the mapping tables is increased due to frequent operation of the mapping tables is reduced. In the embodiment of the invention, a message queue can be set for each thread, when a plurality of operation tasks exist, the operation tasks can be put into the message queue, and the thread sequentially extracts and executes the operation tasks from the message queue, so that the phenomenon that the mapping table unavailability probability is increased due to the simultaneous execution of the operation tasks is reduced. For example, if the expiration time included in a mapping relationship in the mapping table of the disk is earlier than the current time, and the importance identifier included in the mapping relationship is the first identifier, the computer may insert a modification task to the message queue of the thread corresponding to the disk, and modify the importance identifier included in the mapping relationship into the second identifier.
In one embodiment, step S110 can be implemented as following steps S111 to S112:
s111: acquiring the latest accessed time and preset effective duration of the data with the importance identifier as the first identifier, wherein the latest accessed time is as follows: the time at which the data was last accessed;
s112: and determining the sum of the latest accessed time and the preset effective time of the data with the importance marked as the first mark as the mark expiration time of the data with the importance marked as the first mark.
The computer may store the latest accessed time of the data and the preset effective duration of the data, and when the latest accessed time of the data and the preset effective duration of the data are stored in the computer, the computer may locally acquire the latest accessed time of the data and the preset effective duration of the data. Specifically, the computer may store attribute information of the data, where the attribute information may include a preset effective time duration and a latest access time of the data, and the attribute information may further include other information of the data, such as a storage path of the data. The computer may obtain attribute information of the data from a local area, and extract a last accessed time of the data and a valid duration of the data from the obtained attribute information.
When the data is accessed within a certain time from the latest accessed time, the data is shown to be interested by the user, and when the data is not accessed within the certain time from the latest accessed time, the data is shown to be well interested by the user.
In one embodiment, step S150 can be implemented as steps S151 to S152 as follows:
s151: acquiring the latest accessed time of the pre-deletion data, wherein the latest accessed time is as follows: the time the data was last accessed.
The computer can locally store the latest accessed time of each data, and when the computer locally stores the latest accessed time of each data, the computer can obtain the latest accessed time of the pre-deleted data from the local.
S152: and determining data to be deleted from the pre-deletion data according to the acquired latest accessed time, and deleting the determined data.
In one embodiment, step S152 can be implemented as the following steps: and determining data of which the time interval from the latest accessed time to the current time is greater than a second preset time interval from the pre-deletion data, and deleting the determined data. The second preset time interval may be determined according to the update speed of the data, the storage condition of the computer, or the like, or may also be determined according to other practical conditions, when the update speed of the data is fast, the second preset time interval may be set to be a shorter time interval, and when the occupancy rate of the storage of the computer is high, the second preset time interval may be set to be a shorter time interval. For example, the second preset time interval may be any one of 1 day to 10 days, or may be other time intervals, and the embodiment of the present invention is not particularly limited.
When the time interval between the latest accessed time of the data and the current time is larger than the second preset time interval, the data is indicated to be accessed earlier, namely the data is not accessed within a longer time from the current time, and at the moment, the data is indicated to be not interested by the user or is outdated, the data is deleted to release the storage space of the computer, the outdated data can be deleted more accurately, and the influence of data deletion on the user is reduced.
In another embodiment, step S152 can also be implemented as the following steps: and sequentially selecting a preset number of data from each pre-deleted data according to the sequence of the latest accessed time of each pre-deleted data from morning to evening, and deleting the selected preset number of data. The specific value of the preset number can be determined according to the actual conditions of the requirement of data updating on the storage of the computer, the size of data stored in the computer, the storage occupation condition of the computer, the input/output pressure of the storage of the computer and the like. For example, the preset number may be set to a large value when the demand for the storage of the computer is large for data update, and may be set to a large value when the space occupied by the data stored in the computer is small. The specific value of the preset number can be set by a person skilled in the art according to actual situations, and the embodiment of the present invention is not particularly limited. Deleting data according to the sequence of the latest accessed time of each pre-deleted data from early to late, so that the deleted data can be more consistent with the preference of the user, the data which are not interested by the user or the data which are outdated can be more accurately deleted, and the data which are interested by the user are reserved.
Because the latest accessed time of the data can reflect whether the data is outdated or not or whether the data is attractive to the user or not, the data is deleted according to the latest accessed time of the data, so that the deleted data can be more consistent with the preference of the user, and the data can be deleted more specifically.
In one embodiment, step S110 may include the following steps:
judging whether the data with the importance identification as the first identification is accessed or not;
if yes, acquiring the latest accessed time of the data with the importance identification as the first identification from the recorded accessed time;
if not, determining the time that the data with the importance identified as the first identification is downloaded as the last accessed time of the data with the importance identified as the first identification.
When the execution subject of the data deletion method provided by the embodiment of the present invention is a CDN cache server, the time for downloading the data may be: the time at which the data was downloaded from the global storage, which is the origin server where the data is stored.
In this case, the time when the data is downloaded to the computer may be determined as the latest access time of the data, so that the computer can acquire the latest access time of each data.
Corresponding to the above data deleting method, an embodiment of the present invention further provides a data deleting device, as shown in fig. 3, where the device includes:
a time obtaining unit 310, configured to obtain an identifier expiration time of data with an importance identifier as a first identifier, where the importance identifier indicates whether the data is important data, and the first identifier is: an identifier indicating that the data is important data;
a time monitoring unit 320, configured to monitor whether the obtained identifier expiration time is earlier than the current time;
an identifier modification unit 330, configured to, when a monitoring result of the time monitoring unit is yes, change the importance identifier of the data corresponding to the acquired identifier expiration time into a second identifier, where the second identifier is: an identifier indicating that the data is non-essential data;
a data selecting unit 340, configured to select data corresponding to the second identifier as pre-deletion data;
a data deleting unit 350, configured to delete data according to the pre-deleted data.
The data deleting device provided by the embodiment of the invention distinguishes important data and non-important data by using the importance identification, and the important data and the non-important data do not need to be respectively stored in different storage spaces, so that the storage space does not need to be redistributed, the data does not need to be stored again, the data deleting operation process can be simplified, and the data deleting efficiency can be improved.
In one embodiment, the apparatus may further include:
and the data setting unit is used for adding an importance identifier for the data after the data is downloaded, and setting identifier expiration time for the importance identifier.
In one embodiment, the apparatus may further include:
a data storage unit, configured to store the downloaded data, where a mapping table is correspondingly set in a disk for storing the downloaded data, and the mapping table includes: the identification of the data stored in the disk, the importance identification of the data and the identification expiration time of the importance identification;
and the information recording unit is used for recording the added importance identifier and the identifier expiration time of the importance identifier into a mapping table corresponding to a disk for storing the downloaded data.
In one embodiment, the time obtaining unit 310 may include:
a time and duration obtaining subunit, configured to obtain a latest access time and a preset valid duration of the data with the importance identifier as the first identifier, where the latest access time is: the time at which the data was last accessed;
and the identification expiration time determining subunit is used for determining the importance as the sum of the latest accessed time of the data with the first identification and the preset effective duration as the identification expiration time of the data with the importance as the first identification.
In one embodiment, the data deleting unit 350 may include:
a time obtaining subunit, configured to obtain a latest accessed time of the pre-deletion data, where the latest accessed time is: the time at which the data was last accessed;
and the data deleting subunit is used for determining data to be deleted from the pre-deleted data according to the acquired latest accessed time and deleting the determined data.
The embodiment of the present invention further provides a computer, as shown in fig. 4, including a processor 401, a communication interface 402, a memory 403, and a communication bus 404, where the processor 401, the communication interface 402, and the memory 403 complete mutual communication through the communication bus 404,
a memory 403 for storing a computer program;
the processor 401, when executing the program stored in the memory 403, implements the following steps:
acquiring the identifier expiration time of data with the importance identifier as a first identifier, wherein the importance identifier represents whether the data is important data, and the first identifier is as follows: an identifier indicating that the data is important data;
monitoring whether the acquired identifier expiration time is earlier than the current time;
if the time is earlier than the preset time, changing the importance identifier of the data corresponding to the acquired identifier expiration time into a second identifier, wherein the second identifier is as follows: an identifier indicating that the data is non-essential data;
selecting data corresponding to the second identifier as pre-deletion data;
and deleting data aiming at the pre-deleted data.
The computer provided by the embodiment of the invention distinguishes the important data from the non-important data by the importance identification, and the important data and the non-important data do not need to be respectively stored in different storage spaces, so that the redistribution of the storage spaces is not needed, the data does not need to be stored again, the operation process of data deletion can be simplified, and the efficiency of data deletion is improved.
The communication bus mentioned in the above computer may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this is not intended to represent only one bus or type of bus.
The communication interface is used for communication between the server and other devices.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In another embodiment of the present invention, a computer-readable storage medium is further provided, which has instructions stored therein, and when the computer-readable storage medium runs on a computer, the computer is caused to execute the data deleting method described in any one of the above embodiments.
In yet another embodiment provided by the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the data deletion method described in any of the above embodiments.
For the device/computer/storage medium/program product embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points.
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 an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the device/computer/storage medium embodiments, since they are substantially similar to the method embodiments, the description is relatively simple and reference may be made to the partial description of the method embodiments for relevant points.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the 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 (12)

1. A method for deleting data, the method comprising:
acquiring the identifier expiration time of data with the importance identifier as a first identifier, wherein the importance identifier represents whether the data is important data, and the first identifier is as follows: an identifier indicating that the data is important data; the identifier expiration time is used for representing the time when the importance identifier expires;
monitoring whether the acquired identifier expiration time is earlier than the current time;
if the time is earlier than the preset time, changing the importance identifier of the data corresponding to the acquired identifier expiration time into a second identifier, wherein the second identifier is as follows: an identifier indicating that the data is non-essential data;
selecting data corresponding to the second identifier as pre-deletion data;
and deleting data aiming at the pre-deleted data.
2. The method of claim 1, wherein prior to the step of obtaining an identification expiration time for data having an importance identification of the first identification, the method further comprises:
after the data is downloaded, adding an importance mark for the data, and setting an identification expiration time for the importance mark.
3. The method of claim 2, wherein after the step of downloading the data, the method further comprises:
storing the downloaded data, wherein a mapping table is correspondingly arranged on a disk for storing the downloaded data, and the mapping table comprises: the identification of the data stored in the disk, the importance identification of the data and the identification expiration time of the importance identification;
after the step of adding the importance identifier to the data and setting an identifier expiration time for the importance identifier, the method further comprises:
and recording the added importance identification and the identification expiration time of the importance identification into a mapping table corresponding to a disk for storing the downloaded data.
4. The method of claim 1, wherein obtaining an identifier expiration time for the data having the importance identifier of the first identifier comprises:
acquiring the latest accessed time and preset effective duration of the data with the importance identifier as the first identifier, wherein the latest accessed time is as follows: the time at which the data was last accessed;
and determining the sum of the latest accessed time and the preset effective time of the data with the importance identified as the first identifier as the identifier expiration time of the data with the importance identified as the first identifier.
5. The method according to any one of claims 1 to 4, wherein the performing data deletion on the pre-deletion data comprises:
acquiring the latest accessed time of the pre-deleted data, wherein the latest accessed time is as follows: the time at which the data was last accessed;
and determining data to be deleted from the pre-deletion data according to the acquired latest accessed time, and deleting the determined data.
6. An apparatus for deleting data, the apparatus comprising:
a time acquisition unit configured to acquire an identifier expiration time of data whose importance identifier indicates whether the data is important data, the first identifier being: an identifier indicating that the data is important data; the identifier expiration time is used for representing the time when the importance identifier expires;
the time monitoring unit is used for monitoring whether the acquired identifier expiration time is earlier than the current time;
an identifier modification unit, configured to change, when a monitoring result of the time monitoring unit is yes, the importance identifier of the data corresponding to the acquired identifier expiration time into a second identifier, where the second identifier is: an identifier indicating that the data is non-essential data;
the data selection unit is used for selecting the data corresponding to the second identifier as pre-deletion data;
and the data deleting unit is used for deleting the data aiming at the pre-deleted data.
7. The apparatus of claim 6, further comprising:
and the data setting unit is used for adding an importance identifier for the data after the data is downloaded, and setting identifier expiration time for the importance identifier.
8. The apparatus of claim 7, further comprising:
the data storage unit is used for storing the downloaded data, wherein a mapping table is correspondingly arranged on a magnetic disk for storing the downloaded data, and the mapping table comprises: the identification of the data stored in the disk, the importance identification of the data and the identification expiration time of the importance identification;
and the information recording unit is used for recording the added importance identifier and the identifier expiration time of the importance identifier into a mapping table corresponding to a disk for storing the downloaded data.
9. The apparatus of claim 6, wherein the time obtaining unit comprises:
a time and duration obtaining subunit, configured to obtain a latest access time and a preset valid duration of the data with the importance identifier as the first identifier, where the latest access time is: the time at which the data was last accessed;
and the identification expiration time determining subunit is used for determining the importance as the sum of the latest accessed time of the data with the first identification and the preset effective duration as the identification expiration time of the data with the importance as the first identification.
10. The apparatus according to any one of claims 6 to 9, wherein the data deleting unit includes:
a time obtaining subunit, configured to obtain a latest accessed time of the pre-deletion data, where the latest accessed time is: the time at which the data was last accessed;
and the data deleting subunit is used for determining the data to be deleted from the pre-deleted data according to the acquired latest accessed time and deleting the determined data.
11. A computer, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the bus;
the memory is used for storing a computer program;
the processor, configured to execute the program stored in the memory, implements the method steps of any of claims 1-5.
12. A computer-readable storage medium, characterized in that a computer program is stored in the storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-5.
CN201910457514.2A 2019-05-29 2019-05-29 Data deleting method and device, computer and storage medium Active CN110187836B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910457514.2A CN110187836B (en) 2019-05-29 2019-05-29 Data deleting method and device, computer and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910457514.2A CN110187836B (en) 2019-05-29 2019-05-29 Data deleting method and device, computer and storage medium

Publications (2)

Publication Number Publication Date
CN110187836A CN110187836A (en) 2019-08-30
CN110187836B true CN110187836B (en) 2022-09-02

Family

ID=67718478

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910457514.2A Active CN110187836B (en) 2019-05-29 2019-05-29 Data deleting method and device, computer and storage medium

Country Status (1)

Country Link
CN (1) CN110187836B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113111014B (en) * 2021-04-07 2023-01-06 山东英信计算机技术有限公司 Method, device and equipment for cleaning non-hot data in cache and storage medium
CN113849131A (en) * 2021-09-28 2021-12-28 咪咕文化科技有限公司 Data storage method and device, computing equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104516792A (en) * 2013-10-08 2015-04-15 杰发科技(合肥)有限公司 Data backup method and device
CN104601675A (en) * 2014-12-29 2015-05-06 小米科技有限责任公司 Server load balancing method and device
CN107025289A (en) * 2017-04-14 2017-08-08 腾讯科技(深圳)有限公司 The method and relevant device of a kind of data processing
CN107451190A (en) * 2017-06-26 2017-12-08 北京五八信息技术有限公司 Can persistence non-relational database data processing method and device
CN108932236A (en) * 2017-05-22 2018-12-04 北京金山云网络技术有限公司 A kind of file management method, scratch file delet method and device
CN109213604A (en) * 2018-10-15 2019-01-15 北京奇艺世纪科技有限公司 A kind of management method and device of data source
CN109408469A (en) * 2018-09-05 2019-03-01 中国平安人寿保险股份有限公司 Stale data document handling method, device, electronic device and storage medium
CN112948363A (en) * 2021-02-03 2021-06-11 北京金山云网络技术有限公司 Data processing method and device, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7653667B2 (en) * 2002-09-09 2010-01-26 Sap Ag Methods and systems for data moving using locks

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104516792A (en) * 2013-10-08 2015-04-15 杰发科技(合肥)有限公司 Data backup method and device
CN104601675A (en) * 2014-12-29 2015-05-06 小米科技有限责任公司 Server load balancing method and device
CN107025289A (en) * 2017-04-14 2017-08-08 腾讯科技(深圳)有限公司 The method and relevant device of a kind of data processing
CN108932236A (en) * 2017-05-22 2018-12-04 北京金山云网络技术有限公司 A kind of file management method, scratch file delet method and device
CN107451190A (en) * 2017-06-26 2017-12-08 北京五八信息技术有限公司 Can persistence non-relational database data processing method and device
CN109408469A (en) * 2018-09-05 2019-03-01 中国平安人寿保险股份有限公司 Stale data document handling method, device, electronic device and storage medium
CN109213604A (en) * 2018-10-15 2019-01-15 北京奇艺世纪科技有限公司 A kind of management method and device of data source
CN112948363A (en) * 2021-02-03 2021-06-11 北京金山云网络技术有限公司 Data processing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN110187836A (en) 2019-08-30

Similar Documents

Publication Publication Date Title
CN109561326B (en) Data query method and device
US20160117211A1 (en) Error troubleshooting using a correlated knowledge base
CN110674408B (en) Service platform, and real-time generation method and device of training sample
US10028019B2 (en) Method for controlling network media information publication, apparatus, and server
CN107506376B (en) Client for acquiring data of information point in area
CN108255620B (en) Service logic processing method, device, service server and system
CN110187836B (en) Data deleting method and device, computer and storage medium
CN108243032B (en) Method, device and equipment for acquiring service level information
CN110781372A (en) Method and device for optimizing website, computer equipment and storage medium
CN106997369B (en) Data cleaning method and device
CN110019974B (en) Chart drill-down implementation method and device
CN114003818A (en) Page recommendation method, device, server and storage medium
CN108228598B (en) Media information sorting method, server and system
CN110225122B (en) Message pushing method, device, equipment and storage medium
CN111459987A (en) Cache updating method and device
CN110727895A (en) Sensitive word sending method and device, electronic equipment and storage medium
CN109582863B (en) Recommendation method and server
CN107679143B (en) Baidu map based dynamic step-by-step loading device and method and readable storage medium
CN114253951B (en) Data processing method, system and second server
CN112000709B (en) Social media information total exposure batch mining method and device
CN112732757B (en) Method, system, device, equipment and storage medium for processing degraded data
CN109919470B (en) Method and device for distributing customer information
CN114969003A (en) Method and device for cleaning tablespace, electronic equipment and readable storage medium
CN111367905B (en) Object data storage and data index construction method and device and access server
CN111131393B (en) User activity data statistical method, electronic device 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