Multi-active user quota management method, device, equipment, system and chip
By acquiring and managing quotas for multiple active users and leveraging the collaborative work of the metadata server and quota server, the inconsistency and performance bottleneck issues in quota management under a multi-active environment are resolved. Dynamic monitoring and consistent management of resource usage are achieved, thereby improving the reliability and scalability of the system.
Patent Information
- Application Number
- CN202511011358.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-22
- Publication Date
- 2025-11-07
AI Technical Summary
Existing technologies have limitations in multi-active user quota management, including the risk of quota exceeding limits, read/write latency caused by synchronous updates, and performance bottlenecks in centralized solutions. They are difficult to guarantee real-time consistency and high availability in high-concurrency scenarios.
By obtaining the user quota of the client, determining and executing the creation operation, calculating the total global user quota, and saving the flag based on the total global quota, the data is aggregated and synchronized using the metadata server and quota server to achieve dynamic management and consistent monitoring of resource usage.
Ensuring the accuracy and transparency of quota data acquisition reduces the risk of service interruptions caused by resource overruns or vulnerabilities, improves system consistency and scalability in high-concurrency and multi-node scenarios, and is suitable for business scenarios requiring rapid response.
Smart Images

Figure CN120909779A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of distributed file system storage, and particularly relates to a multi-active user quota management method, device, equipment, system and chip. BACKGROUND
[0002] With the rapid development of information technology, more and more business applications rely on efficient and reliable storage system support. Nowadays, storage systems are mainly divided into three categories: block storage, file system storage and object storage. Among them, file system storage provides unified POSIX interface, has ease of use, standardization and good compatibility, and can meet the needs of efficient organization and access of data consistency, permission management and directory structure in multi-user and multi-application scenarios. In a distributed environment, multi-active technology becomes a key capability for distributed file systems to achieve high availability, scalability, no single point of failure and consistent access. This technology supports multiple nodes to provide read and write services at the same time, ensuring real-time consistency and continuous availability of data in multi-client and multi-site scenarios.
[0003] In the prior art, user quota management of a distributed file system usually relies on a centralized metadata server (MDS) or a distributed metadata management method to record and update user resource usage. In the centralized scheme, a single MDS is responsible for global quota calculation and maintenance, and data is distributed to each node through a synchronization mechanism. Common implementations include log-based incremental updates (such as Apache Hadoop HDFS NameNode quota management) or database-based transaction processing (such as Ceph RadosGW quota mechanism), which ensure the statistical accuracy of user quotas among multiple nodes through periodic synchronization or event-driven methods. However, in the existing method, when multiple nodes are concurrently read and written, the incremental update may not be aggregated in time, and there is a potential risk of quota overrun. Moreover, in the centralized scheme, the single MDS becomes a performance bottleneck, and synchronization updates will cause read and write delays, especially in high-concurrency scenarios, making it difficult to ensure real-time consistency.
[0004] Therefore, the management of multi-active user quotas has become a problem to be solved.
[0005] Patent CN119576567A discloses a storage resource management method, comprising: determining the resource quota and management rules of each storage system according to user input; wherein the storage system comprises: object storage system and file storage system; receiving data operation request, and calling the storage system interface matched with the data operation request type to access the storage system; calling the storage system interface to access the corresponding storage system to obtain the resource quota usage of the storage system; outputting resource quota management prompt information according to the resource quota usage and management rules of the object storage system and the file storage system. The method only involves static resource quota predefinition and single storage system interface calling, is suitable for independent management of object storage and file storage, but cannot realize dynamic management of client resource state, limiting its applicability in multi-active high availability environment.
[0006] Based on this, the application provides a multi-active user quota management method, device, equipment, system and chip to improve the prior art. SUMMARY
[0007] The purpose of the present application is to provide a multi-active user quota management method, device, equipment, system and chip, which can accurately aggregate distributed resource usage in the case of multi-node simultaneous read and write, ensure that the quota is not exceeded, and at the same time consider consistency, high performance and high availability.
[0008] The purpose of the present application is achieved by the following technical solutions:
[0009] In a first aspect, the application provides a multi-active user quota management method for limiting, updating and managing the user quota of a client, comprising:
[0010] Obtaining the user quota of the client;
[0011] Judging the user quota and performing a creation operation;
[0012] Calculating and updating the user quota to obtain the global user quota total;
[0013] Based on the global user quota total, calculating and saving the flag corresponding to the global user quota total.
[0014] The beneficial effects of the technical solution are: first, the user quota of the client is acquired, which lays a foundation for subsequent resource management and ensures the initial acquisition of quota data is accurate. Subsequently, by judging the user quota and performing a creation operation, the system can dynamically respond to the needs of the client and optimize the resource allocation process, thereby improving the system's support for multiple user concurrent access. Further, the user quota is calculated and updated to obtain the total global user quota, which realizes the comprehensive collection of resource usage in a distributed environment and effectively solves the problem of multiple node data islands. Based on this global data, the corresponding flag is calculated and saved, providing an intuitive resource status indication for the system and enhancing the administrator's monitoring ability of resource usage. This method combines vulnerability repair and quota management organically, not only ensuring the safe operation of the system, but also improving consistency and scalability under multi-active architecture through global perspective resource management, especially suitable for high-concurrency and multi-node scenarios, which can significantly reduce the risk of service interruption caused by resource over-limiting or vulnerabilities, thereby providing strong support for business continuity.
[0015] In some optional embodiments, the user quota of the client is acquired by:
[0016] A file creation request from the client is received by the metadata server;
[0017] Based on the file creation request, the user quota of the client is acquired.
[0018] The beneficial effects of the technical solution are: by receiving a file creation request from the client through the metadata server and acquiring the user quota of the client based on the request, the data interaction process in the distributed file system is significantly optimized. The technology uses the metadata server as an intermediate layer to efficiently capture the resource needs of the client, ensuring that the quota data acquisition process is closely related to the actual business operation, thereby reducing the delay and unnecessary overhead of data acquisition. This method makes full use of the distributed characteristics of the metadata server, enabling it to quickly respond to requests from multiple clients and avoiding the bottleneck problem that may be caused by centralized processing. The acquired user quota provides a reliable basis for subsequent judgment and resource allocation, effectively improving the system's adaptability to dynamic loads. In addition, this step associates the file creation request with the quota data, enhancing the transparency of resource usage, so that the system can more accurately track user behavior in a multi-active environment. This design not only improves the real-time performance of data processing, but also lays a foundation for multi-node collaboration, significantly enhancing the scalability and robustness of the system, especially suitable for business scenarios that require fast response.
[0019] In some optional embodiments, the user quota is judged and a creation operation is performed by:
[0020] determining whether the user quota exceeds the memory quota of the metadata server;
[0021] if the user quota exceeds the memory quota of the metadata server, returning quota error information;
[0022] if the user quota does not exceed the memory quota of the metadata server, performing a file creation operation according to the file creation request;
[0023] after the file creation operation is completed, obtaining the quota increment corresponding to the file creation and sending it to the quota server.
[0024] The technical scheme has the beneficial effects that: by judging the user quota and performing the creation operation, the fine management ability of the distributed file system for resource control is significantly enhanced. The method first determines whether the user quota exceeds the memory quota of the metadata server, which sets a clear boundary for resource use and avoids system crashes or performance degradation caused by excessive allocation. If the quota is exceeded, quota error information is returned in time, effectively preventing illegal or over-limit operations and ensuring sustainable use of system resources; if the quota is not exceeded, the operation is performed according to the file creation request to ensure that business requirements are met. After the file creation is completed, the corresponding quota increment is obtained and sent to the quota server, which realizes dynamic updating of resource use data and enhances the collaboration between multiple nodes. This combination of judgment and operation design can monitor and adjust resource allocation in real time in a multi-active environment, significantly reducing the risk of resource contention caused by concurrent access.
[0025] In some optional embodiments, the user quota is calculated and updated to obtain the global user quota total, comprising:
[0026] aggregating and calculating the received quota increment using the quota server to obtain the global user quota total;
[0027] performing a journal write operation on the global user quota total to update the global user quota total;
[0028] transmitting the updated global user quota total to the metadata server.
[0029] The technical scheme has the beneficial effects that the polymeric computing process integrates the incremental data from multiple metadata servers, eliminates the possibility of multi-node data inconsistency, and ensures the comprehensiveness of resource usage statistics. Subsequently, a journal write operation is performed on the global user quota total, which guarantees the recoverability of data in abnormal conditions through the persistent storage technology, and enhances the fault tolerance of the system. The updated global user quota total is transmitted to the metadata server, which realizes the synchronous update of data among distributed nodes and optimizes the cooperation efficiency of each node in the multi-active architecture. This method effectively solves the statistical error problem of traditional distributed systems caused by data dispersion by combining centralized computing and distributed synchronization, further improves the transparency and controllability of resource management. In addition, the journal write operation provides historical data support for the system, facilitating auditing and troubleshooting, significantly enhancing the reliability and maintainability of the system, and is particularly suitable for business environments that require high consistency guarantee.
[0030] In some optional embodiments, the method further comprises:
[0031] obtaining a user quota upper limit value in the metadata server;
[0032] calculating a percentage of the global user quota total to the user quota upper limit value based on the global user quota total and the user quota upper limit value;
[0033] obtaining a flag mark corresponding to the global user quota total according to the percentage of the global user quota total to the user quota upper limit value and a preset ratio interval.
[0034] The technical scheme has the beneficial effects that the polymeric computing process integrates the incremental data from multiple metadata servers, eliminates the possibility of multi-node data inconsistency, and ensures the comprehensiveness of resource usage statistics. Subsequently, a journal write operation is performed on the global user quota total, which guarantees the recoverability of data in abnormal conditions through the persistent storage technology, and enhances the fault tolerance of the system. The updated global user quota total is transmitted to the metadata server, which realizes the synchronous update of data among distributed nodes and optimizes the cooperation efficiency of each node in the multi-active architecture. This method effectively solves the statistical error problem of traditional distributed systems caused by data dispersion by combining centralized computing and distributed synchronization, further improves the transparency and controllability of resource management. In addition, the journal write operation provides historical data support for the system, facilitating auditing and troubleshooting, significantly enhancing the reliability and maintainability of the system, and is particularly suitable for business environments that require high consistency guarantee.
[0035] In some optional embodiments, the method further comprises:
[0036] acquire a flag mark corresponding to the memory quota of the metadata server;
[0037] compare the flag mark corresponding to the total global user quota with the flag mark corresponding to the memory quota of the metadata server;
[0038] if the flag mark corresponding to the total global user quota is consistent with the flag mark corresponding to the memory quota of the metadata server, do not perform any operation;
[0039] if the flag mark corresponding to the total global user quota is inconsistent with the flag mark corresponding to the memory quota of the metadata server, broadcast to the client by using the quota server.
[0040] The technical scheme has the beneficial effects that: the method acquires and compares the flag mark corresponding to the total global user quota and the flag mark corresponding to the memory quota of the metadata server, significantly optimizes the coordination and efficiency of the distributed file system resource management. The method first acquires the flag mark of the memory quota, which provides a benchmark for the local resource state, and then compares the global flag mark with it. This step can timely find the state difference between the distributed nodes. If the two are consistent, no additional operation is needed, avoiding unnecessary communication overhead and improving system performance. If they are inconsistent, the quota server is used to broadcast to the client. This process ensures that the client can timely perceive the change of the resource state, and enhances the real-time performance of user interaction. The comparison and broadcast mechanism dynamically adjusts the synchronization relationship between the local and global states, effectively eliminates the potential inconsistency risk between multiple nodes, and guarantees the data consistency of the system in the multi-active environment. In addition, the condition triggering design of the broadcast operation reduces the network load, optimizes the resource utilization efficiency, and significantly improves the reliability and response speed of the system.
[0041] In a second aspect, the present application provides a multi-active user quota management device, which comprises a processor configured to implement the following steps:
[0042] an acquisition module for acquiring the user quota of the client;
[0043] a judgment module for judging the user quota and performing a creation operation;
[0044] a calculation module for calculating and updating the user quota to obtain the total global user quota;
[0045] a flag mark module for calculating and saving the flag mark corresponding to the total global user quota based on the total global user quota.
[0046] In some optional embodiments, the processor is configured to acquire the user quota of the client in the following manner:
[0047] receiving a file creation request from a client by using a metadata server;
[0048] based on the file creation request, obtaining a user quota amount of the client.
[0049] In some optional embodiments, the processor is configured to determine the user quota amount and perform the creation operation in the following manner:
[0050] determining whether the user quota amount exceeds a memory quota of the metadata server;
[0051] if the user quota amount exceeds the memory quota of the metadata server, returning a quota error message;
[0052] if the user quota amount does not exceed the memory quota of the metadata server, performing a file creation operation according to the file creation request;
[0053] after the file creation operation is completed, obtaining a quota increment corresponding to the file creation and sending the quota increment to a quota server.
[0054] In some optional embodiments, the processor is configured to calculate and update the user quota amount to obtain a global user quota total amount in the following manner:
[0055] aggregating and calculating the received quota increment by using the quota server to obtain the global user quota total amount;
[0056] performing a journal write operation on the global user quota total amount to update the global user quota total amount;
[0057] transmitting the updated global user quota total amount to the metadata server.
[0058] In some optional embodiments, the processor is configured to calculate and save a flag corresponding to the global user quota total amount based on the global user quota total amount in the following manner:
[0059] obtaining a user quota upper limit value in the metadata server;
[0060] based on the global user quota total amount and the user quota upper limit value, calculating a percentage of the global user quota total amount with respect to the user quota upper limit value;
[0061] according to the percentage of the global user quota total amount with respect to the user quota upper limit value and a preset ratio interval, obtaining the flag corresponding to the global user quota total amount.
[0062] In some optional embodiments, the processor is further configured to:
[0063] Obtaining a flag corresponding to the memory quota of the metadata server;
[0064] Comparing the flag corresponding to the total global user quota with the flag corresponding to the memory quota of the metadata server;
[0065] If the flag corresponding to the total global user quota is consistent with the flag corresponding to the memory quota of the metadata server, no operation is performed;
[0066] If the flag corresponding to the total global user quota is inconsistent with the flag corresponding to the memory quota of the metadata server, the quota server is used to broadcast to the client.
[0067] In a third aspect, the present application provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps of any of the above methods when executing the computer program.
[0068] In a fourth aspect, the present application provides a multi-live user quota management system, the system comprising:
[0069] The electronic device described above.
[0070] In a fifth aspect, the present application provides a chip, the chip storing a computer program, and the computer program implementing the steps of any of the above methods when executed by a processor. BRIEF DESCRIPTION OF DRAWINGS
[0071] The present application will be further described below in conjunction with the drawings and embodiments.
[0072] Figure 1 A flowchart of a multi-live user quota management provided by an embodiment of the present application is shown.
[0073] Figure 2 A flowchart of a method for obtaining a total global user quota provided by an embodiment of the present application is shown.
[0074] Figure 3 A structure block diagram of a multi-live user quota management device provided by an embodiment of the present application is shown.
[0075] Figure 4 A structure block diagram of an electronic device provided by an embodiment of the present application is shown.
[0076] Figure 5 A structure diagram of a multi-live user quota management system provided by an embodiment of the present application is shown.
[0077] Figure 6A structural diagram of a program product provided by an embodiment of the present application is shown. DETAILED DESCRIPTION
[0078] The embodiments of the present application are further described below with reference to the drawings and specific embodiments, and it should be noted that the following described embodiments between or between technical features can be combined to form new embodiments without conflict.
[0079] In the embodiments of the present application, "at least one" means one or more, and "multiple" means two or more. The "and / or" describes the association between the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the following situations: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b or c can represent a, b, c, a and b, a and c, b and c, a and b and c, where a, b and c can be single or multiple. It should be noted that "at least one" can also be interpreted as "one or more".
[0080] It should be noted that in the embodiments of the present application, the words "exemplary" or "for example" are used to represent an example, illustration or description. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the words "exemplary" or "for example" are intended to present the relevant concept in a specific manner.
[0081] Method embodiments
[0082] Reference Figure 1 , Figure 1 A flowchart of a multi-active user quota management method provided by an embodiment of the present application is shown.
[0083] The embodiments of the present application provide a multi-active user quota management method for limiting, updating and managing the user quota of a client, and the method comprises:
[0084] Step S101: Obtain the user quota amount of the client;
[0085] Step S102: Judge the user quota amount and perform a creation operation;
[0086] Step S103: Calculate and update the user quota amount to obtain the total amount of the global user quota;
[0087] Step S104: Based on the total global user quota, calculate and save the flag corresponding to the total global user quota.
[0088] Thus, the user quota of the client is first acquired, laying a foundation for subsequent resource management and ensuring the initial acquisition of quota data is accurate. Subsequently, by judging the user quota and performing a creation operation, the client's demand can be dynamically responded to, the resource allocation process is optimized, and the system's support capability for multi-user concurrent access is improved. Further, the user quota is calculated and updated to obtain the total global user quota, which comprehensively aggregates resource usage in a distributed environment and effectively solves the problem of multi-node data islands.
[0089] Based on this global data, the corresponding flag is calculated and saved, providing an intuitive resource status indication for the system and enhancing the administrator's monitoring capability of resource usage. This method combines vulnerability repair and quota management organically, not only ensuring the safe operation of the system, but also improving consistency and scalability under multi-active architecture through global perspective resource management, especially suitable for high-concurrency and multi-node scenarios, which can significantly reduce the risk of service interruption caused by resource over-limit or vulnerability, thereby providing strong support for business continuity.
[0090] In one specific embodiment, the file system client first initiates a file creation request, and the metadata server (MDS) receiving the request makes a preliminary judgment based on the user quota saved in its memory. If the judgment result shows that the user quota does not exceed the preset limit, the MDS continues to perform the complete process operation of file creation, including allocating storage resources and updating related metadata. At the same time, the MDS sends the user quota increment increased due to file creation to the quota server (quota_server) in an asynchronous manner to avoid blocking subsequent operations. If the judgment finds that the user quota has exceeded the limit, the MDS immediately suspends the creation process and directly returns the error information of exceeding the quota to the file system client, prompting the user to adjust resource usage. Then, the MDS calculates and updates the total global user quota, and further calculates and saves the corresponding total global user quota flag based on this data, which is used for subsequent state monitoring and notification. This implementation combines vulnerability repair and quota management, optimizes the resource allocation process under multi-active architecture, and improves the consistency and security of the system.
[0091] In the embodiments of the present application, the file creation operation refers to the file generation process initiated by the client, including allocating storage space, initializing metadata, and updating directory structure, which is executed by the MDS and involves an increment of resource usage.
[0092] Metadata Server (MDS) refers to a server node in a distributed file system responsible for managing file metadata such as file name, permissions, and storage location. In a multi-active architecture, multiple MDSs run simultaneously, handle client requests, and maintain user quota data.
[0093] In some optional embodiments, the method further comprises:
[0094] receiving, by the metadata server, a file creation request from a client;
[0095] obtaining, based on the file creation request, a user quota amount of the client.
[0096] Thus, by receiving a file creation request from a client using a metadata server and obtaining the user quota amount of the client based on this request, the data interaction process in a distributed file system is significantly optimized. This technology uses the metadata server as an intermediate layer to efficiently capture the resource requirements of clients, ensuring that the quota data acquisition process is closely related to actual business operations, thereby reducing the delay and unnecessary overhead of data acquisition. This method fully utilizes the distributed characteristics of the metadata server, enabling it to quickly respond to requests from multiple clients and avoiding the bottleneck problems that may arise from centralized processing.
[0097] The obtained user quota amount provides a reliable basis for subsequent judgment and resource allocation, effectively improving the adaptability of the system to dynamic loads. In addition, this step associates file creation requests with quota data, enhancing the transparency of resource usage, allowing the system to more accurately track user behavior in a multi-active environment. This design not only improves the real-time performance of data processing, but also lays the foundation for multi-node collaboration, significantly enhancing the scalability and robustness of the system, making it particularly suitable for business scenarios that require fast response.
[0098] In some optional embodiments, the method of obtaining the user quota amount of the client comprises: a file system client initiates a file creation request to a distributed system, and the request is routed to one of the metadata servers (MDS). The MDS is responsible for receiving the file creation request and obtaining the corresponding user quota amount from its local memory cache by parsing the user identifier and related context information in the request. After obtaining the quota amount, the MDS uses it as the basis data for subsequent judgment and operation, ensuring the accuracy of the starting data for resource management.
[0099] In some optional embodiments, the method further comprises:
[0100] judging whether the user quota amount exceeds the memory quota of the metadata server;
[0101] If the user quota exceeds the memory quota of the metadata server, a quota error message is returned;
[0102] If the user quota does not exceed the memory quota of the metadata server, a file creation operation is performed according to the file creation request;
[0103] After the file creation operation is completed, the corresponding quota increment of the file creation is obtained and sent to the quota server.
[0104] Therefore, by judging the user quota and performing the creation operation, the fine management ability of the distributed file system for resource control is significantly enhanced. The method first judges whether the user quota exceeds the memory quota of the metadata server, which sets a clear boundary for resource usage and avoids system crashes or performance degradation caused by excessive allocation.
[0105] If the quota is exceeded, a quota error message is returned in time, effectively preventing illegal or over-limit operations and ensuring sustainable use of system resources; if not, the operation is performed according to the file creation request to ensure that business requirements are met.
[0106] After the file creation is completed, the corresponding quota increment is obtained and sent to the quota server, which realizes dynamic updating of resource usage data and enhances the collaboration between multiple nodes. This combination of judgment and operation design can monitor and adjust resource allocation in real time in a multi-active environment, significantly reducing the risk of resource contention caused by concurrent access.
[0107] In the embodiments of the present application, the metadata server first extracts the quota of the current user from its local memory cache and compares it with the preset memory quota threshold. If it is judged that the user quota has exceeded the threshold, the MDS immediately generates a quota error message and returns it to the file system client through the network channel, notifying the user of insufficient resources and aborting the operation. If the user quota does not exceed the memory quota, the MDS performs a file creation operation according to the received file creation request, including allocating storage space, initializing file metadata and updating directory structure. After the operation is completed, the MDS analyzes the resources consumed in the file creation process, obtains the corresponding quota increment data, and sends the increment to the quota server (quota_server) through an asynchronous communication mechanism for global resource update.
[0108] In the embodiments of the present application, the flag marker is an identifier indicating the state of the user quota, which is calculated by the MDS or the quota server according to the resource usage ratio, and may include states such as "normal", "close to the upper limit" or "over the limit", which is used to notify the client.
[0109] Referring to Figure 2 , Figure 2A flowchart of a method for obtaining a global user quota total is shown.
[0110] In some optional embodiments, the computing and updating of the user quota amount to obtain the global user quota total comprises:
[0111] Step S201: aggregating and computing the received quota increment using the quota server to obtain the global user quota total;
[0112] Step S202: performing a journal write operation on the global user quota total to update the global user quota total;
[0113] Step S203: transmitting the updated global user quota total to the metadata server.
[0114] Thus, the aggregation and computation process integrates the increment data from multiple metadata servers, eliminates the possibility of multi-node data inconsistency, and ensures the comprehensiveness of resource usage statistics. Subsequently, the journal write operation is performed on the global user quota total, which guarantees the recoverability of data in abnormal conditions through persistent storage technology, and enhances the fault tolerance of the system.
[0115] Transmitting the updated global user quota total to the metadata server realizes the synchronous update of data among distributed nodes, and optimizes the collaboration efficiency of each node under the multi-active architecture. This method effectively solves the statistical error problem caused by data dispersion in traditional distributed systems through the combination of centralized computation and distributed synchronization, and further improves the transparency and controllability of resource management.
[0116] In addition, the journal write operation provides historical data support for the system, facilitating auditing and troubleshooting, and significantly enhancing the reliability and maintainability of the system, especially suitable for business environments that require high consistency guarantee.
[0117] In some optional embodiments, after the quota server (quota_server) receives the quota increment data sent by the metadata server (MDS), it starts the aggregation and computation process, integrates the increment data provided by each MDS with the existing global user quota total, and generates the latest global user quota total. This computation process is centrally processed by the quota_server, ensuring the uniformity of data among distributed nodes. After the computation is completed, the quota_server performs a journal write operation to record the updated global user quota total to a persistent storage medium, to guarantee the recoverability of data in abnormal conditions. After the write operation is successful, the quota_server transmits the updated global user quota total to all MDSs through a broadcast mechanism, updating the local cache data of the MDSs.
[0118] In some optional embodiments, the method further comprises:
[0119] obtaining a user quota upper limit value in the metadata server;
[0120] calculating a percentage of the global user quota total amount in the user quota upper limit value based on the global user quota total amount and the user quota upper limit value;
[0121] obtaining a flag mark corresponding to the global user quota total amount according to the percentage of the global user quota total amount in the user quota upper limit value and a preset ratio interval.
[0122] Thus, the user quota upper limit value in the metadata server is first obtained, providing a clear reference standard for calculation. Then, the percentage of occupation is calculated based on the global user quota total amount and the upper limit value, which provides a quantitative evaluation basis for resource usage.
[0123] According to the preset ratio interval, the corresponding flag mark is obtained, which converts the complex resource state into an intuitive identification, facilitating the system and user to quickly identify the resource usage. The saved flag mark provides persistent support for subsequent resource management decisions, enhancing the state tracking ability of the system.
[0124] This design realizes real-time updating and visual management of resource state by combining global data with local threshold, effectively reducing the risk of service interruption caused by resource over-limit. In addition, the flexibility of the preset ratio interval adapts to the individual needs of different business scenarios, significantly improving the adaptability and user experience of the system.
[0125] In some optional embodiments, the method further comprises:
[0126] obtaining a flag mark corresponding to the memory quota of the metadata server;
[0127] comparing the flag mark corresponding to the global user quota total amount with the flag mark corresponding to the memory quota of the metadata server;
[0128] if the flag mark corresponding to the global user quota total amount is consistent with the flag mark corresponding to the memory quota of the metadata server, then no operation is performed;
[0129] if the flag mark corresponding to the global user quota total amount is inconsistent with the flag mark corresponding to the memory quota of the metadata server, then the quota server is utilized to broadcast to the client.
[0130] Therefore, the method significantly optimizes the coordination and efficiency of distributed file system resource management by acquiring and comparing the flag mark corresponding to the total global user quota and the flag mark corresponding to the metadata server memory quota.
[0131] The method first acquires the flag mark of the memory quota, which provides a benchmark for the local resource state, and then compares the global flag mark with it. This step can timely discover the state difference between distributed nodes. If the two are consistent, no additional operation is needed, avoiding unnecessary communication overhead and improving system performance. If they are inconsistent, the quota server is used to broadcast to the client. This process ensures that the client can timely perceive the change of the resource state, enhancing the real-time performance of user interaction.
[0132] This comparison and broadcast mechanism effectively eliminates the potential inconsistency risk between multiple nodes by dynamically adjusting the synchronization relationship between the local and global states, ensuring the data consistency of the system in a multi-active environment. In addition, the condition-triggered design of the broadcast operation reduces network load, optimizes resource utilization efficiency, and significantly improves the reliability and response speed of the system.
[0133] In one specific embodiment, first, the MDS reads the flag mark related to the memory quota from its local memory cache. The mark is pre-calculated by the system according to the current usage of the memory quota, such as "normal" or "close to the upper limit" indicating the resource state. At the same time, the MDS receives the flag mark corresponding to the total global user quota sent by the quota server through broadcast. The mark is generated by the quota server according to the aggregation of resource usage data of all nodes. The MDS then compares the two, such as checking whether they are both in the "normal" state. If the comparison result shows that the two are consistent, the MDS judges that there is no difference between the local and global states, and the current state remains unchanged, without triggering any further operation, thereby avoiding unnecessary communication overhead and optimizing system performance. If the comparison shows inconsistency, such as the local flag mark being "normal" and the global flag mark changing to "close to the upper limit", the MDS initiates a request to the quota server, which immediately broadcasts the new global flag mark to all file system clients through the multicast protocol.
[0134] Device embodiment
[0135] Referring to Figure 3 , Figure 3 A structural block diagram of a multi-active user quota management device provided by an embodiment of the present application is shown.
[0136] The embodiment of the application further provides a multi-active user quota management device, and the specific implementation and the achieved technical effects are the same as those of the method embodiment, and part of the content will not be repeated.
[0137] The application provides a multi-active user quota management device, which comprises a processor configured to implement the following steps:
[0138] The acquisition module 101 is configured to acquire the user quota amount of the client.
[0139] The judgment module 102 is configured to judge the user quota amount and perform a creation operation.
[0140] The calculation module 103 is configured to calculate and update the user quota amount to obtain the global user quota total amount.
[0141] The flag marking module 104 is configured to calculate and save the flag marking corresponding to the global user quota total amount based on the global user quota total amount.
[0142] In some optional embodiments, the processor is configured to acquire the user quota amount of the client in the following manner:
[0143] The metadata server is used to receive a file creation request from the client.
[0144] The user quota amount of the client is acquired based on the file creation request.
[0145] In some optional embodiments, the processor is configured to judge the user quota amount and perform a creation operation in the following manner:
[0146] It is judged whether the user quota amount exceeds the memory quota of the metadata server.
[0147] If the user quota amount exceeds the memory quota of the metadata server, quota error information is returned.
[0148] If the user quota amount does not exceed the memory quota of the metadata server, a file creation operation is performed according to the file creation request.
[0149] After the file creation operation is completed, the quota increment corresponding to the file creation is acquired and sent to the quota server.
[0150] In some optional embodiments, the processor is configured to calculate and update the user quota amount to obtain the global user quota total amount in the following manner:
[0151] The quota server is used to aggregate and calculate the received quota increment to obtain the global user quota total amount.
[0152] performing a journal write operation on the global user quota total to update the global user quota total;
[0153] transmitting the updated global user quota total to the metadata server.
[0154] In some optional embodiments, the processor is configured to calculate and save the flag corresponding to the global user quota total based on the global user quota total in the following manner:
[0155] obtaining a user quota upper limit value in the metadata server;
[0156] calculating a percentage of the global user quota total in the user quota upper limit value based on the global user quota total and the user quota upper limit value;
[0157] obtaining the flag corresponding to the global user quota total according to the percentage of the global user quota total in the user quota upper limit value and a preset ratio interval.
[0158] In some optional embodiments, the processor is further configured to:
[0159] obtaining a flag corresponding to a memory quota of the metadata server;
[0160] comparing the flag corresponding to the global user quota total with the flag corresponding to the memory quota of the metadata server;
[0161] if the flag corresponding to the global user quota total is consistent with the flag corresponding to the memory quota of the metadata server, performing no operation;
[0162] if the flag corresponding to the global user quota total is inconsistent with the flag corresponding to the memory quota of the metadata server, broadcasting to the client by using the quota server.
[0163] Device embodiments
[0164] The embodiments of the present application also provide an electronic device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of any of the above methods when executing the computer program. The specific implementation manners and the achieved technical effects are the same as those described in the above method embodiments, and some contents will not be described herein.
[0165] Referring to FIG. 4, Figure 4 FIG. 4 shows a structural framework diagram of an electronic device provided by the embodiments of the present application.
[0166] The electronic device includes at least one memory 210, at least one processor 220, and a bus 230 connecting different platform systems.
[0167] The memory 210 can include a readable medium in the form of volatile memory, such as random access memory (RAM) 211 and / or cache memory 212, and can further include read only memory (ROM) 213.
[0168] The memory 210 also stores a computer program, which can be executed by the processor 220, so that the processor 220 implements the steps of any of the above methods.
[0169] The memory 210 can also include utility 214 having at least one program module 215, such as an operating system, one or more application programs, other program modules, and program data, and each of these examples or some combination thereof, can include implementation of a network environment.
[0170] Correspondingly, the processor 220 can execute the above computer program, and can execute the utility 214.
[0171] The processor 220 can employ one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs), or other electronic elements.
[0172] The bus 230 can be one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration bus, a processor or local bus using any of a variety of bus architectures, and a local bus using a variety of bus architectures.
[0173] The electronic device can also communicate with one or more external devices 240 such as a keyboard or pointing device, a Bluetooth device, or a device enabling wired or wireless communication with one or more other computing devices. Communication with such devices can be facilitated by an input / output interface 250. Still yet, the electronic device can communicate with one or more networks, such as a local area network (LAN), a wide area network (WAN), and / or the Internet, through a network adapter 260. The network adapter 260 can be any of a plurality of different types of adapters to enable wired or wireless communication between the electronic device and the other computing devices on the network. It should be appreciated that the electronic device can be a mobile device, a personal computer, a workstation, a server, a device of a different type, or any combination thereof. It is also contemplated that the electronic device can employ one or more buses, not shown, to communicate information between various hardware components within the electronic device. It is further contemplated that the electronic device can employ one or more data buses to communicate information between various hardware components within the electronic device.
[0174] System embodiments
[0175] Referring to Figure 5 , Figure 5 A structure diagram of a multi-live user quota management system provided by an embodiment of the present application is shown.
[0176] An embodiment of the present application further provides a multi-live user quota management system, which comprises:
[0177] The electronic device described above.
[0178] Medium embodiments
[0179] An embodiment of the present application further provides a chip, which stores a computer program. The computer program is executed by a processor to implement the steps of any of the above methods. The specific implementation manners and the achieved technical effects of the embodiment are the same as those of the above method embodiments, and some contents will not be described here.
[0180] Referring to Figure 6 , Figure 6 A structure diagram of a program product provided by an embodiment of the present application is shown.
[0181] The program product is used to implement any of the above methods. The program product can take a portable compact disc read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present application is not limited to this, and in the embodiments of the present application, the readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. The program product can take any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium may, for example, be but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include an electrical connection having one or more wires, a portable disc, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0182] The chip can include a data signal propagating in a baseband or as a carrier wave propagating over a carrier, in which the readable program code is carried. Such a propagating data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium can also be any readable medium that can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium can be transmitted in any suitable medium, including but not limited to wireless, wired, optical, RF, etc., or any suitable combination of the above. The program code for performing the operations of the present application can be written in any combination of one or more programming languages, including an object-oriented programming language such as Java, C++, etc., and conventional procedural programming languages such as C, Python, or similar programming languages. The program code can be executed entirely on a user computing device, partially on a user device, as a standalone software package, partially on a user computing device and partially on a remote computing device, or entirely on a 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 kind 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).
[0183] The application is described from the use purpose, efficiency, progress and novelty, which meets the function improvement and use requirements emphasized by the patent law. The above description and drawings are only the preferred embodiments of the application, and are not limited to the application. Therefore, all similar, identical, equivalent replacement or modification within the scope of the patent application of the application shall be within the scope of the patent application protection of the application.
Claims
1. A method for managing multi-active user quotas, characterized in that, The method for limiting, updating and managing user quota of a client comprises: obtaining a user quota amount of the client; judging the user quota amount and performing a creation operation; calculating and updating the user quota amount to obtain a global user quota total amount; based on the global user quota total amount, calculating and saving a flag corresponding to the global user quota total amount.
2. The method of claim 1, wherein, The method for obtaining the user quota amount of the client comprises: receiving a file creation request from the client by using a metadata server; based on the file creation request, obtaining the user quota amount of the client.
3. The method of claim 1, wherein, The method for judging the user quota amount and performing the creation operation comprises: judging whether the user quota amount exceeds a memory quota of the metadata server; if the user quota amount exceeds the memory quota of the metadata server, returning a quota error message; if the user quota amount does not exceed the memory quota of the metadata server, performing a file creation operation according to the file creation request; after the file creation operation is completed, obtaining a quota increment corresponding to the file creation and sending the quota increment to a quota server.
4. The method of claim 3, wherein, The method for calculating and updating the user quota amount to obtain the global user quota total amount comprises: aggregating and calculating the received quota increment by using the quota server to obtain the global user quota total amount; performing a journal write operation on the global user quota total amount to update the global user quota total amount; transmitting the updated global user quota total amount to the metadata server.
5. The method of claim 1, wherein, The method for calculating and saving the flag corresponding to the global user quota total amount based on the global user quota total amount comprises: obtaining a user quota upper limit value in the metadata server; based on the global user quota total amount and the user quota upper limit value, calculating a percentage of the global user quota total amount in the user quota upper limit value; based on the percentage of the global user quota total amount in the user quota upper limit value and a preset ratio interval, obtaining the flag corresponding to the global user quota total amount.
6. The method of claim 5, wherein, The method further comprises: obtaining a flag corresponding to the memory quota of the metadata server; comparing the flag corresponding to the global user quota total amount with the flag corresponding to the memory quota of the metadata server; if the flag corresponding to the global user quota total amount is consistent with the flag corresponding to the memory quota of the metadata server, not performing any operation; if the flag corresponding to the global user quota total amount is inconsistent with the flag corresponding to the memory quota of the metadata server, broadcasting to the client by using the quota server.
7. A management device for multi-active user quotas, characterized in that, The multi-active user quota management device comprises: an obtaining module for obtaining a user quota amount of a client; a judging module for judging the user quota amount and performing a creation operation; a calculating module for calculating and updating the user quota amount to obtain a global user quota total amount; a flag module for calculating and saving a flag corresponding to the global user quota total amount based on the global user quota total amount.
8. An electronic device, comprising: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor is configured to perform the steps of the method according to any one of claims 1-6.
9. A management system for multi-active user quotas, characterized in that, The multi-active user quota management system comprises: the electronic device according to claim 8.
10. A chip, characterized by The chip stores a computer program, and the computer program is executed by a processor to realize the steps of the method in any one of claims 1-6.
Citation Information
Patent Citations
Storage resource management method and system
CN119576567A