WO2018090703A1 - Data storage and deletion method and apparatus - Google Patents

Data storage and deletion method and apparatus Download PDF

Info

Publication number
WO2018090703A1
WO2018090703A1 PCT/CN2017/101547 CN2017101547W WO2018090703A1 WO 2018090703 A1 WO2018090703 A1 WO 2018090703A1 CN 2017101547 W CN2017101547 W CN 2017101547W WO 2018090703 A1 WO2018090703 A1 WO 2018090703A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
stored
correspondence
identifier information
information
Prior art date
Application number
PCT/CN2017/101547
Other languages
French (fr)
Chinese (zh)
Inventor
黄华东
夏伟强
王伟
林起芊
Original Assignee
杭州海康威视数字技术股份有限公司
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 杭州海康威视数字技术股份有限公司 filed Critical 杭州海康威视数字技术股份有限公司
Publication of WO2018090703A1 publication Critical patent/WO2018090703A1/en

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/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • G06F3/0611Improving I/O performance in relation to response time
    • 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
    • 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/0608Saving storage space on 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/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]

Definitions

  • the present application relates to the field of data storage technologies, and in particular, to a data storage and deletion method and apparatus.
  • the data is stored in an object storage system, which is a simple storage system, which is particularly suitable for scenarios where data is stored for a long time and rarely modified.
  • the object storage system also has elastic expansion properties. Therefore, the object storage system is more and more widely used in the fields of security monitoring and network disk.
  • the object storage system can conveniently store data in various formats, such as pictures, video data, text documents and the like.
  • the client where the user is located sends a detection request containing data to the data storage end, and the data storage terminal determines whether the local storage and the data are stored according to the verification information.
  • the data storage end determines that the target data is stored
  • the data storage end directly copies the data content corresponding to the target data, and stores a copy of the data content for the user who should upload the data.
  • the client is notified that the data storage of the client is successful; when the data storage terminal determines that the target data is not stored, the client is notified to upload the data.
  • the data storage end obtains a request for deleting the stored data corresponding to the client where the user is located, the related art needs to delete the data content of the stored data.
  • the data storage end stores data multiple times, that is, N users upload the same data, and the data storage end stores the data N times, which causes waste of the storage space of the data storage end, and when the data storage end is used.
  • the stored data is deleted and the amount of data of the data content corresponding to the stored data is large, it takes a long time to delete the stored data.
  • the purpose of the embodiment of the present application is to provide a data storage and deletion method and device to save storage space on the data storage end. Further, when the data storage end deletes the stored data, the time taken to delete the stored data is reduced.
  • the specific technical solutions are as follows:
  • the embodiment of the present application provides a data deletion method, where the method includes:
  • the correspondence relationship is a correspondence between the identifier information of the data to be stored and the identifier information of the corresponding stored data, where the corresponding relationship is
  • the stored data is data in which the corresponding data content is stored locally and is the same as the data content of the data to be stored, and the data to be stored is data in which the corresponding data content is to be stored locally;
  • the first identifier information is set to the deleted state, and the client is notified that the to-be-deleted data has been deleted;
  • the step of setting the first identifier information to a deleted state includes:
  • the method further includes: checking the stored correspondence, and determining whether the first correspondence corresponding to the first identifier information still exists in the correspondence relationship;
  • the target data content is deleted in response to the deletion task.
  • the method further includes:
  • the first identification information does not correspond to the target data content, according to the first corresponding Determining, by the first identifier information, second identifier information, where the second identifier information corresponds to the target data content;
  • the step of deleting the first correspondence that includes the first identifier information is performed;
  • the first correspondence that includes the first identifier information is deleted, and the target data content corresponding to the second identifier information is deleted.
  • the method further includes:
  • the target data content corresponding to the first identifier information is deleted.
  • the embodiment of the present application provides a data storage method, where the method includes:
  • the method further includes:
  • the feature information includes verification information of the data to be stored, a data amount of the data to be stored, and a data content of a predetermined number of bits of the data to be stored;
  • the step of comparing the feature information of the data to be stored with the feature information of the locally stored data, and determining whether the target data content of the data content of the data to be stored is stored locally includes:
  • the check information of the data to be stored matches the check information of the locally stored data
  • the data amount of the data to be stored matches the data amount of the locally stored data
  • the predetermined number of bits of the data to be stored it is determined that the target data content identical to the data content of the data to be stored is locally stored.
  • the embodiment of the present application provides a data storage device, where the device includes:
  • a first obtaining module configured to obtain a data deletion instruction sent by the client, where the data deletion instruction carries first identification information of the data to be deleted;
  • a first searching module configured to search, in the stored correspondence, a first correspondence that includes the first identifier information, where the correspondence relationship is identifier information of data to be stored and identifier information of the corresponding stored data.
  • the corresponding stored data is data in which the corresponding data content is stored locally and is the same as the data content of the data to be stored, and the data to be stored is data corresponding to the data content to be stored locally.
  • a first determining module configured to determine whether the first identifier information corresponds to the target data content after the first correspondence information that includes the first identifier information is found; if yes, trigger the setting module, if not, trigger the first Delete the module;
  • the setting module is configured to set the first identification information to a deleted state
  • a first notification module configured to notify the client that the data to be deleted has been deleted
  • the first deleting module is configured to delete a first correspondence that includes the first identifier information
  • the second notification module is configured to notify the client that the data to be deleted has been deleted.
  • the setting module is configured to: set a deletion task corresponding to the target data content of the first identifier information, and set the first identifier information to a deleted state;
  • the device further includes: a second determining module and a second deleting module;
  • the second determining module is configured to check the stored correspondence, and determine whether the first correspondence corresponding to the first identifier information still exists in the corresponding relationship, and when it is determined that the corresponding relationship does not exist, triggering the first Second delete the module;
  • the second deleting module is configured to delete the target data content in response to the deleting task.
  • the device further includes a determining module, a third determining module, a fourth determining module, and a third deleting module;
  • the determining module is configured to: when determining that the first identifier information does not correspond to the target data content, determine second identifier information corresponding to the first identifier information according to the first correspondence, the second identifier information Corresponding to the target data content;
  • the third determining module is configured to determine whether the second identifier information is set to the deleted state, and when the second identifier information is not set to the deleted state, triggering the first deleting module; When the second identifier information is set to the deleted state, the fourth determining module is triggered;
  • the fourth determining module is configured to determine, in addition to the first correspondence, whether the second correspondence corresponding to the second identifier information is included in the correspondence, and when determining that the correspondence includes the The second deletion module is triggered when the second correspondence is performed; and the third deletion module is triggered when it is determined that the second correspondence is not included in the correspondence;
  • the third deleting module is configured to delete the first correspondence that includes the first identifier information and delete the target data content corresponding to the second identifier information.
  • the device further includes a fourth deletion module
  • the fourth deleting module is configured to not find the first one in the stored correspondence relationship When the information is identified, the target data content corresponding to the first identification information is deleted.
  • an embodiment of the present application provides a data storage device, where the device includes:
  • a second obtaining module configured to obtain a probe request for data to be stored sent by the client, where the probe request includes third identifier information and feature information of the data to be stored;
  • the comparison determining module is configured to compare the feature information of the data to be stored with the feature information of the locally stored data, and determine whether the target data content that is the same as the data content of the data to be stored is stored locally;
  • a third obtaining module configured to obtain fourth identification information of the target data content if the target data content is already stored
  • a storage notification module configured to store a correspondence between the third identifier information and the fourth identifier information, and notify the client that the to-be-stored data has been stored.
  • the device further includes a sending module and a receiving storage module;
  • the sending module is configured to send data uploading information to the client when the target data content is not stored, so that the client uploads the data content of the to-be-stored data;
  • the receiving storage module is configured to receive and store data content of the data to be stored.
  • the feature information includes verification information of the data to be stored, a data amount of the data to be stored, and a data content of a predetermined number of bits of the data to be stored;
  • the comparison determination module includes a comparison unit and a determination unit
  • the comparison unit is configured to compare the verification information of the data to be stored with the verification information of the locally stored data, and perform the data amount of the data to be stored and the data amount of the locally stored data. Aligning, and comparing the data content of the predetermined number of bits of the data to be stored with the data content of the predetermined number of bits of the locally stored data;
  • the determining unit is configured to: when the check information of the data to be stored matches the check information of the locally stored data, and the data amount of the data to be stored matches the data amount of the locally stored data, and the When the data content of the predetermined number of bits of the data to be stored matches the data content of the predetermined number of bits of the locally stored data, it is determined that the same target as the data content of the data to be stored is locally stored. Data content.
  • an embodiment of the present application provides an electronic device, including a processor and a memory, where the memory is used to store a computer program;
  • the data deletion method provided by the embodiment of the present application is implemented when the processor is configured to execute a computer program stored in the memory.
  • the embodiment of the present application provides a computer program for being executed to perform the data deletion method provided by the embodiment of the present application.
  • the embodiment of the present application provides a storage medium for storing a computer program, and the computer program is executed to execute the data deletion method provided by the embodiment of the present application.
  • an embodiment of the present application provides an electronic device, including a processor and a memory, where the memory is used to store a computer program;
  • the data storage method provided by the embodiment of the present application is implemented when the processor is configured to execute a computer program stored in the memory.
  • the embodiment of the present application provides a computer program for being executed to execute the data storage method provided by the embodiment of the present application.
  • the embodiment of the present application provides a storage medium for storing a computer program, and the computer program is executed to execute the data storage method provided by the embodiment of the present application.
  • the data deletion method includes: obtaining a data deletion instruction that is sent by the client and carrying the first identification information of the data to be deleted, and in the stored correspondence, searching for the first identifier Corresponding relationship between the identifier information of the data to be stored and the identifier information of the corresponding stored data, where the corresponding stored data is stored locally and associated with the information
  • the data of the data to be stored is the same data, and the data to be stored is the data to be stored in the local data; when the first correspondence corresponding to the first identification information is found, it is determined whether the first identification information corresponds to the target data.
  • the data storage end does not repeatedly store the data content, but stores the correspondence between the data to be stored and the corresponding stored data. Therefore, the client can find the target data content according to the corresponding relationship, so as to save the local storage space, and when deleting the data, the correspondence relationship of the corresponding storage can be directly deleted, thereby saving the time consumed when deleting the data.
  • any of the products or methods of the present application necessarily does not necessarily require all of the advantages described above to be achieved at the same time.
  • FIG. 1 is a schematic flowchart of a data deletion method according to an embodiment of the present application
  • FIG. 2 is another schematic flowchart of a data deletion method according to an embodiment of the present application.
  • FIG. 3 is another schematic flowchart of a data deletion method according to an embodiment of the present disclosure.
  • FIG. 4 is another schematic flowchart of a data deletion method according to an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of a data storage method according to an embodiment of the present application.
  • FIG. 6 is another schematic flowchart of a data storage method according to an embodiment of the present disclosure.
  • FIG. 7 is a schematic structural diagram of a data deletion apparatus according to an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a data storage device according to an embodiment of the present application.
  • the embodiment of the present application provides a data storage and deletion method and device, so as to save local storage. Storage space, further, saves time spent deleting data.
  • the data deletion method can be applied to the data storage end, wherein the data storage end stores the target data content, and the corresponding relationship corresponding to the target data content can be stored.
  • the client stores data to the data storage end, first sends a probe request for the data to be stored to the data storage end, and the data storage terminal detects that the target content of the data content of the data to be stored is locally stored according to the probe request.
  • the data content the data content of the data to be stored is not repeatedly stored, but the correspondence relationship between the data to be stored and the stored data corresponding to the target data content is stored.
  • the correspondence relationship includes the identifier information of the data to be stored and the identifier information of the stored data. The identification information can uniquely determine the corresponding data.
  • the client can read the target data content according to the correspondence.
  • the embodiment of the present application provides a data deletion method, which may include the following steps:
  • S101 Obtain a data deletion instruction sent by the client, where the data deletion instruction carries the first identification information of the data to be deleted;
  • the client sends a data deletion instruction carrying the first identification information of the data to be deleted to the data storage end, and the data storage terminal receives the data deletion instruction, and obtains the first identification information in the data deletion instruction by using a related technology, where the first
  • the identifier information may be the file name of the data to be deleted or the corresponding path information to be stored, and the like, and the information of the data to be deleted may be uniquely determined.
  • S102 Search, in the stored correspondence, a first correspondence that includes the first identifier information.
  • the corresponding relationship is a correspondence between the identifier information of the data to be stored and the identifier information of the corresponding stored data;
  • the corresponding stored data is data that the corresponding data content is stored locally and is the same as the data content of the data to be stored. That is, the corresponding data content is stored in the data storage end and is the same data as the data content of the data to be stored;
  • the data to be stored is the data to be stored in the corresponding data content, that is, the corresponding data content is to be stored in the data storage. Data at the end.
  • the corresponding relationship may be: a correspondence between the identification information of each first data and the identification information of the second data, wherein the data content corresponding to each of the first data and the data content corresponding to the second data
  • the data content corresponding to the second data may be stored in the data storage end, and the data content corresponding to each of the first data may not be stored in the data storage end.
  • the first correspondence information including the first identifier information is searched, and the first identifier information is matched with the identifier information in the corresponding relationship.
  • the corresponding relationship is determined to be included in the corresponding relationship.
  • a first correspondence of the identification information and vice versa, determining that the first correspondence that does not include the first identification information exists in the correspondence. After the matching is successful, a subsequent data deletion process is performed.
  • S104 Set the first identification information to the deleted state, and notify the client that the data to be deleted has been deleted;
  • S105 Delete the first correspondence that includes the first identifier information, and notify the client that the data to be deleted has been deleted.
  • the first identifier information may be the identifier information corresponding to the target content data, or may not be the identifier information corresponding to the target content data. Whether the first identification information corresponds to the target data content.
  • the determination is yes, in order to avoid the correspondence corresponding to the target data content, the target data content cannot be read, and the target data content cannot be directly deleted at this time.
  • the first identifier information is set to the deleted state, and the data to be deleted corresponding to the first identifier information of the client is notified to be deleted.
  • the determination is no, the first correspondence corresponding to the first identifier information may be deleted, and the data to be deleted corresponding to the first identifier information is notified to the client.
  • the first identifier information may include: status information that identifies that the corresponding target data content only corresponds to the state of the client. For example, when the status information is “1”, the data content corresponding to the first identifier information may be identified.
  • the client being in a storage state, that is, when the state information included in the first identifier information is “1”, only the client identifies that the data storage end stores the data content corresponding to the first identifier information;
  • the value of the first identifier information is set to "0"
  • the target data content corresponding to the first identifier information is corresponding to the deleted state of the client, that is, when the state information included in the first identifier information is "0". Only the above client identifies that the data content corresponding to the first identification information has been deleted by the data storage end.
  • the first identification information is set to a deleted state, wherein the deleted identification may be any pre-set string or symbol.
  • the deleted identification may be any pre-set string or symbol.
  • a “deleted” character string is added to the first identifier information to set the first identifier information to the deleted state, so that only the client identifies that the data content corresponding to the first identifier information has been deleted.
  • the first correspondence corresponding to the first identifier information is found, where the corresponding relationship is to be And a corresponding relationship between the identifier information of the stored data and the identifier information of the corresponding stored data, where the corresponding stored data is data that is stored locally and is the same as the data content of the data to be stored, the to-be-stored
  • the data is data corresponding to the data content to be stored locally; after the first correspondence corresponding to the first identifier information is found, determining whether the first identifier information corresponds to the target data content; if yes, setting the first identifier information to The status is deleted, and the client is notified that the data to be deleted has been deleted; if not, the first correspondence corresponding to the first identification information is deleted, and the client is notified that the data to be deleted has been deleted.
  • the data storage end when obtaining the probe request of the data to be stored that is the same as the target data content of the stored data, the data storage end does not repeatedly store the data content, but stores the correspondence between the data to be stored and the corresponding stored data. Therefore, the client can find the target data content according to the corresponding relationship, so as to save the local storage space, and when deleting the data, the correspondence relationship of the corresponding storage can be directly deleted, thereby saving the time consumed when deleting the data.
  • the step of setting the first identification information to the deleted state may include:
  • S201 setting a deletion task corresponding to the target data content of the first identification information, and setting the first identification information to the deleted state;
  • the first correspondence relationship including the first identifier information may exist one or more, and all the first correspondences are An identification information is set to the deleted state. And deleting the target data content corresponding to the first identification information, so that when it is determined that the first correspondence relationship including the first identification information does not exist locally, the target data content is deleted. After the deletion task is set for the target data content, whether the corresponding relationship including the first identification information still exists in the stored correspondence relationship may be checked periodically or irregularly. When a correspondence is made, the target data content is deleted.
  • the above local can be local to the data storage end.
  • the first identifier information is set to the deleted state, not only to notify that the data to be deleted by the client is deleted, but also to obtain a probe request for storing data to be stored in the same manner as the target data content.
  • the correspondence between the fifth identifier information of the data to be stored and the first identifier information is restricted.
  • the data storage end notifies the corresponding client to upload the data content of the data to be stored corresponding to the fifth identifier information, and stores the data content.
  • the data storage end stores a corresponding relationship, as shown in Table 1.
  • A, B, C, D, E, F, M, and P are all identification information corresponding to the stored data
  • A, C, D, and E are all corresponding to B
  • B corresponds to target data content 1
  • F and M Both correspond to P
  • P corresponds to the target data content 2;
  • the first correspondence corresponding to B is searched for in the stored correspondence, and the first correspondence includes AB, CB, DB, and EB, and B is determined. Corresponding to the target data content. In this case, you need to set B to the deleted state and notify the client that the data to be deleted has been deleted.
  • the corresponding relationship is checked periodically or irregularly, and it is determined whether there is still a first correspondence relationship including B in the correspondence relationship; when there is no first correspondence relationship including B, the target corresponding to B is Data content 1 is deleted.
  • a data deletion method provided by an embodiment of the present application may further include:
  • S302 determining whether the second identification information has been set to the deleted state; when it is determined that the second identification information is not set to the deleted state, executing S105, when determining that the second identification information has been set to the deleted state, executing S303;
  • S303 Determine whether the second correspondence corresponding to the second identifier information is included in the correspondence relationship, and if it is determined that the second correspondence is included in the correspondence, S105 is performed, and the second relationship is not included in the correspondence. Corresponding to the relationship, executing S304;
  • S304 Delete the first correspondence that includes the first identifier information and delete the target data content corresponding to the second identifier information.
  • the first correspondence may be determined to be only one, and the second identifier information corresponding to the target data content may be determined according to the first correspondence, and the second identifier is further determined. Whether the identifier information is set to the deleted state, and when the second identifier information is determined to be deleted, the second correspondence corresponding to the second identifier information is not included in the correspondence, and The first correspondence may be deleted and the target data content may also be deleted, and the subsequent notification may be notified that the data to be deleted by the client has been deleted. When it is determined that the second identifier information has been set to the deleted state, and the corresponding relationship includes the first correspondence, If the second correspondence relationship of the second identifier information is included, only the first correspondence relationship is deleted.
  • the data storage end stores a corresponding relationship, as shown in Table 1.
  • the data deletion instruction carrying the first identification information is A
  • A does not correspond to the target data content
  • the first correspondence AB it is determined that B and B correspond to the target data content 1, and it is determined whether B has been set to the deleted state.
  • the first correspondence AB is directly deleted.
  • the B is set to the deleted state, it is determined whether the second correspondence corresponding to B is included in the correspondence, such as a table.
  • the second correspondence relationship includes CB, DB, and EB.
  • the first correspondence AB is directly deleted, and only when the second correspondence CB, DB, and EB are not present, the first correspondence AB is deleted and deleted.
  • a data deletion method provided by an embodiment of the present application may further include:
  • the target data content corresponding to the first identifier information may be directly deleted.
  • the embodiment of the present application provides a data storage method, which may include the following steps:
  • S501 Obtain a probe request for data to be stored sent by the client, where the probe request includes third identifier information and feature information of the data to be stored.
  • the client when the client needs to store data, the client first sends a probe request to the data storage terminal based on the data to be stored to detect whether the data storage terminal stores the same target data content as the data content of the data to be stored.
  • the data storage end may obtain a probe request for the data to be stored sent by the client according to the related technology, where the probe request includes first identifier information and feature information of the data to be stored.
  • the feature information may be a check value of the data to be stored, for example, an MD5 value, or the feature information may be a check value of the data to be stored and a data amount, or the feature information may be data to be stored. Check value and partial data content, etc., to detect whether the local target number of the data content of the data to be stored is stored locally by the feature information according to.
  • the third identifier information may be the file name of the data to be stored or the corresponding path information to be stored, etc., and the information of the data to be stored may be uniquely determined; the fourth identifier information mentioned later may correspond to the target data content.
  • the file name of the stored data or the corresponding storage path information, etc., can uniquely determine the information of the stored data.
  • S502 Comparing the feature information of the data to be stored with the feature information of the locally stored data, and determining whether the target data content that is the same as the data content of the data to be stored is stored locally;
  • the feature information of the stored data may be correspondingly stored.
  • the feature information of the data to be stored is compared with the feature information of the locally stored data.
  • the feature information of the data to be stored matches the feature information of the locally stored data, it is determined that the data content of the data to be stored is stored locally.
  • the target data content when the feature information of the data to be stored does not match the feature information of the locally stored data, determines that the target data content that is the same as the data content of the data to be stored is not locally stored.
  • the fourth identification information of the target data content may be obtained by a related technique.
  • S504 Store a correspondence between the third identifier information and the fourth identifier information, and notify the client that the data to be stored is stored.
  • the corresponding relationship between the third identifier information and the fourth identifier information is stored, so that when the client reads the data content corresponding to the third identifier information, the data storage end is configured according to the correspondence between the third identifier information and the fourth identifier information. And reading the target data content corresponding to the fourth identification information.
  • the client sends a probe request to the data storage end, where the third identifier information carrying the data to be stored in the probe request is A and the feature information is a, and the feature information of the stored data is compared by comparing a and the data storage end. Determining that the data storage end has the same target data content as the data content of the data to be stored, and the fourth identifier information B corresponding to the target data content, the data storage end stores the correspondence relationship AB, and notifies the client that the data to be stored is stored. .
  • the probe request includes the third identifier information and the feature information of the data to be stored; and performing the feature information of the data to be stored and the feature information of the locally stored data. Aligning, determining whether the local has the same target data content as the data content of the data to be stored; if the target data content is already stored, obtaining the fourth identification information of the target data content; storing the third identification information and the The fourth identifies the correspondence between the information and notifies the client that the data to be stored has been stored.
  • the client when the target data content of the data to be stored is stored locally, the client does not prompt the client to upload the data content of the data to be stored, but only the third identifier information of the data to be stored.
  • the data storage end when the data storage end receives the deletion request that is sent by the client and carries the third identifier information, and the data storage end only stores the correspondence between the third identifier information and the fourth identifier information corresponding to the target data content,
  • the data storage terminal may delete only the corresponding relationship, and the data content corresponding to the third identifier information does not need to be deleted, thereby saving the time consumed for deleting the data.
  • a data storage method provided by an embodiment of the present application may further include:
  • S601 When the target data content is not stored, send data upload information to the client, so that the client uploads data content of the data to be stored;
  • S602 Receive and store data content of the data to be stored.
  • the data uploading information is sent to the client by the related technology, so that the client uploads the data content of the data to be stored, and receives the storage according to the related technology.
  • the data content of the data to be stored is sent to the client by the related technology, so that the client uploads the data content of the data to be stored, and receives the storage according to the related technology.
  • the feature information may include: verification information of data to be stored, data amount of data to be stored, and data content of a predetermined number of bits of data to be stored;
  • the comparing the feature information of the data to be stored with the feature information of the locally stored data, The step of determining whether the local has stored the same target data content as the data content of the data to be stored may include:
  • the feature information may include the check information of the data to be stored, the data amount of the data to be stored, and the data content of the predetermined number of bits of the data to be stored.
  • Comparison with the verification information of the stored data and the verification information of the locally stored data, the amount of data of the data to be stored and the amount of data of the locally stored data, the data content of the predetermined number of bits of the data to be stored, and the reservation of the locally stored data The data content of the number of bits determines whether the data content is the same. Only when the above three comparison results are matched, it is determined that the data content is the same.
  • the embodiment of the present application provides a data deletion device.
  • the device may include:
  • the first obtaining module 710 is configured to obtain a data deletion instruction sent by the client, where the data deletion instruction carries the first identification information of the data to be deleted;
  • the first search module 720 is configured to search, in the stored correspondence, a first correspondence that includes the first identifier information, where the correspondence relationship is identifier information of data to be stored and identifier of the corresponding stored data.
  • the corresponding stored data is data that is stored locally and is the same as the data content of the data to be stored, and the data to be stored is the corresponding data content to be stored locally. data;
  • the first determining module 730 is configured to: when finding the first correspondence that includes the first identifier information After determining whether the first identifier information corresponds to the target data content; if yes, triggering the setting module, if not, triggering the first deleting module;
  • the setting module 740 is configured to set the first identification information to a deleted state
  • the first notification module 750 is configured to notify the client that the data to be deleted has been deleted
  • the first deleting module 760 is configured to delete a first correspondence that includes the first identifier information.
  • the second notification module 770 is configured to notify the client that the data to be deleted has been deleted.
  • the first correspondence corresponding to the first identifier information is found, where the corresponding relationship is to be And a corresponding relationship between the identifier information of the stored data and the identifier information of the corresponding stored data, where the corresponding stored data is data that is stored locally and is the same as the data content of the data to be stored, the to-be-stored
  • the data is data corresponding to the data content to be stored locally; after the first correspondence corresponding to the first identifier information is found, determining whether the first identifier information corresponds to the target data content; if yes, setting the first identifier information to The status is deleted, and the client is notified that the data to be deleted has been deleted; if not, the first correspondence corresponding to the first identification information is deleted, and the client is notified that the data to be deleted has been deleted.
  • the data storage end when obtaining the probe request of the data to be stored that is the same as the target data content of the stored data, the data storage end does not repeatedly store the data content, but stores the correspondence between the data to be stored and the corresponding stored data. Therefore, the client can find the target data content according to the corresponding relationship, so as to save the local storage space, and when deleting the data, the correspondence relationship of the corresponding storage can be directly deleted, thereby saving the time consumed when deleting the data.
  • the setting module 720 is specifically configured to: set a deletion task corresponding to the target data content of the first identifier information, and set the first identifier information to a deleted state;
  • the device further includes: a second determining module and a second deleting module;
  • the second determining module is configured to check the stored correspondence, and determine whether the first correspondence corresponding to the first identifier information still exists in the corresponding relationship, and when it is determined that the corresponding relationship does not exist, triggering the first Second delete the module;
  • the second deleting module is configured to delete the target data content in response to the deleting task.
  • the apparatus further includes a determining module, a third determining module, a fourth determining module, and a third deleting module;
  • the determining module is configured to: when determining that the first identifier information does not correspond to the target data content, determine second identifier information corresponding to the first identifier information according to the first correspondence, the second identifier information Corresponding to the target data content;
  • the third determining module is configured to determine whether the second identifier information is set to the deleted state, and when the second identifier information is not set to the deleted state, triggering the first deleting module; When the second identifier information is set to the deleted state, the fourth determining module is triggered;
  • the fourth determining module is configured to determine, in addition to the first correspondence, whether the second correspondence corresponding to the second identifier information is included in the correspondence, and when determining that the correspondence includes the The second deletion module is triggered when the second correspondence is performed; and the third deletion module is triggered when it is determined that the second correspondence is not included in the correspondence;
  • the third deleting module is configured to delete the first correspondence that includes the first identifier information and delete the target data content corresponding to the second identifier information.
  • the apparatus further includes a fourth deletion module
  • the fourth deleting module is configured to delete the target data content corresponding to the first identifier information when the first identifier information is not found in the stored correspondence relationship.
  • the embodiment of the present application provides a data storage device.
  • the device may include:
  • a second obtaining module 810 configured to obtain a probe request for data to be stored sent by the client, where the probe request includes third identifier information and feature information of the data to be stored;
  • the comparison determining module 820 is configured to compare the feature information of the data to be stored with the feature information of the locally stored data, and determine whether the target data content that is the same as the data content of the data to be stored is stored locally;
  • a third obtaining module 830 configured to obtain fourth identification information of the target data content if the target data content is already stored
  • the storage notification module 840 is configured to store a correspondence between the third identifier information and the fourth identifier information, and notify the client that the to-be-stored data has been stored.
  • the probe request includes the third identifier information and the feature information of the data to be stored; and performing the feature information of the data to be stored and the feature information of the locally stored data. Aligning, determining whether the local has the same target data content as the data content of the data to be stored; if the target data content is already stored, obtaining the fourth identification information of the target data content; storing the third identification information and the The fourth identifies the correspondence between the information and notifies the client that the data to be stored has been stored.
  • the client when the target data content of the data to be stored is stored locally, the client does not prompt the client to upload the data content of the data to be stored, but only the third identifier information of the data to be stored.
  • the data storage end when the data storage end receives the deletion request that is sent by the client and carries the third identifier information, and the data storage end only stores the correspondence between the third identifier information and the fourth identifier information corresponding to the target data content,
  • the data storage terminal may delete only the corresponding relationship, and the data content corresponding to the third identifier information does not need to be deleted, thereby saving the time consumed for deleting the data.
  • a data storage device provided by an embodiment of the present application may further include a sending module and a receiving storage module.
  • the sending module is configured to send data uploading information to the client when the target data content is not stored, so that the client uploads the data content of the to-be-stored data;
  • the receiving storage module is configured to receive and store data content of the data to be stored.
  • the feature information may include verification information of the data to be stored, a data amount of the data to be stored, and a data content of a predetermined number of bits of the data to be stored;
  • the comparison determination module includes a comparison unit and a determination unit
  • the comparison unit is configured to compare the verification information of the data to be stored with the locally stored data. Verifying the information for comparison, and comparing the amount of data of the data to be stored with the amount of data of the locally stored data, and prescribing the data content of the predetermined number of bits of the data to be stored with the locally stored data The data content of the digits is compared;
  • the determining unit is configured to: when the check information of the data to be stored matches the check information of the locally stored data, and the data amount of the data to be stored matches the data amount of the locally stored data, and the When the data content of the predetermined number of bits of the data to be stored matches the data content of the predetermined number of bits of the locally stored data, it is determined that the target data content identical to the data content of the data to be stored is locally stored.
  • the embodiment of the present application further provides an electronic device, including a processor and a memory, wherein the memory is used to store a computer program;
  • the data deletion method provided by the embodiment of the present application is implemented by the processor, when the computer program is stored on the memory, where the data deletion method may include the following steps:
  • the correspondence relationship is a correspondence between the identifier information of the data to be stored and the identifier information of the corresponding stored data, where the corresponding relationship is
  • the stored data is data in which the corresponding data content is stored locally and is the same as the data content of the data to be stored, and the data to be stored is data in which the corresponding data content is to be stored locally;
  • the first identifier information is set to the deleted state, and the client is notified that the to-be-deleted data has been deleted;
  • the processor of the electronic device runs the computer program stored in the memory to perform the data deletion method provided by the embodiment of the present application, and thus can achieve: obtaining the number
  • the data storage end does not repeatedly store the data content, but stores the correspondence between the data to be stored and the corresponding stored data, so that the client According to the corresponding relationship, the target data content can be found to save the local storage space, and when the data is deleted, the corresponding storage correspondence can be directly deleted, which saves the time consumed when deleting the data.
  • the electronic device is specifically configured to:
  • the method further includes: checking the stored correspondence, and determining whether the first correspondence corresponding to the first identifier information still exists in the correspondence relationship;
  • the target data content is deleted in response to the deletion task.
  • the electronic device is further configured to:
  • the step of deleting the first correspondence that includes the first identifier information is performed;
  • the first correspondence that includes the first identifier information is deleted, and the target data content corresponding to the second identifier information is deleted.
  • the electronic device is further configured to:
  • the target data content corresponding to the first identifier information is deleted.
  • the embodiment of the present application further provides a computer program for being executed to perform the data deletion method provided by the embodiment of the present application, wherein the data deletion method may include the following steps:
  • the correspondence relationship is a correspondence between the identifier information of the data to be stored and the identifier information of the corresponding stored data, where the corresponding relationship is
  • the stored data is data in which the corresponding data content is stored locally and is the same as the data content of the data to be stored, and the data to be stored is data in which the corresponding data content is to be stored locally;
  • the first identifier information is set to the deleted state, and the client is notified that the to-be-deleted data has been deleted;
  • the computer program can execute the data deletion method provided by the embodiment of the present application at runtime, so that when the detection request of the data to be stored is the same as the target data content of the stored data,
  • the data storage end does not repeatedly store the data content, but stores the correspondence between the data to be stored and the corresponding stored data, so that the client can find the target data content according to the corresponding relationship, thereby saving local storage space, and
  • the corresponding relationship of the corresponding storage can be directly deleted, which saves the time consumed when deleting the data.
  • the computer program is configured to be executed to perform the process of setting the first identification information to a deleted state, specifically for:
  • the method further includes: checking the stored correspondence, and determining whether the first correspondence corresponding to the first identifier information still exists in the correspondence relationship;
  • the target data content is deleted in response to the deletion task.
  • the computer program is operative to execute:
  • the step of deleting the first correspondence that includes the first identifier information is performed;
  • the first correspondence that includes the first identifier information is deleted, and the target data content corresponding to the second identifier information is deleted.
  • the computer program is operative to execute:
  • the target data content corresponding to the first identifier information is deleted.
  • the embodiment of the present application provides a storage medium, where the storage medium is used to store a computer program, and the computer program is executed to perform the data deletion method provided by the embodiment of the present application.
  • the data deletion method may include the following steps:
  • a first correspondence including the first identifier information where The corresponding relationship is a correspondence between the identifier information of the data to be stored and the identifier information of the corresponding stored data, where the corresponding stored data is stored locally and associated with the data to be stored.
  • Data having the same data content, and the data to be stored is data to be stored locally in the corresponding data content;
  • the first identifier information is set to the deleted state, and the client is notified that the to-be-deleted data has been deleted;
  • the storage medium stores a computer program that executes the data deletion method provided by the embodiment of the present application at runtime, and thus can realize: obtaining the same data to be stored as the target data content of the stored data.
  • the data storage end does not repeatedly store the data content, but stores the correspondence between the data to be stored and the corresponding stored data, so that the client can find the target data content according to the corresponding relationship, thereby saving the local The storage space, and when deleting data, can directly delete the corresponding relationship of the storage, saving the time consumed when deleting the data.
  • the computer program is executed to perform the process of setting the first identification information to a deleted state, specifically for:
  • the method further includes: checking the stored correspondence, and determining whether the first correspondence corresponding to the first identifier information still exists in the correspondence relationship;
  • the target data content is deleted in response to the deletion task.
  • the computer program is executed to execute:
  • the step of deleting the first correspondence that includes the first identifier information is performed;
  • the first correspondence that includes the first identifier information is deleted, and the target data content corresponding to the second identifier information is deleted.
  • the computer program is executed to execute:
  • the target data content corresponding to the first identifier information is deleted.
  • the embodiment of the present application further provides an electronic device, including a processor and a memory, wherein the memory is used to store a computer program;
  • the data storage method provided by the embodiment of the present application is implemented by the processor, where the data storage method may include the following steps:
  • the processor of the electronic device runs the computer program stored in the memory
  • the electronic device is further configured to:
  • the feature information includes verification information of the data to be stored, a data amount of the data to be stored, and a data content of a predetermined number of bits of the data to be stored;
  • the electronic device performs the comparison between the feature information of the data to be stored and the feature information of the locally stored data, and determines whether the target data content that is the same as the data content of the data to be stored is stored locally.
  • the process specifically used to:
  • the check information of the data to be stored matches the check information of the locally stored data
  • the data amount of the data to be stored matches the data amount of the locally stored data
  • the predetermined number of bits of the data to be stored it is determined that the target data content identical to the data content of the data to be stored is locally stored.
  • the embodiment of the present application further provides a computer program for being executed to perform the data storage method provided by the embodiment of the present application, wherein the data storage method may include the following steps:
  • the computer program performs the data storage method provided by the embodiment of the present application at runtime, so that it can realize that only one real data content is stored locally for the data with the same data content, thereby saving local storage space. That is, the storage space on the data storage side is saved, and the storage time when the client stores data is saved.
  • the computer program is executed to execute:
  • the feature information includes verification information of the data to be stored, a data amount of the data to be stored, and a data content of a predetermined number of bits of the data to be stored;
  • the computer program is executed to perform the comparing the feature information of the data to be stored with the feature information of the locally stored data, and determining whether the same target data of the data content of the data to be stored has been stored locally In the process of content, it is specifically used to:
  • the check information of the data to be stored matches the check information of the locally stored data
  • the data amount of the data to be stored matches the data amount of the locally stored data
  • the predetermined number of bits of the data to be stored it is determined that the target data content identical to the data content of the data to be stored is locally stored.
  • the embodiment of the present application provides a storage medium, where the storage medium is used to store a computer program.
  • the computer program is executed to execute the data storage method provided by the embodiment of the present application, wherein the data storage method may include the following steps:
  • the storage medium stores a computer program that executes the data storage method provided by the embodiment of the present application at runtime, and thus can realize that only one real data content is stored locally for the data with the same data content, thereby saving
  • the local storage space saves storage space on the data storage side and saves storage time when the client stores data.
  • the computer program is executed to execute:
  • the feature information includes verification information of the data to be stored, a data amount of the data to be stored, and a data content of a predetermined number of bits of the data to be stored;
  • the computer program is executed to perform the comparing the feature information of the data to be stored with the feature information of the locally stored data, and determining whether the same target data of the data content of the data to be stored has been stored locally In the process of content, it is specifically used to:
  • the check information of the data to be stored matches the check information of the locally stored data
  • the data amount of the data to be stored matches the data amount of the locally stored data
  • the predetermined number of bits of the data to be stored it is determined that the target data content identical to the data content of the data to be stored is locally stored.

Abstract

A data storage and deletion method and apparatus, the data deletion method comprising: acquiring a data deletion instruction sent by a client, the data deletion instruction carrying first identification information of data to be deleted (S101); searching for a first correspondence relationship comprising the first identification information in a stored correspondence relationship (S102); determining whether the first identification information corresponds to target data content after the first correspondence relationship comprising the first identification information is found (S103); if yes, configuring the first identification information to be in a deleted state and notifying the client that the data to be deleted has been deleted (S104); and if no, deleting the first correspondence relationship comprising the first identification information, and notifying the client that the data to be deleted has been deleted (S105). While acquiring a probe request for data to be stored having the same data content as target data content of stored data, the method and apparatus do not repeatedly store the data content, but rather store the correspondence relationship between the data to be stored and the corresponding stored data, thereby saving local storage space, and saving the time spent in deleting data.

Description

一种数据存储和删除方法及装置Data storage and deletion method and device
本申请要求于2016年11月15日提交中国专利局、申请号为201611032369.6发明名称为“一种数据存储和删除方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201611032369.6, entitled "A Data Storage and Deletion Method and Apparatus", filed on November 15, 2016, the entire contents of in.
技术领域Technical field
本申请涉及数据存储技术领域,特别是涉及一种数据存储和删除方法及装置。The present application relates to the field of data storage technologies, and in particular, to a data storage and deletion method and apparatus.
背景技术Background technique
为了避免数据的丢失,用户越来越倾向将数据存储于网络侧中,以避免用户所在客户端出现故障或丢失时,数据也随之损坏或丢失。例如将数据存储于对象存储系统中,该对象存储系统是一种结构简单的存储系统,特别适合数据长期保存且很少修改的情景。另外对象存储系统还具有弹性扩容属性,因此,对象存储系统在安防监控、网盘等领域的应用越来越广泛。对象存储系统可以方便的存储各种格式的数据,例如图片、视频数据、文本文档等数据。In order to avoid data loss, users are increasingly inclined to store data in the network side to avoid data loss or loss when the user's client is faulty or lost. For example, the data is stored in an object storage system, which is a simple storage system, which is particularly suitable for scenarios where data is stored for a long time and rarely modified. In addition, the object storage system also has elastic expansion properties. Therefore, the object storage system is more and more widely used in the fields of security monitoring and network disk. The object storage system can conveniently store data in various formats, such as pictures, video data, text documents and the like.
相关技术中,每个用户上传数据时,用户所在客户端会对应该数据向数据存储端发送一个包含数据的校验信息的探测请求,数据存储端根据该校验信息确定本地是否已存储与该数据的校验信息相同的目标数据,当数据存储端确定为已存储该目标数据时,数据存储端直接复制该目标数据对应的数据内容,并对应该上传数据的用户存储该数据内容的副本,进一步的,通知用户所在客户端数据存储成功;当数据存储端确定为未存储该目标数据时,通知用户所在客户端上传数据。后续的,当数据存储端获得对应用户所在客户端删除已存储数据的请求时,相关技术中需要对应删除该已存储数据的数据内容。In the related art, when each user uploads data, the client where the user is located sends a detection request containing data to the data storage end, and the data storage terminal determines whether the local storage and the data are stored according to the verification information. When the data storage end determines that the target data is stored, the data storage end directly copies the data content corresponding to the target data, and stores a copy of the data content for the user who should upload the data. Further, the client is notified that the data storage of the client is successful; when the data storage terminal determines that the target data is not stored, the client is notified to upload the data. Subsequently, when the data storage end obtains a request for deleting the stored data corresponding to the client where the user is located, the related art needs to delete the data content of the stored data.
可见,相关技术中数据存储端会多次存储数据,即N个用户上传同一个数据,数据存储端存储N次该数据,这样就造成了数据存储端的存储空间的浪费,并且,当数据存储端删除已存储数据,且已存储数据对应的数据内容的数据量较大时,删除该已存储数据所消耗时间较长。 It can be seen that in the related art, the data storage end stores data multiple times, that is, N users upload the same data, and the data storage end stores the data N times, which causes waste of the storage space of the data storage end, and when the data storage end is used. When the stored data is deleted and the amount of data of the data content corresponding to the stored data is large, it takes a long time to delete the stored data.
发明内容Summary of the invention
本申请实施例的目的在于提供一种数据存储和删除方法及装置,以节省数据存储端的存储空间,进一步的,在数据存储端删除已存储数据时,以降低删除已存储数据所消耗的时间。具体技术方案如下:The purpose of the embodiment of the present application is to provide a data storage and deletion method and device to save storage space on the data storage end. Further, when the data storage end deletes the stored data, the time taken to delete the stored data is reduced. The specific technical solutions are as follows:
一方面,本申请实施例提供了一种数据删除方法,所述方法包括:In one aspect, the embodiment of the present application provides a data deletion method, where the method includes:
获得客户端发送的数据删除指令,其中,所述数据删除指令中携带待删除数据的第一标识信息;Obtaining a data deletion instruction sent by the client, where the data deletion instruction carries the first identification information of the data to be deleted;
在存储的对应关系中,查找包含所述第一标识信息的第一对应关系,其中,所述对应关系为待存储数据的标识信息与相应的已存储数据的标识信息的对应关系,所述相应的已存储数据为所对应数据内容已存储于本地且与所述待存储数据的数据内容相同的数据,所述待存储数据为所对应数据内容待存储于本地的数据;Searching, in the stored correspondence, a first correspondence that includes the first identifier information, where the correspondence relationship is a correspondence between the identifier information of the data to be stored and the identifier information of the corresponding stored data, where the corresponding relationship is The stored data is data in which the corresponding data content is stored locally and is the same as the data content of the data to be stored, and the data to be stored is data in which the corresponding data content is to be stored locally;
当查找到包含所述第一标识信息的第一对应关系后,判断所述第一标识信息是否对应目标数据内容;After finding the first correspondence that includes the first identifier information, determining whether the first identifier information corresponds to the target data content;
如果是,则将所述第一标识信息设置为已删除状态,并通知所述客户端所述待删除数据已删除;If yes, the first identifier information is set to the deleted state, and the client is notified that the to-be-deleted data has been deleted;
如果否,则删除包含所述第一标识信息的第一对应关系,并通知所述客户端所述待删除数据已删除。If no, the first correspondence corresponding to the first identifier information is deleted, and the client is notified that the data to be deleted has been deleted.
可选地,所述将所述第一标识信息设置为已删除状态的步骤,包括:Optionally, the step of setting the first identifier information to a deleted state includes:
对应所述第一标识信息的目标数据内容设置删除任务,并将所述第一标识信息设置为已删除状态;Setting a deletion task corresponding to the target data content of the first identification information, and setting the first identification information to a deleted state;
所述方法还包括:检查存储的所述对应关系,判断所述对应关系中是否还存在包含所述第一标识信息的第一对应关系;The method further includes: checking the stored correspondence, and determining whether the first correspondence corresponding to the first identifier information still exists in the correspondence relationship;
当判断为未存在时,响应所述删除任务,删除所述目标数据内容。When it is determined that there is no existence, the target data content is deleted in response to the deletion task.
可选地,所述方法还包括:Optionally, the method further includes:
当判断所述第一标识信息不对应目标数据内容时,根据所述第一对应关 系,确定所述第一标识信息对应的第二标识信息,所述第二标识信息与所述目标数据内容对应;When it is determined that the first identification information does not correspond to the target data content, according to the first corresponding Determining, by the first identifier information, second identifier information, where the second identifier information corresponds to the target data content;
判断所述第二标识信息是否已设置为已删除状态;Determining whether the second identification information has been set to a deleted state;
当判断所述第二标识信息未设置为已删除状态时,执行所述删除所述包含第一标识信息的第一对应关系的步骤;When it is determined that the second identifier information is not set to the deleted state, performing the step of deleting the first correspondence relationship that includes the first identifier information;
当判断所述第二标识信息已设置为已删除状态时,判断所述对应关系中除所述第一对应关系外是否还包括包含所述第二标识信息的第二对应关系;When it is determined that the second identifier information has been set to the deleted state, determining whether the second relationship corresponding to the second identifier information is included in the correspondence relationship other than the first correspondence relationship;
当判断所述对应关系中包含所述第二对应关系时,执行所述删除包含所述第一标识信息的第一对应关系的步骤;When it is determined that the second correspondence is included in the correspondence, the step of deleting the first correspondence that includes the first identifier information is performed;
当判断所述对应关系中不包含所述第二对应关系时,删除包含所述第一标识信息的第一对应关系且删除所述第二标识信息对应的目标数据内容。When it is determined that the second correspondence is not included in the correspondence, the first correspondence that includes the first identifier information is deleted, and the target data content corresponding to the second identifier information is deleted.
可选地,所述方法还包括:Optionally, the method further includes:
当在存储的所述对应关系中未查找到所述第一标识信息时,删除所述第一标识信息对应的目标数据内容。When the first identifier information is not found in the stored correspondence, the target data content corresponding to the first identifier information is deleted.
一方面,本申请实施例提供了一种数据存储方法,所述方法包括:In one aspect, the embodiment of the present application provides a data storage method, where the method includes:
获得客户端发送的待存储数据的探测请求,所述探测请求包括所述待存储数据的第三标识信息和特征信息;Obtaining a probe request for the data to be stored sent by the client, where the probe request includes third identifier information and feature information of the data to be stored;
将所述待存储数据的特征信息与本地已存储数据的特征信息进行比对,确定本地是否已存储有与所述待存储数据的数据内容相同的目标数据内容;Comparing the feature information of the to-be-stored data with the feature information of the locally stored data, and determining whether the target data content that is the same as the data content of the to-be-stored data is stored locally;
如果已存储有所述目标数据内容,则获得所述目标数据内容的第四标识信息;Obtaining fourth identification information of the target data content if the target data content is already stored;
存储所述第三标识信息与所述第四标识信息的对应关系,并通知所述客户端所述待存储数据已存储。And storing a correspondence between the third identifier information and the fourth identifier information, and notifying the client that the to-be-stored data is stored.
可选地,所述方法还包括:Optionally, the method further includes:
当未存储有所述目标数据内容时,向所述客户端发送数据上传信息,以使所述客户端上传所述待存储数据的数据内容; When the target data content is not stored, sending data upload information to the client, so that the client uploads the data content of the data to be stored;
接收并存储所述待存储数据的数据内容。Receiving and storing the data content of the data to be stored.
可选地,所述特征信息中包括所述待存储数据的校验信息、所述待存储数据的数据量以及所述待存储数据的预定位数的数据内容;Optionally, the feature information includes verification information of the data to be stored, a data amount of the data to be stored, and a data content of a predetermined number of bits of the data to be stored;
所述将所述待存储数据的特征信息与本地已存储数据的特征信息进行比对,确定本地是否已存储有与所述待存储数据的数据内容相同的目标数据内容的步骤,包括:The step of comparing the feature information of the data to be stored with the feature information of the locally stored data, and determining whether the target data content of the data content of the data to be stored is stored locally includes:
将所述待存储数据的校验信息与本地已存储数据的校验信息进行比对,且将所述待存储数据的数据量与本地已存储数据的数据量进行比对,且将所述待存储数据的预定位数的数据内容与本地已存储数据的预定位数的数据内容进行比对;Comparing the check information of the data to be stored with the check information of the locally stored data, and comparing the data amount of the data to be stored with the data amount of the locally stored data, and the The data content of the predetermined number of bits of the stored data is compared with the data content of the predetermined number of bits of the locally stored data;
当所述待存储数据的校验信息与本地已存储数据的校验信息匹配,且所述待存储数据的数据量与本地已存储数据的数据量匹配,且所述待存储数据的预定位数的数据内容与本地已存储数据的预定位数的数据内容匹配时,确定本地已存储有与所述待存储数据的数据内容相同的目标数据内容。When the check information of the data to be stored matches the check information of the locally stored data, and the data amount of the data to be stored matches the data amount of the locally stored data, and the predetermined number of bits of the data to be stored When the data content matches the data content of the predetermined number of bits of the locally stored data, it is determined that the target data content identical to the data content of the data to be stored is locally stored.
一方面,本申请实施例提供了一种数据存储装置,所述装置包括:In one aspect, the embodiment of the present application provides a data storage device, where the device includes:
第一获得模块,用于获得客户端发送的数据删除指令,其中,所述数据删除指令中携带待删除数据的第一标识信息;a first obtaining module, configured to obtain a data deletion instruction sent by the client, where the data deletion instruction carries first identification information of the data to be deleted;
第一查找模块,用于在存储的对应关系中,查找包含所述第一标识信息的第一对应关系,其中,所述对应关系为待存储数据的标识信息与相应的已存储数据的标识信息的对应关系,所述相应的已存储数据为所对应数据内容已存储于本地且与所述待存储数据的数据内容相同的数据,所述待存储数据为所对应数据内容待存储于本地的数据;a first searching module, configured to search, in the stored correspondence, a first correspondence that includes the first identifier information, where the correspondence relationship is identifier information of data to be stored and identifier information of the corresponding stored data. Corresponding relationship, the corresponding stored data is data in which the corresponding data content is stored locally and is the same as the data content of the data to be stored, and the data to be stored is data corresponding to the data content to be stored locally. ;
第一判断模块,用于当查找到包含所述第一标识信息的第一对应关系后,判断所述第一标识信息是否对应目标数据内容;如果是,触发设置模块,如果否,触发第一删除模块;a first determining module, configured to determine whether the first identifier information corresponds to the target data content after the first correspondence information that includes the first identifier information is found; if yes, trigger the setting module, if not, trigger the first Delete the module;
所述设置模块,用于将所述第一标识信息设置为已删除状态;The setting module is configured to set the first identification information to a deleted state;
第一通知模块,用于通知所述客户端所述待删除数据已删除; a first notification module, configured to notify the client that the data to be deleted has been deleted;
所述第一删除模块,用于删除包含所述第一标识信息的第一对应关系;The first deleting module is configured to delete a first correspondence that includes the first identifier information;
第二通知模块,用于通知所述客户端所述待删除数据已删除。The second notification module is configured to notify the client that the data to be deleted has been deleted.
可选地,所述设置模块,具体用于对应所述第一标识信息的目标数据内容设置删除任务,并将所述第一标识信息设置为已删除状态;Optionally, the setting module is configured to: set a deletion task corresponding to the target data content of the first identifier information, and set the first identifier information to a deleted state;
所述装置还包括:第二判断模块和第二删除模块;The device further includes: a second determining module and a second deleting module;
所述第二判断模块,用于检查存储的所述对应关系,判断所述对应关系中是否还存在包含所述第一标识信息的第一对应关系,当判断为未存在时,触发所述第二删除模块;The second determining module is configured to check the stored correspondence, and determine whether the first correspondence corresponding to the first identifier information still exists in the corresponding relationship, and when it is determined that the corresponding relationship does not exist, triggering the first Second delete the module;
所述第二删除模块,用于响应所述删除任务,删除所述目标数据内容。The second deleting module is configured to delete the target data content in response to the deleting task.
可选地,所述装置还包括确定模块、第三判断模块、第四判断模块和第三删除模块;Optionally, the device further includes a determining module, a third determining module, a fourth determining module, and a third deleting module;
所述确定模块,用于当判断所述第一标识信息不对应目标数据内容时,根据所述第一对应关系,确定所述第一标识信息对应的第二标识信息,所述第二标识信息与所述目标数据内容对应;The determining module is configured to: when determining that the first identifier information does not correspond to the target data content, determine second identifier information corresponding to the first identifier information according to the first correspondence, the second identifier information Corresponding to the target data content;
所述第三判断模块,用于判断所述第二标识信息是否已设置为已删除状态,当判断所述第二标识信息未设置为已删除状态时,触发所述第一删除模块;当判断所述第二标识信息已设置为已删除状态时,触发所述第四判断模块;The third determining module is configured to determine whether the second identifier information is set to the deleted state, and when the second identifier information is not set to the deleted state, triggering the first deleting module; When the second identifier information is set to the deleted state, the fourth determining module is triggered;
所述第四判断模块,用于判断所述对应关系中除所述第一对应关系外是否还包括包含所述第二标识信息的第二对应关系,当判断所述对应关系中包含所述第二对应关系时,触发所述第一删除模块;当判断所述对应关系中不包含所述第二对应关系时,触发所述第三删除模块;The fourth determining module is configured to determine, in addition to the first correspondence, whether the second correspondence corresponding to the second identifier information is included in the correspondence, and when determining that the correspondence includes the The second deletion module is triggered when the second correspondence is performed; and the third deletion module is triggered when it is determined that the second correspondence is not included in the correspondence;
所述第三删除模块,用于删除包含所述第一标识信息的第一对应关系且删除所述第二标识信息对应的目标数据内容。The third deleting module is configured to delete the first correspondence that includes the first identifier information and delete the target data content corresponding to the second identifier information.
可选地,所述装置还包括第四删除模块;Optionally, the device further includes a fourth deletion module;
所述第四删除模块,用于当在存储的所述对应关系中未查找到所述第一 标识信息时,删除所述第一标识信息对应的目标数据内容。The fourth deleting module is configured to not find the first one in the stored correspondence relationship When the information is identified, the target data content corresponding to the first identification information is deleted.
另一方面,本申请实施例提供了一种数据存储装置,所述装置包括:On the other hand, an embodiment of the present application provides a data storage device, where the device includes:
第二获得模块,用于获得客户端发送的待存储数据的探测请求,所述探测请求包括所述待存储数据的第三标识信息和特征信息;a second obtaining module, configured to obtain a probe request for data to be stored sent by the client, where the probe request includes third identifier information and feature information of the data to be stored;
比对确定模块,用于将所述待存储数据的特征信息与本地已存储数据的特征信息进行比对,确定本地是否已存储有与所述待存储数据的数据内容相同的目标数据内容;The comparison determining module is configured to compare the feature information of the data to be stored with the feature information of the locally stored data, and determine whether the target data content that is the same as the data content of the data to be stored is stored locally;
第三获得模块,用于如果已存储有所述目标数据内容,则获得所述目标数据内容的第四标识信息;a third obtaining module, configured to obtain fourth identification information of the target data content if the target data content is already stored;
存储通知模块,用于存储所述第三标识信息与所述第四标识信息的对应关系,并通知所述客户端所述待存储数据已存储。And a storage notification module, configured to store a correspondence between the third identifier information and the fourth identifier information, and notify the client that the to-be-stored data has been stored.
可选地,所述装置还包括发送模块和接收存储模块;Optionally, the device further includes a sending module and a receiving storage module;
所述发送模块,用于当未存储有所述目标数据内容时,向所述客户端发送数据上传信息,以使所述客户端上传所述待存储数据的数据内容;The sending module is configured to send data uploading information to the client when the target data content is not stored, so that the client uploads the data content of the to-be-stored data;
所述接收存储模块,用于接收并存储所述待存储数据的数据内容。The receiving storage module is configured to receive and store data content of the data to be stored.
可选地,所述特征信息中包括所述待存储数据的校验信息、所述待存储数据的数据量以及所述待存储数据的预定位数的数据内容;Optionally, the feature information includes verification information of the data to be stored, a data amount of the data to be stored, and a data content of a predetermined number of bits of the data to be stored;
所述比对确定模块包括比对单元和确定单元;The comparison determination module includes a comparison unit and a determination unit;
所述比对单元,用于将所述待存储数据的校验信息与本地已存储数据的校验信息进行比对,且将所述待存储数据的数据量与本地已存储数据的数据量进行比对,且将所述待存储数据的预定位数的数据内容与本地已存储数据的预定位数的数据内容进行比对;The comparison unit is configured to compare the verification information of the data to be stored with the verification information of the locally stored data, and perform the data amount of the data to be stored and the data amount of the locally stored data. Aligning, and comparing the data content of the predetermined number of bits of the data to be stored with the data content of the predetermined number of bits of the locally stored data;
所述确定单元,用于当所述待存储数据的校验信息与本地已存储数据的校验信息匹配,且所述待存储数据的数据量与本地已存储数据的数据量匹配,且所述待存储数据的预定位数的数据内容与本地已存储数据的预定位数的数据内容匹配时,确定本地已存储有与所述待存储数据的数据内容相同的目标 数据内容。The determining unit is configured to: when the check information of the data to be stored matches the check information of the locally stored data, and the data amount of the data to be stored matches the data amount of the locally stored data, and the When the data content of the predetermined number of bits of the data to be stored matches the data content of the predetermined number of bits of the locally stored data, it is determined that the same target as the data content of the data to be stored is locally stored. Data content.
另一方面,本申请实施例提供了一种电子设备,包括处理器和存储器,其中,存储器,用于存放计算机程序;On the other hand, an embodiment of the present application provides an electronic device, including a processor and a memory, where the memory is used to store a computer program;
处理器,用于执行存储器上所存放的计算机程序时,实现本申请实施例所提供的所述数据删除方法。The data deletion method provided by the embodiment of the present application is implemented when the processor is configured to execute a computer program stored in the memory.
另一方面,本申请实施例提供了一种计算机程序,所述计算机程序用于被运行以执行本申请实施例所提供的所述数据删除方法。On the other hand, the embodiment of the present application provides a computer program for being executed to perform the data deletion method provided by the embodiment of the present application.
另一方面,本申请实施例提供了一种存储介质,所述存储介质用于存储计算机程序,所述计算机程序被运行以执行本申请实施例所提供的所述数据删除方法。On the other hand, the embodiment of the present application provides a storage medium for storing a computer program, and the computer program is executed to execute the data deletion method provided by the embodiment of the present application.
另一方面,本申请实施例提供了一种电子设备,包括处理器和存储器,其中,存储器,用于存放计算机程序;On the other hand, an embodiment of the present application provides an electronic device, including a processor and a memory, where the memory is used to store a computer program;
处理器,用于执行存储器上所存放的计算机程序时,实现本申请实施例所提供的所述数据存储方法。The data storage method provided by the embodiment of the present application is implemented when the processor is configured to execute a computer program stored in the memory.
另一方面,本申请实施例提供了一种计算机程序,所述计算机程序用于被运行以执行本申请实施例所提供的所述数据存储方法。On the other hand, the embodiment of the present application provides a computer program for being executed to execute the data storage method provided by the embodiment of the present application.
另一方面,本申请实施例提供了一种存储介质,所述存储介质用于存储计算机程序,所述计算机程序被运行以执行本申请实施例所提供的所述数据存储方法。On the other hand, the embodiment of the present application provides a storage medium for storing a computer program, and the computer program is executed to execute the data storage method provided by the embodiment of the present application.
本申请实施例提供的数据存储和删除方法及装置,数据删除方法包括:获得客户端发送的携带待删除数据的第一标识信息的数据删除指令,在存储的对应关系中,查找包含第一标识信息的第一对应关系,其中,对应关系为待存储数据的标识信息与相应的已存储数据的标识信息的对应关系,该相应的已存储数据为所对应数据内容已存储于本地且与所述待存储数据的数据内容相同的数据,该待存储数据为所对应数据内容待存储于本地的数据;当查找到包含第一标识信息的第一对应关系后,判断第一标识信息是否对应目标数据内容;如果是,则将第一标识信息设置为已删除状态,并通知客户端所 述待删除数据已删除;如果否,则删除包含第一标识信息的第一对应关系,并通知客户端所述待删除数据已删除。可见,在获得数据内容与已存储数据的目标数据内容相同的待存储数据的探测请求时,数据存储端不再重复存储数据内容,而是存储待存储数据与相应的已存储数据的对应关系,以使客户端可以根据该对应关系,查找到目标数据内容,以节省本地的存储空间,并且,在删除数据时,可以直接删除对应存储的对应关系,节省了删除数据时所消耗的时间。当然,实施本申请的任一产品或方法必不一定需要同时达到以上所述的所有优点。The data storage and deletion method and device provided by the embodiment of the present application, the data deletion method includes: obtaining a data deletion instruction that is sent by the client and carrying the first identification information of the data to be deleted, and in the stored correspondence, searching for the first identifier Corresponding relationship between the identifier information of the data to be stored and the identifier information of the corresponding stored data, where the corresponding stored data is stored locally and associated with the information The data of the data to be stored is the same data, and the data to be stored is the data to be stored in the local data; when the first correspondence corresponding to the first identification information is found, it is determined whether the first identification information corresponds to the target data. Content; if yes, the first identification information is set to the deleted state, and the client is notified The deleted data has been deleted; if not, the first correspondence corresponding to the first identification information is deleted, and the client is notified that the data to be deleted has been deleted. It can be seen that, when obtaining the probe request of the data to be stored that is the same as the target data content of the stored data, the data storage end does not repeatedly store the data content, but stores the correspondence between the data to be stored and the corresponding stored data. Therefore, the client can find the target data content according to the corresponding relationship, so as to save the local storage space, and when deleting the data, the correspondence relationship of the corresponding storage can be directly deleted, thereby saving the time consumed when deleting the data. Of course, implementing any of the products or methods of the present application necessarily does not necessarily require all of the advantages described above to be achieved at the same time.
附图说明DRAWINGS
为了更清楚地说明本申请实施例或相关技术中的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings to be used in the embodiments or the related art description will be briefly described below. Obviously, the drawings in the following description are only Some embodiments of the application may also be used to obtain other figures from those of ordinary skill in the art without departing from the scope of the invention.
图1为本申请实施例提供的一种数据删除方法的流程示意图;FIG. 1 is a schematic flowchart of a data deletion method according to an embodiment of the present application;
图2为本申请实施例提供的一种数据删除方法的另一流程示意图;2 is another schematic flowchart of a data deletion method according to an embodiment of the present application;
图3为本申请实施例提供的一种数据删除方法的另一流程示意图;FIG. 3 is another schematic flowchart of a data deletion method according to an embodiment of the present disclosure;
图4为本申请实施例提供的一种数据删除方法的另一流程示意图;4 is another schematic flowchart of a data deletion method according to an embodiment of the present application;
图5为本申请实施例提供的一种数据存储方法的流程示意图;FIG. 5 is a schematic flowchart of a data storage method according to an embodiment of the present application;
图6为本申请实施例提供的一种数据存储方法的另一流程示意图;FIG. 6 is another schematic flowchart of a data storage method according to an embodiment of the present disclosure;
图7为本申请实施例提供的一种数据删除装置的结构示意图;FIG. 7 is a schematic structural diagram of a data deletion apparatus according to an embodiment of the present application;
图8为本申请实施例提供的一种数据存储装置的结构示意图。FIG. 8 is a schematic structural diagram of a data storage device according to an embodiment of the present application.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following with reference to the drawings in the embodiments of the present application. It is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
本申请实施例提供了一种数据存储和删除方法及装置,以节省本地的存 储空间,进一步的,节省删除数据时所消耗的时间。The embodiment of the present application provides a data storage and deletion method and device, so as to save local storage. Storage space, further, saves time spent deleting data.
下面首先对本申请实施例所提供的一种数据删除方法进行介绍。可以理解的是,该数据删除方法可以应用于数据存储端,其中,该数据存储端存储有目标数据内容,以及可以存储有对应该目标数据内容的对应关系。当客户端向数据存储端存储数据时,首先向数据存储端发送关于待存储数据的探测请求,该数据存储端根据该探测请求,探测到本地已存储有与待存储数据的数据内容相同的目标数据内容时,不再重复存储该待存储数据的数据内容,而是存储待存储数据与目标数据内容相应的已存储数据的对应关系。其中,该对应关系中包含待存储数据的标识信息,以及已存储数据的标识信息。该标识信息可以唯一确定对应的数据。后续的,该客户端可以根据该对应关系,读取到目标数据内容。The following is a description of a data deletion method provided by the embodiment of the present application. It can be understood that the data deletion method can be applied to the data storage end, wherein the data storage end stores the target data content, and the corresponding relationship corresponding to the target data content can be stored. When the client stores data to the data storage end, first sends a probe request for the data to be stored to the data storage end, and the data storage terminal detects that the target content of the data content of the data to be stored is locally stored according to the probe request. In the case of the data content, the data content of the data to be stored is not repeatedly stored, but the correspondence relationship between the data to be stored and the stored data corresponding to the target data content is stored. The correspondence relationship includes the identifier information of the data to be stored and the identifier information of the stored data. The identification information can uniquely determine the corresponding data. Subsequently, the client can read the target data content according to the correspondence.
如图1所示,本申请实施例提供了一种数据删除方法,可以包括如下步骤:As shown in FIG. 1 , the embodiment of the present application provides a data deletion method, which may include the following steps:
S101:获得客户端发送的数据删除指令,其中,该数据删除指令中携带待删除数据的第一标识信息;S101: Obtain a data deletion instruction sent by the client, where the data deletion instruction carries the first identification information of the data to be deleted;
客户端向数据存储端发送携带待删除数据的第一标识信息的数据删除指令,数据存储端接收该数据删除指令,并通过相关技术得到该数据删除指令中的第一标识信息,其中,第一标识信息可以为该待删除数据的文件名或者对应的待存储路径信息等,能够唯一确定该待删除数据的信息。The client sends a data deletion instruction carrying the first identification information of the data to be deleted to the data storage end, and the data storage terminal receives the data deletion instruction, and obtains the first identification information in the data deletion instruction by using a related technology, where the first The identifier information may be the file name of the data to be deleted or the corresponding path information to be stored, and the like, and the information of the data to be deleted may be uniquely determined.
S102:在存储的对应关系中,查找包含第一标识信息的第一对应关系;S102: Search, in the stored correspondence, a first correspondence that includes the first identifier information.
其中,对应关系为待存储数据的标识信息与相应的已存储数据的标识信息的对应关系;该相应的已存储数据为所对应数据内容已存储于本地且与待存储数据的数据内容相同的数据,即所对应数据内容已存储于数据存储端且与待存储数据的数据内容相同的数据;该待存储数据为所对应数据内容待存储于本地的数据,即所对应数据内容待存储于数据存储端的数据。The corresponding relationship is a correspondence between the identifier information of the data to be stored and the identifier information of the corresponding stored data; the corresponding stored data is data that the corresponding data content is stored locally and is the same as the data content of the data to be stored. That is, the corresponding data content is stored in the data storage end and is the same data as the data content of the data to be stored; the data to be stored is the data to be stored in the corresponding data content, that is, the corresponding data content is to be stored in the data storage. Data at the end.
也就是说,上述对应关系可以为:每一第一数据的标识信息与第二数据的标识信息的对应关系,其中,上述每一第一数据对应的数据内容与上述第二数据对应的数据内容均相同,上述第二数据所对应的数据内容可以已存储于数据存储端,上述每一第一数据对应的数据内容可以未存储于数据存储端。 That is, the corresponding relationship may be: a correspondence between the identification information of each first data and the identification information of the second data, wherein the data content corresponding to each of the first data and the data content corresponding to the second data The data content corresponding to the second data may be stored in the data storage end, and the data content corresponding to each of the first data may not be stored in the data storage end.
在存储的对应关系中,查找包含该第一标识信息的第一对应关系,可以将第一标识信息与对应关系中的标识信息进行匹配,当匹配成功时,即确定该对应关系中存在包含第一标识信息的第一对应关系,反之,则确定该对应关系中存在未包含第一标识信息的第一对应关系。当匹配成功后,则进行后续的数据删除流程。In the stored correspondence, the first correspondence information including the first identifier information is searched, and the first identifier information is matched with the identifier information in the corresponding relationship. When the matching succeeds, the corresponding relationship is determined to be included in the corresponding relationship. A first correspondence of the identification information, and vice versa, determining that the first correspondence that does not include the first identification information exists in the correspondence. After the matching is successful, a subsequent data deletion process is performed.
S103:当查找到包含第一标识信息的第一对应关系后,判断第一标识信息是否对应目标数据内容;如果是,执行S104,如果否,执行S105;S103: After finding the first correspondence relationship that includes the first identifier information, determining whether the first identifier information corresponds to the target data content; if yes, executing S104, if not, executing S105;
S104:将第一标识信息设置为已删除状态,并通知客户端待删除数据已删除;S104: Set the first identification information to the deleted state, and notify the client that the data to be deleted has been deleted;
S105:删除包含第一标识信息的第一对应关系,并通知客户端待删除数据已删除。S105: Delete the first correspondence that includes the first identifier information, and notify the client that the data to be deleted has been deleted.
当从对应关系中查找到包含第一标识信息的第一对应关系后,该第一标识信息可能是目标内容数据对应的标识信息,也可能不是目标内容数据对应的标识信息,此时,需要判断该第一标识信息是否对应目标数据内容,当判断为是时,为了避免该目标数据内容对应的对应关系,读取不到该目标数据内容,此时不能直接删除该目标数据内容,可以将该第一标识信息设置为已删除状态,并通知客户端第一标识信息对应的待删除数据已删除。当判断为否时,则可以直接删除该包含第一标识信息的第一对应关系,并通知客户端该第一标识信息对应的待删除数据已删除。After the first correspondence corresponding to the first identifier information is found in the corresponding relationship, the first identifier information may be the identifier information corresponding to the target content data, or may not be the identifier information corresponding to the target content data. Whether the first identification information corresponds to the target data content. When the determination is yes, in order to avoid the correspondence corresponding to the target data content, the target data content cannot be read, and the target data content cannot be directly deleted at this time. The first identifier information is set to the deleted state, and the data to be deleted corresponding to the first identifier information of the client is notified to be deleted. When the determination is no, the first correspondence corresponding to the first identifier information may be deleted, and the data to be deleted corresponding to the first identifier information is notified to the client.
举例而言,该第一标识信息中可以包含:标识对应的目标数据内容仅相应于上述客户端的状态的状态信息,例如状态信息为“1”时,可以标识该第一标识信息对应的数据内容相应于上述客户端为存储状态,即当第一标识信息所包含的状态信息为“1”时,仅上述客户端识别为数据存储端存储有该第一标识信息对应的数据内容;当状态信息从“1”设置为“0”时,可以标识该第一标识信息对应的目标数据内容相应于该客户端为已删除状态,即当第一标识信息所包含的状态信息为“0”时,仅上述客户端识别为数据存储端已删除该第一标识信息对应的数据内容。For example, the first identifier information may include: status information that identifies that the corresponding target data content only corresponds to the state of the client. For example, when the status information is “1”, the data content corresponding to the first identifier information may be identified. Corresponding to the above-mentioned client being in a storage state, that is, when the state information included in the first identifier information is “1”, only the client identifies that the data storage end stores the data content corresponding to the first identifier information; When the value of the first identifier information is set to "0", the target data content corresponding to the first identifier information is corresponding to the deleted state of the client, that is, when the state information included in the first identifier information is "0". Only the above client identifies that the data content corresponding to the first identification information has been deleted by the data storage end.
或者,举例而言,可以通过为第一标识信息添加已删除标识的方式,将 第一标识信息设置为已删除状态,其中,该已删除标识可以是任一预先设置的字符串或者符号。例如:为第一标识信息添加“deleted”字符串,以将第一标识信息设置为已删除状态,使得仅上述客户端识别为数据存储端已删除该第一标识信息对应的数据内容。Or, for example, by adding a deleted identifier to the first identification information, The first identification information is set to a deleted state, wherein the deleted identification may be any pre-set string or symbol. For example, a “deleted” character string is added to the first identifier information to set the first identifier information to the deleted state, so that only the client identifies that the data content corresponding to the first identifier information has been deleted.
应用本申请实施例,获得客户端发送的携带待删除数据的第一标识信息的数据删除指令,在存储的对应关系中,查找包含第一标识信息的第一对应关系,其中,对应关系为待存储数据的标识信息与相应的已存储数据的标识信息的对应关系,该相应的已存储数据为所对应数据内容已存储于本地且与所述待存储数据的数据内容相同的数据,该待存储数据为所对应数据内容待存储于本地的数据;当查找到包含第一标识信息的第一对应关系后,判断第一标识信息是否对应目标数据内容;如果是,则将第一标识信息设置为已删除状态,并通知客户端所述待删除数据已删除;如果否,则删除包含第一标识信息的第一对应关系,并通知客户端所述待删除数据已删除。可见,在获得数据内容与已存储数据的目标数据内容相同的待存储数据的探测请求时,数据存储端不再重复存储数据内容,而是存储待存储数据与相应的已存储数据的对应关系,以使客户端可以根据该对应关系,查找到目标数据内容,以节省本地的存储空间,并且,在删除数据时,可以直接删除对应存储的对应关系,节省了删除数据时所消耗的时间。Applying the data deletion instruction of the first identifier information of the data to be deleted sent by the client, in the stored correspondence, the first correspondence corresponding to the first identifier information is found, where the corresponding relationship is to be And a corresponding relationship between the identifier information of the stored data and the identifier information of the corresponding stored data, where the corresponding stored data is data that is stored locally and is the same as the data content of the data to be stored, the to-be-stored The data is data corresponding to the data content to be stored locally; after the first correspondence corresponding to the first identifier information is found, determining whether the first identifier information corresponds to the target data content; if yes, setting the first identifier information to The status is deleted, and the client is notified that the data to be deleted has been deleted; if not, the first correspondence corresponding to the first identification information is deleted, and the client is notified that the data to be deleted has been deleted. It can be seen that, when obtaining the probe request of the data to be stored that is the same as the target data content of the stored data, the data storage end does not repeatedly store the data content, but stores the correspondence between the data to be stored and the corresponding stored data. Therefore, the client can find the target data content according to the corresponding relationship, so as to save the local storage space, and when deleting the data, the correspondence relationship of the corresponding storage can be directly deleted, thereby saving the time consumed when deleting the data.
作为一种实现方式,基于图1,如图2所示,所述将第一标识信息设置为已删除状态的步骤,可以包括:As an implementation manner, based on FIG. 1, as shown in FIG. 2, the step of setting the first identification information to the deleted state may include:
S201:对应第一标识信息的目标数据内容设置删除任务,并将第一标识信息设置为已删除状态;S201: setting a deletion task corresponding to the target data content of the first identification information, and setting the first identification information to the deleted state;
本申请实施例所提供的一种数据删除方法还可以包括:A data deletion method provided by the embodiment of the present application may further include:
S202:检查存储的对应关系,判断对应关系中是否还存在包含第一标识信息的第一对应关系;S202: Check the stored correspondence, and determine whether there is still a first correspondence corresponding to the first identifier information in the correspondence relationship;
S203:当判断为未存在时,响应删除任务,删除目标数据内容。S203: When it is determined that there is no existence, the target data content is deleted in response to the deletion task.
可以理解的是,当该第一标识信息对应目标数据内容时,该包含第一标识信息的第一对应关系可能存在一个或多个,将该第一对应关系中的所有第 一标识信息均设置为已删除状态。并对应第一标识信息的目标数据内容设置删除任务,以使当确定本地不存在包含第一标识信息的第一对应关系时,删除目标数据内容。其中,当对应该目标数据内容设置删除任务后,可以定时或不定时的检查所存储的对应关系中是否还存在包含第一标识信息的对应关系,当确定本地不存在包含第一标识信息的第一对应关系时,删除目标数据内容。It can be understood that, when the first identifier information corresponds to the target data content, the first correspondence relationship including the first identifier information may exist one or more, and all the first correspondences are An identification information is set to the deleted state. And deleting the target data content corresponding to the first identification information, so that when it is determined that the first correspondence relationship including the first identification information does not exist locally, the target data content is deleted. After the deletion task is set for the target data content, whether the corresponding relationship including the first identification information still exists in the stored correspondence relationship may be checked periodically or irregularly. When a correspondence is made, the target data content is deleted.
也就是说,上述本地可以为数据存储端的本地。That is to say, the above local can be local to the data storage end.
其中,将第一标识信息设置为已删除状态,不仅为了通知上述客户端待删除数据已删除,还用于在后续的获得关于需要存储数据内容与该目标数据内容相同的待存储数据的探测请求时,限制生成待存储数据的第五标识信息与第一标识信息的对应关系。此时,该数据存储端会通知对应的客户端上传第五标识信息对应的待存储数据的数据内容,并存储该数据内容。The first identifier information is set to the deleted state, not only to notify that the data to be deleted by the client is deleted, but also to obtain a probe request for storing data to be stored in the same manner as the target data content. The correspondence between the fifth identifier information of the data to be stored and the first identifier information is restricted. At this time, the data storage end notifies the corresponding client to upload the data content of the data to be stored corresponding to the fifth identifier information, and stores the data content.
举例而言,数据存储端存储有对应关系,如表1所示,For example, the data storage end stores a corresponding relationship, as shown in Table 1.
表1Table 1
A-BA-B
C-BC-B
D-BD-B
E-BE-B
F-PF-P
M-PM-P
其中,A、B、C、D、E、F、M和P均为已存储数据对应的标识信息,A、C、D和E均与B对应,且B对应目标数据内容1;F和M均与P对应,且P对应目标数据内容2;Among them, A, B, C, D, E, F, M, and P are all identification information corresponding to the stored data, A, C, D, and E are all corresponding to B, and B corresponds to target data content 1; F and M Both correspond to P, and P corresponds to the target data content 2;
获得客户端发送的数据删除指令,其中,当数据删除指令中携带待删除数据的第一标识信息为A时,在存储的对应关系中,查找包含A的第一对应关系,第一对应关系仅包括A-B,并且确定A不对应目标数据内容。此时,可以 删除包含第一标识信息的第一对应关系,即A-B,并通知客户端待删除数据已删除;Obtaining a data deletion instruction sent by the client, where, when the first identifier information of the data to be deleted in the data deletion instruction is A, in the stored correspondence, the first correspondence corresponding to A is searched, and the first correspondence is only Including AB, and determining that A does not correspond to the target data content. At this point, you can Deleting the first correspondence corresponding to the first identifier information, that is, A-B, and notifying the client that the data to be deleted has been deleted;
当数据删除指令中携带待删除数据的第一标识信息为B时,在存储的对应关系中,查找包含B的第一对应关系,第一对应关系包括A-B、C-B、D-B和E-B,并且确定B对应目标数据内容。此时,需将B设置为已删除状态,并通知客户端待删除数据已删除;When the first identifier information of the data to be deleted is B, the first correspondence corresponding to B is searched for in the stored correspondence, and the first correspondence includes AB, CB, DB, and EB, and B is determined. Corresponding to the target data content. In this case, you need to set B to the deleted state and notify the client that the data to be deleted has been deleted.
当B设置为已删除状态后,定时或不定时的检查对应关系,判断对应关系中是否还存在包含B的第一对应关系;当不存在包含B的第一对应关系后,将B对应的目标数据内容1删除。After B is set to the deleted state, the corresponding relationship is checked periodically or irregularly, and it is determined whether there is still a first correspondence relationship including B in the correspondence relationship; when there is no first correspondence relationship including B, the target corresponding to B is Data content 1 is deleted.
作为一种实现方式,基于图2,如图3所示,本申请实施例所提供的一种数据删除方法还可以包括:As an implementation manner, based on FIG. 2, as shown in FIG. 3, a data deletion method provided by an embodiment of the present application may further include:
S301:当判断第一标识信息不对应目标数据内容时,根据第一对应关系,确定第一标识信息对应的第二标识信息,第二标识信息与目标数据内容对应;S301: When it is determined that the first identifier information does not correspond to the target data content, determine, according to the first correspondence, the second identifier information corresponding to the first identifier information, where the second identifier information corresponds to the target data content;
S302:判断第二标识信息是否已设置为已删除状态;当判断第二标识信息未设置为已删除状态时,执行S105,当判断第二标识信息已设置为已删除状态时,执行S303;S302: determining whether the second identification information has been set to the deleted state; when it is determined that the second identification information is not set to the deleted state, executing S105, when determining that the second identification information has been set to the deleted state, executing S303;
S303:判断对应关系中除第一对应关系外是否还包括包含第二标识信息的第二对应关系,当判断对应关系中包含第二对应关系时,执行S105,当判断对应关系中不包含第二对应关系时,执行S304;S303: Determine whether the second correspondence corresponding to the second identifier information is included in the correspondence relationship, and if it is determined that the second correspondence is included in the correspondence, S105 is performed, and the second relationship is not included in the correspondence. Corresponding to the relationship, executing S304;
S304:删除包含第一标识信息的第一对应关系且删除第二标识信息对应的目标数据内容。S304: Delete the first correspondence that includes the first identifier information and delete the target data content corresponding to the second identifier information.
当判断第一标识信息不对应目标数据内容时,可以确定该第一对应关系仅存在一个,可以依据该第一对应关系,确定目标数据内容对应的第二标识信息,并且,进一步判断该第二标识信息是否设置为已删除状态,当判断为第二标识信息已设置为已删除状态,且对应关系中除该第一对应关系外不包括包含第二标识信息的第二对应关系,此时,可以删除第一对应关系并将目标数据内容也删除,后续的可以通知客户端待删除数据已删除。当判断为第二标识信息已设置为已删除状态,且对应关系中除该第一对应关系外还包括 包含第二标识信息的第二对应关系,则仅删除该第一对应关系。When it is determined that the first identifier information does not correspond to the target data content, the first correspondence may be determined to be only one, and the second identifier information corresponding to the target data content may be determined according to the first correspondence, and the second identifier is further determined. Whether the identifier information is set to the deleted state, and when the second identifier information is determined to be deleted, the second correspondence corresponding to the second identifier information is not included in the correspondence, and The first correspondence may be deleted and the target data content may also be deleted, and the subsequent notification may be notified that the data to be deleted by the client has been deleted. When it is determined that the second identifier information has been set to the deleted state, and the corresponding relationship includes the first correspondence, If the second correspondence relationship of the second identifier information is included, only the first correspondence relationship is deleted.
承接上述例子,数据存储端存储有对应关系,如表1所示,According to the above example, the data storage end stores a corresponding relationship, as shown in Table 1.
获得携带第一标识信息为A的数据删除指令时,A不对应目标数据内容,根据第一对应关系A-B,确定B,B对应目标数据内容1,判断B是否已设置为已删除状态,当B未设置为已删除状态时,直接删除第一对应关系A-B;当B已设置为已删除状态时,判断对应关系中除第一对应关系A-B外是否还包括包含B的第二对应关系,如表1所示,存在第二对应关系包括C-B、D-B和E-B,此时,直接删除第一对应关系A-B,只有当不存在第二对应关系C-B、D-B和E-B时,删除第一对应关系A-B且删除目标数据内容1。When the data deletion instruction carrying the first identification information is A, A does not correspond to the target data content, and according to the first correspondence AB, it is determined that B and B correspond to the target data content 1, and it is determined whether B has been set to the deleted state. When the status is not set to the deleted state, the first correspondence AB is directly deleted. When the B is set to the deleted state, it is determined whether the second correspondence corresponding to B is included in the correspondence, such as a table. As shown in FIG. 1, the second correspondence relationship includes CB, DB, and EB. In this case, the first correspondence AB is directly deleted, and only when the second correspondence CB, DB, and EB are not present, the first correspondence AB is deleted and deleted. Target data content 1.
作为一种实现方式,基于图1,如图4所示,本申请实施例所提供的一种数据删除方法还可以包括:As an implementation manner, based on FIG. 1, as shown in FIG. 4, a data deletion method provided by an embodiment of the present application may further include:
S401:当在存储的对应关系中未查找到第一标识信息时,删除第一标识信息对应的目标数据内容。S401: When the first identifier information is not found in the stored correspondence, the target data content corresponding to the first identifier information is deleted.
当在存储的对应关系中未查找到第一标识信息时,可以确定本地未存储包含第一标识信息的对应关系,此时可以直接删除第一标识信息对应的目标数据内容。When the first identifier information is not found in the stored correspondence, it may be determined that the corresponding relationship including the first identifier information is not stored locally, and the target data content corresponding to the first identifier information may be directly deleted.
如图5所示,本申请实施例提供了一种数据存储方法,可以包括如下步骤:As shown in FIG. 5, the embodiment of the present application provides a data storage method, which may include the following steps:
S501:获得客户端发送的待存储数据的探测请求,该探测请求包括待存储数据的第三标识信息和特征信息;S501: Obtain a probe request for data to be stored sent by the client, where the probe request includes third identifier information and feature information of the data to be stored.
可以理解的是,当客户端需要存储数据时,客户端首先基于待存储数据向数据存储端发送探测请求,以探测数据存储端是否存储有与该待存储数据的数据内容相同的目标数据内容。该数据存储端可以依据相关技术,获得客户端发送的待存储数据的探测请求,该探测请求包括待存储数据的第一标识信息和特征信息。作为一种实现方式,特征信息可以为待存储数据的校验值,例如MD5值,或者,该特征信息可以为待存储数据的校验值以及数据量,或者,该特征信息可以为待存储数据的校验值以及部分数据内容,等等,以通过该特征信息探测本地是否存储有与该待存储数据的数据内容相同的目标数 据。It can be understood that when the client needs to store data, the client first sends a probe request to the data storage terminal based on the data to be stored to detect whether the data storage terminal stores the same target data content as the data content of the data to be stored. The data storage end may obtain a probe request for the data to be stored sent by the client according to the related technology, where the probe request includes first identifier information and feature information of the data to be stored. As an implementation manner, the feature information may be a check value of the data to be stored, for example, an MD5 value, or the feature information may be a check value of the data to be stored and a data amount, or the feature information may be data to be stored. Check value and partial data content, etc., to detect whether the local target number of the data content of the data to be stored is stored locally by the feature information according to.
其中,第三标识信息可以为该待存储数据的文件名或者对应的待存储路径信息等,能够唯一确定该待存储数据的信息;后续所提到的第四标识信息可以为该目标数据内容对应的已存储数据的文件名或者对应的存储路径信息等,能够唯一确定该已存储数据的信息。The third identifier information may be the file name of the data to be stored or the corresponding path information to be stored, etc., and the information of the data to be stored may be uniquely determined; the fourth identifier information mentioned later may correspond to the target data content. The file name of the stored data or the corresponding storage path information, etc., can uniquely determine the information of the stored data.
S502:将待存储数据的特征信息与本地已存储数据的特征信息进行比对,确定本地是否已存储有与待存储数据的数据内容相同的目标数据内容;S502: Comparing the feature information of the data to be stored with the feature information of the locally stored data, and determining whether the target data content that is the same as the data content of the data to be stored is stored locally;
需要说明的是,数据存储端在存储数据时,可以对应存储有已存储数据的特征信息。将待存储数据的特征信息与本地已存储数据的特征信息进行比对,当待存储数据的特征信息与本地已存储数据的特征信息匹配,则确定本地已存储有与待存储数据的数据内容相同的目标数据内容,当待存储数据的特征信息与本地已存储数据的特征信息不匹配时,则确定本地未存储有与待存储数据的数据内容相同的目标数据内容。It should be noted that when the data storage end stores data, the feature information of the stored data may be correspondingly stored. The feature information of the data to be stored is compared with the feature information of the locally stored data. When the feature information of the data to be stored matches the feature information of the locally stored data, it is determined that the data content of the data to be stored is stored locally. The target data content, when the feature information of the data to be stored does not match the feature information of the locally stored data, determines that the target data content that is the same as the data content of the data to be stored is not locally stored.
S503:如果已存储有该目标数据内容,则获得该目标数据内容的第四标识信息;S503: If the target data content is already stored, obtaining fourth identification information of the target data content;
当确定本地已存储有与该待存储数据的数据内容相同的目标数据内容时,可以通过相关技术,获得该目标数据内容的第四标识信息。When it is determined that the target data content that is the same as the data content of the data to be stored is locally stored, the fourth identification information of the target data content may be obtained by a related technique.
S504:存储该第三标识信息与该第四标识信息的对应关系,并通知该客户端待存储数据已存储。S504: Store a correspondence between the third identifier information and the fourth identifier information, and notify the client that the data to be stored is stored.
存储该第三标识信息与该第四标识信息的对应关系,以使该客户端在读取第三标识信息对应的数据内容时,数据存储端根据第三标识信息与第四标识信息的对应关系,读取到第四标识信息对应的目标数据内容。The corresponding relationship between the third identifier information and the fourth identifier information is stored, so that when the client reads the data content corresponding to the third identifier information, the data storage end is configured according to the correspondence between the third identifier information and the fourth identifier information. And reading the target data content corresponding to the fourth identification information.
举例而言,客户端向数据存储端发送探测请求,探测请求中携带待存储数据一的第三标识信息为A和特征信息为a,通过比对a与数据存储端的已存储数据的特征信息,确定数据存储端已存储有与待存储数据的数据内容相同的目标数据内容,该目标数据内容对应的第四标识信息B,则数据存储端存储对应关系A-B,并通知客户端待存储数据已存储。 For example, the client sends a probe request to the data storage end, where the third identifier information carrying the data to be stored in the probe request is A and the feature information is a, and the feature information of the stored data is compared by comparing a and the data storage end. Determining that the data storage end has the same target data content as the data content of the data to be stored, and the fourth identifier information B corresponding to the target data content, the data storage end stores the correspondence relationship AB, and notifies the client that the data to be stored is stored. .
应用本申请实施例,获得客户端发送的待存储数据的探测请求,该探测请求包括待存储数据的第三标识信息和特征信息;将待存储数据的特征信息与本地已存储数据的特征信息进行比对,确定本地是否已存储有与待存储数据的数据内容相同的目标数据内容;如果已存储有该目标数据内容,则获得该目标数据内容的第四标识信息;存储第三标识信息与第四标识信息的对应关系,并通知客户端待存储数据已存储。本申请实施例中,当本地存储有与待存储数据的数据内容相同的目标数据内容时,不再提示客户端上传待存储数据的数据内容,而是仅存储该待存储数据的第三标识信息与该目标数据内容的第四标识信息的对应关系,并通知客户端带存储数据已存储,以使客户端在后续的读取该第三标识信息对应的数据内容时,根据该对应关系,读取该目标数据内容。可见,针对数据内容相同的数据,本地仅存储一个真实的数据内容,节省了本地的存储空间,即节省了数据存储端的存储空间,并且,节省了客户端存储数据时的存储时间。后续的,当数据存储端接收到该客户端发送的携带第三标识信息的的删除请求,且数据存储端中仅存储有第三标识信息与目标数据内容对应的第四标识信息的对应关系,未存储第三标识信息对应的数据内容时,数据存储端可以仅删除对应关系,无需删除第三标识信息对应的数据内容,节省了删除数据所消耗的时间。Applying the detection request of the data to be stored sent by the client, the probe request includes the third identifier information and the feature information of the data to be stored; and performing the feature information of the data to be stored and the feature information of the locally stored data. Aligning, determining whether the local has the same target data content as the data content of the data to be stored; if the target data content is already stored, obtaining the fourth identification information of the target data content; storing the third identification information and the The fourth identifies the correspondence between the information and notifies the client that the data to be stored has been stored. In the embodiment of the present application, when the target data content of the data to be stored is stored locally, the client does not prompt the client to upload the data content of the data to be stored, but only the third identifier information of the data to be stored. Corresponding relationship with the fourth identification information of the target data content, and notifying the client that the stored data is stored, so that the client reads the data content corresponding to the third identification information after the subsequent reading, according to the corresponding relationship, Take the target data content. It can be seen that for the data with the same data content, only one real data content is stored locally, which saves the local storage space, that is, saves the storage space of the data storage end, and saves the storage time when the client stores the data. Subsequently, when the data storage end receives the deletion request that is sent by the client and carries the third identifier information, and the data storage end only stores the correspondence between the third identifier information and the fourth identifier information corresponding to the target data content, When the data content corresponding to the third identifier information is not stored, the data storage terminal may delete only the corresponding relationship, and the data content corresponding to the third identifier information does not need to be deleted, thereby saving the time consumed for deleting the data.
作为一种实现方式,基于图5,如图6所示,本申请实施例提供的一种数据存储方法还可以包括:As an implementation manner, based on FIG. 5, as shown in FIG. 6, a data storage method provided by an embodiment of the present application may further include:
S601:当未存储有该目标数据内容时,向该客户端发送数据上传信息,以使该客户端上传待存储数据的数据内容;S601: When the target data content is not stored, send data upload information to the client, so that the client uploads data content of the data to be stored;
S602:接收并存储待存储数据的数据内容。S602: Receive and store data content of the data to be stored.
当确定本地未存储有与待存储数据的数据内容相同的目标数据内容时,通过相关技术向客户端发送数据上传信息,以使客户端上传待存储数据的和数据内容,并根据相关技术接收存储待存储数据的数据内容。When it is determined that the target data content that is the same as the data content of the data to be stored is not locally stored, the data uploading information is sent to the client by the related technology, so that the client uploads the data content of the data to be stored, and receives the storage according to the related technology. The data content of the data to be stored.
作为一种实现方式,所述特征信息中可以包括:待存储数据的校验信息、待存储数据的数据量以及待存储数据的预定位数的数据内容;As an implementation manner, the feature information may include: verification information of data to be stored, data amount of data to be stored, and data content of a predetermined number of bits of data to be stored;
所述将待存储数据的特征信息与本地已存储数据的特征信息进行比对, 确定本地是否已存储有与待存储数据的数据内容相同的目标数据内容的步骤,可以包括:The comparing the feature information of the data to be stored with the feature information of the locally stored data, The step of determining whether the local has stored the same target data content as the data content of the data to be stored may include:
将待存储数据的校验信息与本地已存储数据的校验信息进行比对,且将待存储数据的数据量与本地已存储数据的数据量进行比对,且将待存储数据的预定位数的数据内容与本地已存储数据的预定位数的数据内容进行比对;Comparing the check information of the data to be stored with the check information of the locally stored data, and comparing the data amount of the data to be stored with the data amount of the locally stored data, and the predetermined number of bits of the data to be stored The data content is compared with the data content of the predetermined number of bits of the locally stored data;
当待存储数据的校验信息与本地已存储数据的校验信息匹配,且待存储数据的数据量与本地已存储数据的数据量匹配,且待存储数据的预定位数的数据内容与本地已存储数据的预定位数的数据内容匹配时,确定本地已存储有与待存储数据的数据内容相同的目标数据内容。When the check information of the data to be stored matches the check information of the locally stored data, and the data amount of the data to be stored matches the data amount of the locally stored data, and the data content of the predetermined number of bits of the data to be stored is locally When the data contents of the predetermined number of bits of the stored data match, it is determined that the target data content identical to the data content of the data to be stored is stored locally.
可以理解的是,在探测本地是否存在与待存储数据的数据内容相同的目标数据内容时,确定存在的限定条件越多,即确定数据内容相同所基于的特征信息中的限定条件越多,存储数据的安全性越高。为了避免后续的非法客户端通过校验值获取到目标数据内容,该特征信息中可以包括待存储数据的校验信息、待存储数据的数据量以及待存储数据的预定位数的数据内容,通过比对待存储数据的校验信息与本地已存储数据的校验信息、待存储数据的数据量与本地已存储数据的数据量、待存储数据的预定位数的数据内容与本地已存储数据的预定位数的数据内容,确定数据内容是否相同。仅在上述三者比对结果均为匹配时,才确定数据内容相同。It can be understood that, when detecting whether there is the same target data content as the data content of the data to be stored locally, it is determined that the more the qualification conditions exist, that is, the more the qualification conditions in the feature information on which the data content is determined to be the same, the storage The security of the data is higher. In order to prevent the subsequent illegal client from acquiring the target data content by using the check value, the feature information may include the check information of the data to be stored, the data amount of the data to be stored, and the data content of the predetermined number of bits of the data to be stored. Comparison with the verification information of the stored data and the verification information of the locally stored data, the amount of data of the data to be stored and the amount of data of the locally stored data, the data content of the predetermined number of bits of the data to be stored, and the reservation of the locally stored data The data content of the number of bits determines whether the data content is the same. Only when the above three comparison results are matched, it is determined that the data content is the same.
相应于上述方法实施例,本申请实施例提供了一种数据删除装置,如图7所示,所述装置可以包括:Corresponding to the foregoing method embodiment, the embodiment of the present application provides a data deletion device. As shown in FIG. 7, the device may include:
第一获得模块710,用于获得客户端发送的数据删除指令,其中,所述数据删除指令中携带待删除数据的第一标识信息;The first obtaining module 710 is configured to obtain a data deletion instruction sent by the client, where the data deletion instruction carries the first identification information of the data to be deleted;
第一查找模块720,用于在存储的对应关系中,查找包含所述第一标识信息的第一对应关系,其中,所述对应关系为待存储数据的标识信息与相应的已存储数据的标识信息的对应关系,所述相应的已存储数据为所对应数据内容已存储于本地且与所述待存储数据的数据内容相同的数据,所述待存储数据为所对应数据内容待存储于本地的数据;The first search module 720 is configured to search, in the stored correspondence, a first correspondence that includes the first identifier information, where the correspondence relationship is identifier information of data to be stored and identifier of the corresponding stored data. Corresponding relationship of the information, the corresponding stored data is data that is stored locally and is the same as the data content of the data to be stored, and the data to be stored is the corresponding data content to be stored locally. data;
第一判断模块730,用于当查找到包含所述第一标识信息的第一对应关系 后,判断所述第一标识信息是否对应目标数据内容;如果是,触发设置模块,如果否,触发第一删除模块;The first determining module 730 is configured to: when finding the first correspondence that includes the first identifier information After determining whether the first identifier information corresponds to the target data content; if yes, triggering the setting module, if not, triggering the first deleting module;
所述设置模块740,用于将所述第一标识信息设置为已删除状态;The setting module 740 is configured to set the first identification information to a deleted state;
第一通知模块750,用于通知所述客户端所述待删除数据已删除;The first notification module 750 is configured to notify the client that the data to be deleted has been deleted;
所述第一删除模块760,用于删除包含所述第一标识信息的第一对应关系;The first deleting module 760 is configured to delete a first correspondence that includes the first identifier information.
第二通知模块770,用于通知所述客户端所述待删除数据已删除。The second notification module 770 is configured to notify the client that the data to be deleted has been deleted.
应用本申请实施例,获得客户端发送的携带待删除数据的第一标识信息的数据删除指令,在存储的对应关系中,查找包含第一标识信息的第一对应关系,其中,对应关系为待存储数据的标识信息与相应的已存储数据的标识信息的对应关系,该相应的已存储数据为所对应数据内容已存储于本地且与所述待存储数据的数据内容相同的数据,该待存储数据为所对应数据内容待存储于本地的数据;当查找到包含第一标识信息的第一对应关系后,判断第一标识信息是否对应目标数据内容;如果是,则将第一标识信息设置为已删除状态,并通知客户端所述待删除数据已删除;如果否,则删除包含第一标识信息的第一对应关系,并通知客户端所述待删除数据已删除。可见,在获得数据内容与已存储数据的目标数据内容相同的待存储数据的探测请求时,数据存储端不再重复存储数据内容,而是存储待存储数据与相应的已存储数据的对应关系,以使客户端可以根据该对应关系,查找到目标数据内容,以节省本地的存储空间,并且,在删除数据时,可以直接删除对应存储的对应关系,节省了删除数据时所消耗的时间。Applying the data deletion instruction of the first identifier information of the data to be deleted sent by the client, in the stored correspondence, the first correspondence corresponding to the first identifier information is found, where the corresponding relationship is to be And a corresponding relationship between the identifier information of the stored data and the identifier information of the corresponding stored data, where the corresponding stored data is data that is stored locally and is the same as the data content of the data to be stored, the to-be-stored The data is data corresponding to the data content to be stored locally; after the first correspondence corresponding to the first identifier information is found, determining whether the first identifier information corresponds to the target data content; if yes, setting the first identifier information to The status is deleted, and the client is notified that the data to be deleted has been deleted; if not, the first correspondence corresponding to the first identification information is deleted, and the client is notified that the data to be deleted has been deleted. It can be seen that, when obtaining the probe request of the data to be stored that is the same as the target data content of the stored data, the data storage end does not repeatedly store the data content, but stores the correspondence between the data to be stored and the corresponding stored data. Therefore, the client can find the target data content according to the corresponding relationship, so as to save the local storage space, and when deleting the data, the correspondence relationship of the corresponding storage can be directly deleted, thereby saving the time consumed when deleting the data.
作为一种实现方式,所述设置模块720,具体用于对应所述第一标识信息的目标数据内容设置删除任务,并将所述第一标识信息设置为已删除状态;As an implementation manner, the setting module 720 is specifically configured to: set a deletion task corresponding to the target data content of the first identifier information, and set the first identifier information to a deleted state;
所述装置还包括:第二判断模块和第二删除模块;The device further includes: a second determining module and a second deleting module;
所述第二判断模块,用于检查存储的所述对应关系,判断所述对应关系中是否还存在包含所述第一标识信息的第一对应关系,当判断为未存在时,触发所述第二删除模块;The second determining module is configured to check the stored correspondence, and determine whether the first correspondence corresponding to the first identifier information still exists in the corresponding relationship, and when it is determined that the corresponding relationship does not exist, triggering the first Second delete the module;
所述第二删除模块,用于响应所述删除任务,删除所述目标数据内容。 The second deleting module is configured to delete the target data content in response to the deleting task.
作为一种实现方式,所述装置还包括确定模块、第三判断模块、第四判断模块和第三删除模块;As an implementation manner, the apparatus further includes a determining module, a third determining module, a fourth determining module, and a third deleting module;
所述确定模块,用于当判断所述第一标识信息不对应目标数据内容时,根据所述第一对应关系,确定所述第一标识信息对应的第二标识信息,所述第二标识信息与所述目标数据内容对应;The determining module is configured to: when determining that the first identifier information does not correspond to the target data content, determine second identifier information corresponding to the first identifier information according to the first correspondence, the second identifier information Corresponding to the target data content;
所述第三判断模块,用于判断所述第二标识信息是否已设置为已删除状态,当判断所述第二标识信息未设置为已删除状态时,触发所述第一删除模块;当判断所述第二标识信息已设置为已删除状态时,触发所述第四判断模块;The third determining module is configured to determine whether the second identifier information is set to the deleted state, and when the second identifier information is not set to the deleted state, triggering the first deleting module; When the second identifier information is set to the deleted state, the fourth determining module is triggered;
所述第四判断模块,用于判断所述对应关系中除所述第一对应关系外是否还包括包含所述第二标识信息的第二对应关系,当判断所述对应关系中包含所述第二对应关系时,触发所述第一删除模块;当判断所述对应关系中不包含所述第二对应关系时,触发所述第三删除模块;The fourth determining module is configured to determine, in addition to the first correspondence, whether the second correspondence corresponding to the second identifier information is included in the correspondence, and when determining that the correspondence includes the The second deletion module is triggered when the second correspondence is performed; and the third deletion module is triggered when it is determined that the second correspondence is not included in the correspondence;
所述第三删除模块,用于删除包含所述第一标识信息的第一对应关系且删除所述第二标识信息对应的目标数据内容。The third deleting module is configured to delete the first correspondence that includes the first identifier information and delete the target data content corresponding to the second identifier information.
作为一种实现方式,所述装置还包括第四删除模块;As an implementation manner, the apparatus further includes a fourth deletion module;
所述第四删除模块,用于当在存储的所述对应关系中未查找到所述第一标识信息时,删除所述第一标识信息对应的目标数据内容。The fourth deleting module is configured to delete the target data content corresponding to the first identifier information when the first identifier information is not found in the stored correspondence relationship.
相应与上述方法实施例,本申请实施例提供了一种数据存储装置,如图8所示,所述装置可以包括:Corresponding to the foregoing method embodiments, the embodiment of the present application provides a data storage device. As shown in FIG. 8, the device may include:
第二获得模块810,用于获得客户端发送的待存储数据的探测请求,所述探测请求包括所述待存储数据的第三标识信息和特征信息;a second obtaining module 810, configured to obtain a probe request for data to be stored sent by the client, where the probe request includes third identifier information and feature information of the data to be stored;
比对确定模块820,用于将所述待存储数据的特征信息与本地已存储数据的特征信息进行比对,确定本地是否已存储有与所述待存储数据的数据内容相同的目标数据内容;The comparison determining module 820 is configured to compare the feature information of the data to be stored with the feature information of the locally stored data, and determine whether the target data content that is the same as the data content of the data to be stored is stored locally;
第三获得模块830,用于如果已存储有所述目标数据内容,则获得所述目标数据内容的第四标识信息; a third obtaining module 830, configured to obtain fourth identification information of the target data content if the target data content is already stored;
存储通知模块840,用于存储所述第三标识信息与所述第四标识信息的对应关系,并通知所述客户端所述待存储数据已存储。The storage notification module 840 is configured to store a correspondence between the third identifier information and the fourth identifier information, and notify the client that the to-be-stored data has been stored.
应用本申请实施例,获得客户端发送的待存储数据的探测请求,该探测请求包括待存储数据的第三标识信息和特征信息;将待存储数据的特征信息与本地已存储数据的特征信息进行比对,确定本地是否已存储有与待存储数据的数据内容相同的目标数据内容;如果已存储有该目标数据内容,则获得该目标数据内容的第四标识信息;存储第三标识信息与第四标识信息的对应关系,并通知客户端待存储数据已存储。本申请实施例中,当本地存储有与待存储数据的数据内容相同的目标数据内容时,不再提示客户端上传待存储数据的数据内容,而是仅存储该待存储数据的第三标识信息与该目标数据内容的第四标识信息的对应关系,并通知客户端带存储数据已存储,以使客户端在后续的读取该第一标识信息对应的数据内容时,根据该对应关系,读取该目标数据内容。可见,针对数据内容相同的数据,本地仅存储一个真实的数据内容,节省了本地的存储空间,即节省了数据存储端的存储空间,并且,节省了客户端存储数据时的存储时间。后续的,当数据存储端接收到该客户端发送的携带第三标识信息的的删除请求,且数据存储端中仅存储有第三标识信息与目标数据内容对应的第四标识信息的对应关系,未存储第三标识信息对应的数据内容时,数据存储端可以仅删除对应关系,无需删除第三标识信息对应的数据内容,节省了删除数据所消耗的时间。Applying the detection request of the data to be stored sent by the client, the probe request includes the third identifier information and the feature information of the data to be stored; and performing the feature information of the data to be stored and the feature information of the locally stored data. Aligning, determining whether the local has the same target data content as the data content of the data to be stored; if the target data content is already stored, obtaining the fourth identification information of the target data content; storing the third identification information and the The fourth identifies the correspondence between the information and notifies the client that the data to be stored has been stored. In the embodiment of the present application, when the target data content of the data to be stored is stored locally, the client does not prompt the client to upload the data content of the data to be stored, but only the third identifier information of the data to be stored. Corresponding relationship with the fourth identification information of the target data content, and notifying the client that the stored data is stored, so that the client reads the data content corresponding to the first identification information after the subsequent reading, according to the corresponding relationship, Take the target data content. It can be seen that for the data with the same data content, only one real data content is stored locally, which saves the local storage space, that is, saves the storage space of the data storage end, and saves the storage time when the client stores the data. Subsequently, when the data storage end receives the deletion request that is sent by the client and carries the third identifier information, and the data storage end only stores the correspondence between the third identifier information and the fourth identifier information corresponding to the target data content, When the data content corresponding to the third identifier information is not stored, the data storage terminal may delete only the corresponding relationship, and the data content corresponding to the third identifier information does not need to be deleted, thereby saving the time consumed for deleting the data.
作为一种实现方式,本申请实施例所提供的一种数据存储装置还可以包括发送模块和接收存储模块;As an implementation manner, a data storage device provided by an embodiment of the present application may further include a sending module and a receiving storage module.
所述发送模块,用于当未存储有所述目标数据内容时,向所述客户端发送数据上传信息,以使所述客户端上传所述待存储数据的数据内容;The sending module is configured to send data uploading information to the client when the target data content is not stored, so that the client uploads the data content of the to-be-stored data;
所述接收存储模块,用于接收并存储所述待存储数据的数据内容。The receiving storage module is configured to receive and store data content of the data to be stored.
作为一种实现方式,所述特征信息中可以包括所述待存储数据的校验信息、所述待存储数据的数据量以及所述待存储数据的预定位数的数据内容;As an implementation manner, the feature information may include verification information of the data to be stored, a data amount of the data to be stored, and a data content of a predetermined number of bits of the data to be stored;
所述比对确定模块包括比对单元和确定单元;The comparison determination module includes a comparison unit and a determination unit;
所述比对单元,用于将所述待存储数据的校验信息与本地已存储数据的 校验信息进行比对,且将所述待存储数据的数据量与本地已存储数据的数据量进行比对,且将所述待存储数据的预定位数的数据内容与本地已存储数据的预定位数的数据内容进行比对;The comparison unit is configured to compare the verification information of the data to be stored with the locally stored data. Verifying the information for comparison, and comparing the amount of data of the data to be stored with the amount of data of the locally stored data, and prescribing the data content of the predetermined number of bits of the data to be stored with the locally stored data The data content of the digits is compared;
所述确定单元,用于当所述待存储数据的校验信息与本地已存储数据的校验信息匹配,且所述待存储数据的数据量与本地已存储数据的数据量匹配,且所述待存储数据的预定位数的数据内容与本地已存储数据的预定位数的数据内容匹配时,确定本地已存储有与所述待存储数据的数据内容相同的目标数据内容。The determining unit is configured to: when the check information of the data to be stored matches the check information of the locally stored data, and the data amount of the data to be stored matches the data amount of the locally stored data, and the When the data content of the predetermined number of bits of the data to be stored matches the data content of the predetermined number of bits of the locally stored data, it is determined that the target data content identical to the data content of the data to be stored is locally stored.
本申请实施例还提供了一种电子设备,其特征在于,包括处理器和存储器,其中,存储器,用于存放计算机程序;The embodiment of the present application further provides an electronic device, including a processor and a memory, wherein the memory is used to store a computer program;
处理器,用于执行存储器上所存放的计算机程序时,实现本申请实施例所提供的数据删除方法,其中,该数据删除方法可以包括步骤:The data deletion method provided by the embodiment of the present application is implemented by the processor, when the computer program is stored on the memory, where the data deletion method may include the following steps:
获得客户端发送的数据删除指令,其中,所述数据删除指令中携带待删除数据的第一标识信息;Obtaining a data deletion instruction sent by the client, where the data deletion instruction carries the first identification information of the data to be deleted;
在存储的对应关系中,查找包含所述第一标识信息的第一对应关系,其中,所述对应关系为待存储数据的标识信息与相应的已存储数据的标识信息的对应关系,所述相应的已存储数据为所对应数据内容已存储于本地且与所述待存储数据的数据内容相同的数据,所述待存储数据为所对应数据内容待存储于本地的数据;Searching, in the stored correspondence, a first correspondence that includes the first identifier information, where the correspondence relationship is a correspondence between the identifier information of the data to be stored and the identifier information of the corresponding stored data, where the corresponding relationship is The stored data is data in which the corresponding data content is stored locally and is the same as the data content of the data to be stored, and the data to be stored is data in which the corresponding data content is to be stored locally;
当查找到包含所述第一标识信息的第一对应关系后,判断所述第一标识信息是否对应目标数据内容;After finding the first correspondence that includes the first identifier information, determining whether the first identifier information corresponds to the target data content;
如果是,则将所述第一标识信息设置为已删除状态,并通知所述客户端所述待删除数据已删除;If yes, the first identifier information is set to the deleted state, and the client is notified that the to-be-deleted data has been deleted;
如果否,则删除包含所述第一标识信息的第一对应关系,并通知所述客户端所述待删除数据已删除。If no, the first correspondence corresponding to the first identifier information is deleted, and the client is notified that the data to be deleted has been deleted.
应用本申请实施例,该电子设备的处理器运行存储器中存储的计算机程序,以执行本申请实施例所提供的数据删除方法,因此能够实现:在获得数 据内容与已存储数据的目标数据内容相同的待存储数据的探测请求时,数据存储端不再重复存储数据内容,而是存储待存储数据与相应的已存储数据的对应关系,以使客户端可以根据该对应关系,查找到目标数据内容,以节省本地的存储空间,并且,在删除数据时,可以直接删除对应存储的对应关系,节省了删除数据时所消耗的时间。Applying the embodiment of the present application, the processor of the electronic device runs the computer program stored in the memory to perform the data deletion method provided by the embodiment of the present application, and thus can achieve: obtaining the number When the content is the same as the target data content of the stored data, the data storage end does not repeatedly store the data content, but stores the correspondence between the data to be stored and the corresponding stored data, so that the client According to the corresponding relationship, the target data content can be found to save the local storage space, and when the data is deleted, the corresponding storage correspondence can be directly deleted, which saves the time consumed when deleting the data.
可选地,所述电子设备在执行实现所述将所述第一标识信息设置为已删除状态的过程中,具体用于:Optionally, in the process of performing the implementing the setting of the first identifier information to a deleted state, the electronic device is specifically configured to:
对应所述第一标识信息的目标数据内容设置删除任务,并将所述第一标识信息设置为已删除状态;Setting a deletion task corresponding to the target data content of the first identification information, and setting the first identification information to a deleted state;
所述方法还包括:检查存储的所述对应关系,判断所述对应关系中是否还存在包含所述第一标识信息的第一对应关系;The method further includes: checking the stored correspondence, and determining whether the first correspondence corresponding to the first identifier information still exists in the correspondence relationship;
当判断为未存在时,响应所述删除任务,删除所述目标数据内容。When it is determined that there is no existence, the target data content is deleted in response to the deletion task.
可选地,所述电子设备还用于:Optionally, the electronic device is further configured to:
当判断所述第一标识信息不对应目标数据内容时,根据所述第一对应关系,确定所述第一标识信息对应的第二标识信息,所述第二标识信息与所述目标数据内容对应;Determining, according to the first correspondence, the second identifier information corresponding to the first identifier information, where the second identifier information corresponds to the target data content, when determining that the first identifier information does not correspond to the target data content ;
判断所述第二标识信息是否已设置为已删除状态;Determining whether the second identification information has been set to a deleted state;
当判断所述第二标识信息未设置为已删除状态时,执行所述删除所述包含第一标识信息的第一对应关系的步骤;When it is determined that the second identifier information is not set to the deleted state, performing the step of deleting the first correspondence relationship that includes the first identifier information;
当判断所述第二标识信息已设置为已删除状态时,判断所述对应关系中除所述第一对应关系外是否还包括包含所述第二标识信息的第二对应关系;When it is determined that the second identifier information has been set to the deleted state, determining whether the second relationship corresponding to the second identifier information is included in the correspondence relationship other than the first correspondence relationship;
当判断所述对应关系中包含所述第二对应关系时,执行所述删除包含所述第一标识信息的第一对应关系的步骤;When it is determined that the second correspondence is included in the correspondence, the step of deleting the first correspondence that includes the first identifier information is performed;
当判断所述对应关系中不包含所述第二对应关系时,删除包含所述第一标识信息的第一对应关系且删除所述第二标识信息对应的目标数据内容。When it is determined that the second correspondence is not included in the correspondence, the first correspondence that includes the first identifier information is deleted, and the target data content corresponding to the second identifier information is deleted.
可选地,所述电子设备还用于: Optionally, the electronic device is further configured to:
当在存储的所述对应关系中未查找到所述第一标识信息时,删除所述第一标识信息对应的目标数据内容。When the first identifier information is not found in the stored correspondence, the target data content corresponding to the first identifier information is deleted.
本申请实施例还提供了一种计算机程序,所述计算机程序用于被运行以执行本申请实施例所提供的数据删除方法,其中,数据删除方法可以包括步骤:The embodiment of the present application further provides a computer program for being executed to perform the data deletion method provided by the embodiment of the present application, wherein the data deletion method may include the following steps:
获得客户端发送的数据删除指令,其中,所述数据删除指令中携带待删除数据的第一标识信息;Obtaining a data deletion instruction sent by the client, where the data deletion instruction carries the first identification information of the data to be deleted;
在存储的对应关系中,查找包含所述第一标识信息的第一对应关系,其中,所述对应关系为待存储数据的标识信息与相应的已存储数据的标识信息的对应关系,所述相应的已存储数据为所对应数据内容已存储于本地且与所述待存储数据的数据内容相同的数据,所述待存储数据为所对应数据内容待存储于本地的数据;Searching, in the stored correspondence, a first correspondence that includes the first identifier information, where the correspondence relationship is a correspondence between the identifier information of the data to be stored and the identifier information of the corresponding stored data, where the corresponding relationship is The stored data is data in which the corresponding data content is stored locally and is the same as the data content of the data to be stored, and the data to be stored is data in which the corresponding data content is to be stored locally;
当查找到包含所述第一标识信息的第一对应关系后,判断所述第一标识信息是否对应目标数据内容;After finding the first correspondence that includes the first identifier information, determining whether the first identifier information corresponds to the target data content;
如果是,则将所述第一标识信息设置为已删除状态,并通知所述客户端所述待删除数据已删除;If yes, the first identifier information is set to the deleted state, and the client is notified that the to-be-deleted data has been deleted;
如果否,则删除包含所述第一标识信息的第一对应关系,并通知所述客户端所述待删除数据已删除。If no, the first correspondence corresponding to the first identifier information is deleted, and the client is notified that the data to be deleted has been deleted.
应用本申请实施例,可计算机程序在运行时执行本申请实施例所提供的数据删除方法,因此能够实现:在获得数据内容与已存储数据的目标数据内容相同的待存储数据的探测请求时,数据存储端不再重复存储数据内容,而是存储待存储数据与相应的已存储数据的对应关系,以使客户端可以根据该对应关系,查找到目标数据内容,以节省本地的存储空间,并且,在删除数据时,可以直接删除对应存储的对应关系,节省了删除数据时所消耗的时间。With the embodiment of the present application, the computer program can execute the data deletion method provided by the embodiment of the present application at runtime, so that when the detection request of the data to be stored is the same as the target data content of the stored data, The data storage end does not repeatedly store the data content, but stores the correspondence between the data to be stored and the corresponding stored data, so that the client can find the target data content according to the corresponding relationship, thereby saving local storage space, and When the data is deleted, the corresponding relationship of the corresponding storage can be directly deleted, which saves the time consumed when deleting the data.
可选地,所述计算机程序用于被运行以执行所述将所述第一标识信息设置为已删除状态的过程中,具体用于:Optionally, the computer program is configured to be executed to perform the process of setting the first identification information to a deleted state, specifically for:
对应所述第一标识信息的目标数据内容设置删除任务,并将所述第一标 识信息设置为已删除状态;Setting a deletion task corresponding to the target data content of the first identification information, and setting the first target The information is set to the deleted state;
所述方法还包括:检查存储的所述对应关系,判断所述对应关系中是否还存在包含所述第一标识信息的第一对应关系;The method further includes: checking the stored correspondence, and determining whether the first correspondence corresponding to the first identifier information still exists in the correspondence relationship;
当判断为未存在时,响应所述删除任务,删除所述目标数据内容。When it is determined that there is no existence, the target data content is deleted in response to the deletion task.
可选地,所述计算机程序用于被运行以执行:Optionally, the computer program is operative to execute:
当判断所述第一标识信息不对应目标数据内容时,根据所述第一对应关系,确定所述第一标识信息对应的第二标识信息,所述第二标识信息与所述目标数据内容对应;Determining, according to the first correspondence, the second identifier information corresponding to the first identifier information, where the second identifier information corresponds to the target data content, when determining that the first identifier information does not correspond to the target data content ;
判断所述第二标识信息是否已设置为已删除状态;Determining whether the second identification information has been set to a deleted state;
当判断所述第二标识信息未设置为已删除状态时,执行所述删除所述包含第一标识信息的第一对应关系的步骤;When it is determined that the second identifier information is not set to the deleted state, performing the step of deleting the first correspondence relationship that includes the first identifier information;
当判断所述第二标识信息已设置为已删除状态时,判断所述对应关系中除所述第一对应关系外是否还包括包含所述第二标识信息的第二对应关系;When it is determined that the second identifier information has been set to the deleted state, determining whether the second relationship corresponding to the second identifier information is included in the correspondence relationship other than the first correspondence relationship;
当判断所述对应关系中包含所述第二对应关系时,执行所述删除包含所述第一标识信息的第一对应关系的步骤;When it is determined that the second correspondence is included in the correspondence, the step of deleting the first correspondence that includes the first identifier information is performed;
当判断所述对应关系中不包含所述第二对应关系时,删除包含所述第一标识信息的第一对应关系且删除所述第二标识信息对应的目标数据内容。When it is determined that the second correspondence is not included in the correspondence, the first correspondence that includes the first identifier information is deleted, and the target data content corresponding to the second identifier information is deleted.
可选地,所述计算机程序用于被运行以执行:Optionally, the computer program is operative to execute:
当在存储的所述对应关系中未查找到所述第一标识信息时,删除所述第一标识信息对应的目标数据内容。When the first identifier information is not found in the stored correspondence, the target data content corresponding to the first identifier information is deleted.
本申请实施例提供了一种存储介质,所述存储介质用于存储计算机程序,所述计算机程序被运行以执行本申请实施例所提供的数据删除方法,其中,数据删除方法可以包括步骤:The embodiment of the present application provides a storage medium, where the storage medium is used to store a computer program, and the computer program is executed to perform the data deletion method provided by the embodiment of the present application. The data deletion method may include the following steps:
获得客户端发送的数据删除指令,其中,所述数据删除指令中携带待删除数据的第一标识信息;Obtaining a data deletion instruction sent by the client, where the data deletion instruction carries the first identification information of the data to be deleted;
在存储的对应关系中,查找包含所述第一标识信息的第一对应关系,其 中,所述对应关系为待存储数据的标识信息与相应的已存储数据的标识信息的对应关系,所述相应的已存储数据为所对应数据内容已存储于本地且与所述待存储数据的数据内容相同的数据,所述待存储数据为所对应数据内容待存储于本地的数据;Searching, in the stored correspondence, a first correspondence including the first identifier information, where The corresponding relationship is a correspondence between the identifier information of the data to be stored and the identifier information of the corresponding stored data, where the corresponding stored data is stored locally and associated with the data to be stored. Data having the same data content, and the data to be stored is data to be stored locally in the corresponding data content;
当查找到包含所述第一标识信息的第一对应关系后,判断所述第一标识信息是否对应目标数据内容;After finding the first correspondence that includes the first identifier information, determining whether the first identifier information corresponds to the target data content;
如果是,则将所述第一标识信息设置为已删除状态,并通知所述客户端所述待删除数据已删除;If yes, the first identifier information is set to the deleted state, and the client is notified that the to-be-deleted data has been deleted;
如果否,则删除包含所述第一标识信息的第一对应关系,并通知所述客户端所述待删除数据已删除。If no, the first correspondence corresponding to the first identifier information is deleted, and the client is notified that the data to be deleted has been deleted.
应用本申请实施例,存储介质存储有在运行时执行本申请实施例所提供的数据删除方法的计算机程序,因此能够实现:在获得数据内容与已存储数据的目标数据内容相同的待存储数据的探测请求时,数据存储端不再重复存储数据内容,而是存储待存储数据与相应的已存储数据的对应关系,以使客户端可以根据该对应关系,查找到目标数据内容,以节省本地的存储空间,并且,在删除数据时,可以直接删除对应存储的对应关系,节省了删除数据时所消耗的时间。Applying the embodiment of the present application, the storage medium stores a computer program that executes the data deletion method provided by the embodiment of the present application at runtime, and thus can realize: obtaining the same data to be stored as the target data content of the stored data. When the request is detected, the data storage end does not repeatedly store the data content, but stores the correspondence between the data to be stored and the corresponding stored data, so that the client can find the target data content according to the corresponding relationship, thereby saving the local The storage space, and when deleting data, can directly delete the corresponding relationship of the storage, saving the time consumed when deleting the data.
可选地,所述计算机程序被运行以执行所述将所述第一标识信息设置为已删除状态的过程中,具体用于:Optionally, the computer program is executed to perform the process of setting the first identification information to a deleted state, specifically for:
对应所述第一标识信息的目标数据内容设置删除任务,并将所述第一标识信息设置为已删除状态;Setting a deletion task corresponding to the target data content of the first identification information, and setting the first identification information to a deleted state;
所述方法还包括:检查存储的所述对应关系,判断所述对应关系中是否还存在包含所述第一标识信息的第一对应关系;The method further includes: checking the stored correspondence, and determining whether the first correspondence corresponding to the first identifier information still exists in the correspondence relationship;
当判断为未存在时,响应所述删除任务,删除所述目标数据内容。When it is determined that there is no existence, the target data content is deleted in response to the deletion task.
可选地,所述计算机程序被运行以执行:Optionally, the computer program is executed to execute:
当判断所述第一标识信息不对应目标数据内容时,根据所述第一对应关系,确定所述第一标识信息对应的第二标识信息,所述第二标识信息与所述 目标数据内容对应;Determining, according to the first correspondence, the second identifier information corresponding to the first identifier information, where the second identifier information is related to the Corresponding to the target data content;
判断所述第二标识信息是否已设置为已删除状态;Determining whether the second identification information has been set to a deleted state;
当判断所述第二标识信息未设置为已删除状态时,执行所述删除所述包含第一标识信息的第一对应关系的步骤;When it is determined that the second identifier information is not set to the deleted state, performing the step of deleting the first correspondence relationship that includes the first identifier information;
当判断所述第二标识信息已设置为已删除状态时,判断所述对应关系中除所述第一对应关系外是否还包括包含所述第二标识信息的第二对应关系;When it is determined that the second identifier information has been set to the deleted state, determining whether the second relationship corresponding to the second identifier information is included in the correspondence relationship other than the first correspondence relationship;
当判断所述对应关系中包含所述第二对应关系时,执行所述删除包含所述第一标识信息的第一对应关系的步骤;When it is determined that the second correspondence is included in the correspondence, the step of deleting the first correspondence that includes the first identifier information is performed;
当判断所述对应关系中不包含所述第二对应关系时,删除包含所述第一标识信息的第一对应关系且删除所述第二标识信息对应的目标数据内容。When it is determined that the second correspondence is not included in the correspondence, the first correspondence that includes the first identifier information is deleted, and the target data content corresponding to the second identifier information is deleted.
可选地,所述计算机程序被运行以执行:Optionally, the computer program is executed to execute:
当在存储的所述对应关系中未查找到所述第一标识信息时,删除所述第一标识信息对应的目标数据内容。When the first identifier information is not found in the stored correspondence, the target data content corresponding to the first identifier information is deleted.
本申请实施例还提供了一种电子设备,其特征在于,包括处理器和存储器,其中,存储器,用于存放计算机程序;The embodiment of the present application further provides an electronic device, including a processor and a memory, wherein the memory is used to store a computer program;
处理器,用于执行存储器上所存放的计算机程序时,实现本申请实施例所提供的数据存储方法,其中,该数据存储方法可以包括步骤:The data storage method provided by the embodiment of the present application is implemented by the processor, where the data storage method may include the following steps:
获得客户端发送的待存储数据的探测请求,所述探测请求包括所述待存储数据的第三标识信息和特征信息;Obtaining a probe request for the data to be stored sent by the client, where the probe request includes third identifier information and feature information of the data to be stored;
将所述待存储数据的特征信息与本地已存储数据的特征信息进行比对,确定本地是否已存储有与所述待存储数据的数据内容相同的目标数据内容;Comparing the feature information of the to-be-stored data with the feature information of the locally stored data, and determining whether the target data content that is the same as the data content of the to-be-stored data is stored locally;
如果已存储有所述目标数据内容,则获得所述目标数据内容的第四标识信息;Obtaining fourth identification information of the target data content if the target data content is already stored;
存储所述第三标识信息与所述第四标识信息的对应关系,并通知所述客户端所述待存储数据已存储。And storing a correspondence between the third identifier information and the fourth identifier information, and notifying the client that the to-be-stored data is stored.
应用本申请实施例,该电子设备的处理器运行存储器中存储的计算机程 序,以执行本申请实施例所提供的数据存储方法,因此能够实现:针对数据内容相同的数据,本地仅存储一个真实的数据内容,节省了本地的存储空间,即节省了数据存储端的存储空间,并且,节省了客户端存储数据时的存储时间。Applying the embodiment of the present application, the processor of the electronic device runs the computer program stored in the memory In order to perform the data storage method provided by the embodiment of the present application, it is possible to realize that only one real data content is stored locally for the same data content, thereby saving local storage space, that is, saving storage space of the data storage end. And, saves storage time when the client stores data.
可选地,所述电子设备还用于:Optionally, the electronic device is further configured to:
当未存储有所述目标数据内容时,向所述客户端发送数据上传信息,以使所述客户端上传所述待存储数据的数据内容;When the target data content is not stored, sending data upload information to the client, so that the client uploads the data content of the data to be stored;
接收并存储所述待存储数据的数据内容。Receiving and storing the data content of the data to be stored.
可选地,所述特征信息中包括所述待存储数据的校验信息、所述待存储数据的数据量以及所述待存储数据的预定位数的数据内容;Optionally, the feature information includes verification information of the data to be stored, a data amount of the data to be stored, and a data content of a predetermined number of bits of the data to be stored;
所述电子设备在执行实现所述将所述待存储数据的特征信息与本地已存储数据的特征信息进行比对,确定本地是否已存储有与所述待存储数据的数据内容相同的目标数据内容的过程中,具体用于:The electronic device performs the comparison between the feature information of the data to be stored and the feature information of the locally stored data, and determines whether the target data content that is the same as the data content of the data to be stored is stored locally. In the process, specifically used to:
将所述待存储数据的校验信息与本地已存储数据的校验信息进行比对,且将所述待存储数据的数据量与本地已存储数据的数据量进行比对,且将所述待存储数据的预定位数的数据内容与本地已存储数据的预定位数的数据内容进行比对;Comparing the check information of the data to be stored with the check information of the locally stored data, and comparing the data amount of the data to be stored with the data amount of the locally stored data, and the The data content of the predetermined number of bits of the stored data is compared with the data content of the predetermined number of bits of the locally stored data;
当所述待存储数据的校验信息与本地已存储数据的校验信息匹配,且所述待存储数据的数据量与本地已存储数据的数据量匹配,且所述待存储数据的预定位数的数据内容与本地已存储数据的预定位数的数据内容匹配时,确定本地已存储有与所述待存储数据的数据内容相同的目标数据内容。When the check information of the data to be stored matches the check information of the locally stored data, and the data amount of the data to be stored matches the data amount of the locally stored data, and the predetermined number of bits of the data to be stored When the data content matches the data content of the predetermined number of bits of the locally stored data, it is determined that the target data content identical to the data content of the data to be stored is locally stored.
本申请实施例还提供了一种计算机程序,所述计算机程序用于被运行以执行本申请实施例所提供的数据存储方法,其中,数据存储方法可以包括步骤:The embodiment of the present application further provides a computer program for being executed to perform the data storage method provided by the embodiment of the present application, wherein the data storage method may include the following steps:
获得客户端发送的待存储数据的探测请求,所述探测请求包括所述待存储数据的第三标识信息和特征信息;Obtaining a probe request for the data to be stored sent by the client, where the probe request includes third identifier information and feature information of the data to be stored;
将所述待存储数据的特征信息与本地已存储数据的特征信息进行比对, 确定本地是否已存储有与所述待存储数据的数据内容相同的目标数据内容;Comparing the feature information of the data to be stored with the feature information of the locally stored data, Determining whether the local target data content that is the same as the data content of the data to be stored is stored locally;
如果已存储有所述目标数据内容,则获得所述目标数据内容的第四标识信息;Obtaining fourth identification information of the target data content if the target data content is already stored;
存储所述第三标识信息与所述第四标识信息的对应关系,并通知所述客户端所述待存储数据已存储。And storing a correspondence between the third identifier information and the fourth identifier information, and notifying the client that the to-be-stored data is stored.
应用本申请实施例,计算机程序在运行时执行本申请实施例所提供的数据存储方法,因此能够实现:针对数据内容相同的数据,本地仅存储一个真实的数据内容,节省了本地的存储空间,即节省了数据存储端的存储空间,并且,节省了客户端存储数据时的存储时间。Applying the embodiment of the present application, the computer program performs the data storage method provided by the embodiment of the present application at runtime, so that it can realize that only one real data content is stored locally for the data with the same data content, thereby saving local storage space. That is, the storage space on the data storage side is saved, and the storage time when the client stores data is saved.
可选地,所述计算机程序被运行以执行:Optionally, the computer program is executed to execute:
当未存储有所述目标数据内容时,向所述客户端发送数据上传信息,以使所述客户端上传所述待存储数据的数据内容;When the target data content is not stored, sending data upload information to the client, so that the client uploads the data content of the data to be stored;
接收并存储所述待存储数据的数据内容。Receiving and storing the data content of the data to be stored.
可选地,所述特征信息中包括所述待存储数据的校验信息、所述待存储数据的数据量以及所述待存储数据的预定位数的数据内容;Optionally, the feature information includes verification information of the data to be stored, a data amount of the data to be stored, and a data content of a predetermined number of bits of the data to be stored;
所述计算机程序被运行以执行所述将所述待存储数据的特征信息与本地已存储数据的特征信息进行比对,确定本地是否已存储有与所述待存储数据的数据内容相同的目标数据内容的过程中,具体用于:The computer program is executed to perform the comparing the feature information of the data to be stored with the feature information of the locally stored data, and determining whether the same target data of the data content of the data to be stored has been stored locally In the process of content, it is specifically used to:
将所述待存储数据的校验信息与本地已存储数据的校验信息进行比对,且将所述待存储数据的数据量与本地已存储数据的数据量进行比对,且将所述待存储数据的预定位数的数据内容与本地已存储数据的预定位数的数据内容进行比对;Comparing the check information of the data to be stored with the check information of the locally stored data, and comparing the data amount of the data to be stored with the data amount of the locally stored data, and the The data content of the predetermined number of bits of the stored data is compared with the data content of the predetermined number of bits of the locally stored data;
当所述待存储数据的校验信息与本地已存储数据的校验信息匹配,且所述待存储数据的数据量与本地已存储数据的数据量匹配,且所述待存储数据的预定位数的数据内容与本地已存储数据的预定位数的数据内容匹配时,确定本地已存储有与所述待存储数据的数据内容相同的目标数据内容。When the check information of the data to be stored matches the check information of the locally stored data, and the data amount of the data to be stored matches the data amount of the locally stored data, and the predetermined number of bits of the data to be stored When the data content matches the data content of the predetermined number of bits of the locally stored data, it is determined that the target data content identical to the data content of the data to be stored is locally stored.
本申请实施例提供了一种存储介质,所述存储介质用于存储计算机程序, 所述计算机程序被运行以执行本申请实施例所提供的数据存储方法,其中,数据存储方法可以包括步骤:The embodiment of the present application provides a storage medium, where the storage medium is used to store a computer program. The computer program is executed to execute the data storage method provided by the embodiment of the present application, wherein the data storage method may include the following steps:
获得客户端发送的待存储数据的探测请求,所述探测请求包括所述待存储数据的第三标识信息和特征信息;Obtaining a probe request for the data to be stored sent by the client, where the probe request includes third identifier information and feature information of the data to be stored;
将所述待存储数据的特征信息与本地已存储数据的特征信息进行比对,确定本地是否已存储有与所述待存储数据的数据内容相同的目标数据内容;Comparing the feature information of the to-be-stored data with the feature information of the locally stored data, and determining whether the target data content that is the same as the data content of the to-be-stored data is stored locally;
如果已存储有所述目标数据内容,则获得所述目标数据内容的第四标识信息;Obtaining fourth identification information of the target data content if the target data content is already stored;
存储所述第三标识信息与所述第四标识信息的对应关系,并通知所述客户端所述待存储数据已存储。And storing a correspondence between the third identifier information and the fourth identifier information, and notifying the client that the to-be-stored data is stored.
应用本申请实施例,存储介质存储有在运行时执行本申请实施例所提供的数据存储方法的计算机程序,因此能够实现:针对数据内容相同的数据,本地仅存储一个真实的数据内容,节省了本地的存储空间,即节省了数据存储端的存储空间,并且,节省了客户端存储数据时的存储时间。Applying the embodiment of the present application, the storage medium stores a computer program that executes the data storage method provided by the embodiment of the present application at runtime, and thus can realize that only one real data content is stored locally for the data with the same data content, thereby saving The local storage space saves storage space on the data storage side and saves storage time when the client stores data.
可选地,所述计算机程序被运行以执行:Optionally, the computer program is executed to execute:
当未存储有所述目标数据内容时,向所述客户端发送数据上传信息,以使所述客户端上传所述待存储数据的数据内容;When the target data content is not stored, sending data upload information to the client, so that the client uploads the data content of the data to be stored;
接收并存储所述待存储数据的数据内容。Receiving and storing the data content of the data to be stored.
可选地,所述特征信息中包括所述待存储数据的校验信息、所述待存储数据的数据量以及所述待存储数据的预定位数的数据内容;Optionally, the feature information includes verification information of the data to be stored, a data amount of the data to be stored, and a data content of a predetermined number of bits of the data to be stored;
所述计算机程序被运行以执行所述将所述待存储数据的特征信息与本地已存储数据的特征信息进行比对,确定本地是否已存储有与所述待存储数据的数据内容相同的目标数据内容的过程中,具体用于:The computer program is executed to perform the comparing the feature information of the data to be stored with the feature information of the locally stored data, and determining whether the same target data of the data content of the data to be stored has been stored locally In the process of content, it is specifically used to:
将所述待存储数据的校验信息与本地已存储数据的校验信息进行比对,且将所述待存储数据的数据量与本地已存储数据的数据量进行比对,且将所述待存储数据的预定位数的数据内容与本地已存储数据的预定位数的数据内容进行比对; Comparing the check information of the data to be stored with the check information of the locally stored data, and comparing the data amount of the data to be stored with the data amount of the locally stored data, and the The data content of the predetermined number of bits of the stored data is compared with the data content of the predetermined number of bits of the locally stored data;
当所述待存储数据的校验信息与本地已存储数据的校验信息匹配,且所述待存储数据的数据量与本地已存储数据的数据量匹配,且所述待存储数据的预定位数的数据内容与本地已存储数据的预定位数的数据内容匹配时,确定本地已存储有与所述待存储数据的数据内容相同的目标数据内容。When the check information of the data to be stored matches the check information of the locally stored data, and the data amount of the data to be stored matches the data amount of the locally stored data, and the predetermined number of bits of the data to be stored When the data content matches the data content of the predetermined number of bits of the locally stored data, it is determined that the target data content identical to the data content of the data to be stored is locally stored.
对于系统/装置实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。For the system/device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this context, relational terms such as first and second are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply such entities or operations. There is any such actual relationship or order between them. Furthermore, the term "comprises" or "comprises" or "comprises" or any other variations thereof is intended to encompass a non-exclusive inclusion, such that a process, method, article, or device that comprises a plurality of elements includes not only those elements but also Other elements, or elements that are inherent to such a process, method, item, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element.
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。The various embodiments in the present specification are described in a related manner, and the same or similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
以上所述仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本申请的保护范围内。 The above description is only the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application are included in the scope of the present application.

Claims (20)

  1. 一种数据删除方法,其特征在于,所述方法包括:A data deletion method, the method comprising:
    获得客户端发送的数据删除指令,其中,所述数据删除指令中携带待删除数据的第一标识信息;Obtaining a data deletion instruction sent by the client, where the data deletion instruction carries the first identification information of the data to be deleted;
    在存储的对应关系中,查找包含所述第一标识信息的第一对应关系,其中,所述对应关系为待存储数据的标识信息与相应的已存储数据的标识信息的对应关系,所述相应的已存储数据为所对应数据内容已存储于本地且与所述待存储数据的数据内容相同的数据,所述待存储数据为所对应数据内容待存储于本地的数据;Searching, in the stored correspondence, a first correspondence that includes the first identifier information, where the correspondence relationship is a correspondence between the identifier information of the data to be stored and the identifier information of the corresponding stored data, where the corresponding relationship is The stored data is data in which the corresponding data content is stored locally and is the same as the data content of the data to be stored, and the data to be stored is data in which the corresponding data content is to be stored locally;
    当查找到包含所述第一标识信息的第一对应关系后,判断所述第一标识信息是否对应目标数据内容;After finding the first correspondence that includes the first identifier information, determining whether the first identifier information corresponds to the target data content;
    如果是,则将所述第一标识信息设置为已删除状态,并通知所述客户端所述待删除数据已删除;If yes, the first identifier information is set to the deleted state, and the client is notified that the to-be-deleted data has been deleted;
    如果否,则删除包含所述第一标识信息的第一对应关系,并通知所述客户端所述待删除数据已删除。If no, the first correspondence corresponding to the first identifier information is deleted, and the client is notified that the data to be deleted has been deleted.
  2. 根据权利要求1所述的方法,其特征在于,所述将所述第一标识信息设置为已删除状态的步骤,包括:The method according to claim 1, wherein the step of setting the first identification information to a deleted state comprises:
    对应所述第一标识信息的目标数据内容设置删除任务,并将所述第一标识信息设置为已删除状态;Setting a deletion task corresponding to the target data content of the first identification information, and setting the first identification information to a deleted state;
    所述方法还包括:检查存储的所述对应关系,判断所述对应关系中是否还存在包含所述第一标识信息的第一对应关系;The method further includes: checking the stored correspondence, and determining whether the first correspondence corresponding to the first identifier information still exists in the correspondence relationship;
    当判断为未存在时,响应所述删除任务,删除所述目标数据内容。When it is determined that there is no existence, the target data content is deleted in response to the deletion task.
  3. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 further comprising:
    当判断所述第一标识信息不对应目标数据内容时,根据所述第一对应关系,确定所述第一标识信息对应的第二标识信息,所述第二标识信息与所述目标数据内容对应; Determining, according to the first correspondence, the second identifier information corresponding to the first identifier information, where the second identifier information corresponds to the target data content, when determining that the first identifier information does not correspond to the target data content ;
    判断所述第二标识信息是否已设置为已删除状态;Determining whether the second identification information has been set to a deleted state;
    当判断所述第二标识信息未设置为已删除状态时,执行所述删除所述包含第一标识信息的第一对应关系的步骤;When it is determined that the second identifier information is not set to the deleted state, performing the step of deleting the first correspondence relationship that includes the first identifier information;
    当判断所述第二标识信息已设置为已删除状态时,判断所述对应关系中除所述第一对应关系外是否还包括包含所述第二标识信息的第二对应关系;When it is determined that the second identifier information has been set to the deleted state, determining whether the second relationship corresponding to the second identifier information is included in the correspondence relationship other than the first correspondence relationship;
    当判断所述对应关系中包含所述第二对应关系时,执行所述删除包含所述第一标识信息的第一对应关系的步骤;When it is determined that the second correspondence is included in the correspondence, the step of deleting the first correspondence that includes the first identifier information is performed;
    当判断所述对应关系中不包含所述第二对应关系时,删除包含所述第一标识信息的第一对应关系且删除所述第二标识信息对应的目标数据内容。When it is determined that the second correspondence is not included in the correspondence, the first correspondence that includes the first identifier information is deleted, and the target data content corresponding to the second identifier information is deleted.
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 3, wherein the method further comprises:
    当在存储的所述对应关系中未查找到所述第一标识信息时,删除所述第一标识信息对应的目标数据内容。When the first identifier information is not found in the stored correspondence, the target data content corresponding to the first identifier information is deleted.
  5. 一种数据存储方法,其特征在于,所述方法包括:A data storage method, the method comprising:
    获得客户端发送的待存储数据的探测请求,所述探测请求包括所述待存储数据的第三标识信息和特征信息;Obtaining a probe request for the data to be stored sent by the client, where the probe request includes third identifier information and feature information of the data to be stored;
    将所述待存储数据的特征信息与本地已存储数据的特征信息进行比对,确定本地是否已存储有与所述待存储数据的数据内容相同的目标数据内容;Comparing the feature information of the to-be-stored data with the feature information of the locally stored data, and determining whether the target data content that is the same as the data content of the to-be-stored data is stored locally;
    如果已存储有所述目标数据内容,则获得所述目标数据内容的第四标识信息;Obtaining fourth identification information of the target data content if the target data content is already stored;
    存储所述第三标识信息与所述第四标识信息的对应关系,并通知所述客户端所述待存储数据已存储。And storing a correspondence between the third identifier information and the fourth identifier information, and notifying the client that the to-be-stored data is stored.
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:The method of claim 5, wherein the method further comprises:
    当未存储有所述目标数据内容时,向所述客户端发送数据上传信息,以使所述客户端上传所述待存储数据的数据内容;When the target data content is not stored, sending data upload information to the client, so that the client uploads the data content of the data to be stored;
    接收并存储所述待存储数据的数据内容。 Receiving and storing the data content of the data to be stored.
  7. 根据权利要求5或6所述的方法,其特征在于,所述特征信息中包括所述待存储数据的校验信息、所述待存储数据的数据量以及所述待存储数据的预定位数的数据内容;The method according to claim 5 or 6, wherein the feature information includes verification information of the data to be stored, a data amount of the data to be stored, and a predetermined number of bits of the data to be stored. Data content
    所述将所述待存储数据的特征信息与本地已存储数据的特征信息进行比对,确定本地是否已存储有与所述待存储数据的数据内容相同的目标数据内容的步骤,包括:The step of comparing the feature information of the data to be stored with the feature information of the locally stored data, and determining whether the target data content of the data content of the data to be stored is stored locally includes:
    将所述待存储数据的校验信息与本地已存储数据的校验信息进行比对,且将所述待存储数据的数据量与本地已存储数据的数据量进行比对,且将所述待存储数据的预定位数的数据内容与本地已存储数据的预定位数的数据内容进行比对;Comparing the check information of the data to be stored with the check information of the locally stored data, and comparing the data amount of the data to be stored with the data amount of the locally stored data, and the The data content of the predetermined number of bits of the stored data is compared with the data content of the predetermined number of bits of the locally stored data;
    当所述待存储数据的校验信息与本地已存储数据的校验信息匹配,且所述待存储数据的数据量与本地已存储数据的数据量匹配,且所述待存储数据的预定位数的数据内容与本地已存储数据的预定位数的数据内容匹配时,确定本地已存储有与所述待存储数据的数据内容相同的目标数据内容。When the check information of the data to be stored matches the check information of the locally stored data, and the data amount of the data to be stored matches the data amount of the locally stored data, and the predetermined number of bits of the data to be stored When the data content matches the data content of the predetermined number of bits of the locally stored data, it is determined that the target data content identical to the data content of the data to be stored is locally stored.
  8. 一种数据删除装置,其特征在于,所述装置包括:A data deletion device, characterized in that the device comprises:
    第一获得模块,用于获得客户端发送的数据删除指令,其中,所述数据删除指令中携带待删除数据的第一标识信息;a first obtaining module, configured to obtain a data deletion instruction sent by the client, where the data deletion instruction carries first identification information of the data to be deleted;
    第一查找模块,用于在存储的对应关系中,查找包含所述第一标识信息的第一对应关系,其中,所述对应关系为待存储数据的标识信息与相应的已存储数据的标识信息的对应关系,所述相应的已存储数据为所对应数据内容已存储于本地且与所述待存储数据的数据内容相同的数据,所述待存储数据为所对应数据内容待存储于本地的数据;a first searching module, configured to search, in the stored correspondence, a first correspondence that includes the first identifier information, where the correspondence relationship is identifier information of data to be stored and identifier information of the corresponding stored data. Corresponding relationship, the corresponding stored data is data in which the corresponding data content is stored locally and is the same as the data content of the data to be stored, and the data to be stored is data corresponding to the data content to be stored locally. ;
    第一判断模块,用于当查找到包含所述第一标识信息的第一对应关系后,判断所述第一标识信息是否对应目标数据内容;如果是,触发设置模块,如果否,触发第一删除模块;a first determining module, configured to determine whether the first identifier information corresponds to the target data content after the first correspondence information that includes the first identifier information is found; if yes, trigger the setting module, if not, trigger the first Delete the module;
    所述设置模块,用于将所述第一标识信息设置为已删除状态;The setting module is configured to set the first identification information to a deleted state;
    第一通知模块,用于通知所述客户端所述待删除数据已删除; a first notification module, configured to notify the client that the data to be deleted has been deleted;
    所述第一删除模块,用于删除包含所述第一标识信息的第一对应关系;The first deleting module is configured to delete a first correspondence that includes the first identifier information;
    第二通知模块,用于通知所述客户端所述待删除数据已删除。The second notification module is configured to notify the client that the data to be deleted has been deleted.
  9. 根据权利要求8所述的装置,其特征在于,所述设置模块,具体用于对应所述第一标识信息的目标数据内容设置删除任务,并将所述第一标识信息设置为已删除状态;The device according to claim 8, wherein the setting module is configured to set a deletion task corresponding to the target data content of the first identification information, and set the first identification information to a deleted state;
    所述装置还包括:第二判断模块和第二删除模块;The device further includes: a second determining module and a second deleting module;
    所述第二判断模块,用于检查存储的所述对应关系,判断所述对应关系中是否还存在包含所述第一标识信息的第一对应关系,当判断为未存在时,触发所述第二删除模块;The second determining module is configured to check the stored correspondence, and determine whether the first correspondence corresponding to the first identifier information still exists in the corresponding relationship, and when it is determined that the corresponding relationship does not exist, triggering the first Second delete the module;
    所述第二删除模块,用于响应所述删除任务,删除所述目标数据内容。The second deleting module is configured to delete the target data content in response to the deleting task.
  10. 根据权利要求8所述的装置,其特征在于,所述装置还包括确定模块、第三判断模块、第四判断模块和第三删除模块;The device according to claim 8, wherein the device further comprises a determining module, a third determining module, a fourth determining module, and a third deleting module;
    所述确定模块,用于当判断所述第一标识信息不对应目标数据内容时,根据所述第一对应关系,确定所述第一标识信息对应的第二标识信息,所述第二标识信息与所述目标数据内容对应;The determining module is configured to: when determining that the first identifier information does not correspond to the target data content, determine second identifier information corresponding to the first identifier information according to the first correspondence, the second identifier information Corresponding to the target data content;
    所述第三判断模块,用于判断所述第二标识信息是否已设置为已删除状态,当判断所述第二标识信息未设置为已删除状态时,触发所述第一删除模块;当判断所述第二标识信息已设置为已删除状态时,触发所述第四判断模块;The third determining module is configured to determine whether the second identifier information is set to the deleted state, and when the second identifier information is not set to the deleted state, triggering the first deleting module; When the second identifier information is set to the deleted state, the fourth determining module is triggered;
    所述第四判断模块,用于判断所述对应关系中除所述第一对应关系外是否还包括包含所述第二标识信息的第二对应关系,当判断所述对应关系中包含所述第二对应关系时,触发所述第一删除模块;当判断所述对应关系中不包含所述第二对应关系时,触发所述第三删除模块;The fourth determining module is configured to determine, in addition to the first correspondence, whether the second correspondence corresponding to the second identifier information is included in the correspondence, and when determining that the correspondence includes the The second deletion module is triggered when the second correspondence is performed; and the third deletion module is triggered when it is determined that the second correspondence is not included in the correspondence;
    所述第三删除模块,用于删除包含所述第一标识信息的第一对应关系且删除所述第二标识信息对应的目标数据内容。The third deleting module is configured to delete the first correspondence that includes the first identifier information and delete the target data content corresponding to the second identifier information.
  11. 根据权利要求8-10任一项所述的装置,其特征在于,所述装置还包括第四删除模块; The device according to any one of claims 8 to 10, wherein the device further comprises a fourth deletion module;
    所述第四删除模块,用于当在存储的所述对应关系中未查找到所述第一标识信息时,删除所述第一标识信息对应的目标数据内容。The fourth deleting module is configured to delete the target data content corresponding to the first identifier information when the first identifier information is not found in the stored correspondence relationship.
  12. 一种数据存储装置,其特征在于,所述装置包括:A data storage device, characterized in that the device comprises:
    第二获得模块,用于获得客户端发送的待存储数据的探测请求,所述探测请求包括所述待存储数据的第三标识信息和特征信息;a second obtaining module, configured to obtain a probe request for data to be stored sent by the client, where the probe request includes third identifier information and feature information of the data to be stored;
    比对确定模块,用于将所述待存储数据的特征信息与本地已存储数据的特征信息进行比对,确定本地是否已存储有与所述待存储数据的数据内容相同的目标数据内容;The comparison determining module is configured to compare the feature information of the data to be stored with the feature information of the locally stored data, and determine whether the target data content that is the same as the data content of the data to be stored is stored locally;
    第三获得模块,用于如果已存储有所述目标数据内容,则获得所述目标数据内容的第四标识信息;a third obtaining module, configured to obtain fourth identification information of the target data content if the target data content is already stored;
    存储通知模块,用于存储所述第三标识信息与所述第四标识信息的对应关系,并通知所述客户端所述待存储数据已存储。And a storage notification module, configured to store a correspondence between the third identifier information and the fourth identifier information, and notify the client that the to-be-stored data has been stored.
  13. 根据权利要求12所述的装置,其特征在于,所述装置还包括发送模块和接收存储模块;The device according to claim 12, wherein the device further comprises a transmitting module and a receiving storage module;
    所述发送模块,用于当未存储有所述目标数据内容时,向所述客户端发送数据上传信息,以使所述客户端上传所述待存储数据的数据内容;The sending module is configured to send data uploading information to the client when the target data content is not stored, so that the client uploads the data content of the to-be-stored data;
    所述收存储模块,用于接收并存储所述待存储数据的数据内容。The storage module is configured to receive and store data content of the data to be stored.
  14. 根据权利要求12或13所述的装置,其特征在于,所述特征信息中包括所述待存储数据的校验信息、所述待存储数据的数据量以及所述待存储数据的预定位数的数据内容;The device according to claim 12 or 13, wherein the feature information includes verification information of the data to be stored, a data amount of the data to be stored, and a predetermined number of bits of the data to be stored. Data content
    所述比对确定模块包括比对单元和确定单元;The comparison determination module includes a comparison unit and a determination unit;
    所述比对单元,用于将所述待存储数据的校验信息与本地已存储数据的校验信息进行比对,且将所述待存储数据的数据量与本地已存储数据的数据量进行比对,且将所述待存储数据的预定位数的数据内容与本地已存储数据的预定位数的数据内容进行比对;The comparison unit is configured to compare the verification information of the data to be stored with the verification information of the locally stored data, and perform the data amount of the data to be stored and the data amount of the locally stored data. Aligning, and comparing the data content of the predetermined number of bits of the data to be stored with the data content of the predetermined number of bits of the locally stored data;
    所述确定单元,用于当所述待存储数据的校验信息与本地已存储数据的 校验信息匹配,且所述待存储数据的数据量与本地已存储数据的数据量匹配,且所述待存储数据的预定位数的数据内容与本地已存储数据的预定位数的数据内容匹配时,确定本地已存储有与所述待存储数据的数据内容相同的目标数据内容。The determining unit is configured to: when the verification information of the data to be stored is locally stored Verifying that the information matches, and the amount of data of the data to be stored matches the amount of data of the locally stored data, and the data content of the predetermined number of bits of the data to be stored matches the data content of the predetermined number of bits of the locally stored data At the time, it is determined that the target data content identical to the data content of the data to be stored is stored locally.
  15. 一种电子设备,其特征在于,包括处理器和存储器,其中,存储器,用于存放计算机程序;An electronic device, comprising: a processor and a memory, wherein the memory is configured to store a computer program;
    处理器,用于执行存储器上所存放的计算机程序时,实现权利要求1-4任一项所述的数据删除方法。The processor, when used to execute a computer program stored on a memory, implements the data deletion method according to any one of claims 1-4.
  16. 一种计算机程序,其特征在于,所述计算机程序用于被运行以执行权利要求1-4任一项所述的数据删除方法。A computer program for operating the data deletion method of any of claims 1-4.
  17. 一种存储介质,其特征在于,所述存储介质用于存储计算机程序,所述计算机程序被运行以执行权利要求1-4任一项所述的数据删除方法。A storage medium, characterized in that the storage medium is for storing a computer program, the computer program being operative to perform the data deletion method of any one of claims 1-4.
  18. 一种电子设备,其特征在于,包括处理器和存储器,其中,存储器,用于存放计算机程序;An electronic device, comprising: a processor and a memory, wherein the memory is configured to store a computer program;
    处理器,用于执行存储器上所存放的计算机程序时,实现权利要求5-7任一项所述的数据存储方法。The processor, when used to execute a computer program stored on a memory, implements the data storage method of any one of claims 5-7.
  19. 一种计算机程序,其特征在于,所述计算机程序用于被运行以执行权利要求5-7任一项所述的数据存储方法。A computer program for operating a data storage method according to any one of claims 5-7.
  20. 一种存储介质,其特征在于,所述存储介质用于存储计算机程序,所述计算机程序被运行以执行权利要求5-7任一项所述的数据存储方法。 A storage medium, characterized in that the storage medium is for storing a computer program, the computer program being operative to perform the data storage method of any one of claims 5-7.
PCT/CN2017/101547 2016-11-15 2017-09-13 Data storage and deletion method and apparatus WO2018090703A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201611032369.6A CN108073355B (en) 2016-11-15 2016-11-15 Data storage and deletion method and device
CN201611032369.6 2016-11-15

Publications (1)

Publication Number Publication Date
WO2018090703A1 true WO2018090703A1 (en) 2018-05-24

Family

ID=62146085

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/101547 WO2018090703A1 (en) 2016-11-15 2017-09-13 Data storage and deletion method and apparatus

Country Status (2)

Country Link
CN (1) CN108073355B (en)
WO (1) WO2018090703A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110209888A (en) * 2019-05-08 2019-09-06 无线生活(杭州)信息科技有限公司 The storage method and device of interface requests
CN111414356A (en) * 2019-01-07 2020-07-14 北京京东尚科信息技术有限公司 Data storage method and device, non-relational database system and storage medium
CN112181630A (en) * 2019-07-05 2021-01-05 银河水滴科技(北京)有限公司 Data storage method, data storage equipment and computer readable storage medium
CN113625603A (en) * 2021-07-27 2021-11-09 金鹏电子信息机器有限公司 Security monitoring management system and management method based on big data

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109032509A (en) * 2018-06-29 2018-12-18 郑州云海信息技术有限公司 A kind of data-erasure method and relevant apparatus of distributed memory system
CN111198793A (en) * 2018-11-19 2020-05-26 北京京东尚科信息技术有限公司 Data deleting method and system, medium and computer system
CN111338810A (en) * 2018-12-19 2020-06-26 北京京东尚科信息技术有限公司 Method and apparatus for storing information
CN111404980B (en) * 2019-09-29 2023-04-18 杭州海康威视系统技术有限公司 Data storage method and object storage system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103414759A (en) * 2013-07-22 2013-11-27 华为技术有限公司 Network disc file transmission method and network disc file transmission device
CN103631933A (en) * 2013-12-06 2014-03-12 中国科学院计算技术研究所 Distributed duplication elimination system-oriented data routing method
CN103873503A (en) * 2012-12-12 2014-06-18 鸿富锦精密工业(深圳)有限公司 Data block backup system and method
CN105095300A (en) * 2014-05-16 2015-11-25 阿里巴巴集团控股有限公司 Method and system for database backup
US20160246682A1 (en) * 2010-10-25 2016-08-25 International Business Machines Corporation File deduplication in a file system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4706342B2 (en) * 2005-06-09 2011-06-22 株式会社日立製作所 Data management method and apparatus
CN103559279A (en) * 2013-11-07 2014-02-05 深信服网络科技(深圳)有限公司 Cloud storage acceleration method and device
CN104361034A (en) * 2014-10-27 2015-02-18 浪潮(北京)电子信息产业有限公司 File management method and device based on cloud storage
CN104317926B (en) * 2014-10-31 2017-10-17 北京思特奇信息技术股份有限公司 The data storage and query method and corresponding device and system of a kind of persistence
CN106033452B (en) * 2015-03-17 2019-06-25 阿里巴巴集团控股有限公司 A kind of data-updating method and device
CN104866242B (en) * 2015-05-29 2018-12-04 上海京东到家元信信息技术有限公司 A kind of data deletion system, method and data delete center

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160246682A1 (en) * 2010-10-25 2016-08-25 International Business Machines Corporation File deduplication in a file system
CN103873503A (en) * 2012-12-12 2014-06-18 鸿富锦精密工业(深圳)有限公司 Data block backup system and method
CN103414759A (en) * 2013-07-22 2013-11-27 华为技术有限公司 Network disc file transmission method and network disc file transmission device
CN103631933A (en) * 2013-12-06 2014-03-12 中国科学院计算技术研究所 Distributed duplication elimination system-oriented data routing method
CN105095300A (en) * 2014-05-16 2015-11-25 阿里巴巴集团控股有限公司 Method and system for database backup

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111414356A (en) * 2019-01-07 2020-07-14 北京京东尚科信息技术有限公司 Data storage method and device, non-relational database system and storage medium
CN110209888A (en) * 2019-05-08 2019-09-06 无线生活(杭州)信息科技有限公司 The storage method and device of interface requests
CN112181630A (en) * 2019-07-05 2021-01-05 银河水滴科技(北京)有限公司 Data storage method, data storage equipment and computer readable storage medium
CN113625603A (en) * 2021-07-27 2021-11-09 金鹏电子信息机器有限公司 Security monitoring management system and management method based on big data

Also Published As

Publication number Publication date
CN108073355B (en) 2020-03-17
CN108073355A (en) 2018-05-25

Similar Documents

Publication Publication Date Title
WO2018090703A1 (en) Data storage and deletion method and apparatus
US10460107B2 (en) Systems and methods for automatic snapshotting of backups based on malicious modification detection
US10121003B1 (en) Detection of malware, such as ransomware
US8495037B1 (en) Efficient isolation of backup versions of data objects affected by malicious software
TWI512491B (en) Data synchronization methods for synchronizing data in communication systems and communication systems
US10929125B2 (en) Determining provenance of files in source code projects
US8176555B1 (en) Systems and methods for detecting malicious processes by analyzing process names and process characteristics
JP2019518298A (en) Virus detection technology benchmarking
CN108573007A (en) Method, apparatus, electronic equipment and the storage medium of data consistency detection
US9817605B2 (en) Systems and methods of storing data associated with content of a data storage device
WO2015196981A1 (en) Method and device for recognizing picture junk files
WO2018233630A1 (en) Fault discovery
US8402542B2 (en) Non-sensitive-passage database for cut-and-paste attack detection systems
CN103365766A (en) Method and system for protecting file integrity
US9760842B2 (en) Operation target management apparatus and non-transitory computer readable medium
US20080162944A1 (en) Information processing apparatus, information processing system, and computer readable storage medium
US8543541B2 (en) Preventing transfer and duplication of redundantly referenced objects across nodes of an application system
US9686310B2 (en) Method and apparatus for repairing a file
KR101940864B1 (en) Client device and back-up method based on cloud, recording medium for performing the method
JP4807364B2 (en) Information management device
CN108459927B (en) Data backup method and device and server
US8095980B2 (en) Detecting malicious behavior in data transmission of a de-duplication system
CN106294017A (en) A kind of information security back-up method
WO2019072088A1 (en) File management method, file management device, electronic equipment and storage medium
US20160277628A1 (en) Information processing apparatus, information processsing system, and non-transitory computer readable medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17872481

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17872481

Country of ref document: EP

Kind code of ref document: A1