File management method and device, equipment and storage medium
By automatically deleting and shrinking files on local storage devices and backing up the original files on cloud storage devices, the problem of limited storage space on terminal devices is solved, enabling storage expansion and improved user experience.
Patent Information
- Application Number
- CN202411795067.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-08-19
- Filing Date
- 2024-12-06
- Publication Date
- 2026-03-03
AI Technical Summary
Terminal devices have limited local storage space, and existing technologies require manual selection of local or cloud storage devices, resulting in a poor user experience and difficulty in efficiently expanding storage capacity.
Files that meet certain criteria are automatically deleted from local storage devices, and their abbreviated forms or information are stored. The original files are backed up on cloud storage devices, and the storage capacity is displayed uniformly, providing file information or abbreviated forms for users to access.
It improves the storage efficiency of local storage devices, simplifies user operations, enhances the user experience, and enables the expansion of local storage devices.
Smart Images

Figure CN121597645A_ABST
Abstract
Description
[0001] This application claims priority to Chinese Patent Application No. 202411140693.4, filed on August 19, 2024, entitled “Method, Apparatus, Device and Storage Medium for Document Management”, the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of backup storage technology, and in particular to a method, apparatus, device and storage medium for file management. Background Technology
[0003] With the development of network and computer technologies, files on terminal devices can be stored on connected local storage devices. As the number of files on terminal devices increases, while the storage space on local storage devices is limited, it is necessary to consider using remote storage devices to expand the capacity of local storage devices. Therefore, a method for expanding local storage devices using remote storage devices is needed. Summary of the Invention
[0004] This application provides a method, apparatus, device, and storage medium for file management, and provides a method for expanding the capacity of a local storage device from a remote storage device. The technical solution adopted is as follows:
[0005] In a first aspect, this application provides a file management method, which is applied to a local storage device connected to a cloud storage device. The method includes: the local storage device acquiring a first file; and deleting the first file in the local storage device when the first file meets the deletion conditions. After the first file is deleted, the local storage device stores file information of the first file or a shortened version of the first file, wherein the data size of the file information and the data size of the shortened version are both less than the data size of the first file. The cloud storage device stores the first file.
[0006] In the solution presented in this application, the local storage device, after obtaining the first file, deletes the file when it meets the deletion conditions, and stores the file information or a shortened version of the file. Since the data size of the file information and the shortened version is smaller than the original file, it saves storage resources on the local storage device, allowing it to store more files and thus expand its storage capacity. Furthermore, because the first file is stored on a cloud storage device, it can be provided to the user even when the user retrieves the first file.
[0007] In one alternative approach, the local storage device provides storage services to at least one terminal device; the method further includes: receiving an access request for storage capacity sent by a first terminal device among the at least one terminal device; sending a first storage capacity and / or a second storage capacity to the first terminal device, wherein the first storage capacity is the sum of the total storage capacity of the local storage device and the cloud storage device, and the second storage capacity is the sum of the remaining storage capacity of the local storage device and the cloud storage device.
[0008] In the solution presented in this application, when a user views the total storage capacity and / or the remaining available storage capacity, the local storage device displays the unified storage capacity of both the local storage device and the remote cloud storage device. In this way, the user is presented with a unified storage capacity and does not need to worry about the operation of the remote cloud storage device.
[0009] In one alternative approach, the local storage device also provides network services to at least one terminal device. Thus, the local storage device can provide not only storage services to the terminal device but also network services.
[0010] In one alternative approach, the first file is only considered for deletion once the local storage device's storage space usage exceeds a target value. This ensures that deletion is only performed when the local storage device's storage space is potentially insufficient, thus storing files on the local storage device as much as possible and improving access efficiency.
[0011] In one alternative approach, when the first file meets the deletion criteria, the first file is abbreviated to generate and store a abbreviated file of the first file, so that the abbreviated file is stored on the local storage device and can be viewed by the user when accessing the first file.
[0012] In one alternative approach, after deleting the first file on the local storage device, when a user accesses a file, a shortened file or file information corresponding to that file is provided first, while the original file is downloaded from a remote cloud storage device and provided to the user. In this way, the user can start browsing the file immediately upon accessing it without waiting, resulting in a better user experience.
[0013] In one alternative approach, the first file meets the deletion conditions, including: the last access time of the first file is more than a first threshold from the current time; or, the last access time of the folder containing the first file is more than a second threshold from the current time.
[0014] In the scheme shown in this application, if a file has not been accessed for a relatively long time, it indicates that the probability of it being accessed again is relatively low, so it can be deleted. Alternatively, if the files in a folder belong to the same category and may be accessed together, then if a folder has not been accessed for a relatively long time, it indicates that the probability of it being accessed again is relatively low, so the files in the folder can be deleted.
[0015] In an alternative approach, the method further includes: when the last access time of the folder containing the first file is more than a second threshold from the current time, deleting all files in the folder containing the first file on the local storage device, wherein after deleting all files, the local storage device stores file information of each file or a thumbnail of each file.
[0016] In the scheme shown in this application, the files in the folder are highly related. When the last access time of the folder is more than a certain threshold away from the current time, all files in the folder can be deleted to save storage space on the local storage device.
[0017] In one alternative approach, upon receiving an access request for the second file, the file information of the second file or a shortened version of the second file is provided, and all files in the folder containing the first file are retrieved from the cloud storage device. The second file is any file in the folder containing the first file. After retrieving the second file, the second file is provided.
[0018] In the solution presented in this application, the files in the folder are highly related. When a file in the folder is accessed, it means that other files in the folder may also be accessed. Therefore, all files in the folder can be retrieved from the cloud storage device, so that when users access other files, they can directly access the original files, thus improving the user experience.
[0019] In one alternative approach, the time difference between file creations in the folder containing the first file is less than a third threshold, and the number of files is less than a fourth threshold; or, the time difference between file creations in the folder containing the first file is less than the third threshold, and the files are created at the same geographical location. This provides two methods for partitioning folders.
[0020] Secondly, this application provides a document management apparatus that has the functionality to implement the first aspect or any optional method of the first aspect described above. The apparatus includes at least one module for implementing the document management method provided by the first aspect or any optional method of the first aspect.
[0021] In some embodiments, the modules in the file management device are implemented in software, and are program modules. In other embodiments, the modules in the file management device are implemented in hardware or firmware.
[0022] Thirdly, this application provides a storage device including a processor and a memory;
[0023] The memory stores computer program instructions;
[0024] The processor is configured to execute computer program instructions stored in the memory, causing the storage device to perform the method as described in the first aspect or any alternative method of the first aspect.
[0025] Fourthly, this application provides a computer-readable storage medium including computer program instructions that, when executed by a storage device, perform the method as described in the first aspect or any optional manner of the first aspect.
[0026] Fifthly, this application provides a computer program product containing instructions, which are computer program instructions that, when executed by a storage device, cause the storage device to perform the method described in the first aspect or any optional manner of the first aspect. Attached Figure Description
[0027] Figure 1 This is a schematic diagram of a system architecture provided in an exemplary embodiment of this application;
[0028] Figure 2 This is a schematic diagram of a unified storage space provided in an exemplary embodiment of this application;
[0029] Figure 3 This is a schematic diagram illustrating the acquisition of storage capacity provided in an exemplary embodiment of this application;
[0030] Figure 4 This is a schematic diagram of the structure of a local storage device provided in an exemplary embodiment of this application;
[0031] Figure 5 This is a flowchart illustrating a file management method provided in an exemplary embodiment of this application;
[0032] Figure 6 This is a schematic diagram of the interaction flow of a file management method provided in an exemplary embodiment of this application;
[0033] Figure 7 This is a schematic diagram of the structure of a file management apparatus provided in an exemplary embodiment of this application. Detailed Implementation
[0034] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0035] With the development of network and computer technologies, files on terminal devices can be stored on connected storage devices. These storage devices, located close to the terminal device, are called local storage devices. To increase the storage capacity of local storage devices, one typically expands the storage capacity of the device's hardware or uses cloud storage for backup. For example, if a solid-state drive (SSD) is connected to the storage device, the SSD can be replaced with a larger capacity SSD. Alternatively, an application can access the local storage device and select manual or automatic backup methods to back up files to a remote cloud storage device.
[0036] Compared to replacing an SSD, cloud storage devices offer convenient expansion, but users need to manually select between local and cloud storage. This process is complex and provides a poor user experience. Therefore, a method is needed to expand local storage using cloud storage.
[0037] The following describes the application scenarios of file management methods.
[0038] File management methods can be applied to home storage applications. Figure 1 It provides a system architecture for home storage application scenarios. For example... Figure 1 As shown, the system architecture includes terminal devices, local storage devices, and cloud storage devices. Terminal devices establish wireless or wired communication connections with local storage devices. Terminal devices can access and manage files on local storage devices through applications. Local storage devices can establish communication connections with cloud storage devices, such as through fiber optic connections. Terminal devices include, but are not limited to, user-used mobile phones, desktop computers, tablets, or smart home appliances. Local storage devices provide storage resources for terminal devices, while cloud storage devices are deployed remotely and can be cloud drives or servers. In this application scenario, all terminal devices within the home can store files on the local storage device, sharing its storage resources. Alternatively, users can control the local storage device to download files via an application. Downloaded files can be stored on the local storage device, or the local storage device can automatically download network-side configuration files, meaning files on the local storage device can also be downloaded from the network. All terminal devices within the home can access the files stored on the local storage device.
[0039] Alternatively, the local storage device may be a network attached storage (NAS) device or module.
[0040] Optionally, the local storage device is a gateway with storage capabilities, such as a gateway connected to a NAS module. It provides network services to terminal devices, transmitting communication messages sent by the terminal devices to external systems and sending communication messages from external systems to the terminal devices. Simultaneously, the local storage device also provides storage services to terminal devices using its network services. These terminal devices can be managed by an application. For example, when a terminal device connects to the network provided by the local storage device, the local storage device sends a prompt message to the managing user's terminal device, allowing the user to authorize access to the storage service. If the user authorizes access, the local storage device provides storage services to that terminal device; otherwise, it only provides network services. This prevents unauthorized access to files and improves file security.
[0041] A gateway with storage capabilities can be an optical modem, such as an optical network terminal (ONT) or an optical network unit (ONU). When a local storage device is used in a Fiber To The Room (FTTR) scenario, the local storage device can be the main gateway of the FTTR, a sub-gateway of the FTTR, or it can include both the main gateway and sub-gateways of the FTTR. When the local storage device includes both the main gateway and sub-gateways of the FTTR, the storage capacity of the local storage device is the sum of the storage capacities of the main gateway and all sub-gateways. The main gateway and all sub-gateways are connected to the cloud storage device.
[0042] It should be noted that the above explanation uses home storage as an example. File management methods can also be applied to any scenario requiring expansion of local storage devices. For example, within a company, the local storage device is a storage server, and files from all company terminals are stored on this server. The storage capacity of this storage server can be expanded through cloud storage devices.
[0043] Optionally, for users, the interaction between local storage devices and cloud storage devices is blocked, and the storage on local storage devices and cloud storage devices are merged into a unified storage space. See [link to relevant documentation]. Figure 2Users can view the total storage capacity and / or remaining storage capacity through an application on their terminal device. The total storage capacity is the sum of the storage capacities of the local storage device and the cloud storage device, which can be considered the first storage capacity. The remaining storage capacity is the remaining available storage capacity, which can be considered the second storage capacity, and is the sum of the remaining storage capacities of the local storage device and the cloud storage device. For example, see... Figure 3 A user sends a storage capacity access request to a local storage device via a first terminal device. The local storage device then returns a first storage capacity and / or a second storage capacity to the first terminal device. The first terminal device displays the first storage capacity and / or the second storage capacity.
[0044] The following describes the entity responsible for implementing the file management method.
[0045] The entity executing the file management method is a file management device. Optionally, this device is a hardware device, such as a storage device; alternatively, it is a software device, such as a software program running on the storage device.
[0046] Figure 4 It also provides a schematic diagram of the local storage device. For example... Figure 4 As shown, the storage device 400 includes a bus 402, a processor 404, a memory 406, and a communication interface 408. The processor 404, the memory 406, and the communication interface 408 communicate with each other via the bus 402. It should be understood that this application does not limit the number of processors and memories in the storage device 400.
[0047] Bus 402 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 4 The bus 402 may be represented by a single line, but this does not mean that there is only one bus or one type of bus. The bus 402 may include a path for transmitting information between various components of the storage device 400 (e.g., memory 406, processor 404, communication interface 408).
[0048] Processor 404 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0049] Memory 406 may include volatile memory, such as random access memory (RAM). Memory 406 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0050] The memory 406 stores executable program code, and the processor 404 executes the executable program code to implement the file management function, thereby implementing the file management method. That is, the memory 406 stores computer program instructions for executing the file management method.
[0051] The communication interface 408 uses transceiver modules such as, but not limited to, network interface cards and transceivers to enable communication between the storage device 400 and other devices or communication networks.
[0052] Optionally, when the storage device is an optical modem, the communication interface 408 can be an optical module.
[0053] The following describes the file management method flow in the embodiments of this application, such as... Figure 5 Steps 501 to 502. Figure 5 In this context, the files include, but are not limited to, images, videos, audio, and documents. Images, videos, audio, and documents can be in any format, and this application does not impose any limitations on them.
[0054] Step 501: The local storage device retrieves the first file.
[0055] The first file can be any type of file.
[0056] In this embodiment, a first terminal device sends a first file to a local storage device. The first terminal device can be any terminal device using the storage service provided by the local storage device. The local storage device receives the first file. Alternatively, the local storage device downloads the first file from another device. For example, a user accesses the local storage device using an application, causing the local storage device to download the first file from a network-side server. Another example is that the local storage device automatically downloads some network-side configuration files from the network-side server; the first file can be a network-side configuration file.
[0057] Here, the first file is the original file, which refers to the file that has not been abbreviated.
[0058] The local storage device also records file information about the first file in a local database. This file information may include one or more of the following: access time, the identifier of the terminal device that sent the first file, the file creation time, or the geographical location where the file was created. The last access time of the first file is updated each time a user accesses it subsequently.
[0059] Step 502: When the first file meets the deletion conditions, delete the first file on the local storage device. After deleting the first file, the local storage device stores the file information of the first file or a shortened version of the first file. The data size of the file information and the data size of the shortened version are both less than the data size of the first file. The cloud storage device stores the first file.
[0060] In this embodiment, the local storage device determines whether each file meets the deletion criteria based on its file information according to a preset period (the period can be set based on experience). When the local storage device determines that the first file meets the deletion criteria, it deletes the first file on the local storage device, but does not delete the file information of the first file. Furthermore, the first file is stored on a cloud storage device, which is any remote storage device that expands the capacity of the local storage device. In one example, after obtaining the first file, the local storage device automatically sends the first file to the cloud storage device, which receives and stores the first file. In another example, after the first file meets the deletion criteria but before deleting it, the local storage device automatically sends the first file to the cloud storage device, which receives and stores the first file. Thus, the user is unaware of the backup process.
[0061] Since the local storage device already contains the file information for the first file, the user can still view this information even after the first file is deleted. This file information can be displayed as a list or as a fixed icon. After the first file is deleted, the local storage device stores a fixed icon, and next to this icon, displays the filename and a fixed extension of the first file to distinguish it as having been deleted. For example, the fixed extension might be identified by a specific set of characters.
[0062] Alternatively, the local storage device can perform abbreviated processing on the first file to obtain a shortened file. The process is as follows: the local storage device obtains the abbreviated processing scheme corresponding to the file type of the first file, uses this scheme to abbreviate the first file, and obtains the shortened data corresponding to the first file. This shortened data is called the first shortened file. The size of the first shortened file is smaller than the size of the first file, and the first shortened file can still be viewed or moved. After obtaining the first shortened file, the local storage device deletes the first file. Here, the file types are different, and the abbreviated processing schemes are also different.
[0063] When the first file is an image, the thumbnailing process includes compressing the resolution by a certain ratio, for example, compressing the resolution of the first file to 10% of the original resolution.
[0064] When the first file is an audio file, the shortening process includes shortening the audio duration and / or reducing the bitrate. For example, the audio data after the first duration of the first file is deleted. The first duration can be set according to the duration required to retrieve the first file from the cloud storage device (e.g., the first duration is slightly longer than the duration required to retrieve the first file from the cloud storage device). Reducing the bitrate means reducing the bitrate to a specified bitrate.
[0065] When the first file is a video, the thumbnailing process includes one or more of the following: reducing video resolution, reducing bitrate, or shortening video length. For example, deleting video data after the second duration of the first file. The second duration can be set according to the duration required to retrieve the first file from the cloud storage device (e.g., the second duration is slightly longer than the duration required to retrieve the first file from the cloud storage device), reducing video resolution means reducing the video resolution to a specified resolution, and reducing bitrate means reducing the bitrate to a specified bitrate.
[0066] When the first file is a text file, the abbreviation process involves removing text content. For example, retaining a preset amount of text.
[0067] The above are solutions for abbreviating several common file types. For other file types, you can find the corresponding abbreviation solutions and process them accordingly.
[0068] Optionally, after the first file is abbreviated, the filename of the first file is updated to the filename of the first file plus a fixed suffix to indicate that the first file has been abbreviated.
[0069] Optionally, after determining that all files in a folder meet the deletion criteria, the above processing is performed on each file in the folder, and each file is deleted to save storage space on the local storage device.
[0070] When using file information to determine whether the first file meets the deletion criteria, there are multiple methods. Two optional methods are provided below.
[0071] Method 1: The local storage device retrieves the last access time of the first file from its local database. This last access time is the time of the most recent access to the first file. The system then checks if this last access time is more than a first threshold from the current time. If it is, the first file meets the deletion criteria; otherwise, it does not. The first threshold can be set according to actual needs. It can be a fixed value for all files, or it can be dynamically adjusted. For example, when multiple files are frequently downloaded from the cloud storage device, the first threshold can be increased; when only a few files are downloaded from the cloud storage device, the first threshold can remain unchanged. Another example: when the remaining storage capacity of the local storage device is not less than a certain threshold of the total storage capacity, the first threshold is set to a specified value. As time progresses, the local storage device may store more and more files, and if the remaining storage capacity falls below this threshold, the first threshold can be decreased to delete infrequently used files from the local storage device as quickly as possible.
[0072] Method Two: The local storage device determines the folder containing the first file. This folder is logically generated and can be set to be visible to the user or not; it is used solely for file management. For each folder, the files within it are of the same type; for example, all files in folder A are images, and all files in folder B are videos.
[0073] In one approach, files created around the same time are more likely to be accessed by users simultaneously, so they can be managed together. For example, files with a creation time difference of less than a third threshold can be grouped into a folder. This third threshold can be set according to actual needs, such as one day.
[0074] In another approach, excessively large folders may negatively impact user experience. Therefore, folders should contain a maximum of a fourth threshold number of files. Files with a generation time difference less than the third threshold are grouped into one folder. If the number of files with a generation time difference less than the third threshold exceeds the fourth threshold, they will be split into at least two folders. The fourth threshold can be set based on empirical values, such as 100.
[0075] In another approach, files generated at similar geographical locations and around the same time are more likely to be accessed by the same user. Therefore, these files can be grouped into a logical folder for unified management. For example, if a user takes multiple photos during a short trip to city A, these photos are more likely to be accessed together and can be grouped into a logical folder. The third threshold is less than 3 days.
[0076] In another approach, files with similar content are more likely to be accessed by users together, so these files can be grouped into a logical folder for unified management. For example, if the files are photos, photos of the same person could be grouped into a folder. Here, the number of photos in each folder is less than or equal to a certain threshold.
[0077] For each folder, the local storage device uses the access time of the last accessed file in that folder as the folder's last access time. The local storage device then determines whether this last access time is more than a second threshold from the current time. This second threshold can be the same as the first threshold. If it is, all files in the folder are determined to meet the deletion criteria; otherwise, none of the files in the folder meet the deletion criteria. The second threshold can be set according to actual needs. Therefore, if the last access time of the folder containing the first file is more than the second threshold from the current time, the first file is determined to meet the deletion criteria.
[0078] Optionally, files in the same folder may come from the same terminal device or different terminal devices.
[0079] In one alternative approach, when the local storage device's storage space is insufficient, the stored files are abbreviated. For example, the local storage device periodically checks whether its storage space occupancy rate exceeds a target value. If it does, step 502 is executed. After step 502, if the storage space occupancy rate is again found to be below the target value, file deletion is stopped, and the process returns to periodically checking whether the storage space occupancy rate exceeds the target value. Here, the target value could be 50%, etc.
[0080] Alternatively, users can customize the target value. For example, users can log in to the local storage device through an application on their terminal device and configure the target value.
[0081] In one alternative approach, when a user subsequently accesses the first file, they send an access request for the first file to the local storage device using the first terminal device. The local storage device receives the access request, sends a shortened version of the first file or file information back to the first terminal device, and simultaneously sends a download request for the first file to a cloud storage device in the background. This download request is used to download the first file from the cloud storage device. After downloading the first file from the cloud storage device, the local storage device sends the first file back to the first terminal device, allowing the user to view the complete first file.
[0082] In one alternative approach, where the local storage device uses logical folders to determine if a file meets the deletion criteria, after a user sends an access request for a second file to the local storage device via a terminal device, when the local storage device provides the terminal device with a thumbnail of the second file, if the second file belongs to a folder (using the folder containing the first file as an example), the local storage device not only sends a download request for the second file to the cloud storage device but also sends download requests for other files in the same folder as the first file, prioritizing the download of the second file. This increases the probability of files belonging to the same folder being accessed together; when one file is accessed, other files are also downloaded, allowing the user to quickly access the original files when accessing other files.
[0083] Alternatively, the local storage device can send the folder-to-file mapping to the cloud storage device. Subsequently, when the cloud storage device detects that a file in a folder has been accessed, it determines the folder to which that file belongs and sends all files in that folder to the local storage device.
[0084] Optionally, for a given file, after the local storage device downloads the file from the cloud storage device, it can delete the corresponding thumbnail file from the local storage device to save storage space.
[0085] In one alternative approach, a user might want to manually back up files from their local storage device to cloud storage. The terminal device's application has a backup option; after the user activates the automatic backup option, the terminal device sends an automatic backup activation message to the local storage device, which then performs the backup accordingly. Figure 5The process involves file management. After the user disables the automatic backup function via the backup option, the terminal device sends an automatic backup disabled message to the local storage device, which then performs the backup process according to the terminal device's instructions. This allows the user to choose whether or not to have the local storage device perform the backup automatically.
[0086] In one alternative approach, users can also manage files stored on the local storage device through an application on their terminal device. For example, the user can send a deletion request for a first file to the local storage device through the application. If the local storage device currently stores the first file, then the first file is deleted; if the local storage device currently stores a first thumbnail file, then the first thumbnail file is deleted. The local storage device also deletes the file information recorded in its local database. The local storage device also sends a deletion instruction message to the cloud storage device, instructing the cloud storage device to delete the first file. In this way, the local storage device controls the deletion of files backed up to the cloud storage device without requiring user intervention, simplifying user operations and improving the user experience.
[0087] The following explanation uses the example of a first terminal device uploading a first file to a local storage device and a first terminal device retrieving a first file from a local storage device. Figure 6 Steps 601 to 610. In Figure 6 In this context, the local storage device is the local storage device described above, and abbreviation processing is performed on the first file.
[0088] Step 601: The first terminal device sends the first file to the local storage device.
[0089] Wherein, the first terminal device is any terminal device using local storage devices, and the first file is any type of file.
[0090] In this embodiment, when using the first terminal device, the user can set file upload conditions, etc. For example, the user can choose to periodically upload files of a specified type, or the user can choose to automatically upload files of a specified type whenever a new file of a specified type is added, or the user can choose to automatically upload files when the number of new files of a specified type reaches a certain threshold.
[0091] After determining that the first file meets the upload conditions, the first terminal device sends the first file to the local storage device.
[0092] In an alternative approach, as described above, the local storage device can also be a gateway, and the first terminal device belongs to the network accessing the local storage device and is one of the devices using its storage services. In this embodiment, each terminal device using the network accessing the local storage device and its storage services can upload files to the local storage device; the first terminal device is used as an example for illustration.
[0093] Step 602: The local storage device receives the first file.
[0094] In this embodiment, after receiving the first file, the local storage device records the file information of the first file into the local database.
[0095] Step 603: The local storage device backs up the first file to the cloud storage device.
[0096] In this embodiment, after obtaining the first file, the local storage device stores the first file and automatically sends it to the cloud storage device. Thus, the user is unaware of the backup process.
[0097] Step 604: The cloud storage device stores the first file to achieve backup of the first file.
[0098] In this embodiment, after receiving the first file, the cloud storage device stores the first file. Thus, both the local storage device and the cloud storage device store the first file.
[0099] Step 605: The local storage device determines whether the first file meets the deletion criteria.
[0100] In this embodiment, the local storage device determines whether each stored file meets the deletion conditions based on the file information of each file according to a preset period. The determination method is described above and will not be repeated here.
[0101] Step 606: When the first file meets the deletion conditions, the local storage device generates and stores the first abbreviated file corresponding to the first file, and deletes the first file from the local storage device. When the first file does not meet the deletion conditions, return to step 605.
[0102] Optionally, the first abbreviated file can be generated either after the first file is detected to meet the deletion conditions, or after the first file is obtained.
[0103] Step 607: The first terminal device sends an access request for the first file to the local storage device.
[0104] In this embodiment, when the user accesses the first file again, the first terminal device is used to send an access request for the first file to the local storage device.
[0105] It should be noted that when the file management method is applied to a multi-user storage application scenario, files stored on the local storage device can be shared. The terminal device accessing the first file may or may not be the device that uploaded the first file. This explanation takes the first terminal device as an example.
[0106] Step 608: The local storage device receives the access request for the first file, provides the first abbreviated file, and sends a download request for the first file to the cloud storage device.
[0107] In this embodiment, the local storage device receives an access request for the first file, sends a first abbreviated file back to the first terminal device, and simultaneously sends a download request for the first file to the cloud storage device in the background. This download request is used to download the first file from the cloud storage device.
[0108] Step 609: The cloud storage device receives the download request for the first file and sends the first file to the local storage device.
[0109] Step 610: The local storage device receives the first file and provides the first file.
[0110] In this embodiment, after the local storage device downloads the first file from the cloud storage device, it sends the first file to the first terminal device, allowing the user to browse the complete first file.
[0111] exist Figure 6 In this process, step 603 can occur at any stage after the first file is received and before the first file is deleted, such as backing up the first file to the cloud storage device after receiving the first file, or backing up the first file to the cloud storage device after detecting that the deletion conditions are met.
[0112] exist Figure 6In the illustrated process, the local storage device automatically backs up files to the cloud storage device and automatically restores files from the cloud storage device to the local storage device. From the user's perspective, no user intervention is required, and the backup and restore operations are handled automatically, simplifying the user experience and improving user satisfaction. Furthermore, the local storage device stores the thumbnailed data, which is smaller than the original file size, allowing for the storage of more files. For example, with a local storage capacity of 128GB and each photo being 4MB, it can store 28*1024 / 4 = 32768 photos. Each photo's thumbnail is 40KB. Following the expansion scheme of this application, the local storage device can store up to 300,000 photos. Moreover, the local storage device, being a local storage device, offers faster access speeds, while the cloud storage device, being a remote device, has slower access speeds. By storing the thumbnailed files on the local storage device, users can view the files immediately while simultaneously downloading the original files, ensuring uninterrupted access.
[0113] The apparatus provided in the embodiments of this application is described below.
[0114] Figure 7 This is a structural diagram of a file management device provided in an embodiment of this application. This device can be implemented as part or all of a system through software, hardware, or a combination of both. The device is applied to a local storage device connected to a cloud storage device. The device provided in this embodiment can implement the process executed by the local storage device in this embodiment. The device includes: a transceiver module 710 and a processing module 720, wherein:
[0115] The transceiver module 710 is used to acquire the first file;
[0116] The processing module 720 is used to delete the first file in the local storage device when the first file meets the deletion conditions. After the first file is deleted, the local storage device stores the file information of the first file or a shortened file of the first file. The data size of the file information and the data size of the shortened file are both less than the data size of the first file. The cloud storage device stores the first file.
[0117] In an alternative embodiment, the processing module 720 is further configured to determine, before deleting the first file from the local storage device when the first file meets the deletion conditions, that the occupancy rate of the storage space of the local storage device exceeds a target value.
[0118] In an optional embodiment, the processing module 720 is further configured to perform abbreviated processing on the first file when the first file meets the deletion conditions, and generate and store abbreviated files of the first file.
[0119] In one alternative approach, the local storage device provides storage services for at least one terminal device;
[0120] The transceiver module 710 is also used for:
[0121] Receive a storage capacity access request sent by the first terminal device among the at least one terminal devices;
[0122] Send a first storage capacity and / or a second storage capacity to the first terminal device, wherein the first storage capacity is the sum of the total storage capacity of the local storage device and the cloud storage device, and the second storage capacity is the sum of the remaining storage capacity of the local storage device and the cloud storage device.
[0123] In an alternative approach, the local storage device also provides network services to the at least one terminal device.
[0124] In an alternative embodiment, the transceiver module 710 is further configured to:
[0125] After deleting the first file on the local storage device, the system receives an access request for the first file, provides the file information of the first file or a shortened version of the first file, and retrieves the first file from the cloud storage device.
[0126] After obtaining the first file, provide the first file.
[0127] In one alternative approach, the first file meets the deletion conditions, including:
[0128] The last access time of the first file is more than a first threshold from the current time; or,
[0129] The last access time of the folder containing the first file is more than the second threshold from the current time.
[0130] In an alternative embodiment, the processing module 720 is further configured to:
[0131] When the last access time of the folder containing the first file exceeds a second threshold from the current time, all files in the folder containing the first file are deleted from the local storage device. After deleting all the files, the local storage device stores file information or abbreviated files of each of the files.
[0132] In an alternative embodiment, the transceiver module 710 is further configured to:
[0133] Receive an access request for a second file, provide file information of the second file or a shortened file of the second file, and retrieve all files in the folder where the first file is located from the cloud storage device, wherein the second file is any file in the folder where the first file is located;
[0134] After obtaining the second file, provide the second file.
[0135] In one alternative approach, the time difference between file generation in the folder containing the first file is less than a third threshold, and the number of files is less than a fourth threshold; or,
[0136] The files in the folder containing the first file have a generation time difference of less than the third threshold, and the files are generated in the same geographical location.
[0137] In an alternative embodiment, the transceiver module 710 is further configured to back up the first file to the cloud storage device before deleting the first file from the local storage device.
[0138] Figure 7 For a detailed description of the file management process performed by the file management device shown, please refer to the descriptions in the previous embodiments; it will not be repeated here. Figure 7 The document management device shown is attached. Figure 4 Storage device 400 in the middle.
[0139] In this embodiment, a computer program product is provided, comprising computer program instructions stored in a computer-readable storage medium. A processor of the storage device reads the computer program instructions from the computer-readable storage medium and executes the computer program instructions, causing the storage device to perform... Figure 5 The steps performed by the local storage device in the process shown.
[0140] Those skilled in the art will recognize that the method steps and units described in the embodiments disclosed in this application can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the steps and components of each embodiment have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0141] In the several embodiments provided in this application, it should be understood that the disclosed system architecture, apparatus, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, or may be electrical, mechanical, or other forms of connection.
[0142] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of the embodiments of this application, depending on actual needs.
[0143] Furthermore, the modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or in software.
[0144] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0145] In this application, the terms "first" and "second," etc., are used to distinguish identical or similar items that have substantially the same function and purpose. It should be understood that there is no logical or temporal dependency between "first" and "second," nor does it limit the quantity or order of execution. It should also be understood that although the following description uses the terms "first" and "second," etc., to describe various elements, these elements should not be limited by the terms. These terms are merely used to distinguish one element from another. For example, without departing from the scope of the various examples, a first document can be referred to as a second document, and similarly, a second document can be referred to as a first document. Both the first and second documents can be documents, and in some cases, they can be separate and different documents.
[0146] In this application, the term "at least one" means one or more, and the term "multiple" means two or more.
[0147] The above description is merely an exemplary embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and such modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for file management, characterized in that, Applied to a local storage device connected to a cloud storage device, the method includes: Get the first file; When the first file meets the deletion conditions, the first file is deleted from the local storage device. After the first file is deleted, the local storage device stores the file information of the first file or a shortened version of the first file. The data size of the file information and the data size of the shortened version are both less than the data size of the first file. The cloud storage device stores the first file.
2. The method according to claim 1, characterized in that, The local storage device provides storage services for at least one terminal device; The method further includes: Receive a storage capacity access request sent by the first terminal device among the at least one terminal devices; Send a first storage capacity and / or a second storage capacity to the first terminal device, wherein the first storage capacity is the sum of the total storage capacity of the local storage device and the cloud storage device, and the second storage capacity is the sum of the remaining storage capacity of the local storage device and the cloud storage device.
3. The method according to claim 2, characterized in that, The local storage device also provides network services to the at least one terminal device.
4. The method according to any one of claims 1 to 3, characterized in that, Before deleting the first file from the local storage device when the first file meets the deletion conditions, the method further includes: It is determined that the occupancy rate of the local storage device exceeds the target value.
5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: When the first file meets the deletion conditions, the first file is abbreviated to generate and store a shortened version of the first file.
6. The method according to any one of claims 1 to 5, characterized in that, After deleting the first file from the local storage device, the method further includes: Receive an access request for the first file, provide file information of the first file or a shortened version of the first file, and retrieve the first file from the cloud storage device; After obtaining the first file, provide the first file.
7. The method according to any one of claims 1 to 6, characterized in that, The first file meets the deletion conditions, including: The last access time of the first file is more than a first threshold from the current time; or, The last access time of the folder containing the first file is more than the second threshold from the current time.
8. The method according to claim 7, characterized in that, The method further includes: When the last access time of the folder containing the first file exceeds a second threshold from the current time, all files in the folder containing the first file are deleted from the local storage device. After deleting all the files, the local storage device stores file information or abbreviated files of each file in all the files.
9. The method according to claim 8, characterized in that, The method further includes: Receive an access request for a second file, provide file information of the second file or a shortened file of the second file, and retrieve all files in the folder where the first file is located from the cloud storage device, wherein the second file is any file in the folder where the first file is located; After obtaining the second file, provide the second file.
10. The method according to any one of claims 7 to 9, characterized in that, The time difference between file generation in the folder containing the first file is less than the third threshold, and the number of files is less than the fourth threshold; or, The files in the folder containing the first file have a generation time difference of less than the third threshold, and the files are generated in the same geographical location.
11. The method according to any one of claims 1 to 10, characterized in that, Before deleting the first file on the local storage device, the method further includes: backing up the first file to the cloud storage device.
12. A document management device, characterized in that, An apparatus for use in a local storage device connected to a cloud storage device, the apparatus comprising: The send / receive module is used to acquire the first file; The processing module is configured to delete the first file on the local storage device when the first file meets the deletion conditions, wherein after the first file is deleted, the local storage device stores the file information of the first file or a shortened file of the first file, the data size of the file information and the data size of the shortened file are both less than the data size of the first file, and the cloud storage device stores the first file.
13. The apparatus according to claim 12, characterized in that, The local storage device provides storage services for at least one terminal device; The transceiver module is also used to receive a storage capacity access request sent by the first terminal device among the at least one terminal device; The transceiver module is further configured to send a first storage capacity and / or a second storage capacity to the first terminal device, wherein the first storage capacity is the sum of the total storage capacity of the local storage device and the cloud storage device, and the second storage capacity is the sum of the remaining storage capacity of the local storage device and the cloud storage device.
14. The apparatus according to claim 13, characterized in that, The local storage device also provides network services to the at least one terminal device.
15. The apparatus according to any one of claims 12 to 14, characterized in that, The processing module is further configured to, when the first file meets the deletion conditions, determine, before deleting the first file on the local storage device, that the occupancy rate of the storage space on the local storage device exceeds a target value.
16. The apparatus according to any one of claims 12 to 15, characterized in that, The processing module is further configured to perform abbreviated processing on the first file when the first file meets the deletion conditions, and generate and store the abbreviated file of the first file.
17. The apparatus according to any one of claims 12 to 16, characterized in that, The transceiver module is also used for: After deleting the first file on the local storage device, the system receives an access request for the first file, provides the file information of the first file or a shortened version of the first file, and retrieves the first file from the cloud storage device. After obtaining the first file, provide the first file.
18. A storage device, characterized in that, Including processor and memory; The memory stores computer program instructions; The processor is configured to execute computer program instructions stored in the memory to cause the storage device to perform the method as described in any one of claims 1 to 11.
19. A computer-readable storage medium, characterized in that, It includes computer program instructions, which, when executed by a storage device, cause the storage device to perform the method as described in any one of claims 1 to 11.