Directory processing method and device, equipment, medium and program product
Through a directory processing method, the problem of poor flexibility in setting and modifying non-empty directory quota in the prior art is solved, and flexible quota configuration for to-be-processed directories and subdirectories is realized, and system performance and response speed are improved.
Patent Information
- Application Number
- CN202411463797.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-02-07
AI Technical Summary
The prior art has poor flexibility when setting and modifying quotas for non-empty directories. In large file systems, the directory tree setting and management quotas are cumbersome, which may affect the entire directory tree structure and consume system resources.
Provide a directory processing method, by receiving processing requests, configuring the capacity limits of the historical root directory and the newly created directory based on capacity configuration information, and quota configurations for the to be processed directories and subdirectories to ensure quota harmony. The method also includes moving the pending directory, canceling the quota configuration, modifying the capacity limit, and improving system performance through asynchronous processing.
It improves the flexibility and efficiency of capacity limit configuration of the to-process directory, improves the system's response speed and interactive experience, and makes full use of multi-core processors and parallel processing capabilities through asynchronous processing, improving data processing efficiency and system performance.
Smart Images

Figure CN119396578A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and more specifically, to a directory processing method, apparatus, device, medium and program product. Background Art
[0002] The quota of a distributed file system is a mechanism for managing and limiting the use of storage resources in a file system. The purpose is to ensure that each user, group or directory in the system does not exceed the preset limit when using storage space, so as to ensure that the system resources can be fairly and reasonably allocated to different users or applications. By setting quotas for a distributed file system, you can effectively prevent users or programs from excessively occupying file system resources, help administrators better manage and plan file system resources, and improve system stability and reliability.
[0003] In the process of realizing the concept of the present disclosure, the inventors found that there are at least the following problems in the related art: the method of allocating quotas and modifying non-empty directories in the form of metadata is less flexible; in large file systems, even if quotas and modifications to non-empty directories can be implemented through a directory tree, since the directory tree setting and quota management are cumbersome, once the quota is changed, it may affect other parts of the entire directory tree structure, and consume system resources when operating large-scale files. Summary of the invention
[0004] In view of this, the present disclosure provides a directory processing method, apparatus, device, medium and program product.
[0005] One aspect of the present disclosure provides a directory processing method, including: receiving a processing request for a directory to be processed, wherein the processing request at least includes capacity configuration information of a historical root directory to which the directory to be processed belongs; configuring a first capacity limit of the historical root directory according to the capacity configuration information; and, while configuring a second capacity limit of a first newly created directory to be generated under the historical root directory, configuring a third capacity limit of the directory to be processed and a fourth capacity limit of a subdirectory to be processed under the directory to be processed, so that the sum of the second capacity limit and the third capacity limit does not exceed the first capacity limit.
[0006] According to an embodiment of the present disclosure, the directory processing method also includes: moving the directory to be processed from the historical root directory to the target directory; canceling the configuration of the third capacity limit for the directory to be processed; and while creating a new second directory to be generated under the directory to be processed, canceling the configuration of the fourth capacity limit for the sub-directory to be processed.
[0007] According to an embodiment of the present disclosure, the directory processing method also includes: modifying the third capacity limit of the directory to be processed to the target capacity limit; according to the target capacity limit, configuring the fifth capacity limit of the third newly created directory to be generated under the directory to be processed, and modifying the fourth capacity limit to the target capacity limit, so that the sum of the fifth capacity limit and the fourth capacity limit under the directory to be processed does not exceed the target capacity limit.
[0008] According to an embodiment of the present disclosure, after the third capacity limit of the directory to be processed is modified to the target capacity limit, the directory processing method also includes: establishing a modification relationship tree for modifying the directory to be processed from the third capacity limit to the target capacity limit; and determining, based on the modification relationship tree, to modify the third capacity limit of the directory to be processed to the target capacity limit.
[0009] According to an embodiment of the present disclosure, the directory processing method also includes: creating a quota file and a quota number corresponding to the quota file for each directory, wherein the quota file is used to record the capacity limit and used capacity of the directory; storing the quota number in the metadata of each directory to query the capacity limit and used capacity of each directory based on the quota number.
[0010] According to an embodiment of the present disclosure, the first capacity limit of the historical root directory is configured according to the capacity configuration information, including: summarizing the first total used capacity of the historical root directory according to the used capacity of each directory; when the first total used capacity is less than the first capacity limit, setting the first capacity limit to the total directory capacity of the historical root directory.
[0011] According to an embodiment of the present disclosure, the third capacity limit of the directory to be processed is modified to the target capacity limit, including: summarizing the second total used capacity of the directory to be processed according to the used capacity of each directory; when the second total used capacity is less than the target capacity limit, and the third total used capacity of other directories under the historical root directory except the directory to be processed is less than the difference between the first capacity limit and the target capacity limit, the third capacity limit of the directory to be processed is modified to the target capacity limit.
[0012] One aspect of the present disclosure provides a directory processing device, including: a receiving module, used to receive a processing request for a directory to be processed, wherein the processing request at least includes capacity configuration information of a historical root directory to which the directory to be processed belongs; a first configuration module, used to configure a first capacity limit of the historical root directory according to the capacity configuration information; and a second configuration module, used to configure a second capacity limit of a first newly created directory to be generated under the historical root directory, and at the same time, configure a third capacity limit of the directory to be processed and a fourth capacity limit of a subdirectory to be processed under the directory to be processed, so that the sum of the second capacity limit and the third capacity limit does not exceed the first capacity limit.
[0013] Another aspect of the present disclosure provides an electronic device, comprising:
[0014] One or more processors; a memory for storing one or more programs,
[0015] When one or more programs are executed by one or more processors, the one or more processors implement the above method.
[0016] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the above method when executed.
[0017] Another aspect of the present disclosure provides a computer program product, which includes computer executable instructions, and the instructions are used to implement the above method when executed.
[0018] According to an embodiment of the present disclosure, when a non-empty directory is detected, the second capacity limit of the directory to be processed can be quickly configured, so that users or programs that trigger operations can get initial feedback more quickly, thereby improving the response speed and interactive experience of the overall system. Furthermore, by utilizing a quota modification component, it is possible to asynchronously and independently process quotas of existing files (files to be processed) or existing directories (directories to be processed) of non-empty directories in the background. This can make full use of the system's multi-core processors and parallel processing capabilities, improve data processing efficiency and the overall performance of the system. As the system scale and data volume gradually increase, the asynchronous processing process can be more easily expanded. The concurrent processing capability can be improved by increasing the number of coordinated modification modules, etc., without significantly affecting the system's main thread and other tasks. This flexibility enables the system to better adapt to changing business needs and data growth. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0020] Figure 1 Schematically illustrates an exemplary system architecture 100 to which a directory processing method according to an embodiment of the present disclosure can be applied;
[0021] Figure 2 A flowchart of a directory processing method according to an embodiment of the present disclosure is schematically shown;
[0022] Figure 3 A schematic diagram schematically shows a non-empty directory quota method according to an embodiment of the present disclosure;
[0023] Figure 4A schematic diagram of a method for processing directory movement according to an embodiment of the present disclosure is schematically shown;
[0024] Figure 5 A schematic diagram of a method for modifying a pending directory quota according to an embodiment of the present disclosure is schematically shown;
[0025] Figure 6 The schematic diagram schematically shows the relationship between metadata and quota coding according to an embodiment of the present disclosure;
[0026] Figure 7 A block diagram schematically shows a directory processing device according to an embodiment of the present disclosure; and
[0027] Figure 8 A block diagram of an electronic device suitable for implementing the above-described directory identification method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0028] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0029] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0030] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0031] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0032] In the embodiments of the present disclosure, the collection, updating, analysis, processing, use, transmission, provision, disclosure, storage, etc. of the data involved (for example, including but not limited to user personal information) are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information and network security.
[0033] In the embodiments of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
[0034] When setting quotas for a directory of files through metadata extension fields, the quota information is associated with the metadata of the specific directory. When setting quotas for a non-empty directory, you need to consider the space occupied by the existing files and subdirectories in the directory. If the space occupied by these files and subdirectories exceeds the quota to be set, a conflict will occur. When moving a non-empty directory across directories, if a file or directory with quota attributes is moved to another quota directory, the quota setting of the new directory may be different from that of the original directory, resulting in confusion in quota management. The nesting of quota directories will increase the complexity of quota management. When there are nested quota directories, the quota relationship and inheritance between multiple directories need to be considered.
[0035] When setting quotas for directories of files through a directory tree, as the directory tree structure becomes more complex and hierarchical, setting and managing quotas for each directory becomes cumbersome, especially in large file systems. Once the quota is set, changing the quota may affect the relevant parts of the entire directory tree structure, which is not flexible enough. Real-time calculation and monitoring of space usage of each directory, especially in large-scale file operations, will consume more system resources.
[0036] In view of this, an embodiment of the present disclosure provides a directory processing method, including:
[0037] Receiving a processing request for a directory to be processed, wherein the processing request at least includes capacity configuration information of a historical root directory to which the directory to be processed belongs;
[0038] According to the capacity configuration information, configuring the first capacity limit of the historical root directory; and,
[0039] While configuring the second capacity limit of the first newly created directory to be generated under the historical root directory, the third capacity limit of the directory to be processed and the fourth capacity limit of the subdirectory to be processed under the directory to be processed are configured so that the sum of the second capacity limit and the third capacity limit does not exceed the first capacity limit.
[0040] Figure 1The exemplary system architecture 100 to which the directory processing method according to the embodiment of the present disclosure can be applied is schematically shown. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0041] like Figure 1 As shown, the system architecture 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0042] The user may use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software, etc. (only for example).
[0043] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0044] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0045] It should be noted that the directory identification method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the directory identification system provided in the embodiment of the present disclosure can generally be set in the server 105. The directory identification method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the directory identification system provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Alternatively, the directory identification method provided in the embodiment of the present disclosure can also be executed by the first terminal device 101, the second terminal device 102 or the third terminal device 103, or can also be executed by other terminal devices different from the first terminal device 101, the second terminal device 102 or the third terminal device 103. Accordingly, the directory identification system provided in the embodiment of the present disclosure may also be arranged in the first terminal device 101 , the second terminal device 102 or the third terminal device 103 , or in other terminal devices different from the first terminal device 101 , the second terminal device 102 or the third terminal device 103 .
[0046] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0047] Figure 2 The flowchart of the directory processing method according to the embodiment of the present disclosure is schematically shown. Figure 3 The following schematically shows a method for allocating quotas for non-empty directories according to an embodiment of the present disclosure. Figure 2 and Figure 3 Provide explanation.
[0048] like Figure 2 As shown, the directory processing method includes operations S210 to S230.
[0049] In operation S210, a processing request for a directory to be processed is received, wherein the processing request at least includes capacity configuration information of a historical root directory to which the directory to be processed belongs.
[0050] According to an embodiment of the present disclosure, the directory to be processed is a directory in the distributed file system that has no quota information yet, and a capacity quota configuration needs to be performed on it. Figure 3As shown, the to-be-processed directory may also be in the form of a to-be-processed file. That is, when it is necessary to configure a capacity quota for a non-empty directory, the capacity quota may be configured directly for the to-be-processed directory or for the to-be-processed file at the same time.
[0051] According to an embodiment of the present disclosure, capacity quota configuration is performed for a directory to be processed or a file to be processed according to a processing request for the directory to be processed.
[0052] Specifically, according to the processing request for the directory to be processed, it is determined whether the historical root directory to which the directory to be processed belongs is a non-empty directory containing subdirectories or files. When the historical root directory does not contain subdirectories and files, the capacity limit of the historical root directory is directly set, that is, the historical root directory quota. For example, the historical root directory limit is set to 50GB. When the historical root directory contains subdirectories and files, it is determined that the historical root directory is a non-empty directory, and the quota modification component in the distributed file system is actively notified to use the quota modification component to allocate quotas to the directory to be processed or the files to be processed. It is also possible to set a quota modification component to periodically identify whether there is a non-empty directory, so as to allocate quotas to the directory to be processed or the files to be processed according to the identification results.
[0053] According to an embodiment of the present disclosure, the capacity configuration information includes the size of the capacity quota of the historical root directory that is restricted from writing, for example, it may be 2MB, 50GB, 100GB, 1TB, etc.
[0054] In operation S220, a first capacity quota of the historical root directory is configured according to the capacity configuration information.
[0055] According to an embodiment of the present disclosure, the first capacity limit of the historical root directory is configured according to the capacity configuration information, so that the capacity of the historical root directory and all files and subdirectories under it cannot exceed the first capacity limit.
[0056] In operation S230, while configuring the second capacity limit of the first newly created directory to be generated under the historical root directory, the third capacity limit of the directory to be processed and the fourth capacity limit of the subdirectory to be processed under the directory to be processed are configured so that the sum of the second capacity limit and the third capacity limit does not exceed the first capacity limit. After configuring the first capacity limit of the historical root directory, the quota result can be returned to the client so that the read and write restrictions can be determined according to the quota information.
[0057] According to the embodiment of the present disclosure, after configuring the first capacity limit of the historical root directory, the second capacity limit of the first newly created directory to be generated under the historical root directory should be less than or equal to the first capacity limit of the historical root directory. At the same time, using the quota modification component, the third capacity limit of the existing to-be-processed files or to-be-processed directories is configured in the background at the same time, and if the to-be-processed directory also includes to-be-processed subdirectories or to-be-processed subfiles, etc., the capacity limits of the to-be-processed subfiles and to-be-processed subdirectories also need to be configured level by level.
[0058] According to an embodiment of the present disclosure, the second capacity limit and the third capacity limit may be the same or different. When the second capacity limit and the third capacity limit are the same, it may be sufficient to limit the sum of all file and directory capacities under the historical root directory to not exceed the first capacity limit, and the second capacity limit and the third capacity limit may be randomly allocated or evenly allocated. When the second capacity limit and the third capacity limit are different, the second capacity limit and the third capacity limit may be configured respectively according to specific work requirements or actual conditions.
[0059] According to an embodiment of the present disclosure, when a non-empty directory is detected, the second capacity quota of the directory to be processed can be quickly configured, so that users or programs that trigger operations can get initial feedback more quickly, thereby improving the response speed and interactive experience of the overall system. Furthermore, by utilizing a quota modification component, it is possible to asynchronously and independently process quotas of existing files (files to be processed) or existing directories (directories to be processed) of non-empty directories in the background. In this way, the multi-core processor and parallel processing capabilities of the system can be fully utilized to improve the efficiency of data processing and the overall performance of the system. As the system scale and data volume gradually increase, the asynchronous processing process implemented by the quota modification component can be more easily expanded. The concurrent processing capability can be improved by increasing the number of coordinated modification modules, etc., without significantly affecting the main thread and other tasks of the system. This flexibility enables the system to better adapt to changing business needs and data growth.
[0060] Figure 4 A schematic diagram of a method for processing directory movement according to an embodiment of the present disclosure is schematically shown.
[0061] According to the embodiment of the present disclosure, according to the processing request of the directory to be processed, it is determined whether the directory to be processed is a non-empty directory containing sub-directories. When the directory to be processed is an empty directory without sub-directories, or a file to be processed, the file to be processed or the directory to be processed can be directly moved. When the directory to be processed is a non-empty directory containing sub-directories or files, it is necessary to move the sub-directories under the directory to be processed. Specifically,
[0062] According to an embodiment of the present disclosure, the method for moving a directory to be processed or a file to be processed includes steps 21 to 23.
[0063] In step 21, the directory to be processed is moved from the historical root directory to the target directory.
[0064] According to the embodiments of the present disclosure, Figure 4 As shown, according to actual needs, for example, it is necessary to move infrequently used files or directories from the historical root directory to partially release the capacity of the historical root directory. In this case, it is necessary to move infrequently used files (directories to be processed or files to be processed) to the target directory without quota restrictions to achieve storage of the directories to be processed or files to be processed.
[0065] In step 22, the configuration of the third capacity quota for the directory to be processed is canceled.
[0066] According to an embodiment of the present disclosure, after the directory to be processed is moved from the historical root directory to the target directory, the marked quota information in the directory to be processed is deleted so that the directory to be processed has no quota restriction.
[0067] In step 23, while creating a second newly created directory to be generated under the directory to be processed, the configuration of the fourth capacity limit for the subdirectory to be processed is cancelled.
[0068] According to the embodiment of the present disclosure, after deleting the marked quota information in the pending directory, the second newly created directory to be generated under the pending directory will inherit the quota information of the pending directory, that is, the second newly created directory is also free of quota restrictions. At the same time, using the quota modification component, the third capacity quota deletion of the pending files or pending subdirectories with quota information under the pending directory is deleted in the background.
[0069] According to an embodiment of the present disclosure, when it is detected that the directory to be processed is not an empty directory, the directory to be processed is quickly moved, and the second capacity limit of the directory to be processed is configured according to the capacity limit information of the target directory. Exemplarily, when the target directory has no capacity limit, the directory to be processed is also configured to have no capacity limit. The modification result can be quickly returned to the client. Furthermore, while creating a new second directory under the directory to be processed, the third capacity limit of the files to be processed or the sub-directories to be processed can be asynchronously and independently deleted in the background by utilizing the quota modification component. In this way, the multi-core processor and parallel processing capabilities of the system can be fully utilized to improve the efficiency of data processing and the overall performance of the system.
[0070] Figure 5 A schematic diagram of a method for modifying a pending directory quota according to an embodiment of the present disclosure is schematically shown.
[0071] According to an embodiment of the present disclosure, according to a processing request for a directory to be processed, it is determined whether the directory to be processed is a non-empty directory containing subdirectories. When the directory to be processed is a non-empty directory containing subdirectories or files, modifying the quota information of the directory to be processed includes steps 31 and 32.
[0072] In step 31, the third capacity limit of the directory to be processed is modified to the target capacity limit.
[0073] According to an embodiment of the present disclosure, the third capacity quota of the directory to be processed is modified to the target capacity quota according to the target capacity quota information in the processing request, for example, the third capacity quota of 200 GB is modified to 500 GB. Figure 5 In the expression, q1 is changed to q2.
[0074] In step 32, according to the target capacity limit, the fifth capacity limit of the third newly created directory to be generated under the directory to be processed is configured, and the fourth capacity limit is modified to the target capacity limit, so that the sum of the fifth capacity limit and the fourth capacity limit under the directory to be processed does not exceed the target capacity limit.
[0075] According to the embodiment of the present disclosure, after the second capacity quota of the directory to be processed is modified, the modification result can be immediately returned to the client so as to determine the read and write restrictions in time according to the quota information. Afterwards, the third newly created directory to be generated under the directory to be processed will inherit the quota information of the directory to be processed, that is, the quota information of the third newly created directory is q2. At the same time, using the quota modification component, the third capacity limit of the files to be processed or the subdirectories to be processed with quota information under the directory to be processed is modified to q2 in the background.
[0076] According to an embodiment of the present disclosure, before step 31, the method further includes using a quota modification component to establish a modification relationship tree for modifying the to-be-processed directory from the third capacity limit to the target capacity limit.
[0077] According to an embodiment of the present disclosure, the modification relationship tree is used to represent the directional relationship of quota information modification, for example Figure 5 As shown in , the second capacity limit of the waiting-to-be-processed directory is changed from q1 to q2.
[0078] In step 42, according to the modification relationship tree, it is determined that the third capacity limit of the directory to be processed is modified to the target capacity limit.
[0079] Figure 6 The schematic diagram of the relationship between metadata and quota coding according to the embodiment of the present disclosure is schematically shown. According to the embodiment of the present disclosure, the directory processing method further includes step 41 and step 42.
[0080] In step 41, a quota file and a quota number corresponding to the quota file are created for each directory, wherein the quota file is used to record the capacity quota and used capacity of the directory.
[0081] According to the embodiments of the present disclosure, the metadata of the distributed file system is managed in slices, so that the subdirectories and files under a directory can be distributed on any slice; when creating a directory quota, a quota file for recording quota information is created for each slice; when the size or number of the directory or file recorded in the metadata on a slice changes, the used capacity in the quota file of the slice is updated synchronously, and the update of the metadata and the update of the quota file are transactional. Set a summary node, through which the quota modification component can regularly summarize the quota information on each slice, where the summarized used capacity is used as the capacity of the quota directory.
[0082] In step 42, the quota number is stored in the metadata of each directory, so that the capacity quota and used capacity of each directory can be queried according to the quota number.
[0083] According to the embodiments of the present disclosure, Figure 6 As shown in the figure, the quota file records the maximum number and capacity of files allowed in the directory to be processed. Each quota file has a unique quota code (such as q1 or q2, etc.), and the quota file can be quickly located through the quota code in the metadata. The quota file can be persisted to the following key-value storage or database. The quota code is recorded in the metadata of the quota file, such as Figure 6 As shown, when modifying a file, the file system client can obtain the quota information through the quota code and determine whether the operation is feasible by comparing the capacity limit value and the used capacity.
[0084] According to an embodiment of the present disclosure, operation S220 includes step 51 and step 52 .
[0085] In step 51, the first total used capacity of the historical root directory is summarized according to the used capacity of each directory;
[0086] In step 52, when the first used total capacity is less than the first capacity limit, the first capacity limit is set to the total directory capacity of the historical root directory.
[0087] For example, Figure 3 As shown, the quota information modification component is used to calculate the first total used capacity of all directories and files under the historical root directory.
[0088] For example: 20GB+30GB+50GB+130GB=230GB. If the first capacity limit is 250GB, the first capacity limit is set to the total capacity of the historical root directory, that is, the total capacity of the historical root directory is configured to be 250GB. If the first capacity limit is 200GB, since the total used capacity exceeds the first capacity limit, the quota cannot be configured for the non-empty directory.
[0089] According to an embodiment of the present disclosure, the third capacity quota of the to-be-processed directory is modified to a target capacity quota, including step 61 and step 62 .
[0090] In step 61, the second total used capacity of the directories to be processed is summarized according to the used capacity of each directory.
[0091] In step 62, when the second total used capacity is less than the target capacity limit, and the third total used capacity of other directories under the historical root directory except the directory to be processed is less than the difference between the first capacity limit and the target capacity limit, the third capacity limit of the directory to be processed is modified to the target capacity limit.
[0092] For example, Figure 5 As shown, the quota information modification component is used to calculate the second total used capacity of all directories and files under the directory to be processed.
[0093] For example: 2GB+3GB+13GB=18GB. If the target capacity limit is 50GB, the second total used capacity is less than the target capacity limit; the third total used capacity of the to-be-processed file q1 is 2GB, the first capacity limit is 100GB, the difference between the first capacity limit and the target capacity limit is 50GB, and the third total used capacity is less than the difference between the first capacity limit and the target capacity limit, then the third capacity limit of the to-be-processed directory can be modified to the target capacity limit, for example, to 50GB.
[0094] Figure 7 The block diagram of a directory processing device according to an embodiment of the present disclosure is schematically shown.
[0095] like Figure 7 As shown, the directory processing device 700 includes a receiving module 710 , a first configuration module 720 and a second configuration module 730 .
[0096] The receiving module 710 is used to receive a processing request for a directory to be processed, wherein the processing request at least includes the capacity configuration information of the historical root directory to which the directory to be processed belongs; the first configuration module 720 is used to configure the first capacity limit of the historical root directory according to the capacity configuration information; the second configuration module 730 is used to configure the second capacity limit of the first newly created directory to be generated under the historical root directory, and at the same time, configure the third capacity limit of the directory to be processed and the fourth capacity limit of the sub-directory to be processed under the directory to be processed, so that the sum of the second capacity limit and the third capacity limit does not exceed the first capacity limit.
[0097] According to an embodiment of the present disclosure, the directory processing device further includes: a moving module, a first canceling module and a second canceling module.
[0098] A moving module is used to move the directory to be processed from the historical root directory to the target directory; a first canceling module is used to cancel the configuration of the third capacity limit for the directory to be processed; a second canceling module is used to cancel the configuration of the fourth capacity limit for the sub-directory to be processed while creating a new second directory to be generated under the directory to be processed.
[0099] According to an embodiment of the present disclosure, the directory processing device further includes: a modification module and a third configuration module.
[0100] A modification module is used to modify the third capacity limit of the directory to be processed to the target capacity limit; a third configuration module is used to configure the fifth capacity limit of the third newly created directory to be generated under the directory to be processed according to the target capacity limit, and modify the fourth capacity limit to the target capacity limit, so that the sum of the fifth capacity limit and the fourth capacity limit under the directory to be processed does not exceed the target capacity limit.
[0101] According to an embodiment of the present disclosure, the directory processing device further includes: a establishing module and a determining module.
[0102] The establishment module is used to establish a modification relationship tree for modifying the to-be-processed directory from the third capacity limit to the target capacity limit; the determination module is used to determine to modify the third capacity limit of the to-be-processed directory to the target capacity limit based on the modification relationship tree.
[0103] According to an embodiment of the present disclosure, the directory processing device further includes: a creation module and a storage module.
[0104] A creation module is used to create a quota file and a quota number corresponding to the quota file for each directory, wherein the quota file is used to record the capacity limit and used capacity of the directory; a storage module is used to store the quota number in the metadata of each directory, so as to query the capacity limit and used capacity of each directory according to the quota number.
[0105] According to an embodiment of the present disclosure, the first configuration module 720 includes: a first summary submodule and a setting submodule.
[0106] The first summary submodule is used to summarize the first used total capacity of the historical root directory according to the used capacity of each directory; the setting submodule is used to set the first capacity limit as the total directory capacity of the historical root directory when the first used total capacity is less than the first capacity limit.
[0107] According to an embodiment of the present disclosure, the modification module includes: a second summarization submodule and a modification submodule.
[0108] The second aggregation submodule is used to summarize the second total used capacity of the directory to be processed according to the used capacity of each directory; the modification submodule is used to modify the third capacity limit of the directory to be processed to the target capacity limit when the second total used capacity is less than the target capacity limit and the third total used capacity of other directories under the historical root directory except the directory to be processed is less than the difference between the first capacity limit and the target capacity limit.
[0109] According to an embodiment of the present disclosure, when a non-empty directory is detected, the second capacity quota of the directory to be processed can be quickly configured, so that users or programs that trigger operations can get initial feedback more quickly, thereby improving the response speed and interactive experience of the overall system. Furthermore, by utilizing a quota modification component, it is possible to asynchronously and independently process quotas of existing files (files to be processed) or existing directories (directories to be processed) of non-empty directories in the background. In this way, the multi-core processor and parallel processing capabilities of the system can be fully utilized to improve the efficiency of data processing and the overall performance of the system. As the system scale and data volume gradually increase, the asynchronous processing process implemented by the quota modification component can be more easily expanded. The concurrent processing capability can be improved by increasing the number of coordinated modification modules, etc., without significantly affecting the main thread and other tasks of the system. This flexibility enables the system to better adapt to changing business needs and data growth.
[0110] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging circuits, or can be implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.
[0111] For example, any multiple of the receiving module 710, the first configuration module 720, and the second configuration module 730 can be combined in one module / unit / sub-unit for implementation, or any one of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more of these modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to an embodiment of the present disclosure, at least one of the receiving module 710, the first configuration module 720, and the second configuration module 730 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, at least one of the receiving module 710 , the first configuration module 720 , and the second configuration module 730 may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be performed.
[0112] Figure 8 A block diagram of an electronic device suitable for implementing the above-described directory identification method according to an embodiment of the present disclosure is schematically shown.
[0113] Figure 8 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0114] like Figure 8 As shown, the electronic device 800 according to an embodiment of the present disclosure includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 to a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a dedicated microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include an onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0115] In RAM 803, various programs and data required for the operation of electronic device 800 are stored. Processor 801, ROM 802 and RAM 803 are connected to each other via bus 809. Processor 801 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 802 and / or RAM 803. It should be noted that the program can also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in one or more memories.
[0116] According to an embodiment of the present disclosure, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to the bus 809. The electronic device 800 may further include one or more of the following components connected to the input / output (I / O) interface 805: an input portion 806 including a keyboard, a mouse, etc.; an output portion 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 808 including a hard disk, etc.; and a communication portion 809 including a network interface card such as a LAN card, a modem, etc. The communication portion 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output (I / O) interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage portion 808 as needed.
[0117] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0118] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0119] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
[0120] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 702 and / or the RAM 703 described above and / or one or more memories other than the ROM 702 and the RAM 703 .
[0121] An embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains a program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the directory identification method provided by the embodiment of the present disclosure.
[0122] When the computer program is executed by the processor 701, the above functions defined in the system / device of the embodiment of the present disclosure are executed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0123] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 709, and / or installed from the removable medium 711. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0124] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0125] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments of the present disclosure can be combined and / or combined in a variety of ways, even if such a combination or combination is not explicitly recorded in the present disclosure. In particular, without departing from the spirit and teaching of the present disclosure, the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0126] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A directory processing method, comprising: Receiving a processing request for a directory to be processed, wherein the processing request at least includes capacity configuration information of a historical root directory to which the directory to be processed belongs; configuring a first capacity limit of the historical root directory according to the capacity configuration information; and, While configuring the second capacity limit of the first new directory to be generated under the historical root directory, the third capacity limit of the directory to be processed and the fourth capacity limit of the subdirectory to be processed under the directory to be processed are configured so that the sum of the second capacity limit and the third capacity limit does not exceed the first capacity limit.
2. The method according to claim 1, further comprising: Move the directory to be processed from the historical root directory to the target directory; cancelling the configuration of the third capacity limit for the to-be-processed directory; While creating a second newly created directory to be generated under the directory to be processed, the configuration of the fourth capacity limit for the subdirectory to be processed is cancelled.
3. The method according to claim 1, further comprising: Modify the third capacity limit of the to-be-processed directory to a target capacity limit; According to the target capacity limit, the fifth capacity limit of the third newly created directory to be generated under the directory to be processed is configured, and the fourth capacity limit is modified to the target capacity limit so that the sum of the fifth capacity limit and the fourth capacity limit under the directory to be processed does not exceed the target capacity limit.
4. The method according to claim 3, wherein: After modifying the third capacity limit of the to-be-processed directory to a target capacity limit, the method further includes: Establishing a modification relationship tree for modifying the to-be-processed directory from the third capacity limit to the target capacity limit; According to the modification relationship tree, it is determined that the third capacity limit of the to-be-processed directory is modified to the target capacity limit.
5. The method according to any one of claims 1 to 4, further comprising: Creating a quota file and a quota number corresponding to the quota file for each directory, wherein the quota file is used to record the capacity limit and used capacity of the directory; The quota number is stored in the metadata of each directory, so that the capacity quota and the used capacity of each directory can be queried according to the quota number.
6. The method according to claim 5, wherein: Configuring a first capacity limit of the historical root directory according to the capacity configuration information includes: According to the used capacity of each directory, summarizing the first used total capacity of the historical root directory; When the first used total capacity is smaller than the first capacity limit, the first capacity limit is set to the total directory capacity of the historical root directory.
7. The method according to claim 5, wherein: Modifying the third capacity limit of the to-be-processed directory to a target capacity limit includes: According to the used capacity of each directory, summarizing the second used total capacity of the to-be-processed directory; When the second total used capacity is less than the target capacity limit, and the third total used capacity of other directories under the historical root directory except the directory to be processed is less than the difference between the first capacity limit and the target capacity limit, the third capacity limit of the directory to be processed is modified to the target capacity limit.
8. A directory processing device, comprising: A receiving module, configured to receive a processing request for a directory to be processed, wherein the processing request at least includes capacity configuration information of a historical root directory to which the directory to be processed belongs; a first configuration module, configured to configure a first capacity limit of the historical root directory according to the capacity configuration information; and The second configuration module is used to configure the second capacity limit of the first new directory to be generated under the historical root directory, and to configure the third capacity limit of the directory to be processed and the fourth capacity limit of the subdirectory to be processed under the directory to be processed, so that the sum of the second capacity limit and the third capacity limit does not exceed the first capacity limit.
9. An electronic device, comprising: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method according to any one of claims 1 to 7.
11. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.