Network disk file processing method and device
By creating file records and setting attribute information in the user's network disk file storage space, the problem of unnecessary traffic and space waste during file sharing is solved, and the effect of saving space and traffic is achieved without affecting the user experience.
Patent Information
- Application Number
- CN202210407950.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-19
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2042-04-19
AI Technical Summary
How to rationally utilize network traffic and network disk space to avoid unnecessary waste of traffic and space during file sharing without affecting the user experience.
By creating file records in the user's network disk file storage space, and setting the attribute information of the file record, including the parent file ID, based on the target network disk file's file file's file ID, and then linking the saved file records and the target network disk file, the actual file copying is performed only when needed.
It effectively saves network disk space and network traffic, improves file operation efficiency, and does not affect users' normal use of network disk files.
Smart Images

Figure CN114661675B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data storage, and in particular to a network disk file processing method and device. Background Art
[0002] With the digital transformation of social life, the demand for data storage continues to expand, and the capacity of various storage devices is getting larger and larger. Among them, the use of network disks has greatly met the storage needs of users. At the same time, users also copy and spread information by sharing network disk files. In the above file sharing process, other users often save the shared files to their own local storage or network disk after receiving the shared file information. The above copy and spread process occupies a large amount of network traffic. In fact, most users will never actually open and browse the shared files after saving them.
[0003] Therefore, how to reasonably utilize network traffic and network disk space without affecting the user experience is a technical problem that needs to be solved urgently. Summary of the invention
[0004] In order to solve at least one technical problem in the above-mentioned background technology, the present invention proposes a network disk file processing method and device.
[0005] In order to achieve the above object, according to one aspect of the present invention, a network disk file processing method is provided, the method comprising:
[0006] Upon receiving a save instruction from the user for a target network disk file, obtaining a file ID of the target network disk file;
[0007] A first file record is created in the user's network disk file storage space, and attribute information of the first file record is set according to the file ID of the target network disk file, wherein the attribute information specifically includes: a parent file ID, and the parent file ID of the first file record is the same as the file ID of the target network disk file.
[0008] Optionally, the attribute information specifically further includes: a sharing attribute and a file resource address; the sharing attribute includes: a first attribute value used to identify that the file is shared and a second attribute value used to identify that the file is not shared;
[0009] Optionally, the method further includes:
[0010] When receiving a deletion instruction from the user for a second file record in the network disk file storage space, if the sharing attribute of the second file record is a second attribute value, deleting the second file record and the attribute information of the second file record;
[0011] If the sharing attribute of the second file record is the first attribute value, and the parent file ID of the second file record is empty, copy the file corresponding to the second file record to the file resource address of all file records whose parent file ID is the file ID of the second file record, then delete the second file record and the attribute information of the second file record, and set the parent file ID of all file records whose parent file ID is the file ID of the second file record to be empty;
[0012] If the shared attribute of the second file record is the first attribute value, and the parent file ID of the second file record is not empty, the parent file ID of all file records whose parent file ID is the file ID of the second file record is set to the parent file ID of the second file record, and then the second file record and the attribute information of the second file record are deleted.
[0013] Optionally, the method further includes:
[0014] When receiving the user's deletion instruction for the third file record in the network disk file storage space, if the sharing attribute of the third file record is the first attribute value, and the parent file ID of the third file record is empty and there is a file record whose parent file ID is the file ID of the third file record, the third file record is transferred to the preset public file storage space.
[0015] Optionally, the method further includes:
[0016] When receiving a sharing instruction from the user for a fourth file record in the network disk file storage space, the sharing attribute of the fourth file record is set to the first attribute value.
[0017] Optionally, the method further includes:
[0018] Upon receiving a cancel sharing instruction from the user for the fifth file record in the network disk file storage space, if the parent file ID of the fifth file record is empty, copying the file corresponding to the fifth file record to the file resource addresses of all file records whose parent file IDs are the file IDs of the fifth file record, and then setting the sharing attribute of the fifth file record to the second attribute value, and setting the parent file IDs of all file records whose parent file IDs are the file IDs of the fifth file record to empty;
[0019] If the parent file ID of the fifth file record is not empty, the parent file IDs of all file records whose parent file IDs are the file IDs of the fifth file record are set to the parent file ID of the fifth file record, and then the shared attribute of the fifth file record is set to the second attribute value.
[0020] In order to achieve the above object, according to another aspect of the present invention, a network disk file processing device is provided, the device comprising:
[0021] A target network disk file information acquisition unit, configured to acquire a file ID of the target network disk file upon receiving a user's instruction to save the target network disk file;
[0022] The network disk file saving unit is used to create a first file record in the network disk file storage space of the user, and set the attribute information of the first file record according to the file ID of the target network disk file, wherein the attribute information specifically includes: a parent file ID, and the parent file ID of the first file record is the same as the file ID of the target network disk file.
[0023] In order to achieve the above-mentioned purpose, according to another aspect of the present invention, a computer device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned network disk file processing method when executing the computer program.
[0024] In order to achieve the above-mentioned purpose, according to another aspect of the present invention, a computer-readable storage medium is further provided, on which a computer program / instruction is stored, and when the computer program / instruction is executed by a processor, the steps of the above-mentioned network disk file processing method are implemented.
[0025] In order to achieve the above-mentioned purpose, according to another aspect of the present invention, a computer program product is further provided, including a computer program / instruction, which implements the steps of the above-mentioned network disk file processing method when executed by a processor.
[0026] The beneficial effects of the present invention are:
[0027] When a user of an embodiment of the present invention saves a target network disk file to his own network disk file storage space, he creates a first file record in his own network disk file storage space, and sets the attribute information of the first file record according to the file ID of the target network disk file, wherein the attribute information specifically includes: a parent file ID, and the parent file ID of the first file record is the same as the file ID of the target network disk file. The present invention associates the first file record saved in its own network disk file storage space with the target network disk file through the parent file ID. Therefore, when the user saves the target network disk file to his own network disk file storage space, the present invention does not require unnecessary file copy traffic, but only needs to maintain the attribute information of the file record, thereby saving network disk space. If the target network disk file needs to be downloaded or opened later, the target network disk file can be found according to the parent file ID of the first file record in his own network disk file storage space, and then the operation can be performed, which does not affect the actual use of the network disk file by the user. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0029] Figure 1 is a first flow chart of a network disk file processing method according to an embodiment of the present invention;
[0030] Figure 2 is a second flow chart of the network disk file processing method according to an embodiment of the present invention;
[0031] Figure 3 is a third flow chart of the network disk file processing method according to an embodiment of the present invention;
[0032] Figure 4 is a fourth flow chart of the network disk file processing method according to an embodiment of the present invention;
[0033] Figure 5 is a fifth flow chart of the network disk file processing method according to an embodiment of the present invention;
[0034] Figure 6 is a structural block diagram of a network disk file processing device according to an embodiment of the present invention;
[0035] Figure 7 It is a schematic diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0036] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0037] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0038] It should be noted that the terms "including" and "having" and any variations thereof in the specification and claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or apparatus.
[0039] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0040] It should be noted that the acquisition, storage, use, and processing of data in the technical solution of this application are in compliance with the relevant provisions of national laws and regulations.
[0041] It should be noted that the network disk file processing method and device of the present application can be applied to the financial field as well as other technical fields.
[0042] The purpose of the present invention is to provide a network disk file processing method and device. The present invention replaces the network disk file with a file record in the user's storage space, and replaces the direct sharing, saving, deletion, unsharing, opening and downloading of the network disk file by maintaining the attribute information of the file record, thereby avoiding unnecessary traffic and saving network disk space.
[0043] In one embodiment of the present invention, the attribute information of the file record specifically includes: file name, file URL, user ID, sharing attribute, file ID, parent file ID and file status and other information. The sharing attribute identifies whether the file is shared by the user of the user ID, which is divided into "yes" and "no". The file status includes "normal", "to be deleted in batches" and "to be unshared in batches". The file ID uniquely identifies the file, and the parent file ID identifies whether the file is shared through the file identified by the parent file ID. The present invention is based on the user's operation instructions, including sharing, saving, deleting, unsharing, opening and downloading. Only when the operation instruction of the shared file needs to be copied immediately, the actual copying is performed. For the most frequently operated saving operation instruction, only the attribute information of the file record needs to be maintained, so as to facilitate users to share network disk files through file IDs, and other users to find network disk files using file IDs and perform the above instructions on the files. By using a network disk file sharing system and method of the present invention, unnecessary copy traffic is avoided, network disk space is saved, and by maintaining the parent file ID, the file identified by the parent file ID can be operated accordingly without affecting the actual user experience.
[0044] Figure 1is a first flow chart of the network disk file processing method according to an embodiment of the present invention, corresponding to the saving operation of the network disk file, such as Figure 1 As shown, in one embodiment of the present invention, the network disk file processing method of the present invention includes step S101 and step S102.
[0045] Step S101, upon receiving a user's instruction to save a target network disk file, obtaining a file ID of the target network disk file.
[0046] Step S102, create a first file record in the user's network disk file storage space, and set the attribute information of the first file record according to the file ID of the target network disk file, wherein the attribute information specifically includes: a parent file ID, and the parent file ID of the first file record is the same as the file ID of the target network disk file.
[0047] In one embodiment of the present invention, when creating the first file record, the first file record may also be created in a storage location specified by the user in the network disk file storage space of the user.
[0048] In one embodiment of the present invention, the present invention sets up an information storage module for storing attribute information of each file record. In one embodiment of the present invention, this step specifically generates the attribute information of the first file record in the information storage module according to the file name and file ID of the target network disk file.
[0049] In another embodiment of the present invention, the attribute information of the file record may also be directly recorded in the file record.
[0050] In one embodiment of the present invention, when generating attribute information of the first file record, the file name of the target network disk file is used as the file name of the first file record, and the file ID of the target network disk file is used as the parent file ID of the first file record, the file URL and file ID of the first file record are generated, the user ID of the first file record is generated according to the user ID, the sharing attribute of the first file record is generated and the initial value is set to "no", and the file status of the first file record is generated and the initial value is set to "normal".
[0051] It can be seen that when the user of the present invention saves the target network disk file to his own network disk file storage space, he creates a first file record in his own network disk file storage space, and sets the attribute information of the first file record according to the file ID of the target network disk file. The present invention associates the first file record saved in its own network disk file storage space with the target network disk file through the parent file ID. Therefore, when the user saves the target network disk file to his own network disk file storage space, the present invention does not require unnecessary file copy traffic, and only needs to maintain the attribute information of the file record. The space occupied by the attribute information is very small, which saves network disk space. If the target network disk file needs to be downloaded or opened later, the target network disk file can be found according to the parent file ID of the first file record in its own network disk file storage space, and then the operation can be performed, which does not affect the user's normal actual use of the network disk file.
[0052] In one embodiment of the present invention, the attribute information specifically further includes: a sharing attribute and a file resource address; the sharing attribute includes: a first attribute value for identifying that the file is shared and a second attribute value for identifying that the file is not shared. In one specific embodiment of the present invention, the first attribute value may be "yes" and the second attribute value may be "no". In one specific embodiment of the present invention, the file resource address may specifically be a file URL (Uniform Resource Locator).
[0053] Figure 2 The corresponding user deletes the network disk files in his own network disk file storage space, such as Figure 2 As shown, in one embodiment of the present invention, the network disk file processing method of the present invention also includes steps S201 to S203.
[0054] Step S201, when receiving a deletion instruction from the user for a second file record in the network disk file storage space, if the sharing attribute of the second file record is a second attribute value, deleting the second file record and the attribute information of the second file record.
[0055] In one embodiment of the present invention, if the sharing attribute of the second file record is not shared, the second file record in the user's network disk file storage space is directly deleted and the attribute information of the second file record in the deletion information storage module is deleted.
[0056] Step S202, if the sharing attribute of the second file record is the first attribute value, and the parent file ID of the second file record is empty, copy the file corresponding to the second file record to the file resource address of all file records whose parent file ID is the file ID of the second file record, then delete the second file record and the attribute information of the second file record, and set the parent file ID of all file records whose parent file ID is the file ID of the second file record to empty.
[0057] In one embodiment of the present invention, if the sharing attribute of the second file record is shared, and the parent file ID of the second file record is empty, the above step S202 can ensure that when the second file record is deleted, the file record with the file ID of the second file record as the parent file ID can operate normally.
[0058] In one embodiment of the present invention, the attribute information specifically further includes: file status; the file status specifically includes three types: normal, to be deleted in batches, and to be unshared in batches.
[0059] In one embodiment of the present invention, step S202 specifically includes:
[0060] If the sharing attribute of the second file record is the first attribute value, and the parent file ID of the second file record is empty, the file resource address of the second file record is hidden, and the file status of the second file record is set to be batch deleted, and then the batch deletion task is executed regularly. The batch deletion task is used to copy the file corresponding to the file record to the file resource address of all file records whose parent file ID is the file ID of the file record for the file record whose file status is to be batch deleted, and then delete the file record and the attribute information of the file record, and set the parent file ID of all file records whose parent file ID is the file ID of the file record to be empty.
[0061] The present invention can avoid file operation errors when deleting files by setting file status and performing batch deletion tasks at a fixed time, thereby improving the user experience of deleting files.
[0062] In one embodiment of the present invention, the scheduled execution of the batch deletion task may specifically be executing the batch deletion task at 23:59:59 every night.
[0063] Step S203, if the shared attribute of the second file record is the first attribute value, and the parent file ID of the second file record is not empty, the parent file ID of all file records whose parent file ID is the file ID of the second file record is set to the parent file ID of the second file record, and then the second file record and the attribute information of the second file record are deleted.
[0064] In one embodiment of the present invention, if the sharing attribute of the second file record is shared, and the parent file ID of the second file record is not empty, the above step S203 can ensure that when the second file record is deleted, the network disk file with the file ID of the second file record as the parent file ID can be operated normally.
[0065] In another embodiment of the present invention, the specific process for a user to delete a file record in his / her network disk file storage space is as follows:
[0066] When receiving the user's deletion instruction for the third file record in the network disk file storage space, if the sharing attribute of the third file record is the first attribute value, and the parent file ID of the third file record is empty and there is a file record whose parent file ID is the file ID of the third file record, the third file record is transferred to the preset public file storage space.
[0067] In this embodiment, when deleting the third file record, if the sharing attribute of the third file record is shared, and there is a file record whose parent file ID is the file ID of the third file record, the third file record is directly transferred to the preset public file storage space, thereby avoiding the problem that the file record with the file ID of the third file record as the parent file ID cannot operate normally after the third file record is directly deleted, and the file records associated with the third file record can operate normally, and the embodiment of the above steps S201 to S203 does not need to copy the file corresponding to the file record when deleting the file record, further reducing network traffic and saving network disk space.
[0068] In one embodiment of the present invention, the process of a user sharing a network disk file in his own network disk file storage space includes the following steps:
[0069] When receiving a sharing instruction from the user for a fourth file record in the network disk file storage space, the sharing attribute of the fourth file record is set to the first attribute value.
[0070] In one embodiment of the present invention, when the attribute information of the file record is generated, the initial shared attribute is the second attribute value.
[0071] Figure 3 The corresponding user cancels the sharing operation of the network disk files in his own network disk file storage space, such as Figure 3 As shown, in one embodiment of the present invention, the network disk file processing method of the present invention also includes step S301 and step S302.
[0072] Step S301, when receiving the user's instruction to cancel sharing of the fifth file record in the network disk file storage space, if the parent file ID of the fifth file record is empty, copy the file corresponding to the fifth file record to the file resource address of all file records whose parent file ID is the file ID of the fifth file record, and then set the sharing attribute of the fifth file record to the second attribute value, and set the parent file ID of all file records whose parent file ID is the file ID of the fifth file record to empty.
[0073] In one embodiment of the present invention, if the parent file ID of the fifth file record is empty, the above step S301 can ensure that the file record with the file ID of the fifth file record as the parent file ID can operate normally when the sharing of the fifth file record is canceled.
[0074] In one embodiment of the present invention, step S301 specifically includes:
[0075] If the parent file ID of the fifth file record is empty, the file status of the fifth file record is set to be to be batch unshared, and then the batch unshared task is executed regularly. The batch unshared task is used to copy the file corresponding to the file record to the file resource address of all file records whose parent file ID is the file ID of the file record for the file record whose file status is to be batch unshared, and then set the sharing attribute of the file record to the second attribute value, and set the parent file ID of all file records whose parent file ID is the file ID of the file record to be empty.
[0076] In a specific embodiment of the present invention, the file resource address may specifically be a file URL.
[0077] The present invention can avoid file operation errors when canceling sharing by setting file status and performing batch sharing cancellation tasks at a scheduled time, thereby improving the user experience of canceling sharing.
[0078] In one embodiment of the present invention, the scheduled execution of the batch sharing cancellation task may specifically be executing the batch sharing cancellation task at 23:59:59 every night.
[0079] Step S302: If the parent file ID of the fifth file record is not empty, the parent file IDs of all file records whose parent file IDs are the file ID of the fifth file record are set to the parent file ID of the fifth file record, and then the sharing attribute of the fifth file record is set to the second attribute value.
[0080] In one embodiment of the present invention, if the parent file ID of the fifth file record is not empty, the above step S302 can ensure that the file record with the file ID of the fifth file record as the parent file ID can operate normally when the sharing of the fifth file record is canceled.
[0081] Figure 4 The corresponding user opens the network disk file in his own network disk file storage space, such as Figure 4 As shown, in one embodiment of the present invention, the network disk file processing method of the present invention also includes step S401 and step S402.
[0082] Step S401, when receiving the user's instruction to open the sixth file record in the network disk file storage space, if the parent file ID of the sixth file record is empty, open the file corresponding to the sixth file record from the file resource address of the sixth file record.
[0083] In one embodiment of the present invention, if the parent file ID of the sixth file record is empty, the file of the sixth file record is stored in the file resource address of the sixth file record, so that the file corresponding to the sixth file record can be opened directly from the file resource address of the sixth file record.
[0084] Step S402, if the parent file ID of the sixth file record is not empty, then search for the previous level file record in sequence according to the parent file ID of the sixth file record until the parent file ID of the previous level file record found is empty, and then copy the file to the file resource address of the sixth file record through the file resource address of the previous level file record whose parent file ID is empty, open the file corresponding to the sixth file record from the file resource address of the sixth file record, and then set the parent file ID of the sixth file record to empty.
[0085] In one embodiment of the present invention, if the parent file ID of the sixth file record is not empty, it is necessary to search for the previous level file records in sequence until the source file record is found (that is, the file record whose associated parent file ID is empty), and then copy the file from the file resource address of the source file record to the file resource address of the sixth file record, and then open the file corresponding to the sixth file record from the file resource address of the sixth file record.
[0086] Figure 5 The corresponding user downloads the network disk files in his own network disk file storage space, such as Figure 5 As shown, in one embodiment of the present invention, the network disk file processing method of the present invention also includes step S501 and step S502.
[0087] Step S501, when receiving the download instruction of the user for the seventh file record in the network disk file storage space, if the parent file ID of the seventh file record is empty, downloading the file corresponding to the seventh file record from the file resource address of the seventh file record.
[0088] In one embodiment of the present invention, if the parent file ID of the seventh file record is empty, the file of the seventh file record is stored in the file resource address of the sixth file record, so that the file corresponding to the seventh file record can be directly downloaded from the file resource address of the seventh file record.
[0089] Step S502, if the parent file ID of the seventh file record is not empty, then search for the previous level file record in sequence according to the parent file ID of the seventh file record until the parent file ID of the previous level file record found is empty, and then download the file corresponding to the seventh file record through the file resource address of the previous level file record whose parent file ID is empty.
[0090] In one embodiment of the present invention, if the parent file ID of the seventh file record is not empty, it is necessary to search for the previous level file records in sequence until the source file record is found (that is, the file record whose associated parent file ID is empty), and then download the file from the file resource address of the source file record.
[0091] It can be seen from the above embodiments that the present invention achieves at least the following beneficial effects:
[0092] By using the present invention, the attribute information of the file record, such as the file name, file URL, user ID, sharing attribute, file ID, parent file ID and file status, is maintained. For the user's operation instructions, including sharing, saving, deleting, canceling sharing, opening and downloading, the actual file copying is performed only when the operation instruction of the shared file needs to be copied immediately. For the most frequently operated saving operation instruction, only the attribute information of the file record needs to be maintained, so that users can share network disk files through file IDs, and other users can find network disk shared files through file IDs and perform the above-instructed operations on the files, thus avoiding unnecessary copying traffic and saving network disk space. Moreover, by maintaining the parent file ID, corresponding operations can be performed on the file identified by the parent file ID, without affecting the actual user experience.
[0093] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0094] Based on the same inventive concept, an embodiment of the present invention also provides a network disk file processing device, which can be used to implement the network disk file processing method described in the above embodiment, as described in the following embodiment. Since the principle of solving the problem by the network disk file processing device is similar to that of the network disk file processing method, the embodiment of the network disk file processing device can refer to the embodiment of the network disk file processing method, and the repeated parts will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements predetermined functions. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0095] Figure 6 is a structural block diagram of a network disk file processing device according to an embodiment of the present invention. Figure 6 As shown, in one embodiment of the present invention, the network disk file processing device of the present invention includes:
[0096] The target network disk file information acquisition unit 1 is used to acquire the file ID of the target network disk file when receiving a user's instruction to save the target network disk file;
[0097] The network disk file saving unit 2 is used to create a first file record in the user's network disk file storage space, and set the attribute information of the first file record according to the file ID of the target network disk file, wherein the attribute information specifically includes: a parent file ID, and the parent file ID of the first file record is the same as the file ID of the target network disk file.
[0098] In one embodiment of the present invention, the attribute information specifically further includes: a sharing attribute and a file resource address; the sharing attribute includes: a first attribute value for identifying that the file is shared and a second attribute value for identifying that the file is not shared.
[0099] In one embodiment of the present invention, the network disk file processing device of the present invention further includes:
[0100] a first file deletion processing unit, configured to, upon receiving a deletion instruction from the user for a second file record in the network disk file storage space, delete the second file record and the attribute information of the second file record if the sharing attribute of the second file record is a second attribute value;
[0101] a second file deletion processing unit, configured to, if the sharing attribute of the second file record is the first attribute value and the parent file ID of the second file record is null, copy the file corresponding to the second file record to the file resource addresses of all file records whose parent file IDs are the file ID of the second file record, then delete the second file record and the attribute information of the second file record, and set the parent file IDs of all file records whose parent file IDs are the file ID of the second file record to null;
[0102] The third file deletion processing unit is used to set the parent file ID of all file records whose parent file ID is the file ID of the second file record to the parent file ID of the second file record if the shared attribute of the second file record is the first attribute value and the parent file ID of the second file record is not empty, and then delete the second file record and the attribute information of the second file record.
[0103] In one embodiment of the present invention, the network disk file processing device of the present invention further includes:
[0104] The fourth file deletion processing unit is used to transfer the third file record to a preset public file storage space when receiving a deletion instruction from the user for the third file record in the network disk file storage space, if the sharing attribute of the third file record is the first attribute value, and the parent file ID of the third file record is empty and there is a file record whose parent file ID is the file ID of the third file record.
[0105] In one embodiment of the present invention, the network disk file processing device of the present invention further includes:
[0106] The file sharing processing unit is used to set the sharing attribute of the fourth file record in the network disk file storage space to the first attribute value when receiving the sharing instruction of the fourth file record in the network disk file storage space from the user.
[0107] In one embodiment of the present invention, the network disk file processing device of the present invention further includes:
[0108] a first file sharing cancellation processing unit, configured to, upon receiving a sharing cancellation instruction from the user for a fifth file record in the network disk file storage space, copy the file corresponding to the fifth file record to the file resource addresses of all file records whose parent file IDs are the file IDs of the fifth file record if the parent file ID of the fifth file record is empty, then set the sharing attribute of the fifth file record to a second attribute value, and set the parent file IDs of all file records whose parent file IDs are the file IDs of the fifth file record to empty;
[0109] The second file sharing cancellation processing unit is used to set the parent file ID of all file records whose parent file ID is the file ID of the fifth file record to the parent file ID of the fifth file record if the parent file ID of the fifth file record is not empty, and then set the sharing attribute of the fifth file record to the second attribute value.
[0110] In one embodiment of the present invention, the network disk file processing device of the present invention further includes:
[0111] a first file opening processing unit, configured to, upon receiving an opening instruction from the user for a sixth file record in the network disk file storage space, open a file corresponding to the sixth file record from a file resource address of the sixth file record if a parent file ID of the sixth file record is empty;
[0112] The second file opening processing unit is used to search for the previous level file record in sequence according to the parent file ID of the sixth file record if the parent file ID of the sixth file record is not empty, until the parent file ID of the previous level file record found is empty, and then copy the file to the file resource address of the sixth file record through the file resource address of the previous level file record whose parent file ID is empty, open the file corresponding to the sixth file record from the file resource address of the sixth file record, and then set the parent file ID of the sixth file record to empty.
[0113] In one embodiment of the present invention, the network disk file processing device of the present invention further includes:
[0114] a first file download processing unit, configured to, upon receiving a download instruction from the user for a seventh file record in the network disk file storage space, download a file corresponding to the seventh file record from a file resource address of the seventh file record if a parent file ID of the seventh file record is empty;
[0115] The second file download processing unit is used to search for the previous level file record in sequence according to the parent file ID of the seventh file record if the parent file ID of the seventh file record is not empty, until the parent file ID of the previous level file record found is empty, and then download the file corresponding to the seventh file record through the file resource address of the previous level file record whose parent file ID is empty.
[0116] In one embodiment of the present invention, the attribute information specifically further includes: file status; the file status includes three types: normal, to be deleted in batches, and to be unshared in batches.
[0117] In one embodiment of the present invention, the second file deletion processing unit is specifically used to hide the file resource address of the second file record if the sharing attribute of the second file record is the first attribute value and the parent file ID of the second file record is empty, and set the file status of the second file record to be batch deleted, and then regularly execute the batch deletion task. The batch deletion task is used to copy the file corresponding to the file record to the file resource address of all file records whose parent file ID is the file ID of the file record for the file record whose file status is to be batch deleted, and then delete the file record and the attribute information of the file record, and set the parent file ID of all file records whose parent file ID is the file ID of the file record to be empty.
[0118] In one embodiment of the present invention, the first file sharing cancellation processing unit is specifically used to set the file status of the fifth file record to be to be batch-unshared if the parent file ID of the fifth file record is empty, and then regularly execute the batch sharing cancellation task, the batch sharing cancellation task is used to copy the file corresponding to the file record to the file resource address of all file records whose parent file ID is the file ID of the file record for the file record whose file status is to be batch-unshared, and then set the sharing attribute of the file record to the second attribute value, and set the parent file ID of all file records whose parent file ID is the file ID of the file record to be empty.
[0119] In order to achieve the above object, according to another aspect of the present application, a computer device is also provided. Figure 7 As shown, the computer device includes a memory, a processor, a communication interface and a communication bus. A computer program that can be executed on the processor is stored in the memory. When the processor executes the computer program, the steps in the above-mentioned embodiment method are implemented.
[0120] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0121] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs and units, such as the corresponding program units in the above method embodiments of the present invention. The processor executes various functional applications of the processor and works data processing by running the non-transitory software programs, instructions and modules stored in the memory, that is, implementing the method in the above method embodiments.
[0122] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0123] The one or more units are stored in the memory, and when executed by the processor, the method in the above embodiment is performed.
[0124] The specific details of the above-mentioned computer device can be understood by referring to the corresponding related descriptions and effects in the above-mentioned embodiments, and will not be repeated here.
[0125] In order to achieve the above purpose, according to another aspect of the present application, a computer-readable storage medium is also provided, wherein the computer-readable storage medium stores a computer program, and the computer program implements the steps in the above-mentioned network disk file processing method when executed in a computer processor. Those skilled in the art can understand that the implementation of all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, which, when executed, may include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk (Hard Disk Drive, abbreviated as: HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.
[0126] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a computer program product is also provided, including a computer program / instruction, which implements the steps of the above-mentioned network disk file processing method when executed by a processor.
[0127] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0128] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A network disk file processing method, characterized in that: include: Upon receiving a save instruction from the user for a target network disk file, obtaining a file ID of the target network disk file; Creating a first file record in the user's network disk file storage space, and setting attribute information of the first file record according to the file ID of the target network disk file, wherein the attribute information specifically includes: a parent file ID, where the parent file ID of the first file record is the same as the file ID of the target network disk file; The attribute information specifically includes: a sharing attribute and a file resource address; the sharing attribute includes: a first attribute value for identifying that the file is shared and a second attribute value for identifying that the file is not shared; The method further comprises: Upon receiving a cancel sharing instruction from the user for the fifth file record in the network disk file storage space, if the parent file ID of the fifth file record is empty, copying the file corresponding to the fifth file record to the file resource addresses of all file records whose parent file IDs are the file IDs of the fifth file record, and then setting the sharing attribute of the fifth file record to the second attribute value, and setting the parent file IDs of all file records whose parent file IDs are the file IDs of the fifth file record to empty; If the parent file ID of the fifth file record is not empty, the parent file IDs of all file records whose parent file IDs are the file IDs of the fifth file record are set to the parent file ID of the fifth file record, and then the shared attribute of the fifth file record is set to the second attribute value.
2. The network disk file processing method according to claim 1, characterized in that: The attribute information specifically includes: a sharing attribute and a file resource address; the sharing attribute includes: a first attribute value for identifying that the file is shared and a second attribute value for identifying that the file is not shared; The method further comprises: When receiving a deletion instruction from the user for a second file record in the network disk file storage space, if the sharing attribute of the second file record is a second attribute value, deleting the second file record and the attribute information of the second file record; If the sharing attribute of the second file record is the first attribute value, and the parent file ID of the second file record is empty, copy the file corresponding to the second file record to the file resource address of all file records whose parent file ID is the file ID of the second file record, then delete the second file record and the attribute information of the second file record, and set the parent file ID of all file records whose parent file ID is the file ID of the second file record to be empty; If the shared attribute of the second file record is the first attribute value, and the parent file ID of the second file record is not empty, the parent file ID of all file records whose parent file ID is the file ID of the second file record is set to the parent file ID of the second file record, and then the second file record and the attribute information of the second file record are deleted.
3. The network disk file processing method according to claim 1, characterized in that: The attribute information specifically includes: a sharing attribute; the sharing attribute includes: a first attribute value for identifying that the file is shared and a second attribute value for identifying that the file is not shared; The method further comprises: When receiving the user's deletion instruction for the third file record in the network disk file storage space, if the sharing attribute of the third file record is the first attribute value, and the parent file ID of the third file record is empty and there is a file record whose parent file ID is the file ID of the third file record, the third file record is transferred to the preset public file storage space.
4. The network disk file processing method according to claim 1, characterized in that: The attribute information specifically includes: a sharing attribute; the sharing attribute includes: a first attribute value for identifying that the file is shared and a second attribute value for identifying that the file is not shared; The method further comprises: When receiving a sharing instruction from the user for a fourth file record in the network disk file storage space, the sharing attribute of the fourth file record is set to the first attribute value.
5. The network disk file processing method according to claim 1, characterized in that: The attribute information specifically includes: file resource address; The method further comprises: When receiving an opening instruction from the user for a sixth file record in the network disk file storage space, if the parent file ID of the sixth file record is empty, opening a file corresponding to the sixth file record from the file resource address of the sixth file record; If the parent file ID of the sixth file record is not empty, the previous level file record is searched upward in sequence according to the parent file ID of the sixth file record until the parent file ID of the previous level file record found is empty, and then the file is copied to the file resource address of the sixth file record through the file resource address of the previous level file record whose parent file ID is empty, and the file corresponding to the sixth file record is opened from the file resource address of the sixth file record, and then the parent file ID of the sixth file record is set to empty.
6. The network disk file processing method according to claim 1, characterized in that: The attribute information specifically includes: file resource address; The method further comprises: When receiving a download instruction from the user for the seventh file record in the network disk file storage space, if the parent file ID of the seventh file record is empty, downloading the file corresponding to the seventh file record from the file resource address of the seventh file record; If the parent file ID of the seventh file record is not empty, the previous level file record is searched upward in sequence according to the parent file ID of the seventh file record until the parent file ID of the previous level file record found is empty, and then the file corresponding to the seventh file record is downloaded through the file resource address of the previous level file record whose parent file ID is empty.
7. The network disk file processing method according to claim 2, characterized in that: The attribute information specifically includes: file status; If the sharing attribute of the second file record is the first attribute value and the parent file ID of the second file record is empty, copying the file corresponding to the second file record to the file resource address of all file records whose parent file ID is the file ID of the second file record, then deleting the second file record and the attribute information of the second file record, and setting the parent file ID of all file records whose parent file ID is the file ID of the second file record to empty, specifically includes: If the sharing attribute of the second file record is the first attribute value, and the parent file ID of the second file record is empty, the file resource address of the second file record is hidden, and the file status of the second file record is set to be batch deleted, and then the batch deletion task is executed regularly. The batch deletion task is used to copy the file corresponding to the file record to the file resource address of all file records whose parent file ID is the file ID of the file record for the file record whose file status is to be batch deleted, and then delete the file record and the attribute information of the file record, and set the parent file ID of all file records whose parent file ID is the file ID of the file record to be empty.
8. The network disk file processing method according to claim 1, characterized in that: The attribute information specifically includes: file status; If the parent file ID of the fifth file record is empty, copying the file corresponding to the fifth file record to the file resource address of all file records whose parent file ID is the file ID of the fifth file record, then setting the sharing attribute of the fifth file record to the second attribute value, and setting the parent file ID of all file records whose parent file ID is the file ID of the fifth file record to empty, specifically includes: If the parent file ID of the fifth file record is empty, the file status of the fifth file record is set to be to be batch unshared, and then the batch unshared task is executed regularly. The batch unshared task is used to copy the file corresponding to the file record to the file resource address of all file records whose parent file ID is the file ID of the file record for the file record whose file status is to be batch unshared, and then set the sharing attribute of the file record to the second attribute value, and set the parent file ID of all file records whose parent file ID is the file ID of the file record to be empty.
9. A network disk file processing device, characterized in that: include: A target network disk file information acquisition unit, configured to acquire a file ID of the target network disk file upon receiving a user's instruction to save the target network disk file; A network disk file storage unit, configured to create a first file record in the network disk file storage space of the user, and set attribute information of the first file record according to the file ID of the target network disk file, wherein the attribute information specifically includes: a parent file ID, the parent file ID of the first file record is the same as the file ID of the target network disk file; The attribute information specifically includes: a sharing attribute and a file resource address; the sharing attribute includes: a first attribute value for identifying that the file is shared and a second attribute value for identifying that the file is not shared; The device also includes: a first file sharing cancellation processing unit, configured to, upon receiving a sharing cancellation instruction from the user for a fifth file record in the network disk file storage space, copy the file corresponding to the fifth file record to the file resource addresses of all file records whose parent file IDs are the file IDs of the fifth file record if the parent file ID of the fifth file record is empty, then set the sharing attribute of the fifth file record to a second attribute value, and set the parent file IDs of all file records whose parent file IDs are the file IDs of the fifth file record to empty; The second file sharing cancellation processing unit is used to set the parent file ID of all file records whose parent file ID is the file ID of the fifth file record to the parent file ID of the fifth file record if the parent file ID of the fifth file record is not empty, and then set the sharing attribute of the fifth file record to the second attribute value.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
11. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
12. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Distribution type file system dummy directory and name space implementing method
CN101187930A
Database-based network disk file replication method and server
CN105306564A