Data deletion method, data copy method, device, equipment and storage medium

By leveraging the collaborative work of object indexing services and data indexing services, storage indexes and hard link records are generated and managed, solving the problems of large storage space consumption, long execution time, and inaccurate counting during data copying and deletion, thereby improving the reliability and efficiency of data deletion.

CN116541381BActive Publication Date: 2025-11-28TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210089177.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-25
Publication Date
2025-11-28
Estimated Expiration
2042-01-25

AI Technical Summary

Technical Problem

Existing data copying and deletion methods suffer from problems such as large storage space consumption, long execution time, and inaccurate counting leading to data loss or inability to delete in big data scenarios.

Method used

By working together with the object index service and the data index service, storage indexes and hard link records are generated and managed, ensuring that a new storage index and hard link record is generated for each copy or delete operation, until the physical data is deleted when there are no more linked records.

Benefits of technology

It improves the reliability of data deletion, avoids wasted memory space and accidental deletion, and optimizes the efficiency of data copying and deletion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116541381B_ABST
    Figure CN116541381B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a data deletion method, a data copy method, a device, equipment and a storage medium. The method comprises the following steps: an object index service deletes a target storage index stored by the object index service in response to a deletion operation, and instructs a data index service to delete the target storage index and a hard link record of the target storage index and generate a successful deletion result when the target storage index has a target hard link record or an associated storage index; when the target storage index does not correspond to the target hard link record and the associated storage index, the target storage index is deleted and a data deletion instruction is generated. If the object index service receives the data deletion instruction, the physical data corresponding to the target storage index is deleted. Since one hard link record is generated every time a copy operation is performed on the physical data, one hard link record is deleted every time a data deletion operation is performed, and the physical data is deleted when there is no target hard link record and associated storage index, the reliability of data deletion is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computers, and more particularly, to a data deletion method, a data copying method, an apparatus, a device, and a storage medium. BACKGROUND

[0002] Currently, there are two common copying methods for users in the process of data copying and deletion. One is to copy real physical data, and the other is to copy data by reference counting.

[0003] When real physical data is copied, that is, the physical data is directly copied, this copying method occupies a large amount of storage space and has a large delay in the copying process. In particular, in a big data scenario, this way of copying real physical data can lead to a long task execution time and a large amount of memory occupation. Similarly, in the deletion process, a large amount of time is also occupied. The reference counting copying method is based on the above-mentioned real physical data copying scenario.

[0004] When data is copied by reference counting, the data is not copied, but a layer of reference counting is added between the file index and the data. When copying, the counter is added, and when deleting, the counter is reduced. When the counter is reduced to 0, the real file data is triggered to be deleted. However, when data is copied by the reference counting copying method, the counting is not accurate, so that in the subsequent data deletion process, if the counter is too large, the data cannot be deleted, and the garbage cannot be cleaned up in time; if the counter is too small, data loss is easily caused in the data deletion process.

[0005] Therefore, it is an urgent technical problem to provide a data deletion method that can effectively avoid data loss or garbage in the subsequent data deletion process during data copying. SUMMARY

[0006] Therefore, the embodiments of the present application provide a data deletion method, a data copying method, an apparatus, a device, and a storage medium, which can effectively alleviate the above technical problems.

[0007] In a first aspect, the embodiments of the present application provide a data deletion method applied to an object index service, the method comprising: in response to a deletion operation on target data, obtaining a target storage index corresponding to the target data, generating a deletion request including the target storage index, and deleting the target storage index stored in the object index service, the object index service having physical data corresponding to the target data; sending the deletion request to a data index service, instructing the data index service to delete the target storage index and a hard link record of the target storage index when the data index service has a storage index associated with the target storage index or a target hard link record corresponding to the target storage index stored therein, and to generate a successful deletion result, or instructing the data index service to generate a data deletion instruction and delete the target storage index when the target storage index does not correspond to the target hard link record and the associated storage index, the hard link record being generated based on copying the physical data to obtain a new storage index, and one new storage index and one hard link record of the new storage index being generated for each copy of the physical data, all storage indexes and hard link records corresponding to the physical data being stored in the data index service, and the target hard link record corresponding to the target storage index being other hard link records associated with the target storage index except the hard link record of the target storage index; receiving a data deletion success result or a data deletion instruction fed back by the data index service, and deleting physical data corresponding to the target storage index if the data deletion instruction is received.

[0008] In a second aspect, the embodiments of the present application provide a data deletion method applied to a data index service, which comprises the following steps: receiving a deletion request sent by an object index service, wherein the deletion request is generated by the object index service in response to a deletion operation on target data, and the deletion request carries a target storage index corresponding to the target data; in response to the deletion request, when a storage index associated with the target storage index or a target hard link record corresponding to the target storage index is stored in the data index service, deleting the target storage index and the hard link record of the target storage index, and generating a successful deletion result; or when the target storage index does not correspond to the target hard link record and the associated storage index, generating a data deletion instruction and deleting the target storage index, wherein the hard link record is generated based on a copy of the physical data, and a new storage index and a hard link record of the new storage index are generated each time the physical data is copied, all storage indexes and hard link records corresponding to the physical data are stored in the data index service, and the target hard link record corresponding to the target storage index is a hard link record other than the hard link record of the target storage index and stored in association with the target storage index; feeding back the data successful deletion result or the data deletion instruction to the object index service, so that the object index service deletes the physical data corresponding to the target storage index when receiving the data deletion instruction.

[0009] In a third aspect, the embodiments of the present application provide a data copy method applied to an object index service, which comprises the following steps: in response to a data copy operation on target physical data, generating a first storage index according to a data storage index of the target physical data; sending a data copy request comprising the first storage index to a data index service, instructing the data index service to generate a hard link record of the first storage index, and associating and storing the data storage index, the first storage index and the hard link record of the first storage index; receiving the hard link record fed back by the data index service, and associating and storing the hard link record with the first storage index.

[0010] In a fourth aspect, the embodiments of the present application provide a data copy method applied to a data index service, which comprises the following steps: receiving a data copy request comprising a first storage index sent by an object index service, wherein the first storage index is generated by the object index service based on a data storage index of a target data source in response to a copy operation on the target data source; in response to the data copy request, generating a hard link record of the first storage index, and associating and storing the data storage index, the first storage index and the hard link record of the first storage index; sending the hard link record to the object index service, so that the object index service associates and stores the hard link record with the first storage index.

[0011] In a fifth aspect, an embodiment of the present application provides a data deletion apparatus applied to an object index service, the apparatus comprising: a deletion request generation module, a deletion request sending module, and a deletion result obtaining module. The deletion request generation module is configured to, in response to a deletion operation on target data, acquire a target storage index corresponding to the target data, generate a deletion request comprising the target storage index, and delete the target storage index stored in the object index service, the object index service having physical data corresponding to the target data. The deletion request sending module is configured to send the deletion request to a data index service, instruct the data index service to delete the target storage index and a hard link record of the target storage index when the data index service has a storage index associated with the target storage index or a target hard link record corresponding to the target storage index stored therein, and generate a successful deletion result, or instruct the data index service to generate a data deletion instruction and delete the target storage index when the target storage index does not correspond to the target hard link record and the associated storage index, the hard link record being generated based on copying the physical data to obtain a new storage index, and one new storage index and one hard link record of the new storage index being generated for each copy of the physical data, all storage indexes and hard link records corresponding to the physical data being stored in the data index service, and the target hard link record corresponding to the target storage index being a hard link record other than the hard link record of the target storage index and being stored in association with the target storage index. The deletion result obtaining module is configured to receive a data successful deletion result or a data deletion instruction fed back by the data index service, and delete the physical data corresponding to the target storage index if the data deletion instruction is received.

[0012] In an implementation manner, the apparatus further comprises: an index receiving module, an index confirming module, and a first instruction sending module. The index receiving module is configured to receive at least one to-be-detected storage index sent by the data index service when the same physical data corresponds to at least one hard link record, the at least one to-be-detected storage index comprising a storage index to which each hard link record in the at least one hard link record belongs respectively and is stored in the data index service. The index confirming module is configured to confirm whether a target to-be-detected storage index exists in the at least one to-be-detected storage index, the target to-be-detected storage index not matching a storage index stored in the object index service. The first instruction sending module is configured to send an index deletion instruction to the data index service if the target to-be-detected storage index exists and the number of target to-be-detected storage indexes is less than the number of the at least one to-be-detected storage index, and instruct the data index service to delete the target to-be-detected storage index and a hard link record of the target to-be-detected storage index.

[0013] In an implementation, the apparatus further comprises a deletion quantity obtaining module and a second instruction sending module. The deletion quantity obtaining module is configured to, if there is a target to-be-detected index and the number of target to-be-detected storage indexes is the same as the number of the at least one to-be-detected storage index, generate a target deletion quantity according to the number of the at least one to-be-detected storage index, wherein the target deletion quantity is less than the number of the plurality of to-be-detected storage indexes; and the second instruction sending module is configured to send an index deletion instruction comprising the target deletion quantity to the data index service, instructing the data index service to delete the target deletion quantity of target to-be-detected storage indexes and hard link records of the target to-be-detected storage indexes.

[0014] In an implementation, the apparatus further comprises a record detecting module configured to detect whether there is a target hard link record in the object index service, and if there is, delete the target hard link record, wherein the target hard link record is a hard link record not associated with a storage index.

[0015] In an implementation, the apparatus further comprises a data deleting module configured to detect whether the physical data corresponding to the target hard link record corresponds to a storage index, and if not, delete the physical data.

[0016] In a sixth aspect, the present application also provides a data deletion device applied to a data index service, which comprises a deletion request receiving module, a deletion request responding module and a deletion result feedback module. The deletion request receiving module is configured to receive a deletion request sent by an object index service, the deletion request being generated by the object index service in response to a deletion operation on target data, and the deletion request carrying a target storage index corresponding to the target data. The deletion request responding module is configured to, in response to the deletion request, delete the target storage index and a hard link record of the target storage index, and generate a successful deletion result when a storage index associated with the target storage index or a target hard link record corresponding to the target storage index is stored in the data index service; or generate a data deletion instruction and delete the target storage index when the target storage index does not correspond to the target hard link record and the associated storage index. The hard link record is generated based on a copy of the physical data, and a new storage index and a hard link record of the new storage index are generated each time the physical data is copied. All storage indexes and hard link records corresponding to the physical data are stored in the data index service, and the target hard link record corresponding to the target storage index is a hard link record other than the hard link record of the target storage index and associated with the target storage index. The deletion result feedback module is configured to feed back the data successful deletion result or the data deletion instruction to the object index service, so that the object index service deletes the physical data corresponding to the target storage index when receiving the data deletion instruction.

[0017] In a seventh aspect, the present application also provides a data copy device applied to an object index service, which comprises a copy operation responding module, a copy request sending module and an information receiving module. The copy operation responding module is configured to, in response to a data copy operation on target physical data, generate a first storage index according to a data storage index of the target physical data. The copy request sending module is configured to send a data copy request comprising the first storage index to a data index service, instruct the data index service to generate a hard link record of the first storage index, and store the data storage index, the first storage index and the hard link record of the first storage index in association. The information receiving module is configured to receive the hard link record fed back by the data index service, and store the hard link record in association with the first storage index.

[0018] In an implementation manner, the copy request sending module is further configured to send a data copy request comprising index information of the data storage index and the first storage index to the data index service, instruct the data index service to verify the first storage index according to the index information, and generate the hard link record of the first storage index after the verification is successful.

[0019] In an implementation, the copy operation response module is further configured to, in response to the data copy operation on the target physical data, obtain a response time corresponding to the data copy operation; generate a random number according to the response time, and generate a first storage index according to the random number and a data storage index of the target physical data.

[0020] In an eighth aspect, the present application provides a data copy device applied to a data index service, the device comprising a copy request receiving module, a copy request response module, and an information sending module. The copy request receiving module is configured to receive a data copy request including a first storage index sent by an object index service, the first storage index being generated by the object index service based on a data storage index of a target data source in response to a copy operation on the target data source. The copy request response module is configured to, in response to the data copy request, generate a hard link record of the first storage index, and store the data storage index, the first storage index, and the hard link record of the first storage index in association. The information sending module is configured to send the hard link record to the object index service, so that the object index service stores the hard link record in association with the first storage index.

[0021] In an implementation, the copy request response module is further configured to verify the first storage index by using index information of the data storage index, and generate the hard link record of the first storage index if the verification is successful.

[0022] In a ninth aspect, an electronic device is provided, which includes a processor and a memory. One or more programs are stored in the memory and configured to be executed by the processor to implement the method described above.

[0023] In a tenth aspect, a computer readable storage medium is provided, which stores program codes. When the program codes are run by a processor, the method described above is executed.

[0024] In an eleventh aspect, a computer program product or a computer program is provided, which includes computer instructions stored in a computer readable storage medium. A processor of a computer device acquires the computer instructions from the computer readable storage medium. The processor executes the computer instructions, so that the computer device executes the method described above.

[0025] The data deletion method, the data copy method, the device, the equipment and the storage medium provided by the embodiment of the application are as follows: when the data deletion method is executed, the object index service responds to a deletion operation on target data, acquires a target storage index corresponding to the target data, generates a deletion request including the target storage index, and deletes the target storage index stored in the object index service, and the object index service has physical data corresponding to the target data. The object index service sends a deletion request to a data index service, and the data index service deletes the target storage index and a hard link record of the target storage index when the data index service has a storage index associated with the target storage index or a target hard link record corresponding to the target storage index, and generates a successful deletion result, or the data index service generates a data deletion instruction and deletes the target storage index when the target storage index does not correspond to the target hard link record and the associated storage index, the hard link record is generated based on a new storage index obtained by copying the physical data, and a new storage index and a hard link record of the new storage index are generated for each copy of the physical data, all storage indexes and hard link records corresponding to the physical data are associated and stored in the data index service, and the target hard link record corresponding to the target storage index is a hard link record associated with the target storage index except the hard link record of the target storage index. The object index service receives a data deletion result or a data deletion instruction fed back by the data index service, and if the data deletion instruction is received, the physical data corresponding to the target storage index is deleted. Since one hard link record is generated for each copy operation of the physical data, in the data deletion process, one hard link record is deleted for each data deletion operation, and the physical data is deleted when there is no hard link record and associated storage index, so that the reliability of data deletion is improved, and the situation that the physical data cannot be deleted, the memory space is wasted, or the physical data is mistakenly deleted is avoided. BRIEF DESCRIPTION OF DRAWINGS

[0026] In order to more clearly illustrate the technical solutions in the embodiments of the application, the following will briefly introduce the drawings needed in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of these drawings.

[0027] Figure 1 A schematic diagram of the connection of the data processing system provided by the embodiment of the application is shown;

[0028] Figure 2 Another schematic diagram of the connection of the data processing system provided by the embodiment of the application is shown;

[0029] Figure 3 Fig. 1 shows a flow diagram of a data deletion method applied to an object indexing service according to an embodiment of the present application;

[0030] Figure 4 Fig. 2 shows a flow diagram of a data deletion method applied to a data indexing service according to an embodiment of the present application;

[0031] Figure 5 Fig. 3 shows a flow diagram of a data copy method applied to an object indexing service according to an embodiment of the present application;

[0032] Figure 6 Fig. 4 shows a flow diagram of a data copy method applied to a data indexing service according to an embodiment of the present application;

[0033] Figure 7 Fig. 5 shows a timing flow diagram of a data copy method executed by a data processing system according to an embodiment of the present application;

[0034] Figure 8 Fig. 6 shows a timing flow diagram of a data deletion method executed by a data processing system according to an embodiment of the present application;

[0035] Figure 9 Fig. 7 shows a connection block diagram of a data deletion apparatus applied to an object indexing service according to an embodiment of the present application.

[0036] Figure 10 Fig. 8 shows a connection block diagram of a data deletion apparatus applied to a data indexing service according to an embodiment of the present application.

[0037] Figure 11 Fig. 9 shows a connection block diagram of a data copy apparatus applied to an object indexing service according to an embodiment of the present application;

[0038] Figure 12 Fig. 10 shows a connection block diagram of a data copy apparatus applied to a data indexing service according to an embodiment of the present application.

[0039] Figure 13 Fig. 11 shows a structural block diagram of an electronic device for executing the method according to an embodiment of the present application. DETAILED DESCRIPTION

[0040] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative labor fall within the scope of protection of the present application.

[0041] For the convenience of understanding the present scheme, several concepts are introduced as follows:

[0042] Target data: refers to a data file identifying a target physical data with a name or a data file identifying a target physical data after copying the target physical data.

[0043] Target physical data: refers to data actually stored in a storage or a processor, etc., which can be queried, called, copied, deleted, etc.

[0044] Object index service: can be an application program or a software program, specifically an object-oriented (i.e., user-oriented) software program, which can be used to generate an index of target physical data when the target physical data is stored, so as to identify the uniqueness of the target physical data and the storage location of the target physical data by using the index, and can generate a new index based on the index of the target physical data during the data copying process.

[0045] Data index service: can be an application program or a software program, specifically a service-oriented software program, which can be used to generate a hard link record corresponding to a new index when copying the target physical data, so as to identify which index of the target physical data the new index is copied from by using the hard link record.

[0046] Storage index: a storage structure created for accelerating retrieval. It is established for a table and is composed of index pages other than data pages storing the table. Each row in the index page contains a logical pointer through which the data can be directly retrieved, thus accelerating the retrieval of physical data. The storage index is usually used to store data of interest to the user, such as file size, file ID (file identification), creation time, and modification time of the physical data, and can also store data of interest to the storage system, such as file digest and storage structure, etc.

[0047] As shown in Figure 1 and Figure 2 , the present application provides a system architecture diagram of a data processing system, wherein the data processing system comprises a data index service 20 and an object index service 10, wherein the data index service 20 and the object index service 10 can be installed on the same electronic device or different electronic devices. Figure 1 A diagram showing the data index service 20 and the object index service 10 installed on different electronic devices is shown.

[0048] The electronic device can be a terminal device or a server. When the data index service 20 and the object index service 10 are installed in different electronic devices, one of them can be installed in a terminal device and the other can be installed in a server, and the terminal and the server can interact through a network. Figure 1 and Figure 2 A schematic diagram is shown in which the object index service 10 is installed in a client and the data index service 20 is installed in a server.

[0049] The server can be a stand-alone physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDNs, and big data and artificial intelligence platforms. The terminal can be a smartphone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal and the server can be directly or indirectly connected through wired or wireless communication, which is not limited in the present application.

[0050] When the data processing system shown in Figure 1 When the data processing system shown in

[0051] By using the above data processing system for data copying, a first storage index and a hard link record of the first storage index are newly generated each time a copy task is executed, so that when the user accesses the physical data through the first storage index obtained by executing the copy operation, the physical data is accessed through the first storage index and the hard link record of the first storage index. Since the physical data does not need to be copied during the copying process, the memory occupied after copying the data can be effectively saved, and the time occupied by copying the physical data can be avoided.

[0052] When the data processing system shown in Figure 2When the data processing system shown in the figure performs a data deletion operation, the object index service 10 acquires a target storage index corresponding to target data in response to a deletion operation on the target data, generates a deletion request including the target storage index, and deletes the target storage index stored in the object index service 10, which has physical data corresponding to the target data. The object index service 10 sends the deletion request to the data index service 20. When the data index service 20 receives the deletion request sent by the object index service 10, if the data index service 20 stores a storage index associated with the target storage index or a target hard link record corresponding to the target storage index, the data index service 20 deletes the target storage index and the hard link record of the target storage index, and generates a successful deletion result, or the target storage index stored in the data index service 20 does not correspond to a target hard link record and an associated storage index, and the data index service 20 generates a data deletion instruction and deletes the target storage index. The hard link record is generated based on a copy of the physical data, and a new storage index and a hard link record of the new storage index are generated for each copy of the physical data. All storage indexes and hard link records corresponding to the physical data are stored in the data index service 20. The target hard link record corresponding to the target storage index is a hard link record associated with the target storage index other than the hard link record of the target storage index. The object index service 10 receives the data deletion result or the data deletion instruction fed back by the data index service 20. If the data deletion instruction is received, the physical data corresponding to the target storage index is deleted.

[0053] By using the data processing system described above to perform a data deletion operation, since a hard link record is generated for each copy of the physical data, in the data deletion process, each time a data deletion operation is performed, a hard link record is deleted, and until there is no hard link record and associated storage index after deletion, the physical data is deleted, thereby improving the reliability of data deletion and avoiding the situation that the physical data cannot be deleted, causing memory space waste or mistakenly deleting the physical data.

[0054] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0055] Please refer to Figure 3 , Figure 3 The data deletion method shown in the figure is proposed in an embodiment of the present application, and the method can be applied to an object index service. The method includes the following steps.

[0056] Step S110: In response to a deletion operation on target data, a target storage index corresponding to the target data is acquired, a deletion request including the target storage index is generated, and the target storage index stored in the object index service is deleted. The object index service has physical data corresponding to the target data.

[0057] Since the user can only see the file name, the index name or the identification information, the target data can not be the physical data, but a file name, a file identification or a storage index name of the physical data, and the target data corresponds to a unique target storage index, so that the user can obtain the corresponding target storage index according to the target data, and then perform the operation of querying, calling, copying or deleting the corresponding physical data based on the target storage index. That is, the user enables the object index service to obtain the corresponding target storage index by triggering the file name, the index name or the identification information deletion operation.

[0058] In an implementation of the present application, the target data can be a file name, a storage index name or identification information corresponding to the physical data, or a copied file name, a copied storage index name or copied identification information obtained by copying the physical data.

[0059] The physical data can be picture data, text data, audio and video data, etc.

[0060] The deletion operation on the target data can be triggered by the user, that is, the user can trigger the operation by voice, gesture or touch operation.

[0061] When the object index service obtains the target storage index corresponding to the target data in response to the deletion operation on the target data, it can specifically access the memory corresponding to the object index service to query the target storage index corresponding to the target data in response to the deletion operation on the target data. The target storage index can be a storage index of the physical data, or a new storage index obtained by copying the physical data.

[0062] The new storage index obtained by copying the physical data is specifically generated based on the storage index of the physical data, for example, the new storage index obtained by copying can include a random number, a character or a label in addition to the storage index of the physical data. It should be noted that if the target storage index is a new storage index obtained by copying the storage index of the physical data, the new storage index corresponds to a hard link record, and the hard link record is used to indicate that the new storage index is copied from the above-mentioned storage index of the physical data.

[0063] It should be understood that if the target storage index is a new storage index obtained by copying, the hard link record of the target storage index can also be deleted when the target storage index stored in the object index service is deleted.

[0064] To avoid that the user can still see the target data after the target storage index is deleted, causing the user to repeatedly delete the target data, in this embodiment, the object index service deletes the target data when deleting the target storage index stored by the object index service. So that the user can no longer see the target data, thereby avoiding the user repeatedly performing the delete operation or subsequently performing the access operation.

[0065] Step S120: send a delete request to the data index service, instructing the data index service to delete the target storage index and the hard link record of the target storage index when the data index service stores a storage index associated with the target storage index or a target hard link record corresponding to the target storage index, and generate a successful deletion result, or instruct the data index service to generate a data deletion instruction and delete the target storage index when the target storage index does not correspond to a target hard link record and an associated storage index.

[0066] The hard link record is generated based on copying the physical data to obtain a new storage index, and a new storage index and a hard link record of the new storage index are generated for each copy of the physical data. All storage indexes and hard link records corresponding to the physical data are stored in the data index service. The target hard link record corresponding to the target storage index is a hard link record associated with the target storage index other than the hard link record of the target storage index.

[0067] In the data index service, for the same physical data, all storage indexes corresponding to the physical data and hard link records of the storage indexes are stored in association. When the data index service receives the delete request, since the delete request includes the target storage index, the data index service can query whether the data index service stores other indexes associated with the target storage index or whether it stores a hard link record corresponding to the target storage index in response to the delete request. The hard link record corresponding to the target storage index can be a hard link record of the target storage index or a hard link record (target hard link record) of another index associated with the target storage index.

[0068] It should be noted that if the data index service queries that the target storage index corresponds to a target hard link record or another storage index, it means that the physical data has been copied, i.e. this deletion will not directly delete the physical data, but only delete the target storage index. It should also be noted that if the target storage index corresponds to a hard link record, and the hard link record corresponding to the target storage index includes the hard link record of the target storage index, then when the target storage index is deleted, the hard link record of the target storage index is deleted. If the target storage index corresponds to a hard link record, but the hard link record corresponding to the target storage index does not include the hard link record of the target storage index, then only the target storage index can be deleted.

[0069] If the data index service finds that the target storage index does not correspond to a target hard link record and is not associated with other storage indexes, it can be confirmed that the target storage index is the only storage index that can access the physical data. If the target storage index is deleted, the physical data will no longer be accessible. Therefore, to avoid the physical data becoming garbage data (data that occupies memory but cannot be cleaned up or accessed) after the target storage index is deleted, a data deletion instruction can be generated to instruct the object index service to delete the physical data according to the data deletion instruction. It should be understood that the deletion instruction can specifically include the location of the physical data, the file size of the physical data, identification information, storage structure, and / or file digest, and the like. The above information can be obtained according to the target storage index.

[0070] Step S130: receiving the data deletion success result or the data deletion instruction fed back by the data index service. If the data deletion instruction is received, the physical data corresponding to the target storage index is deleted.

[0071] Specifically, if the data deletion instruction is received, the physical data is deleted according to the storage location of the physical data, the file size of the physical data, and the file digest included in the data deletion instruction.

[0072] The data deletion method of the present application can be used. The object index service deletes the target storage index in response to the deletion operation. The deletion request is sent to the data index service, which instructs the data index service to delete the target storage index and the hard link record of the target storage index and generate a deletion success result when the target storage index corresponds to a target hard link record or an associated storage index, and to delete the target storage index and generate a data deletion instruction when the target storage index does not correspond to a hard link record and an associated storage index. If the data deletion instruction is received by the object index service, the physical data corresponding to the target storage index is deleted. Since a new storage index and a new hard link record of the storage index are generated for each copy operation of the physical data, when the target data is deleted, a storage index (target storage index) of the corresponding physical data is deleted for each deletion operation of the target data, and a hard link record is also deleted. When the number of hard link records is zero (there is no target hard link record corresponding to the target storage index) and there is no other storage index, it is confirmed that the physical data is not associated with other storage indexes, and the physical data is deleted, thereby effectively improving the reliability of data deletion.

[0073] Furthermore, during the deletion process, even if the user repeatedly triggers the deletion operation on the target data, once the storage index corresponding to the target data in the object index service is deleted, the object index service will not send a deletion request to the data storage service again. Therefore, even if the deletion operation on the target data is repeatedly triggered, other storage indexes or hard link records associated with the target storage index stored in the data index service will not be deleted. Correspondingly, there is no situation of accidental deletion of physical data, thus effectively ensuring the reliability of data deletion.

[0074] During the data copying process, there may be situations where a hard link record is created in the data indexing service, but there is no corresponding storage index in the object indexing service; or a storage index is created, but a hard link record for the storage index is obtained; or a storage index is successfully deleted, but the corresponding hard link record is not deleted, because there may be cases where a hard link record does not have a corresponding storage index, or the storage index corresponding to the same hard link record is inconsistent between the object indexing service and the data indexing service.

[0075] To avoid discrepancies between the storage indexes stored in the data indexing service and the object indexing service, which could prevent users from deleting the corresponding physical data during the data deletion process, in one possible implementation of this application, the method further includes:

[0076] Step S140: When the data indexing service has at least one hard link record corresponding to the same physical data, it sends at least one storage index to be detected. The at least one storage index to be detected includes the storage index to which each hard link record belongs in the data indexing service.

[0077] The data index service stores all storage indexes and hard link records corresponding to the same physical data. If the same physical data stored in the data index service corresponds to multiple hard link records, the storage indexes corresponding to each hard link record can be sent to the object index service as storage indexes to be tested.

[0078] Step S150: Confirm that at least one storage index to be detected exists, and that the target storage index to be detected does not match the storage index stored in the object index service.

[0079] When the object index service receives a storage index to be tested from the data storage service, it can match the storage index to be tested with the storage index corresponding to the physical data stored in the object index service center to detect whether there is a target storage index to be tested that does not match the storage index stored in the object index service.

[0080] Step S160: If the target to-be-detected storage indexes exist and the number of the target to-be-detected storage indexes is less than the number of the at least one to-be-detected storage index, an index deletion instruction including the number of the target to-be-detected storage indexes is sent to the data index service, to instruct the data index service to delete the target to-be-detected storage indexes and the hard link records of the target to-be-detected storage indexes.

[0081] Step S170: If the target to-be-detected indexes exist and the number of the target to-be-detected storage indexes is the same as the number of the at least one to-be-detected storage index, a target deletion quantity is generated according to the number of the at least one to-be-detected storage index, where the target deletion quantity is less than the number of the at least one to-be-detected storage index.

[0082] Step S180: An index deletion instruction including the target deletion quantity is sent to the data index service, to instruct the data index service to delete the target deletion quantity of the target to-be-detected storage indexes and the hard link records of the target to-be-detected storage indexes.

[0083] By receiving the at least one to-be-detected storage index sent by the data index service when the same physical data corresponds to at least one hard link record, and instructing the data index service to delete the target to-be-detected storage indexes and the hard link records of the target to-be-detected storage indexes when the target to-be-detected storage indexes exist and do not match the storage indexes stored in the object index service and the number of the target to-be-detected storage indexes is less than the number of the at least one to-be-detected storage index, and instructing the data index service to delete the target deletion quantity of the target to-be-detected storage indexes and the hard link records of the target to-be-detected storage indexes when the target to-be-detected storage indexes exist and do not match the storage indexes stored in the object index service and the number of the target to-be-detected storage indexes is the same as the number of the at least one to-be-detected storage index, the target deletion quantity is less than the number of the at least one to-be-detected storage index. In this way, the situation that the real physical data cannot be deleted due to the existence of the error storage indexes and the hard link records in the data index service can be effectively avoided.

[0084] To avoid the situation that the hard link records do not correspond to the storage indexes, causing the corresponding physical data to be unable to be deleted, in an embodiment of the present application, the method further includes: detecting whether the target hard link record exists in the object index service, and deleting the target hard link record if the target hard link record exists, where the target hard link record is a hard link record that is not associated with a storage index.

[0085] It should be noted that the hard link record that is not associated with a storage index refers to a target hard link record that is not a hard link record of the storage index of the corresponding physical data.

[0086] In this way, in order to avoid that the target hard link record corresponds to physical data, but the physical data does not correspond to other storage indexes, so that the physical data cannot be accessed and becomes garbage data. In an embodiment of the present application, before deleting the target hard link record, the method further comprises: detecting whether the physical data corresponding to the target hard link record corresponds to a storage index, and if not, deleting the physical data.

[0087] Please refer to Figure 4 In another embodiment of the present application, a data deletion method is provided, which is applied to a data index service, and the method comprises:

[0088] Step S210: receiving a deletion request sent by an object index service, the deletion request being generated by the object index service in response to a deletion operation on target data, and the deletion request carrying a target storage index corresponding to the target data.

[0089] Step S220: in response to the deletion request, when storing a storage index associated with the target storage index or a target hard link record corresponding to the target storage index in the data index service, deleting the target storage index and the hard link record of the target storage index, and generating a successful deletion result; or when the target storage index does not correspond to a target hard link record and an associated storage index, generating a data deletion instruction and deleting the target storage index.

[0090] The hard link record is generated based on copying the physical data, and each time the physical data is copied, a new storage index and a hard link record of the new storage index are generated, and all storage indexes and hard link records corresponding to the physical data are stored in the data index service, and the target hard link record corresponding to the target storage index is a hard link record associated with the target storage index other than the hard link record of the target storage index.

[0091] Step S230: feeding back the data successful deletion result or the data deletion instruction to the object index service, so that the object index service deletes the physical data corresponding to the target storage index after receiving the data deletion instruction.

[0092] For specific descriptions of steps S210-S230, please refer to the specific descriptions of steps S110-S130 in the foregoing.

[0093] It should be understood that, in order to avoid that the storage indexes stored in the data index service and the object index service are different, causing the user to be unable to delete the corresponding physical data during the deletion of the data, in an embodiment of the present application, the method further comprises:

[0094] Step S240: when the same physical data corresponds to at least one hard link record, sending at least one to-be-detected storage index to the object index service, the at least one to-be-detected storage index including a storage index to which each hard link record in the at least one hard link record stored in the data index service respectively belongs.

[0095] Step S250: receiving an index deletion instruction fed back by the object service when it is confirmed that the target to-be-detected index exists in the at least one to-be-detected storage index, the target to-be-detected storage index not matching the storage index stored in the object index service.

[0096] Step S260: deleting the target to-be-detected storage index and the hard link record of the target to-be-detected storage index in response to the index deletion instruction.

[0097] In this way, if the number of target to-be-detected storage indexes is the same as the number of the at least one to-be-detected storage index, the target deletion quantity in the index deletion instruction is generated by the object index service according to the number of the at least one to-be-detected storage index, and the target deletion quantity is less than the number of the plurality of to-be-detected storage indexes. Deleting the target to-be-detected storage index and the hard link record of the target to-be-detected storage index in response to the index deletion instruction includes: deleting the target deletion quantity of target to-be-detected storage indexes and the hard link record of the target to-be-detected storage index in response to the index deletion instruction.

[0098] For the specific description of steps S240-S250, refer to the specific description of steps S140-S180 in the foregoing embodiments, which will not be repeated here.

[0099] For the specific description of steps S240-S250, refer to the specific description of steps S140-S180 in the foregoing embodiments, which will not be repeated here. Figure 5 The embodiment of the present application further provides a data copying method, which is applied to an object index service, and the method comprises the following steps:

[0100] Step S310: in response to a data copying operation on target physical data, generating a first storage index according to a data storage index of the target physical data.

[0101] The deletion operation on the target physical data can be triggered by a user, i.e., triggered by the user through voice, gesture or touch operation.

[0102] Since the user can only see the file name, index name or identification information, the deletion operation on the target physical data can be a deletion operation based on the file name, file identification or storage index name of the target physical data seen by the user.

[0103] The target physical data can be picture data, text data, audio and video data, etc.

[0104] The first storage index can include a random number, a character, a label, or the like in addition to the data storage index of the target physical data.

[0105] In an embodiment of the present application, the first storage index can be generated based on the data storage index of the target physical data and MD5 (a cryptographic hash function), SHA (a secure hash algorithm), or another globally unique identifier id (for example, a unique identifier generated by an algorithm).

[0106] To ensure that the multiple storage indexes generated by performing multiple copying operations on the same target physical data are different from each other, in the present embodiment, the manner of generating the first storage index according to the data storage index of the target physical data in response to the data copying operation on the target physical data can include:

[0107] In response to the data copying operation on the target physical data, the time of responding to the data copying operation is obtained. A random number is generated according to the time of responding, and the first storage index is generated according to the random number and the data storage index of the target physical data.

[0108] The manner of generating a random number according to the time of responding can be to encrypt the time of responding by using the MD5 or SHA algorithm to obtain a random number, or to use the time of responding as a random number seed and generate a random number by using a random number generation algorithm and the random number seed.

[0109] Step S320: The data copying request including the first storage index is sent to the data index service, instructing the data index service to generate a hard link record of the first storage index, and the data storage index, the first storage index, and the hard link record of the first storage index are stored in association.

[0110] To ensure the reliability of the first storage index obtained by the data index service, in the present embodiment, the data copying request carries index information of the data storage index, for example, the file name, the file identifier, and the file digest of the physical data corresponding to the data storage index can be stored. The step S320 can specifically be: the data copying request including the index information of the data storage index and the first storage index is sent to the data index service, instructing the data index service to verify the first storage index according to the index information, and generating a hard link record of the first storage index after the verification is successful.

[0111] The data index service indexes the information and verifies the first storage index by comparison. If the first storage index includes the information, the comparison is successful, i.e., the verification is passed.

[0112] In the embodiment, the hard link is used to indicate that the first storage index to which the hard link belongs is copied from the data storage index.

[0113] In the data copying process, a first storage index is generated each time a copy operation is performed. Accordingly, a hard link of the first storage index is generated, i.e., the number of hard link records stored in the data index service is increased by 1. The hard link record is in the form of a copy of the physical data, but does not occupy actual memory space. Therefore, in the present application, the hard link record actually serves as a placeholder. That is, the number of hard link records is increased by 1 each time a copy operation is performed. Accordingly, the number of hard link records is decreased by 1 each time a deletion operation is performed. When the number of hard link records is 0 and a data deletion instruction is received again, the physical data is deleted. In this way, the accuracy of the data copying and deletion process is ensured.

[0114] Step S330: receiving the hard link record fed back by the data index service and storing the hard link record in association with the first storage index.

[0115] To enable the object index service to access the target physical data through the first storage index after receiving the hard link record fed back by the data index service and storing the hard link record in association with the first storage index, in the embodiment, the method further includes generating an identifier based on the first storage index. The identifier can be used to represent a copied file name, a file identifier, or an index name of the target physical data after copying, which can be viewed by a user. After the identifier is generated, the identifier is stored in association with the first storage index and the hard link record of the first storage index. In this way, when the target physical data is accessed through the first storage index subsequently, the user can trigger an access operation on the identifier, so that the object index service acquires the first storage index corresponding to the identifier in response to the access operation and accesses the target physical data according to the first storage index.

[0116] By using the data copy method, the object index service generates a first storage index according to the data storage index of the target physical data in response to the data copy operation on the target physical data; sends a data copy request including the first storage index to the data index service, instructs the data index service to generate a hard link record of the first storage index, and stores the data storage index, the first storage index, and the hard link record of the first storage index in association; and receives the hard link record fed back by the data index service and stores the hard link record in association with the first storage index. Thus, after one copy operation is performed on the target physical data, one row of storage index (the first storage index) is generated, and the hard link record of the first index is generated by the data index service to perform a placeholder operation, so that one deletion operation is performed to delete one storage index and the hard link record of the storage index in the subsequent deletion process of the target physical data (such as the deletion process in steps S110-S130 described above). Therefore, the data copy method can effectively ensure the accuracy and reliability of data copy, and further ensure that no physical data is mistakenly deleted or garbage data exists in the subsequent data deletion process.

[0117] Please refer to Figure 6 The embodiment of the application further provides a data copy method applied to a data index service, and the method comprises the following steps:

[0118] Step S410: receiving a data copy request including a first storage index sent by the object index service, the first storage index being generated by the object index service based on a data storage index of a target data source in response to a copy operation on the target data source.

[0119] In an implementation manner, if the data copy request includes the index information of the first storage index and the data storage index, the step S410 can be specifically: verifying the first storage index by using the index information of the data storage index, and generating a hard link record of the first storage index if the verification is successful.

[0120] Step S420: generating a hard link record of the first storage index in response to the data copy request, and storing the data storage index, the first storage index, and the hard link record of the first storage index in association.

[0121] Step S430: sending the hard link record to the object index service, so that the object index service stores the hard link record in association with the first storage index.

[0122] For the specific description of steps S410-S430, please refer to the specific description of steps S310-S330 in the foregoing.

[0123] Please refer toFigure 7 The embodiment of the present application further provides a data copy method, which is applied to the data processing system as shown in Figure 1 The method can comprise the following steps.

[0124] Step S510: The object index service generates a first storage index according to a data storage index of the target physical data in response to a data copy operation on the target physical data.

[0125] Step S520: The object index service sends a data copy request comprising the first storage index to the data index service.

[0126] Step S530: The data index service generates a hard link record of the first storage index, and stores the data storage index, the first storage index and the hard link record of the first storage index in association.

[0127] Step S540: The data index service sends the hard link record of the first storage index to the object index service.

[0128] Step S550: The object index service generates an identification data and stores the identification data in association with the file data when the hard link record is received.

[0129] Please refer to Figure 8 The embodiment of the present application further provides a data deletion method, which is applied to the data processing system as shown in Figure 1 The method can comprise the following steps.

[0130] Step S610: The object index service generates a deletion request comprising a target storage index corresponding to target data and deletes the target storage index stored in the object index service in response to a deletion operation on the target data.

[0131] The object index service has physical data corresponding to the target data.

[0132] Step S620: The object index service sends the deletion request to the data index service.

[0133] Step S630: The data index service deletes the target storage index and the hard link record of the target storage index and generates a successful deletion result when the hard link record of the target storage index is stored in the data index service in response to the deletion request, or generates a data deletion instruction and deletes the target storage index when the target storage index does not correspond to the hard link record and the associated storage index.

[0134] The hard link record is generated based on a new storage index obtained by copying the physical data, and a new storage index and a hard link record of the new storage index are generated for each copy of the physical data.

[0135] Step S640: The data index service feeds back a data deletion success result or a data deletion instruction to the object index service.

[0136] Step S650: The object index service deletes the physical data corresponding to the target storage index if the data deletion instruction is received.

[0137] Referring to Figure 9 The present application provides a data deletion apparatus 700 applied to an object index service, which comprises a deletion request generation module 710, a deletion request sending module 720 and a deletion result obtaining module 730.

[0138] The deletion request generation module 710 is configured to, in response to a deletion operation on target data, acquire a target storage index corresponding to the target data, generate a deletion request comprising the target storage index, and delete the target storage index stored in the object index service, the object index service having physical data corresponding to the target data; the deletion request sending module 720 is configured to send the deletion request to the data index service, instruct the data index service to delete the target storage index and a hard link record of the target storage index and generate a deletion success result when the data index service has the hard link record of the target storage index, or instruct the data index service to generate a data deletion instruction and delete the target storage index when the target storage index does not correspond to a hard link record and an associated storage index, the hard link record being generated based on a new storage index generated by copying the physical data, and one new storage index and one hard link record of the new storage index being generated for each copy of the physical data; and the deletion result obtaining module 730 is configured to receive a data deletion success result or a data deletion instruction fed back by the data index service, and delete the physical data corresponding to the target storage index if the data deletion instruction is received.

[0139] In an implementation manner, the apparatus 700 further comprises an index receiving module, an index confirming module and a first instruction sending module. The index receiving module is configured to receive at least one to-be-detected storage index sent by the data index service when the same physical data corresponds to at least one hard link record, the at least one to-be-detected storage index comprising a storage index to which each hard link record of the at least one hard link record stored in the data index service respectively belongs; the index confirming module is configured to confirm whether a target to-be-detected storage index exists in the at least one to-be-detected storage index, the target to-be-detected storage index not matching the storage index stored in the object index service; and the first instruction sending module is configured to send an index deletion instruction to the data index service if the target to-be-detected storage index exists and the number of the target to-be-detected storage index is less than the number of the at least one to-be-detected storage index, and instruct the data index service to delete the target to-be-detected storage index and a hard link record of the target to-be-detected storage index.

[0140] In an implementation, the apparatus 700 further comprises a deletion quantity obtaining module and a second instruction sending module. The deletion quantity obtaining module is configured to generate a target deletion quantity according to the number of the at least one to-be-detected storage index if the target to-be-detected index exists and the number of the target to-be-detected storage index is the same as the number of the at least one to-be-detected storage index, where the target deletion quantity is less than the number of the plurality of to-be-detected storage indexes; and the second instruction sending module is configured to send an index deletion instruction including the target deletion quantity to the data index service, to instruct the data index service to delete the target to-be-detected storage index and the hard link record of the target to-be-detected storage index with the target deletion quantity.

[0141] In an implementation, the apparatus 700 further comprises a record detecting module, which is configured to detect whether a target hard link record exists in the object index service, and delete the target hard link record if the target hard link record exists, where the target hard link record is a hard link record that is not associated with a storage index.

[0142] In an implementation, the apparatus 700 further comprises a data deleting module, which is configured to detect whether the physical data corresponding to the target hard link record corresponds to a storage index, and delete the physical data if the physical data does not correspond to a storage index.

[0143] Referring to Figure 10 The embodiments of the present application further provide a data deletion apparatus 800 applied to a data index service, which comprises a deletion request receiving module 810, a deletion request responding module 820, and a deletion result feeding back module 830.

[0144] The deletion request receiving module 810 is configured to receive a deletion request sent by an object index service, where the deletion request is generated by the object index service in response to a deletion operation on target data, and the deletion request carries a target storage index corresponding to the target data; the deletion request responding module 820 is configured to, in response to the deletion request, delete the target storage index and a hard link record of the target storage index and generate a successful deletion result if the data index service stores the hard link record of the target storage index; or generate a data deletion instruction and delete the target storage index if the target storage index does not correspond to a hard link record and an associated storage index, where the hard link record is generated based on copying of physical data, and a new storage index and a hard link record of the new storage index are generated each time the physical data is copied; and the deletion result feeding back module 830 is configured to feed back the data successful deletion result or the data deletion instruction to the object index service, so that the object index service deletes the physical data corresponding to the target storage index upon receiving the data deletion instruction.

[0145] Referring to Figure 11The embodiment of the present application also provides a data copy device 900 applied to an object index service, which comprises a copy operation response module 910, a copy request sending module 920 and an information receiving module 930.

[0146] The copy operation response module 910 is used for generating a first storage index according to a data storage index of target physical data in response to a data copy operation on the target physical data; the copy request sending module 920 is used for sending a data copy request comprising the first storage index to a data index service, instructing the data index service to generate a hard link record of the first storage index, and storing the data storage index, the first storage index and the hard link record of the first storage index in association; and the information receiving module 930 is used for receiving the hard link record fed back by the data index service and storing the hard link record in association with the first storage index.

[0147] In an implementable mode, the copy operation response module 910 is also used for obtaining a response time in response to the data copy operation on the target physical data, generating a random number according to the response time, and generating the first storage index according to the random number and the data storage index of the target physical data.

[0148] In an implementable mode, the copy request sending module 920 is also used for sending a data copy request comprising index information of the data storage index and the first storage index to the data index service, instructing the data index service to verify the first storage index according to the index information, and generating the hard link record of the first storage index after the verification is successful.

[0149] Please refer to Figure 12 The embodiment of the present application also provides a data copy device 1000 applied to a data index service, which comprises a copy request receiving module 1010, a copy request response module 1020 and an information sending module 1030.

[0150] The copy request receiving module 1010 is used for receiving a data copy request comprising a first storage index sent by an object index service, the first storage index being generated by the object index service based on a data storage index of a target data source in response to a copy operation on the target data source; the copy request response module 1020 is used for generating a hard link record of the first storage index in response to the data copy request, and storing the data storage index, the first storage index and the hard link record of the first storage index in association; and the information sending module 1030 is used for sending the hard link record to the object index service, so that the object index service stores the hard link record in association with the first storage index.

[0151] It should be noted that the device embodiments in the present application correspond to the foregoing method embodiments, and the specific principles of the device embodiments can be referred to the content in the foregoing method embodiments, which will not be described here.

[0152] The foregoing will be described in detail below with reference to the accompanying drawings. Figure 13 An electronic device 100 provided by the present application will be described.

[0153] Please refer to Figure 13 Based on the data transfer method provided in the foregoing embodiments, the present embodiment further provides another electronic device 100 including a processor 102 that can execute the foregoing method. The electronic device 100 can be a server 10 or a terminal device. The terminal device can be a smart phone, a tablet computer, a computer, a portable computer, or the like, which can install a first client and / or a second client.

[0154] The electronic device 100 further includes a memory 104. The memory 104 stores programs that can execute the content in the foregoing embodiments, and the processor 102 can execute the programs stored in the memory 104.

[0155] The processor 102 can include one or more cores for processing data and a message matrix unit. The processor 102 connects various parts in the entire electronic device 100 through various interfaces and lines, executes various functions of the electronic device 100 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 104, and calling data stored in the memory 104. Alternatively, the processor 102 can be implemented in at least one of a hardware form of a digital signal processing (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 102 can be integrated with a combination of one or more of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU is mainly used to process operating systems, user interfaces, and application programs; the GPU is used to render and draw display content; and the modem is used to process wireless communication. It can be understood that the foregoing modem can also not be integrated into the processor 102, but can be realized by a separate communication chip.

[0156] The memory 104 can include a random access memory (RAM) and can also include a read-only memory (ROM). The memory 104 can be used to store instructions, programs, codes, code sets, or instruction sets. The memory 104 can include a program storage area and a data storage area, where the program storage area can store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing each of the method embodiments described below, and the like. The data storage area can also store data acquired by the electronic device 100 in use, and the like.

[0157] The electronic device 100 can also include a network module and a screen, where the network module is used to receive and send electromagnetic waves, to implement mutual conversion between electromagnetic waves and electrical signals, and to communicate with a communication network or other devices, such as an audio playback device. The network module can include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption / decryption chip, a subscriber identity module (SIM) card, a memory, and the like. The network module can communicate with various networks, such as the Internet, an intranet, a wireless network, or other devices through the wireless network. The wireless network described above can include a cellular telephone network, a wireless local area network, or a metropolitan area network. The screen can display interface content and perform data interaction.

[0158] In some embodiments, the electronic device 100 can further include a peripheral interface 106 and at least one peripheral device. The processor 102, the memory 104, and the peripheral interface 106 can be connected through a bus or a signal line. Each peripheral device can be connected to the peripheral interface through a bus, a signal line, or a circuit board. Specifically, the peripheral devices include at least one of a radio frequency component 108, a positioning component 112, a camera 114, an audio component 116, a display screen 118, a power supply 122, and the like.

[0159] The peripheral interface 106 can be used to connect at least one peripheral device related to I / O (input / output) to the processor 102 and the memory 104. In some embodiments, the processor 102, the memory 104, and the peripheral interface 106 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 102, the memory 104, and the peripheral interface 106 can be implemented on a separate chip or circuit board, and the embodiments of the present application do not limit this.

[0160] The radio frequency component 108 is configured to receive and send RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency component 108 communicates with communication networks and other communication devices through electromagnetic signals. The radio frequency component 108 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency component 108 includes an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and the like. The radio frequency component 108 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to, the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G, and 5G), a wireless local area network, and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency component 108 can also include NFC (Near Field Communication)-related circuitry, which is not limited in the present application.

[0161] The positioning component 112 is configured to position the current geographic location of the electronic device 100 to achieve navigation or LBS (Location Based Service). The positioning component 112 can be a positioning component based on the GPS (Global Positioning System) in the United States, the Beidou system in China, or the Galileo system in Russia.

[0162] The camera 114 is configured to capture images or videos. Optionally, the camera 114 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the electronic device 100, and the rear camera is arranged on the back of the electronic device 100. In some embodiments, the rear camera is at least two, which is any one of a main camera, a depth-of-field camera, a wide-angle camera, and a long-focus camera, to realize the background virtualization function of the main camera and the depth-of-field camera, the panoramic shooting and VR (Virtual Reality) shooting function of the main camera and the wide-angle camera, or other fusion shooting functions. In some embodiments, the camera 114 can also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. The dual-color temperature flash refers to the combination of a warm light flash and a cold light flash, which can be used for light compensation under different color temperatures.

[0163] The audio component 116 can include a microphone and a speaker. The microphone is used to collect sound waves of a user and an environment, and convert the sound waves into an electrical signal input to the processor 102 for processing, or input to the radio frequency component 108 to realize voice communication. The microphone can be multiple for the purpose of stereo sound collection or noise reduction, and arranged at different parts of the electronic device 100 respectively. The microphone can also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert an electrical signal from the processor 102 or the radio frequency component 108 into sound waves. The speaker can be a traditional diaphragm speaker, or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert an electrical signal into a sound wave audible to humans, but also convert an electrical signal into a sound wave inaudible to humans for ranging purposes. In some embodiments, the audio component 114 can also include a headphone jack.

[0164] The display screen 118 is used to display a UI (User Interface). The UI can include graphics, text, icons, videos, and any combination thereof. When the display screen 118 is a touch display screen, the display screen 118 also has the ability to collect a touch signal on or above the surface of the display screen 118. The touch signal can be input to the processor 102 as a control signal for processing. At this time, the display screen 118 can also be used to provide a virtual button and / or a virtual keyboard, also known as a soft button and / or a soft keyboard. In some embodiments, the display screen 118 can be one, arranged on the front panel of the electronic device 100; in other embodiments, the display screen 118 can be at least two, arranged on different surfaces of the electronic device 100 or in a folding design; in yet other embodiments, the display screen 118 can be a flexible display screen, arranged on a curved surface or a folding surface of the electronic device 100. Even, the display screen 118 can also be arranged in an irregular shape other than a rectangle, i.e. a special-shaped screen. The display screen 118 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).

[0165] The power supply 122 is used to supply power to each component in the electronic device 100. The power supply 122 can be alternating current, direct current, a disposable battery, or a rechargeable battery. When the power supply 122 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. The wired rechargeable battery is a battery charged through a wired line, and the wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0166] The embodiment of the present application further provides a computer readable storage medium. The computer readable medium stores program codes, and the program codes can be invoked by a processor to execute the method described in the above method embodiment.

[0167] The computer readable storage medium can be an electronic storage such as a flash memory, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM, a hard disk or a ROM. Alternatively, the computer readable storage medium comprises a non-transitory computer readable medium. The computer readable storage medium has a storage space for program codes for executing any method step in the above method. The program codes can be read from or written to one or more computer program products. The program codes can be compressed in a suitable form, for example.

[0168] The embodiment of the present application further provides a computer program product or a computer program, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method described in the above various optional implementation manners.

[0169] In summary, the data deletion method, data copying method, device, equipment and storage medium provided by the application are as follows: when the data deletion method is executed, the object index service responds to a deletion operation on target data, acquires a target storage index corresponding to the target data, generates a deletion request including the target storage index, and deletes the target storage index stored in the object index service, and the object index service has physical data corresponding to the target data. The object index service sends a deletion request to the data index service, and the data index service deletes the target storage index and a hard link record of the target storage index when the data index service has a storage index associated with the target storage index or a target hard link record corresponding to the target storage index, and generates a successful deletion result, or the data index service generates a data deletion instruction and deletes the target storage index when the target storage index does not correspond to a target hard link record and an associated storage index. The hard link record is generated based on copying the physical data to obtain a new storage index, and a new storage index and a hard link record of the new storage index are generated for each copy of the physical data, and all storage indexes and hard link records corresponding to the physical data are associated and stored in the data index service, and the target hard link record corresponding to the target storage index is a hard link record associated with the target storage index other than the hard link record of the target storage index. The object index service receives the data deletion result or the data deletion instruction fed back by the data index service, and if the data deletion instruction is received, the physical data corresponding to the target storage index is deleted. Since a hard link record is generated for each copy operation of the physical data, in the data deletion process, each data deletion operation is accompanied by deletion of a hard link record, and until there is no hard link record and associated storage index, the physical data is deleted, thereby improving the reliability of data deletion and avoiding the situation of wasting memory space or mistakenly deleting physical data due to the failure to delete the physical data.

[0170] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the application, and not to limit them; although the application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not drive the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the application.

Claims

1. A data deletion method, characterized in that, Applied to an object indexing service, the method includes: In response to a deletion operation on target data, the target storage index corresponding to the target data is obtained, a deletion request including the target storage index is generated, and the target storage index stored in the object index service is deleted, wherein the object index service has physical data corresponding to the target data; The deletion request is sent to the data indexing service, instructing the service to delete the target storage index and its hard link record if it stores a storage index associated with the target storage index or a target hard link record corresponding to the target storage index, and to generate a deletion success result. Alternatively, the service can generate a data deletion instruction and delete the target storage index if it does not have a corresponding target hard link record or associated storage index. The hard link record is generated based on a new storage index obtained by copying the physical data, and a new storage index and a hard link record for that new storage index are generated each time the physical data is copied. All corresponding storage indexes and hard link records are associated and stored in the data index service. The target hard link record corresponding to the target storage index is other hard link records besides the hard link record of the target storage index that are associated and stored with the target storage index. For each copy of the physical data, the storage index obtained by performing the copy is generated based on the data storage index of the physical data and the random number obtained by the copy. The random number obtained by the copy is generated based on the response time of the copy. The system receives a data deletion success result or a data deletion instruction from the data index service. If the data deletion instruction is received, the physical data corresponding to the target storage index is deleted.

2. The method according to claim 1, characterized in that, The method further includes: When the data indexing service receives at least one storage index to be detected when there is at least one hard link record corresponding to the same physical data, the at least one storage index to be detected includes the storage index in the data indexing service to which each hard link record belongs. Confirm whether a target storage index exists among the at least one storage index to be detected, and that the target storage index to be detected does not match the storage index stored in the object index service; If it exists, and the number of target storage indexes to be detected is less than the number of the at least one storage index to be detected, send an index deletion instruction to the data index service, instructing the data index service to delete the target storage index to be detected and the hard link record of the target storage index to be detected.

3. The method according to claim 2, characterized in that, The method further includes: If there is a target storage index to be detected, and the number of target storage indexes to be detected is the same as the number of the at least one storage index to be detected, then a target deletion quantity is generated based on the number of the at least one storage index to be detected, wherein the target deletion quantity is less than the number of the plurality of storage indexes to be detected; Send an index deletion instruction, including the target deletion amount, to the data indexing service, instructing the data indexing service to delete the target storage index to be detected and the hard link record of the target storage index to be detected.

4. The method according to claim 1, characterized in that, The method further includes: The system checks whether a target hard link record exists in the object index service. If it does, the target hard link record is deleted. The target hard link record is a hard link record that is not associated with a storage index.

5. The method according to claim 4, characterized in that, Before deleting the target hard link record, the method further includes: Check whether the physical data corresponding to the target hard link record has a corresponding storage index. If no corresponding storage index is found, delete the physical data corresponding to the target hard link record.

6. A data deletion method, characterized in that, Applied to data indexing services, the method includes: Receive a deletion request sent by the object indexing service. The deletion request is generated by the object indexing service in response to a deletion operation on the target data. The deletion request carries the target storage index corresponding to the target data. In response to a deletion request, if the data index service stores a storage index associated with the target storage index or a target corresponding to the target storage index, the target storage index and its hard link record are deleted, and a deletion success result is generated; or if the target storage index does not have a corresponding target hard link record and associated storage index, a data deletion instruction is generated and the target storage index is deleted. The hard link record is generated based on a new storage index obtained by copying the physical data corresponding to the target data, and a new storage index and a hard link record for the new storage index are generated for each copy of the physical data. All storage indexes and hard link records corresponding to the physical data are associated and stored in the data index service. The target hard link record corresponding to the target storage index is other hard link records besides the hard link record of the target storage index that are associated and stored with the target storage index. For each copy of the physical data, the storage index obtained by performing the copy is determined based on the data storage index of the physical data and a random number obtained by the copy. The random number obtained by the copy is generated based on the response time of the copy of the physical data. The object index service is notified of a successful data deletion result or a data deletion instruction, so that upon receiving the data deletion instruction, the object index service deletes the physical data corresponding to the target storage index.

7. A data copying method, characterized in that, Applied to an object indexing service, the method includes: In response to a data copy operation on the target physical data, obtain the response time of the data copy operation; A random number is generated based on the response time, and a first storage index is generated based on the random number and the data storage index of the target physical data; Send a data copy request including the first storage index to the data indexing service, instructing the data indexing service to generate a hard link record of the first storage index, and associate and store the data storage index, the first storage index, and the hard link record of the first storage index together; The system receives hard link records from the data indexing service and associates and stores these hard link records with the first storage index.

8. The method according to claim 7, characterized in that, Sending a data copy request including the first storage index to the data indexing service, and instructing the data indexing service to generate a hard link record for the first storage index, includes: Send an index information including the data storage index and a data copy request for the first storage index to the data index service, instructing the data index service to verify the first storage index according to the index information, and generate a hard link record for the first storage index after successful verification.

9. A data copying method, characterized in that, Applied to data indexing services, the method includes: The system receives a data copy request from an object indexing service, which includes a first storage index. The first storage index is generated by the object indexing service in response to a data copy operation on a target data source, based on a random number and the data storage index of the target physical data. The random number is generated based on the response time of the data copy operation. Data storage index generated based on the target data source; In response to the data copy request, a hard link record for the first storage index is generated, and the data storage index, the first storage index, and the hard link record of the first storage index are associated and stored together. A hard link record is sent to the object indexing service so that the object indexing service associates and stores the hard link record with the first storage index.

10. The method according to claim 9, characterized in that, The data copy request includes index information for the first storage index and the data storage index. In response to the data copy request, a hard link record for the first storage index is generated, including: The first storage index is verified using the index information of the data storage index. If the verification is successful, a hard link record of the first storage index is generated.

11. A data deletion device, characterized in that, The apparatus, used in an object indexing service, includes: The deletion request generation module is used to respond to the deletion operation of target data, obtain the target storage index corresponding to the target data, generate a deletion request including the target storage index, and delete the target storage index stored in the object index service, wherein the object index service has physical data corresponding to the target data; The deletion request sending module is used to send the deletion request to the data indexing service, instructing the data indexing service to delete the target storage index and its hard link record when it stores a storage index associated with the target storage index or a target hard link record corresponding to the target storage index, and generate a deletion success result; or instructing the data indexing service to generate a data deletion instruction and delete the target storage index when the target storage index does not have a corresponding target hard link record and associated storage index. The hard link record is generated based on a new storage index obtained by copying the physical data, and a new storage index and a hard link record for the new storage index are generated for each copy of the physical data. All storage indexes and hard link records corresponding to the physical data are associated and stored in the data indexing service. The target hard link record corresponding to the target storage index is other hard link records other than the hard link record of the target storage index that are associated and stored with the target storage index. For each copy of the physical data, the storage index obtained by copying the physical data is determined based on the data storage index of the physical data and a random number obtained by copying the physical data. The random number obtained by copying the physical data is generated based on the response time of copying the physical data. The deletion result acquisition module is used to receive the data deletion success result or data deletion instruction from the data indexing service. If the data deletion instruction is received, the physical data corresponding to the target storage index is deleted.

12. A data deletion device, characterized in that, The apparatus, used for data indexing services, includes: The deletion request receiving module is used to receive deletion requests sent by the object index service. The deletion request is generated by the object index service in response to the deletion operation of the target data, and the deletion request carries the target storage index corresponding to the target data. The deletion request response module is used to respond to deletion requests. When the data index service stores a storage index associated with the target storage index or a target corresponding to the target storage index, it deletes the target storage index and its hard link record, and generates a deletion success result. Alternatively, when the target storage index does not have a corresponding target hard link record and associated storage index, it generates a data deletion instruction and deletes the target storage index. The hard link record is generated based on a new storage index obtained by copying the physical data corresponding to the target data. Each copy of the physical data generates a new storage index and a hard link record for that new storage index. All storage indexes and hard link records corresponding to the physical data are associated and stored in the data index service. The target hard link record corresponding to the target storage index is any hard link record other than the hard link record of the target storage index that is associated and stored with the target storage index. For each copy of the physical data, the storage index obtained from that copy is generated based on the data storage index of the physical data and a random number obtained from that copy. The random number obtained from that copy is generated based on the response time of that copy. The deletion result feedback module is used to send a successful data deletion result or a data deletion instruction to the object index service, so that the object index service deletes the physical data corresponding to the target storage index upon receiving the data deletion instruction.

13. A data copying device, characterized in that, The apparatus, used in an object indexing service, includes: The copy operation response module is used to respond to a data copy operation on the target physical data, obtain the response time of the data copy operation, generate a random number based on the response time, and generate a first storage index based on the random number and the data storage index of the target physical data. The copy request sending module is used to send a data copy request including the first storage index to the data index service, instructing the data index service to generate a hard link record of the first storage index, and to associate and store the data storage index, the first storage index and the hard link record of the first storage index together. The information receiving module is used to receive hard link records fed back by the data indexing service, and associate the hard link records with the first storage index for storage.

14. A data copying device, characterized in that, The apparatus, used for data indexing services, includes: A copy request receiving module is used to receive a data copy request sent by an object indexing service, which includes a first storage index. The first storage index is generated by the object indexing service in response to a data copy operation on a target data source, based on a random number and the data storage index of the target physical data. The random number is generated based on the response time of the data copy operation. The copy request response module is used to respond to the data copy request, generate a hard link record of the first storage index, and associate and store the data storage index, the first storage index and the hard link record of the first storage index. The information sending module is used to send hard link records to the object indexing service, so that the object indexing service will associate and store the hard link records with the first storage index.

15. An electronic device, characterized in that, It includes a processor and a memory; one or more programs are stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1-10.

16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program code, wherein the program code, when executed by a processor, performs the method described in any one of claims 1-10.

17. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method described in any one of claims 1-10.

Citation Information

Patent Citations

  • Mail archiving method and system, electronic equipment and storage medium

    CN113094505A