WO2019178890A1 - 文件处理方法及服务器 - Google Patents

文件处理方法及服务器 Download PDF

Info

Publication number
WO2019178890A1
WO2019178890A1 PCT/CN2018/081556 CN2018081556W WO2019178890A1 WO 2019178890 A1 WO2019178890 A1 WO 2019178890A1 CN 2018081556 W CN2018081556 W CN 2018081556W WO 2019178890 A1 WO2019178890 A1 WO 2019178890A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
disk
recycle
files
written
Prior art date
Application number
PCT/CN2018/081556
Other languages
English (en)
French (fr)
Inventor
杜建宏
吴海华
Original Assignee
网宿科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 网宿科技股份有限公司 filed Critical 网宿科技股份有限公司
Priority to US16/082,682 priority Critical patent/US20200311026A1/en
Priority to EP18796818.5A priority patent/EP3564826A1/en
Publication of WO2019178890A1 publication Critical patent/WO2019178890A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0891Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches using clearing, invalidating or resetting means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/113Details of archiving
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1727Details of free space management performed by the file system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure

Definitions

  • Embodiments of the present invention relate to the field of data processing technologies, and in particular, to a file processing method and a server.
  • Cache refers to a technique for storing network content that requires frequent access in a system that is closer to the user and has a faster access speed to improve the speed of content access.
  • a cache server is a server that stores frequently accessed content. With the increasing scale of the network, the rise of the live-on-demand trend, the Internet traffic has grown geometrically. The cache server is used to distribute the source station content to the node closest to the user, so that the user can obtain the desired content nearby, and improve the response speed and success rate of the user access.
  • cache files on the cache server are often large in number and frequently updated, and it is necessary to delete cache files or even delete a cache directory frequently.
  • the system needs to call the interface to recover the disk resources. Therefore, when there are a large number of cache files to be deleted in the same time period, the system will cause high disk input and output (disk IO) load and affect the performance of the cache service.
  • the object of the embodiments of the present invention is to provide a file processing method and a server.
  • the application layer replaces the existing system recovery by using an overwrite method to achieve reuse of the files to be recycled, thereby effectively avoiding frequent recovery due to system recovery.
  • an embodiment of the present invention provides a file processing method, including a recycling step and an overlay writing step.
  • the recycling step includes: adding a file to be reclaimed to a pre-established file when there is a file to be recycled on the disk.
  • the overwriting write step includes: determining whether there is at least one recycled file in the recycle bin when a file is to be written to the disk; When at least one recycle file exists in the recycle bin, a recycle file is selected from the recycle bin; the file to be written is written to the selected recycle file in an overwrite manner.
  • An embodiment of the present invention further provides a server, including: at least one processor; at least one disk communicatively coupled to the at least one processor, the disk for storing a cache file; and, with the at least one processing
  • the memory communicatively coupled to the memory; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the file processing described above method.
  • Embodiments of the present invention also provide a computer readable storage medium storing a computer program that implements the above file processing method when executed by a processor.
  • the file to be recycled is added to the pre-established recycle bin, and the file to be recycled becomes a recycle file; and it is determined that there is a file to be written to the disk and it is determined that at least one of the recycle bin exists.
  • you recycle a file select a recycle file from the recycle bin and write the file to be written overwrite to the selected recycle file. That is, the application layer replaces the existing system recovery by means of overwriting, so as to realize the reuse of the files to be recycled, thereby effectively avoiding the problem that the disk IO load is too high due to frequent system calls during system recovery; That is, the disk IO load is reduced, thereby improving the cache service performance.
  • the method further includes: determining whether at least one recycle file that meets a preset condition exists in the recycle bin; the preset condition is: The file size is less than or equal to the file size of the file to be written; if it is determined that there is a recycling file that satisfies the preset condition, then the step of selecting one of the recovered files from the recycle bin is entered, and the Selecting one of the recycle files from the recycle bin is specifically: selecting a recycle file from the recycle files that satisfy the preset condition.
  • a specific method for selecting a reclaimed file is provided, and the file size of the selected reclaimed file is required to be smaller than or equal to the file size of the file to be written; thus, the file to be written can completely cover the selected file. Recycling files, that is, reclaiming files, does not leave any remaining space uncovered, thus avoiding the wasted space in the reclaimed files being wasted.
  • the selecting a reclaimed file from the reclaimed files satisfying the preset condition specifically: selecting a file size from the reclaimed files satisfying the preset condition and the file size to be written Close to the recycling file.
  • the recycled files in the recycle bin can be utilized as efficiently as possible, thereby minimizing disk utilization.
  • the method further includes: acquiring Determining the current utilization of the disk, and determining whether the current utilization is less than a preset utilization threshold; if yes, entering the creation of a new file, and writing the file to be written into the new file Step; if not, selecting a recycle file from the recycle files in the recycle bin.
  • the current utilization rate of the disk is regarded as one of the consideration factors for writing or creating a new file by using the reclaimed file, and multiple factors can be used for comprehensive judgment, and when the files to be written are more frequently ( Network traffic tends to be large) to minimize disk utilization.
  • the collection station includes a plurality of buckets that are pre-created based on the bucket sorting algorithm; and the adding the files to be recycled to the pre-established recycle bin, specifically including: using the bucket sorting algorithm to file the file to be recycled The size is calculated, and the bucket corresponding to the file to be recycled is obtained; and the file to be recycled is added to the bucket corresponding to the recycled file.
  • the bucket sorting algorithm is used to specifically put the file into the recycle bin, so that it is convenient to quickly select the required recycle file for overwrite writing.
  • the method further includes a disk detecting step; the disk detecting step includes: acquiring a current total number of the recycled files in the recycling station, a current total number of files to be deleted in the preset deleting station, a current time, and the disk The current utilization rate is determined according to the current total number of the reclaimed files, the current total number of the files to be deleted, the current time, and the current utilization rate of the disk, whether the disk meets the preset disk cleaning condition; Presetting the disk cleaning condition, setting a disk detection period, and performing the disk detecting step according to the disk detecting period; if the preset disk cleaning condition is met, performing disk cleaning, and according to the disk detecting period Perform the disk detection step.
  • the disk detection step is added, and the disk is periodically detected, so that the file can be cleaned regularly to avoid the actual disk space being insufficient.
  • FIG. 1 is a flow chart of a file processing method according to a first embodiment of the present invention
  • FIG. 2 is a flow chart of a file processing method according to a second embodiment of the present invention.
  • FIG. 3 is a flowchart of a file processing method according to a third embodiment of the present invention.
  • FIG. 4 is a flow chart of a file processing method according to a fourth embodiment of the present invention.
  • FIG. 5 is a flowchart of a file processing method according to a fifth embodiment of the present invention.
  • FIG. 6 is a specific flowchart of step 509 in the fifth embodiment of the present invention.
  • Figure 7 is a schematic diagram of a server in a sixth embodiment of the present invention.
  • a first embodiment of the present invention relates to a file processing method including a recycling step and an overlay writing step; the recycling step includes: adding a file to be recycled to a pre-established recycling station when a file in the disk is to be recycled, and The file to be reclaimed becomes a reclaimed file; the step of overwriting includes: determining whether there is at least one reclaimed file in the reclaiming station when a file is to be written to the disk; and determining that at least one of the reclaiming station is present When the file is reclaimed, a recycle file is selected from the recycle bin; the file to be written is written to the selected recycle file in an overwrite manner.
  • the first embodiment adds a file to be recycled to a pre-established recycle bin, and the file to be recycled becomes a recycle file; and determines that a file is to be written to the disk and determines that at least one of the recycle bins is present.
  • you recycle a file select a recycle file from the recycle bin and write the file to be written overwrite to the selected recycle file. That is, the application layer replaces the existing system recycling by means of overwriting, so as to realize the reuse of the files to be recycled, thereby effectively avoiding the problem that the disk IO load is too high due to frequent system calls during system recovery. Thereby improving the performance of the cache service.
  • the file processing method of this embodiment is applied to a server, such as a cache server, wherein the client accesses the source station through the cache server; that is, the cache server sends the client's access request to the source station, and receives the access fed back by the source station.
  • a server such as a cache server
  • the cache server sends the client's access request to the source station, and receives the access fed back by the source station.
  • Requesting a corresponding resource such as a video file
  • the cache server stores the resource in a disk in the cache server as a cache file; when the client within the scope of the cache server makes the access request, the cache server may directly
  • the resource corresponding to the access request stored therein is distributed to the client.
  • FIG. 1 is a flowchart of a file processing method according to a first embodiment of the present invention.
  • Step 101 Determine whether there is a file in the disk to be recycled; if yes, proceed to step 102; if not, then end.
  • the cache server may periodically detect whether the file stored in the disk is expired, and if the file expires, determine that the file is to be reclaimed; wherein determining whether the file is expired may be determined by factors such as the accessed frequency of the file. This embodiment does not impose any limitation on the specific method for judging that the file needs to be recovered.
  • Step 102 Add the file to be recycled to the pre-established recycle bin.
  • the cache server obtains the attribute information of the file to be recycled, and adds the attribute information of the file to be recycled to the pre-established recycle bin.
  • the The recycle file becomes a recycle file.
  • each file has a file reclaim flag, and the file reclaim flag is used to indicate whether the file is reclaimed. For example, when the file reclaim flag is 1, it indicates that the file is reclaimed, and the file reclaim flag is 0.
  • the file recycle flag of the file to be recycled is set to 1, indicating the file to be recycled. Becomes a recycle file.
  • the attribute information of the recovered file is used to uniquely represent the recycled file.
  • the attribute information of the recycled file includes at least the file size and physical location of the recycled file, and may also include the file name of the recycled file and the like.
  • Recycled files in the Recycle Bin are not accessible by the application layer, but the physical location of the Recycled file on the disk is the same (the same physical location as when it was not added to the Recycle Bin). It should be noted that, in this embodiment, the attribute information of the file to be collected is added to the recycle station, but the embodiment does not limit this.
  • a data link table can be created in the recycle bin, and attribute information of the recycle file is added to the data link list (added to the data link list in order of recycling the collected files).
  • the above steps 101 and 102 are recovery steps for recovering the documents to be recycled into the recycling station.
  • Step 103 Determine whether there is a file to be written to the disk; if yes, proceed to step 104; if not, then end.
  • the cache server when a terminal sends an access request to the source station through the cache server, and the resource corresponding to the access request does not exist in the cache server, the cache server sends the access request to the source station, and receives the feedback from the source station. To access the resource corresponding to the request, the cache server needs to write the resource to the disk of the cache server first, and then send the resource to the terminal. At this point, the cache server determines that a file is to be written to disk.
  • the resources here are understood as the files described in this embodiment.
  • Step 104 Determine whether at least one recycled file exists in the recycle bin. If yes, go to step 105; if no, go to step 107.
  • the cache server when a file is to be written to disk, the cache server will prioritize the use of recycled files in the recycle bin. When there is at least one reclaimed file in the recycle bin (indicating that the recycle bin is not empty), the cache server selects a recycle file from the recycle bin (ie, proceeds to step 105); when there is at least one recycle file inside the recycle bin (represents the recycle bin) Empty), the cache server creates a new file (ie, proceeds to step 106).
  • Step 105 Select a recycle file from the recycle bin.
  • Step 106 Write the file to be written to the selected recycled file in an overwrite manner.
  • the attribute information of the reclaimed file includes the physical location of the reclaimed file; the cache server obtains the physical location of the reclaimed file from the attribute information of the reclaimed file, and writes the file to be written to the selected file.
  • the physical location of the reclaimed file, and the original data of the reclaimed file is overwritten; that is, the disk overwrite is implemented.
  • the step 106 includes: if it is determined that the file size of the selected reclaimed file is smaller than the file size of the file to be written, expanding the file size of the selected reclaimed file to the file size of the file to be written The same; the file to be written is written to the expanded recycle file in an overwrite manner.
  • the file size of the selected reclaimed file is first expanded, so that the file size of the selected reclaimed file and the file to be written are The file size is the same (the extension is the space that has not been used on the disk); then the file to be written is overwritten into the expanded reclaim file, where part of the file to be written overwrites the reclaimed file, and another part Written in the extension section.
  • the file reclaim flag is set to 0, indicating that the reclaimed file becomes a normal file (ie, Unrecovered, accessible by the application layer)
  • the cache server will update the selected attribute information (file name, file size, physical location, etc.) of the recycled file according to the attribute information of the file to be written; and will be selected
  • the attribute information of the recycle file is deleted from the recycle bin (that is, the recycle bin has one less recycle file, but one more file on the disk that can be accessed by the application layer).
  • steps 103 to 106 are overlay write steps for writing the file to be written in the overlay file to the selected recycle file.
  • Step 107 Create a new file and write the file to be written to the new file.
  • recovery step step 101 to step 102
  • overlay write step step 103 to step 106
  • the method further includes the following steps: determining whether the file size of the reclaimed file meets the requirement of the single file space threshold of the recycle bin (a single file space threshold may include, for example, a maximum threshold and a minimum threshold) The file size of the reclaimed file is between the maximum threshold and the minimum threshold to indicate that the requirement is met; if the requirement is met, the recovery may be performed (ie, proceed to step 102); if the requirement is not met, the recovery cannot be performed (it may be directly The file is placed in a pre-established delete station).
  • a single file space threshold may include, for example, a maximum threshold and a minimum threshold
  • the method may further include: determining whether the current total number of recovered files in the recycle bin exceeds a preset total number of recovered files; if not, the recovery may be performed (ie, proceeding to step 102); No, it is not possible to recycle.
  • the order of judging the file size of the reclaimed file and the judgment of the current total number of reclaimed files is no limitation.
  • the method further includes: updating the attribute information of the recycle bin; and the attribute information of the recycle bin includes at least a current total number of the recovered files and a total number of recovered files.
  • the attribute information of the recycle bin may also include a total file size, a single file space threshold, and the like. Therefore, in the above steps, the single file space threshold and the current total number of recovered files can be obtained from the attribute information of the recycle bin for judgment.
  • the single file space threshold and the total number of recovered files thresholds of the recycle bin can be configured when the recycle bin is initialized (the system itself sets or the user presets). Pre-set the single file space threshold and the total number of recovered files thresholds to avoid the problem of read and write errors that may result from excessive reclaimed files or excessive reclaimed files in the Recycle Bin.
  • the cache server may further have a flag parameter indicating whether the file recovery function is available, and the user may preset the status value of the flag parameter to indicate whether the file recovery function is enabled; if the status value of the flag parameter is determined to be on
  • the file recovery method is enabled, that is, the cache server can perform the file processing method according to the embodiment of the present invention, that is, the recovery step and the overlay write step are all started when the file collection function is enabled; if the flag parameter is determined
  • the status value is off, which means that the file reclamation feature is turned off.
  • the attribute information of the recycle bin can be configured when the file recovery function is detected to be enabled (may be detected in the cache server when the file recovery function is detected or turned on in real time).
  • the information of the recycle bin in this embodiment is stored in the memory of the server; when the server is restarted, the recycle bin needs to be reconstructed.
  • the file reclaim flag of each file on the disk is judged. If the file reclaim flag is 1, indicating that the file is a reclaimed file, the attribute information of the reclaimed file is added to the recycle. Station; if the file recycle flag is 0, the file is a normal file.
  • the file status indicated by different values of the file recovery flag is not limited. For example, if the file recovery flag is 1, it indicates that the file is a normal file. When the recycle flag is 0, it indicates that the file is a recycle file.
  • a second embodiment of the present invention relates to a file processing method.
  • the second embodiment is substantially the same as the first embodiment, and the main improvement is that a second embodiment of the present invention provides a specific way of selecting a recovered document from the recycle bin.
  • FIG. 2 is a flow chart showing a file processing method of the second embodiment. Steps 201 to 204 and steps 207 to 208 are substantially the same as steps 101 to 107 in the first embodiment, and are not described herein again; the difference is:
  • Step 205 Determine whether at least one reclaimed file that meets the preset condition exists in the recycle bin.
  • Step 206 Select a recycle file from the recycle bin, specifically: select a recycle file from the recycle file that meets the preset condition.
  • the default condition is that the file size of the reclaimed file is less than or equal to the file size of the file to be written.
  • the cache server determines whether there is at least one reclaimed file in the recycle bin whose file size is less than or equal to the file size of the file to be written; if it exists, a reclaimed file is selected from the reclaimed files satisfying the preset condition.
  • a specific method for selecting a reclaimed file is provided, and the file size of the selected reclaimed file is required to be smaller than or equal to the file size of the file to be written;
  • the write file can completely cover the selected reclaimed file, that is, the reclaimed file will not have any remaining space and will not be overwritten, thus avoiding the waste space in the reclaimed file being wasted (when the file on the disk is cached in a segmented manner)
  • the system does not automatically recycle the remaining space. Therefore, if the file size of the selected recycle file is larger than the file to be written The file size, the remaining space in the reclaimed file that is not overwritten will be wasted).
  • the preset condition may include a first preset condition and a second preset condition, where the file size of the recycled file is equal to the file size of the file to be written, and the second preset condition is: recycling The file size of the file is smaller than the file size of the file to be written.
  • the cache server may first determine whether the file size of the reclaimed file satisfies the first preset condition.
  • the first preset condition is met, one of the reclaimed files that meet the first preset condition is selected; if the first pre-satisfaction is not met; Setting a condition, and determining whether the file size of the recycled file satisfies the second preset condition; if the second preset condition is met, selecting one of the recovered files from the recycled file that satisfies the second preset condition; if the second pre-satisfaction is not satisfied If the condition is set, it means that there is no recycling file that can be reused, and the process proceeds to step 208.
  • the difference between the file size of the file to be written and the file size of the reclaimed files satisfying the second preset condition may be calculated, and
  • the reclaimed file corresponding to the minimum difference is selected for overwrite writing (that is, the reclaimed file closest to the file size of the file to be written is selected for overwriting writing).
  • This approach can further effectively utilize the recycled files in the recycle bin, further reducing disk utilization.
  • the extended part described in step 106 is the difference between the file size of the file to be written and the file size of the selected recycled file.
  • a third embodiment of the present invention relates to a file processing method.
  • the third embodiment is substantially the same as the second embodiment, and the main improvement is that the third embodiment of the present invention provides another specific manner of selecting one of the recovered documents from the recycle bin.
  • FIG. 3 is a flow chart showing a file processing method of the third embodiment. Steps 301 to 306 and steps 309 to 310 are substantially the same as steps 201 to 208 in the second embodiment, and are not described herein again; the difference is:
  • step 305 If the result of the determination in step 305 is no, the process proceeds to step 307: obtaining the current utilization rate of the disk, and determining whether the current utilization rate is less than the preset utilization threshold; if yes, proceeding to step 310; if not, proceeding to step 308.
  • Step 308 Select a recycle file from the recycle files in the recycle bin; then proceed to step 309.
  • the current utilization rate of the disk is: (the total file size of the file accessible by the application layer + the total file size of the recovered file in the recycle bin) / the total disk space; the cache server periodically calculates the current utilization of the disk.
  • the disk has attribute information, and the attribute information of the disk contains at least the current utilization (which can be updated in real time) and the utilization threshold (which can be preset).
  • step 305 When the result of the determination in step 305 is no, it indicates that there is no reclaimed file in the recycle bin that meets the preset condition (that is, the file size of each reclaimed file in the recycle bin is larger than the file size of the file to be written), and if the current disk is current The usage is lower than the disk usage threshold, indicating that the remaining space of the disk is relatively redundant. Go to step 310 (create a new file). If the current disk usage is greater than or equal to the disk utilization threshold, the remaining space of the disk is displayed. If the disk load is relatively small, the process proceeds to step 308, that is, only one of the reclaimed files larger than the file size of the file to be written is selected for overwriting, although some space may be wasted.
  • the reclaimed file is selected from the reclaimed file that is larger than the file size of the file to be written, and the reclaimed file that is closest to the file size of the file to be written may be selected, that is, the file size and each of the file to be written may be calculated.
  • the difference between the file sizes of the reclaimed files (the file size of each reclaimed file is larger than the file size of the file to be written), and the reclaimed file corresponding to the minimum difference is selected for overwrite writing; thus, the disk space can be wasted as little as possible.
  • a fourth embodiment of the present invention relates to a file processing method.
  • the fourth embodiment is substantially the same as the first embodiment, and the main refinement is that in the fourth embodiment of the present invention, a method of placing a recycled file in a recycle bin and selecting a recycle file from the recycle bin for overwriting is provided. The specific way.
  • FIG. 4 is a flow chart showing a file processing method of the fourth embodiment. Step 401, steps 403-404, and steps 406-407 are substantially the same as steps 201, 203-204, and steps 206-207 in the second embodiment, and are not described herein again; the difference is:
  • Step 402 Add the file to be recycled to the pre-established recycle bin, specifically including:
  • Sub-step 4021 calculating, by using a bucket sorting algorithm, a file size of the file to be recycled, and obtaining a bucket corresponding to the file to be recycled;
  • Sub-step 4022 Add the file to be recycled to the bucket corresponding to the recycle file.
  • the cache server pre-configures the file size threshold of the reclaimed files in the recycle bin, calculates the number of buckets in the recycle bin according to a preset bucket sorting algorithm, and then creates and initializes a file recycle list linked to each bucket. And configure the maximum and minimum values of the bucket index (that is, the bucket serial number), the maximum file size and maximum file size of each bucket, the current file size of each bucket, and the current file number, etc., which can be initialized in the recycle bin. Time to complete.
  • the bucket sorting algorithm may use an algorithm of the store_ow_gb_get_b function to perform calculation, but the embodiment is not limited thereto.
  • the file size of the file to be written is used as a parameter, and the bucket index corresponding to the file to be written is calculated by using a preset bucket sorting algorithm, and then the attribute information of the file to be recycled is added to the bucket corresponding to the bucket index. After the file to be reclaimed is added to the bucket of the recycle bin, it becomes a recycle file (the recycle file cannot be applied to the application layer).
  • the bucket sorting algorithm described in step 402 may also be used when the reclaimed file is relocated to the recycle bin. The way.
  • Step 405 selecting a recycling file from the recycle bin, specifically including:
  • Sub-step 4051 calculating, by using a bucket sorting algorithm, a file size of a file to be written, and obtaining a bucket corresponding to the file to be written;
  • Sub-step 4052 Select a recycle file from the bucket corresponding to the file to be written.
  • the bucket sorting algorithm is used to recover the files, so that the recycled files in the recycle bin are arranged according to the size of the file size.
  • the same bucket sorting algorithm is used to select an appropriate recycle file for overwrite writing, which can make subsequent overlay writes.
  • the reclaimed file is selected more quickly; that is, since each bucket is arranged in a preset order (which can accommodate a single file size from small to large, or from large to small), it can be quickly found later.
  • Appropriate recycling files for overwriting It should be noted that, in this embodiment, the bucket sorting algorithm is adopted in both the recycling step and the overlay writing step, but the method is not limited thereto, even if only the recycling step uses the bucket sorting algorithm and the overlay writing step uses only the sequential comparison method. Recycling files can also increase the speed of selected reclaimed files to some extent.
  • the fourth embodiment may also be an improvement made on the basis of the second or third embodiment.
  • a fifth embodiment of the present invention relates to a file processing method.
  • the fifth embodiment is substantially the same as the first embodiment, and the main difference is that in the fifth embodiment of the present invention, the method further includes a disk detecting step.
  • FIG. 5 is a flow chart showing a file processing method of the fifth embodiment.
  • the steps 501-507 are substantially the same as the steps 101-107 in the first embodiment, and are not described here.
  • the difference is that the disk detecting step is further included, and the disk detecting step specifically includes:
  • Step 508 Obtain the current total number of recovered files in the recycle bin, the current total number of files to be deleted in the preset delete station, the current time, and the current utilization rate of the disk.
  • a deletion station is preset in the cache server, and the deletion station is used to store the file to be deleted.
  • the cache server adopts an asynchronous deletion mechanism; that is, a time period in which the network traffic is smaller during the selected day is used as a cleanup period (for example, in the early morning hours, the network access traffic is relatively small during this time period). ), the deletion of the cache file is concentrated in the cleanup period.
  • the non-cleanup period that is, the period other than the cleaning period in the day
  • a file needs to be deleted and the disk is in a healthy state (the disk is in a healthy state, the current utilization of the disk is less than the preset utilization threshold)
  • the file to be deleted is the file to be deleted, and is not accessible by the application layer.
  • the file to be deleted may be uniquely characterized by the attribute information of the file to be deleted, and the attribute information of the file to be deleted is deleted. In the station.
  • the above application scenario is also applicable to the file processing methods in the first to fourth embodiments, and especially when the cache server adopts the asynchronous deletion mechanism, the disk IO load of the cleanup period is high (because the focus is on the same).
  • the file processing method of the embodiments of the present invention can effectively reduce the number of files to be deleted in the deletion station, thereby effectively reducing the disk IO load during the cleaning period and improving the cache service performance during the cleaning period.
  • Step 509 Determine, according to the current total number of the recovered files, the current total number of files to be deleted, the current time, and the current utilization rate of the disk, whether the disk meets the preset disk cleaning condition; if not, proceed to step 510; if yes, enter Step 511.
  • Step 510 Set a disk detection cycle, and perform a disk detection step according to the disk detection cycle; that is, set a disk detection cycle, and wait for the disk detection cycle to restart the disk detection step.
  • Step 511 Perform disk cleaning and perform a disk detecting step according to the disk detecting cycle; that is, set a disk detecting cycle, and wait for the disk detecting cycle to restart the disk detecting step.
  • the disk cleaning conditions include:
  • Condition (1) the current time belongs to the cleanup period, and the current total number of files to be deleted is not zero; or,
  • Condition (2) the current time is not the cleanup period, the current utilization of the disk is greater than or equal to the utilization threshold, and the current total number of files to be deleted is not zero;
  • the current time is not a cleanup period
  • the current total number of recycled files is greater than or equal to the total number of recovered files
  • the current total number of files to be deleted is not zero.
  • the disk cleaning conditions are not limited, and those skilled in the art can perform settings as needed.
  • step 509 can include the following sub-steps:
  • Sub-step 5091 determining whether the current total number of recovered files and the current total number of files to be deleted are both zero; if yes, proceeding to step 510; if not, proceeding to sub-step 5092.
  • Sub-step 5092 determining whether the current time belongs to the cleanup period; if not, proceeding to sub-step 5093; if yes, proceeding to sub-step 5094.
  • Sub-step 5093 determining whether the following condition is met: the current utilization of the disk is greater than or equal to the utilization threshold, or the current total number of the recycled files is greater than or equal to the total number of recovered files; if yes, proceed to step 5094; if not, proceed to step 511 .
  • Sub-step 5094 determining whether the current total number of files to be deleted is zero; if yes, proceeding to step 510; if not, proceeding to step 511.
  • the file deleted in step 511 may be the file to be deleted (moved from the recycle bin) originally deleted in the delete station, or may be directly placed in the delete station by the application layer. The file to be deleted.
  • the disk detection period when the disk detection period is set in step 510, the disk detection period can be set to different values according to different states of the disk; for example:
  • the disk detection period can be set relatively large, for example, 10 second;
  • the disk detection period can be set relatively small. , for example, 5 seconds;
  • the above-mentioned state and the set value of the corresponding disk detection period are not limited.
  • the above is merely an example, and those skilled in the art can perform setting as needed.
  • the disk detection period may be updated according to the status of the file to be deleted; that is, the step 511 may include: determining whether the current total number of files to be deleted and the current total file size meet the preset detection period. Update condition; if yes, update the disk detection cycle, and perform the disk detection step according to the updated disk detection cycle after the cleaning is completed; if not, perform the disk detection step according to the disk detection cycle after the cleaning is completed.
  • the detection period update condition includes that the current total file size of the file to be deleted is greater than a preset single-cleaned file size threshold; or the current total number of files to be deleted is greater than a preset total number of single-cleaned files. That is, when the detection period update condition is met, it means that all the files to be deleted in the deletion station cannot be cleaned up after performing a disk cleaning, and the disk condition needs to be detected again as soon as possible after completing the cleaning again.
  • the disk detection cycle when the disk detection cycle is updated, can be updated to different values according to different situations. For example, if the current total file size of the file to be deleted is greater than the preset single-cleaned file size threshold, the disk detection period may be updated to a smaller value, for example, 2 seconds; in the file to be deleted In the case where the current total is greater than the preset total number of files for a single cleanup, the disk detection period can be updated to a smaller value, for example, 1 second.
  • the detection period update condition of the disk and the value after the disk detection period is updated are not limited.
  • the above is merely an example, and those skilled in the art can perform setting as needed.
  • the disk detection step, the recovery step, and the overlay write step are performed in parallel; the step numbers in the figure are merely exemplary descriptions, and the order of execution is not limited.
  • the disk detection step can be set to start execution when the file reclamation function is started.
  • the fifth embodiment may also be an improvement made on the basis of the second, third or fourth embodiment.
  • a sixth embodiment of the present invention relates to a server, as shown in FIG. 7, including:
  • At least one processor 701 At least one processor 701;
  • the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the file processing method of any of the above embodiments .
  • the memory and the processor are connected in a bus manner, and the bus may include any number of interconnected buses and bridges that connect the various circuits of one or more processors and memories.
  • the bus can also connect various other circuits, such as peripherals, voltage regulators, and power management circuits, as is well known in the art, and therefore, will not be further described herein.
  • the bus interface provides an interface between the bus and the transceiver.
  • the transceiver can be an element or a plurality of elements, such as multiple receivers and transmitters, providing means for communicating with various other devices on a transmission medium.
  • the data processed by the processor is transmitted over the wireless medium via an antenna. Further, the antenna also receives the data and transmits the data to the processor.
  • the processor is responsible for managing the bus and normal processing, as well as providing various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions.
  • the memory can be used to store data used by the processor when performing operations.
  • a seventh embodiment of the present invention relates to a computer readable storage medium storing a computer program.
  • the above method embodiments are implemented when the computer program is executed by the processor.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明实施例涉及数据处理技术领域,公开了一种文件处理方法及服务器。本发明中,文件处理方法包括回收步骤和覆盖写步骤;回收步骤包括:当磁盘中有文件待回收时,将待回收文件添加到预先建立的回收站内,且待回收文件变为回收文件;覆盖写步骤包括:当有文件待写入磁盘时,判断回收站内是否存在至少一回收文件;当判断出回收站内存在至少一回收文件时,从回收站中选定一个回收文件;将待写入文件以覆盖方式写入选定的回收文件。本发明实施例应用层采用覆盖写的方式替代现有的***回收,来实现对需回收文件的重复利用,从而可以有效避免因***回收时频繁进行***调用,而导致的磁盘IO负载过高的问题,从而提高缓存服务性能。

Description

文件处理方法及服务器 技术领域
本发明实施例涉及数据处理技术领域,特别涉及文件处理方法及服务器。
背景技术
缓存指的是将需要频繁访问的网络内容存放在离用户较近、访问速度更快的***中,以提高内容访问速度的一种技术。缓存服务器就是存放频繁访问内容的服务器。随着网络规模越来越庞大,直播点播潮流的兴起,互联网流量成几何倍数的增长。缓存服务器用来将源站内容分发至最接近用户的节点,使用户可就近取得所需内容,提高用户访问的响应速度和成功率。
发明人发现现有技术中至少存在如下问题:缓存服务器上的缓存文件往往数量庞大,而且经常更新,需要经常删除缓存文件甚至删除某个缓存目录。缓存文件删除时,***需要调用接口以回收磁盘资源,因此,当有同一时间段有大量缓存文件需要删除时,***回收时会导致磁盘输入输出(磁盘IO)负载很高,影响缓存服务性能。
发明内容
本发明实施方式的目的在于提供一种文件处理方法及服务器,应用层采用覆盖写的方式替代现有的***回收,来实现对需回收文件的重复利用,从而可以有效避免因***回收时频繁进行***调用,而导致的磁盘IO负载过高的问题,从而提高缓存服务性能。
为解决上述技术问题,本发明的实施方式提供了一种文件处理方法,包括回收步骤和覆盖写步骤;所述回收步骤包括:当磁盘中有文件待回收时,将待回收文件添加到预先建立的回收站内,且所述待回收文件变为回收文件;所述覆盖写步骤包括:当有文件待写入所述磁盘时,判断所述回收站内是否存在至少一回收文件;当判断出所述回收站内存在至少一回收文件时,从所述回收站中选定一个回收文件;将待写入文件以覆盖方式写入选定的所述回收文件。
本发明的实施方式还提供了一种服务器,包括:至少一个处理器;与所述至少一个处理器通信连接的至少一磁盘,所述磁盘用于存放缓存文件;以及,与所述至少一个处理器通信 连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述文件处理方法。
本发明的实施方式还提供了一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现上述文件处理方法。
本发明实施方式相对于现有技术而言,将待回收文件添加到预先建立的回收站内,待回收文件变为回收文件;并在判断出有文件待写入磁盘且判断出回收站内存在至少一回收文件时,从回收站中选定一个回收文件,并将待写入文件以覆盖方式写入选定的回收文件。即,应用层采用覆盖写的方式替代现有的***回收,来实现对需回收文件的重复利用,从而可以有效避免因***回收时频繁进行***调用,而导致的磁盘IO负载过高的问题;即,降低了磁盘IO负载,从而提高了缓存服务性能。
另外,在所述从所述回收站中选定一个回收文件之前,还包括:判断所述回收站内是否存在至少一个满足预设条件的回收文件;所述预设条件为:所述回收文件的文件大小小于或等于所述待写入文件的文件大小;若判断出存在满足所述预设条件的回收文件,则进入所述从所述回收站中选定一个回收文件的步骤,且所述从所述回收站中选定一个回收文件具体为:从满足所述预设条件的回收文件中选定一个回收文件。本实施例中,提供了一种选定一个回收文件的具体方法,要求选定的回收文件的文件大小小于或等于待写入文件的文件大小;从而,待写入文件可以完全覆盖选定的回收文件,即回收文件不会存在剩余空间没有被覆盖到,从而避免了回收文件中存在剩余空间被浪费掉。
另外,所述从满足所述预设条件的回收文件中选定一个回收文件,具体为:从各满足所述预设条件的回收文件中选定一个与所述待写入文件的文件大小最接近的回收文件。本实施例中,可以尽可能高效地利用回收站中的回收文件,从而尽可能降低磁盘利用率。
另外,若判断出不存在满足所述预设条件的回收文件,或者,若判断出所述回收站内不存在回收文件,则创建一个新文件,并将所述待写入文件写入所述新文件中。进一步的,当判断出不存在满足所述预设条件的回收文件时,且在所述创建一个新文件,并将所述待写入文件写入所述新文件中之前,还包括:获取所述磁盘的当前利用率,并判断所述当前利用率是否小于预设的利用率阈值;若是,则进入所述创建一个新文件,并将所述待写入文件写入所述新文件中的步骤;若否,则从所述回收站内的所述回收文件中选定一个回收文件。本实施例中,将磁盘的当前利用率作为采用回收文件覆盖写或者创建新文件的考量因素之一,可以利用多种因素来进行综合判断,能够在待写入的文件较多较频繁时(网络流量往往很大)尽可能降低磁盘利用率。
另外,所述回收站中包含基于桶排序算法预先创建的多个桶;所述将待回收文件添加到预先建立的回收站内,具体包括:利用所述桶排序算法对所述待回收文件的文件大小进行计算,并得到所述待回收文件对应的桶;将所述待回收文件添加到所述回收文件对应的桶内。本实施例中,采用桶排序算法来具体实现将文件放入回收站,从而可以便于后续快速地选定出所需的回收文件进行覆盖写。
另外,所述方法还包括磁盘检测步骤;所述磁盘检测步骤包括:获取所述回收站内所述回收文件的当前总数、预设的删除站内待删除文件的当前总数、当前时间以及所述磁盘的当前利用率;根据所述回收文件的当前总数、所述待删除文件的当前总数、所述当前时间以及所述磁盘的当前利用率判断所述磁盘是否满足预设的磁盘清理条件;若不满足预设的磁盘清理条件,则设定一磁盘检测周期,并根据所述磁盘检测周期执行所述磁盘检测步骤;若满足预设的磁盘清理条件,则进行磁盘清理,并根据所述磁盘检测周期执行所述磁盘检测步骤。本实施例中,增加了磁盘检测步骤,对磁盘进行周期性检测,从而能够定时清理文件,避免实际磁盘空间不够用。
附图说明
一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。
图1是根据本发明第一实施例的文件处理方法的流程图;
图2是根据本发明第二实施例的文件处理方法的流程图;
图3是根据本发明第三实施例的文件处理方法的流程图;
图4是根据本发明第四实施例的文件处理方法的流程图;。
图5是根据本发明第五实施例的文件处理方法的流程图;
图6是根据本发明第五实施例中的步骤509的具体流程图;
图7是根据本发明第六实施例中的服务器的示意图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合附图对本发明的各实施方式进行详细的阐述。然而,本领域的普通技术人员可以理解,在本发明各实施方式中, 为了使读者更好地理解本申请而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施方式的种种变化和修改,也可以实现本申请所要求保护的技术方案。
本发明的第一实施方式涉及一种文件处理方法,包括回收步骤和覆盖写步骤;所述回收步骤包括:当磁盘中有文件待回收时,将待回收文件添加到预先建立的回收站内,且所述待回收文件变为回收文件;所述覆盖写步骤包括:当有文件待写入所述磁盘时,判断所述回收站内是否存在至少一回收文件;当判断出所述回收站内存在至少一回收文件时,从所述回收站中选定一个回收文件;将待写入文件以覆盖方式写入选定的所述回收文件。
第一实施例相对于现有技术而言,将待回收文件添加到预先建立的回收站内,待回收文件变为回收文件;并在判断出有文件待写入磁盘且判断出回收站内存在至少一回收文件时,从回收站中选定一个回收文件,并将待写入文件以覆盖方式写入选定的回收文件。即,应用层采用覆盖写的方式替代现有的***回收,来实现对需回收文件的重复利用,从而可以有效避免因***回收时频繁进行***调用,而导致的磁盘IO负载过高的问题,从而提高缓存服务性能。
下面对本实施方式的文件处理方法的实现细节进行具体的说明,以下内容仅为方便理解提供的实现细节,并非实施本方案的必须。
本实施例的文件处理方法应用于服务器,例如缓存服务器,其中,客户端通过该缓存服务器访问源站;即,该缓存服务器将客户端的访问请求发送至源站,并接收源站反馈的该访问请求对应的资源(例如视频文件),该缓存服务器将该资源存储在缓存服务器内的磁盘中,作为缓存文件;当该缓存服务器管辖范围内的客户端提出该访问请求时,缓存服务器可以直接将其内部存储的该访问请求对应的资源分发至客户端。需要说明的是,本实施例对文件处理方法所应用的服务器不作任何限制。
如图1所示为本发明第一实施例的文件处理方法的流程图。
步骤101:判断磁盘中是否有文件待回收;若是,则进入步骤102;若否,则结束。
具体而言,缓存服务器可以定时检测存储在磁盘中的文件是否过期,如果文件过期,则判定该文件待回收;其中,判断文件是否过期可以以文件的被访问频率等因素来确定。本实施例对判断文件需要回收的具体方法不作任何限制。
步骤102:将待回收文件添加到预先建立的回收站内。
具体而言,本实施例中,缓存服务器会获取待回收文件的属性信息,并将待回收文件的属性信息添加到预先建立的回收站内,当该待回收文件被添加到回收站后,该待回收文件变为回收文件。本实施例中,每个文件具有一个文件回收标志位,文件回收标志位用于表示该 文件是否被回收,例如,文件回收标志位为1时,表示该文件被回收,文件回收标志位为0时,表示该文件为普通文件(即未被回收,可被应用层访问);当待回收文件被添加到回收站后,该待回收文件的文件回收标志位被置1,表示该待回收文件变为回收文件。
本实施例中,采用回收文件的属性信息来唯一表征该回收文件。回收文件的属性信息至少包含该回收文件的文件大小和物理位置,还可以包括该回收文件的文件名称等。回收站中的回收文件无法被应用层访问,但是该回收文件在磁盘中的物理位置不变(与未被添加到回收站时的物理位置相同)。需要说明的是,本实施例中将待回收文件的属性信息添加到回收站中,然本实施例对此不作任何限定。
在一个例子中,回收站内可以建立数据链表,回收文件的属性信息被添加到该数据链表中(按照回收文件回收的先后顺序,依次添加到该数据链表中)。
以上步骤101和步骤102即为回收步骤,用于将需要回收的文件回收至回收站内。
步骤103:判断是否有文件待写入磁盘;若是,则进入步骤104;若否,则结束。
具体而言,当有终端发送通过缓存服务器向源站发送访问请求,并且缓存服务器中不存在该访问请求对应的资源时,缓存服务器将该访问请求发送至源站,并接收源站反馈的该访问请求对应的资源,缓存服务器需要把资源先写入缓存服务器的磁盘中,然后再把该资源发送至终端。此时,缓存服务器判断出有文件待写入磁盘。其中,这里的资源即理解为本实施例中所述的文件
步骤104:判断回收站内是否存在至少一回收文件。若是,则进入步骤105;若否,则进入步骤107。
具体而言,当有文件待写入磁盘时,缓存服务器会优先考虑使用回收站中的回收文件。当回收站内存在至少一回收文件时(表示回收站不为空),缓存服务器从回收站中选定一个回收文件(即进入步骤105);当回收站内部存在至少一回收文件时(表示回收站为空),缓存服务器创建一个新文件(即进入步骤106)。
步骤105:从回收站中选定一个回收文件。
步骤106:将待写入文件以覆盖方式写入选定的回收文件。
具体而言,本实施例中,回收文件的属性信息中包含该回收文件的物理位置;缓存服务器从回收文件的属性信息中获取该回收文件的物理位置,并将待写入文件写入到选定的回收文件的物理位置,且覆盖该回收文件原来的数据;即实现磁盘覆盖写。
本实施例中,步骤106具体包括:若判断出选定的回收文件的文件大小小于待写入文件的文件大小,则将选定的回收文件的文件大小扩展至与待写入文件的文件大小相同;将待写 入文件以覆盖方式写入扩展后的回收文件中。
即,当选定的回收文件的文件大小小于待写入文件的文件大小时,首先会对选定的回收文件的文件大小进行扩展,使得选定的回收文件的文件大小与待写入文件的文件大小相同(扩展部分为磁盘中尚未被使用的空间);然后再将待写入文件以覆盖方式写入扩展后的回收文件中,其中,待写入文件的一部分覆盖该回收文件,另一部分写在扩展部分。
其中,选定的该回收文件已经被成功覆盖写(这个回收文件的物理位置上已经写入了新的内容)后,文件回收标志位被置为0,表示该回收文件变为普通文件(即未被回收,可被应用层访问),缓存服务器会根据该待写入文件的属性信息更新选定的该回收文件的属性信息(文件名称、文件大小、物理位置等);并且将选定的该回收文件的属性信息从该回收站中删除(即此时回收站少了一个回收文件,但是磁盘中多了一个可被应用层访问的文件)。
以上步骤103至步骤106即为覆盖写步骤,用于将待写入文件以覆盖方式写入选定的回收文件中。
步骤107:创建一个新文件,并将待写入文件写入新文件中。
即,当回收站内不存在回收文件时(表示回收站为空),此时创建一个新文件,并将待写入文件写入新文件中。
需要说明的是,回收步骤(步骤101至步骤102)和覆盖写步骤(步骤103至步骤106)是两个并行执行的步骤,不存在先后顺序,上述步骤编号只是为了方便说明。
进一步的,在步骤101和步骤102之间,还可以包含如下步骤:判断该回收文件的文件大小是否满足该回收站的单文件空间阈值的要求(单文件空间阈值例如可以包括最大阈值和最小阈值,该回收文件的文件大小介于最大阈值和最小阈值之间表示满足要求);如果满足要求,则可以进行回收(即进入步骤102);如果不满足要求,则无法进行回收(可以直接将该文件放置到预先建立的删除站中)。进一步的,在步骤101和步骤102之间,还可以包含:判断回收站内回收文件的当前总数是否超过预设的回收文件总数阈值;如果没有超过,则可以进行回收(即进入步骤102);如果不是,则无法进行回收。其中,对该回收文件的文件大小的判断和对回收文件的当前总数的判断的先后顺序不作任何限制。
进一步的,在回收步骤和/或所述覆盖写步骤之后,还包含:更新回收站的属性信息;回收站的属性信息至少包含回收文件的当前总数、回收文件总数阈值。其中,回收站的属性信息还可以包含总文件大小、单文件空间阈值等。因此,上述步骤中可以从回收站的属性信息中获取单文件空间阈值、回收文件的当前总数,以进行判断。
其中,该回收站的单文件空间阈值、回收文件总数阈值都可以在回收站初始化时进行配 置(***自己设定或者用户预先设定)。预先设定单文件空间阈值和回收文件总数阈值,可以避免由于回收文件过大或者回收站中回收文件过多而可能导致的读写错误的问题。
进一步的,缓存服务器内部还可以有一个表征文件回收功能是否可用的标志参数,用户可以预先设定该标志参数的状态值,以表征是否开启文件回收功能;若判定该标志参数的状态值为开启,则表示开启文件回收功能,即缓存服务器可以执行本发明实施例所述的文件处理方法,即回收步骤和覆盖写步骤均是在文件回收功能被开启时开始被执行;若判定该标志参数的状态值为关闭,表示关闭文件回收功能。其中,回收站的属性信息可以在检测到文件回收功能被开启时被配置(可以是在缓存服务器开机初始化对文件回收功能进行检测或者开机后进行实时检测)。
另外,本实施例中的回收站的信息是存储在服务器的内存中的;当服务器重启时,需要重新构建该回收站。在一个例子中,服务器重启时,会对磁盘中每个文件的文件回收标志位进行判断,如果文件回收标志位为1,表示该文件是回收文件,则将该回收文件的属性信息添加到回收站;如果文件回收标志位为0,表示该文件是普通文件。需要说明的是,本实施例对文件回收标志位的不同取值所表示的文件状态不作任何限制,例如也可以设定为,文件回收标志位为1时,表示该文件是普通文件,该文件回收标志位为0时,表示该文件为回收文件。进一步的,还可以先判断服务器的文件回收功能是否开启;若开启,则重新构建该回收站;并且,还可以在将回收文件重新放入回收站之前,先判断该回收文件的文件大小是否满足该回收站的单文件空间阈值的要求,和/或判断回收站内回收文件的当前总数是否超过预设的回收文件总数阈值,然后根据判断结果决定是否要将该回收文件重新放入回收站。
本发明的第二实施方式涉及一种文件处理方法。第二实施方式与第一实施方式大致相同,主要改进之处在于:本发明第二实施方式中提供了从回收站中选定一个回收文件的一种具体方式。
如图2所示为第二实施例的文件处理方法的流程图。其中,步骤201~204、步骤207~208与第一实施例中的步骤101~107大致相同,此处不再赘述;不同之处在于:
步骤205:判断回收站内是否存在至少一个满足预设条件的回收文件。
步骤206:从回收站中选定一个回收文件,具体为:从满足预设条件的回收文件中选定一个回收文件。
其中,预设条件为:回收文件的文件大小小于或等于待写入文件的文件大小。缓存服务器会判断回收站中是否存在至少一个回收文件,其文件大小小于或等于待写入文件的文件大小;如果存在,则从满足预设条件的回收文件中选定一个回收文件。
第二实施例中相对于第一实施例而言,提供了一种选定一个回收文件的具体方法,要求选定的回收文件的文件大小小于或等于待写入文件的文件大小;从而,待写入文件可以完全覆盖选定的回收文件,即回收文件不会存在剩余空间没有被覆盖到,从而避免了回收文件中存在剩余空间被浪费掉(当磁盘中的文件采用分段方式缓存时,待写入文件写入回收文件后,如果回收文件中存在剩余空间没有被覆盖,***不会对该剩余空间进行自动回收利用,因此,如果选定的回收文件的文件大小大于待写入文件的文件大小,则回收文件中没有被覆盖的剩余空间将会被浪费掉)。
较佳的,预设条件可以包括第一预设条件和第二预设条件,第一预设条件为:回收文件的文件大小等于待写入文件的文件大小,第二预设条件为:回收文件的文件大小小于待写入文件的文件大小。缓存服务器可以先判断回收文件的文件大小是否满足第一预设条件,若满足第一预设条件,则从满足第一预设条件的回收文件中选定一个回收文件;若不满足第一预设条件,再判断回收文件的文件大小是否满足第二预设条件;若满足第二预设条件,则从满足第二预设条件的回收文件中选定一个回收文件;若不满足第二预设条件,则表示不存在可以重复利用的回收文件,此时进入步骤208。其中,当从满足第二预设条件的回收文件中选定一个回收文件时,可以计算该待写入文件的文件大小和各满足第二预设条件的回收文件的文件大小的差值,并选定最小差值对应的回收文件进行覆盖写(即选定与该待写入文件的文件大小最接近的回收文件进行覆盖写)。这种方式可以进一步有效地利用回收站中的回收文件,从而进一步降低磁盘利用率。其中,步骤106中所述的扩展部分即为待写入文件的文件大小与选定的回收文件的文件大小的差值。
本发明的第三实施方式涉及一种文件处理方法。第三实施方式与第二实施方式大致相同,主要改进之处在于:本发明第三实施方式中提供了从回收站中选定一个回收文件的另一种具体方式。
如图3所示为第三实施例的文件处理方法的流程图。其中,步骤301~306、步骤309~310与第二实施例中的步骤201~208大致相同,此处不再赘述;不同之处在于:
当步骤305的判断结果为否时,进入步骤307:获取磁盘的当前利用率,并判断当前利用率是否小于预设的利用率阈值;若是,则进入步骤310;若否,则进入步骤308。
步骤308:从回收站内的回收文件中选定一个回收文件;然后进入步骤309。
本实施例中,磁盘的当前利用率为:(可供应用层访问的文件的总文件大小+回收站中回收文件的总文件大小)/磁盘总空间;缓存服务器会定时计算磁盘的当前利用率;其中,磁盘具有属性信息,且磁盘的属性信息至少包含当前利用率(可以实时更新)和利用率阈值(可 以预先设定)。
当步骤305的判断结果为否时,表示回收站内不存在满足预设条件的回收文件(即回收站内的各回收文件的文件大小均大于待写入文件的文件大小),此时如果磁盘的当前利用率小于磁盘的利用率阈值,表示磁盘的剩余空间还相对富余,此时进入步骤310(创建一个新文件);如果磁盘的当前利用率大于或等于磁盘的利用率阈值,表示磁盘的剩余空间相对较小,磁盘负荷较满,此时进入步骤308,即只能从大于待写入文件的文件大小的回收文件中选定一个回收文件进行覆盖写,虽然可能有部分空间会被浪费掉,但是至少不会提高磁盘的当前利用率。其中,从大于待写入文件的文件大小的回收文件中选定一个回收文件,可以选择与待写入文件的文件大小最接近的回收文件,即可以计算该待写入文件的文件大小和各回收文件(各回收文件的文件大小均大于待写入文件的文件大小)的文件大小的差值,并选定最小差值对应的回收文件进行覆盖写;从而可以尽可能少地浪费磁盘空间。
本发明的第四实施方式涉及一种文件处理方法。第四实施方式与第一实施方式大致相同,主要细化之处在于:本发明第四实施方式中,提供了将回收文件放入回收站以及从回收站选定回收文件进行覆盖写的一种具体方式。
如图4所示为第四实施例的文件处理方法的流程图。其中,步骤401、步骤403~404、步骤406~407与第二实施例中的步骤201、步骤203~204、步骤206~207大致相同,此处不再赘述;不同之处在于:
步骤402,将待回收文件添加到预先建立的回收站内,具体包括:
子步骤4021:利用桶排序算法对待回收文件的文件大小进行计算,并得到待回收文件对应的桶;
子步骤4022:将待回收文件添加到回收文件对应的桶内。
具体而言,缓存服务器会预先配置回收站内回收文件的文件大小阈值,并按照预设的桶排序算法计算出回收站中的桶个数,然后创建并初始化每个桶下挂的文件回收链表,并配置桶索引(即桶序号)的最大值和最小值、每个桶的最大文件大小和最大文件数、统计每个桶的当前文件大小和当前文件数等等,这些都可以在回收站初始化时完成。其中,桶排序算法可以采用store_ow_gb_get_b函数的算法来进行计算,然本实施例不限于此。
具体而言,以待写入文件的文件大小为参数,利用预设的桶排序算法计算出待写入文件对应的桶索引,然后将待回收文件的属性信息添加到该桶索引对应的桶中,待回收文件被添加到回收站的桶内后变为回收文件(回收文件无法被应用层)。
其中,在第一实施例中所述提到的当服务器重启时,需要重新构建该回收站的例子中, 在把回收文件重新放入回收站时,也可以采用步骤402所述的桶排序算法的方式。
步骤405,从回收站中选定一个回收文件,具体包括:
子步骤4051:利用桶排序算法对待写入文件的文件大小进行计算,并得到待写入文件对应的桶;
子步骤4052:从待写入文件对应的桶中选定一个回收文件。
采用桶排序算法对文件进行回收,可以使得回收站中的回收文件按照文件大小的大小顺序进行排列;对应的,采用相同的桶排序算法选定合适的回收文件进行覆盖写,可以使得后续覆盖写时更加快捷地选定出回收文件;即,由于各桶是按照预设顺序(可容纳单个文件大小由小到大、或者由大到小的顺序)排列的,因此,可以使得后续快速查找到合适的回收文件进行覆盖写。需要说明的是,本实施例中,回收步骤和覆盖写步骤中都采用了桶排序算法,然不限于此,即使仅仅是回收步骤采用桶排序算法而覆盖写步骤只采用依次进行比较的方式选定回收文件,也可以在一定程度上提高选定回收文件的速度。
需要说明的是,第四实施例也可以是在第二或第三实施例基础上作出的改进。
本发明的第五实施方式涉及一种文件处理方法。第五实施方式与第一实施方式大致相同,主要区别之处在于:本发明第五实施方式中,该方法还包含磁盘检测步骤。
如图5所示为第五实施例的文件处理方法的流程图。其中,步骤501~507与第一实施例中的步骤101~107大致相同,此处不再赘述;不同之处在于,还包括磁盘检测步骤,且磁盘检测步骤具体包括:
步骤508:获取回收站内回收文件的当前总数、预设的删除站中待删除文件的当前总数、当前时间以及磁盘的当前利用率。
本实施例中,缓存服务器内预设有删除站,删除站用于存放要删除的文件。具体而言,为了降低高峰时段的磁盘IO,缓存服务器采用异步删除机制;即,选定一天中网络流量较小的一个时间段作为清理时段(例如凌晨时段,此时间段网络访问流量相对较小),将缓存文件的删除集中在该清理时段。在非清理时段(即一天中清理时段以外的时段)中,如果检测到有文件需要删除且磁盘属于健康状态时(磁盘属于健康状态,指磁盘的当前利用率小于预设的利用率阈值),则可以先将文件放入删除站,以得到该清理时段再进行删除。其中,被放入删除站中的文件为待删除文件,其不可被应用层访问;另外,待删除文件也可以有该待删除文件的属性信息唯一表征,即将待删除文件的属性信息放在删除站中。需要说明的是,上述应用场景也适用于第一至第四实施例中的文件处理方法,并且,尤其是当缓存服务器采用异步删除机制时,清理时段的磁盘IO负载较高(因为集中在同一时段删除大量文件),本发明 各实施例的文件处理方法可以有效减少删除站中待删除文件的数量,从而可以有效降低清理时段的磁盘IO负载,提高清理时段的缓存服务性能。
步骤509:根据回收文件的当前总数、待删除文件的当前总数、当前时间以及磁盘的当前利用率判断磁盘是否满足预设的磁盘清理条件;若不满足,则进入步骤510;若满足,则进入步骤511。
步骤510:设定一磁盘检测周期,并根据该磁盘检测周期执行磁盘检测步骤;即,设定一磁盘检测周期,并等待该磁盘检测周期后,重新开始磁盘检测步骤。
步骤511:进行磁盘清理,并根据磁盘检测周期执行磁盘检测步骤;即,设定一磁盘检测周期,并等待该磁盘检测周期后,重新开始磁盘检测步骤。
本实施例中,磁盘清理条件包括:
条件(1),当前时间属于清理时段,且待删除文件的当前总数不为零;或者,
条件(2),当前时间不属于清理时段,磁盘的当前利用率大于或等于利用率阈值,且待删除文件的当前总数不为零;或者,
条件(3),当前时间不属于清理时段,回收文件的当前总数大于或等于回收文件总数阈值,且待删除文件的当前总数不为零。
本实施例对磁盘清理条件不作任何限定,本领域技术人员可以根据需要进行设定。
在一个例子中,如图6所示,步骤509可以包含以下子步骤:
子步骤5091:判断回收文件的当前总数和待删除文件的当前总数是否都为零;若是,则进入步骤510;若否,则进入子步骤5092。
子步骤5092:判断当前时间是否属于清理时段;若否,则进入子步骤5093;若是,则进入子步骤5094。
子步骤5093:判断是否满足如下条件:磁盘的当前利用率大于或等于利用率阈值,或者回收文件的当前总数大于或等于回收文件总数阈值;若是,则进入步骤5094;若否,则进入步骤511。
子步骤5094:判断待删除文件的当前总数是否为零;若是,则进入步骤510;若否,则进入步骤511。
需要说明的是,当回收文件的当前总数是否大于或等于回收文件总数阈值时,应用层检测到有文件待回收时,无法将文件放入回收站,此时会直接将文件放入删除站。因此,当满足上述条件(3)时,步骤511中删除的文件可能是删除站中原来就有的待删除文件(从回收站中移过去的),也可能是由应用层直接放入删除站的待删除文件。
较佳的,步骤510中设定磁盘检测周期时,可以根据磁盘的不同状态,将磁盘检测周期设定为不同值;例如:
状态(1),在回收文件的当前总数和待删除文件的当前总数都为零(即子步骤5091的判断结果为是)的情况下,磁盘检测周期可以设定的相对大一点,例如为10秒;
状态(2),在非清理时段,磁盘的当前利用率小于利用率阈值(即磁盘健康),且回收文件的当前总数小于回收文件总数阈值的情况下,磁盘检测周期可以设定的相对小一点,例如为5秒;
本实施例对上述状态以及对应的磁盘检测周期的设定值不作任何限定,以上仅为举例说明,本领域技术人员可以根据需要进行设定。
进一步的,在清理磁盘时,还可以根据待删除文件的状况更新所述磁盘检测周期;即,步骤511具体可以包含:判断待删除文件的当前总数和当前总文件大小是否满足预设的检测周期更新条件;若是,更新磁盘检测周期,并在清理完成后按照更新后的磁盘检测周期执行磁盘检测步骤;若否,在清理完成后根据磁盘检测周期执行磁盘检测步骤。
其中,检测周期更新条件包括待删除文件的当前总文件大小大于预设的单次清理的文件大小阈值;或者,待删除文件的当前总数大于预设的单次清理的文件总数阈值。即,当满足该检测周期更新条件时,表示在执行一次磁盘清理无法清理掉删除站中的所有待删除文件,则需要再完成一次清理后尽快再次检测磁盘情况。
较佳的,在更新磁盘检测周期时,根据不同情况,可以将磁盘检测周期更新为不同值。例如,在待删除文件的当前总文件大小大于预设的单次清理的文件大小阈值的情况下,可以将磁盘检测周期可以更新为较小一点的值,例如为2秒;在待删除文件的当前总数大于预设的单次清理的文件总数阈值的情况下,可以将磁盘检测周期可以更新为更小一点的值,例如为1秒。
本实施例对上述磁盘的检测周期更新条件和磁盘检测周期更新后的值不作任何限定,以上仅为举例说明,本领域技术人员可以根据需要进行设定。
其中,磁盘检测步骤、回收步骤、覆盖写步骤为并行执行;图中的步骤编号仅仅是示例性说明,对执行顺序不作限制。磁盘检测步骤可以被设定为在文件回收功能被启动时开始执行。
需要说明的是,第五实施例也可以是在第二、或第三、或第四实施例基础上作出的改进。
上面各种方法的步骤划分,只是为了描述清楚,实现时可以合并为一个步骤或者对某些步骤进行拆分,分解为多个步骤,只要包括相同的逻辑关系,都在本专利的保护范围内;对 算法中或者流程中添加无关紧要的修改或者引入无关紧要的设计,但不改变其算法和流程的核心设计都在该专利的保护范围内。
本发明第六实施方式涉及一种服务器,如图7所示,包括:
至少一个处理器701;
与所述至少一个处理器通信连接的至少一磁盘702,所述磁盘用于存放文件;以及,
与所述至少一个处理器通信连接的存储器703;其中,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述任一实施例所述的文件处理方法。
其中,存储器和处理器采用总线方式连接,总线可以包括任意数量的互联的总线和桥,总线将一个或多个处理器和存储器的各种电路连接在一起。总线还可以将诸如***设备、稳压器和功率管理电路等之类的各种其他电路连接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的单元。经处理器处理的数据通过天线在无线介质上进行传输,进一步,天线还接收数据并将数据传送给处理器。
处理器负责管理总线和通常的处理,还可以提供各种功能,包括定时,***接口,电压调节、电源管理以及其他控制功能。而存储器可以被用于存储处理器在执行操作时所使用的数据。
本发明第七实施方式涉及一种计算机可读存储介质,存储有计算机程序。计算机程序被处理器执行时实现上述方法实施例。
即,本领域技术人员可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
本领域的普通技术人员可以理解,上述各实施方式是实现本发明的具体实施例,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本发明的精神和范围。

Claims (14)

  1. 一种文件处理方法,其特征在于,包括回收步骤和覆盖写步骤;
    所述回收步骤包括:
    当磁盘中有文件待回收时,将待回收文件添加到预先建立的回收站内,所述待回收文件变为回收文件;
    所述覆盖写步骤包括:
    当有文件待写入所述磁盘时,判断所述回收站内是否存在至少一回收文件;
    当判断出所述回收站内存在至少一回收文件时,从所述回收站中选定一个回收文件;
    将待写入文件以覆盖方式写入选定的所述回收文件。
  2. 根据权利要求1所述的文件处理方法,其特征在于,在所述从所述回收站中选定一个回收文件之前,还包括:
    判断所述回收站内是否存在至少一个满足预设条件的回收文件;所述预设条件为:所述回收文件的文件大小小于或等于所述待写入文件的文件大小;
    若判断出存在满足所述预设条件的回收文件,则进入所述从所述回收站中选定一个回收文件的步骤,且所述从所述回收站中选定一个回收文件具体为:从满足所述预设条件的回收文件中选定一个回收文件。
  3. 根据权利要求2所述的文件处理方法,其特征在于,所述从满足所述预设条件的回收文件中选定一个回收文件,具体为:
    从各满足所述预设条件的回收文件中选定一个与所述待写入文件的文件大小最接近的回收文件。
  4. 根据权利要求2所述的文件处理方法,其特征在于,若判断出不存在满足所述预设条件的回收文件,或者,若判断出所述回收站内不存在回收文件,则创建一个新文件,并将所述待写入文件写入所述新文件中。
  5. 根据权利要求4所述的文件处理方法,其特征在于,当判断出不存在满足所述预设条件的回收文件时,且在所述创建一个新文件,并将所述待写入文件写入所述新文件中之前,还包括:
    获取所述磁盘的当前利用率,并判断所述当前利用率是否小于预设的利用率阈值;若是,则进入所述创建一个新文件,并将所述待写入文件写入所述新文件中的步骤;若否,则从所述回收站内的所述回收文件中选定一个回收文件。
  6. 根据权利要求1所述的文件处理方法,其特征在于,所述回收站中包含基于桶排序算法预先创建的多个桶;
    所述将待回收文件添加到预先建立的回收站内,具体包括:
    利用所述桶排序算法对所述待回收文件的文件大小进行计算,并得到所述待回收文件对应的桶;
    将所述待回收文件添加到所述回收文件对应的桶内。
  7. 根据权利要求1所述的文件处理方法,其特征在于,所述将所述待写入文件以覆盖方式写入选定的所述回收文件,具体包括:
    若判断出选定的所述回收文件的文件大小小于所述待写入文件的文件大小,则将选定的所述回收文件的文件大小扩展至与所述待写入文件的文件大小相同;
    将所述待写入文件以覆盖方式写入扩展后的所述回收文件中。
  8. 根据权利要求1所述的文件处理方法,其特征在于,所述方法还包括磁盘检测步骤;
    所述磁盘检测步骤包括:
    获取所述回收站内所述回收文件的当前总数、预设的删除站内待删除文件的当前总数、当前时间以及所述磁盘的当前利用率;
    根据所述回收文件的当前总数、所述待删除文件的当前总数、所述当前时间以及所述磁盘的当前利用率判断所述磁盘是否满足预设的磁盘清理条件;
    若不满足预设的磁盘清理条件,则设定一磁盘检测周期,并根据所述磁盘检测周期执行所述磁盘检测步骤;
    若满足预设的磁盘清理条件,则进行磁盘清理,并根据所述磁盘检测周期执行所述磁盘检测步骤。
  9. 根据权利要求8所述的文件处理方法,其特征在于,所述磁盘清理条件包括:
    所述当前时间属于预设的清理时段,且所述待删除文件的当前总数不为零;或者,
    所述当前时间不属于所述清理时段,所述磁盘的当前利用率大于或等于预设的利用率阈值,且所述待删除文件的当前总数不为零;或者,
    所述当前时间不属于清理时段,所述回收文件的当前总数大于或等于预设的回收文件总数阈值,且所述待删除文件的当前总数不为零。
  10. 根据权利要求8所述的文件处理方法,其特征在于,所述方法还包括:若满足预设的磁盘清理条件,且在所述进行磁盘清理之前,还包括:
    判断所述待删除文件的当前总数和当前总文件大小是否满足预设的检测周期更新条件; 若是,则更新所述磁盘检测周期,并在清理完成后按照更新后的所述磁盘检测周期执行所述磁盘检测步骤;若否,则在清理完成后根据所述磁盘检测周期执行所述磁盘检测步骤。
  11. 根据权利要求10所述的文件处理方法,其特征在于,所述检测周期更新条件包括:
    所述待删除文件的当前总文件大小大于预设的单次清理的文件大小阈值;或者,
    所述待删除文件的当前总数大于预设的单次清理的文件总数阈值。
  12. 根据权利要求1至11中任一项所述的文件处理方法,其特征在于,在所述回收步骤和/或所述覆盖写步骤之后,还包含:
    更新所述回收站的属性信息;所述回收站的属性信息至少包含所述回收文件的当前总数、回收文件总数阈值。
  13. 一种服务器,其特征在于,包括:
    至少一个处理器;
    与所述至少一个处理器通信连接的至少一磁盘,所述磁盘用于存放文件;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如权利要求1至12中任一所述的文件处理方法。
  14. 一种计算机可读存储介质,存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至12中任一项所述的文件处理方法。
PCT/CN2018/081556 2018-03-19 2018-04-02 文件处理方法及服务器 WO2019178890A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US16/082,682 US20200311026A1 (en) 2018-03-19 2018-04-02 File processing method and server
EP18796818.5A EP3564826A1 (en) 2018-03-19 2018-04-02 File processing method and server

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810226228.0 2018-03-19
CN201810226228.0A CN108595503A (zh) 2018-03-19 2018-03-19 文件处理方法及服务器

Publications (1)

Publication Number Publication Date
WO2019178890A1 true WO2019178890A1 (zh) 2019-09-26

Family

ID=63626629

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/081556 WO2019178890A1 (zh) 2018-03-19 2018-04-02 文件处理方法及服务器

Country Status (4)

Country Link
US (1) US20200311026A1 (zh)
EP (1) EP3564826A1 (zh)
CN (1) CN108595503A (zh)
WO (1) WO2019178890A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111708736A (zh) * 2020-05-21 2020-09-25 四川虹美智能科技有限公司 数据文件处理方法及安卓***文件管理装置
US20220100878A1 (en) * 2020-09-25 2022-03-31 EMC IP Holding Company LLC Facilitating an object protocol based access of data within a multiprotocol environment

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109614385B (zh) * 2018-12-11 2022-06-10 浪潮电子信息产业股份有限公司 一种文件更新方法、装置、设备及可读存储介质
CN109710188B (zh) * 2018-12-24 2023-01-03 武汉烽火众智数字技术有限责任公司 一种磁盘数据管理方法、装置、设备及可读存储介质
CN111949605B (zh) * 2019-05-15 2024-07-19 伊姆西Ip控股有限责任公司 用于实现文件***的方法、设备和计算机程序产品
CN111176571A (zh) * 2019-12-27 2020-05-19 浪潮电子信息产业股份有限公司 一种本地对象的管理方法、装置、设备及介质
US11567900B1 (en) * 2021-07-23 2023-01-31 Databricks, Inc. Scaling delta table optimize command
CN116627352B (zh) * 2023-06-19 2024-03-08 深圳市青葡萄科技有限公司 一种分布式存储器下的数据管理方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130262395A1 (en) * 2012-04-03 2013-10-03 Baloota Application Ltd. Apparatus and methods for restoring data objects
CN103460197A (zh) * 2011-09-21 2013-12-18 株式会社日立制作所 计算机***、文件管理方法以及元数据服务器
CN103473296A (zh) * 2013-09-04 2013-12-25 国云科技股份有限公司 一种适用于云计算的回收站机制及其***
CN103902468A (zh) * 2012-12-27 2014-07-02 华为技术有限公司 存储***的数据清除方法和装置
CN104156474A (zh) * 2014-08-25 2014-11-19 曙光信息产业股份有限公司 一种分布式文件***中文件的快速删除方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7246209B2 (en) * 2004-11-30 2007-07-17 Kabushiki Kaisha Toshiba System for secure erasing of files
WO2012149728A1 (zh) * 2011-09-06 2012-11-08 华为技术有限公司 一种数据删除方法及装置
CN103474087B (zh) * 2013-09-06 2016-10-05 南京南自信息技术有限公司 一种简单防止磁盘碎片产生录像文件的管理方法
CN106407465A (zh) * 2016-10-14 2017-02-15 郑州云海信息技术有限公司 一种基于分布式文件***的文件删除方法和***

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103460197A (zh) * 2011-09-21 2013-12-18 株式会社日立制作所 计算机***、文件管理方法以及元数据服务器
US20130262395A1 (en) * 2012-04-03 2013-10-03 Baloota Application Ltd. Apparatus and methods for restoring data objects
CN103902468A (zh) * 2012-12-27 2014-07-02 华为技术有限公司 存储***的数据清除方法和装置
CN103473296A (zh) * 2013-09-04 2013-12-25 国云科技股份有限公司 一种适用于云计算的回收站机制及其***
CN104156474A (zh) * 2014-08-25 2014-11-19 曙光信息产业股份有限公司 一种分布式文件***中文件的快速删除方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3564826A4 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111708736A (zh) * 2020-05-21 2020-09-25 四川虹美智能科技有限公司 数据文件处理方法及安卓***文件管理装置
CN111708736B (zh) * 2020-05-21 2023-06-23 四川虹美智能科技有限公司 数据文件处理方法及安卓***文件管理装置
US20220100878A1 (en) * 2020-09-25 2022-03-31 EMC IP Holding Company LLC Facilitating an object protocol based access of data within a multiprotocol environment
US11928228B2 (en) * 2020-09-25 2024-03-12 EMC IP Holding Company LLC Facilitating an object protocol based access of data within a multiprotocol environment

Also Published As

Publication number Publication date
EP3564826A4 (en) 2019-11-06
CN108595503A (zh) 2018-09-28
US20200311026A1 (en) 2020-10-01
EP3564826A1 (en) 2019-11-06

Similar Documents

Publication Publication Date Title
WO2019178890A1 (zh) 文件处理方法及服务器
US11275763B2 (en) Storage constrained synchronization of shared content items
US10831715B2 (en) Selective downloading of shared content items in a constrained synchronization system
US11099937B2 (en) Implementing clone snapshots in a distributed storage system
US10360235B2 (en) Storage constrained synchronization engine
US9442997B2 (en) Idle state triggered constrained synchronization of shared content items
US6629109B1 (en) System and method of enabling file revision management of application software
US8392479B1 (en) Method and apparatus for optimizing storage space allocation for computer data
US9413824B1 (en) Storage constrained synchronization of content items based on predicted user access to shared content items using retention scoring
EP2899625A1 (en) Method for adaptively managing a solid state drive, and associated apparatus and associated computer program product
AU2017204647B2 (en) Storage constrained synchronization of shared content items
JP2020017282A (ja) ストレージ制約付きの同期エンジン
CN115525221A (zh) 一种数据更新方法、装置、设备及介质
CN113590027B (zh) 数据存储方法、数据获取方法、***、设备和介质
US11449389B2 (en) Techniques for performing incremental data backups
US11256434B2 (en) Data de-duplication
CN109284237B (zh) 一种全闪存储阵列中的垃圾回收方法及***
US11748203B2 (en) Multi-role application orchestration in a distributed storage system
CN114258532A (zh) 用于合并备份策略的设备和方法
JP6636623B2 (ja) 制約付き同期システムにおける共有コンテンツアイテムの選択的ダウンロード
CN114527935A (zh) 数据存储方法、装置、电子设备、介质及程序产品

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2018796818

Country of ref document: EP

Effective date: 20181116

NENP Non-entry into the national phase

Ref country code: DE