Quota management method, quota management device and computer storage medium

By introducing a quota lock control mechanism in network disk uploads, obtaining the remaining quota and recalculating the quota, the problem of quota detection vulnerability in high concurrent uploads is solved, and effective management of large files and accurate interception of quotas is achieved.

CN119271150AInactive Publication Date: 2025-01-07ZHEJIANG DAHUA TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411784903.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-01-07
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the scenarios of high concurrent upload and large file upload, there are vulnerabilities in quota detection based on the size of a single upload file, and it is difficult to effectively control the quota of the same user, resulting in the problem of quota exceeding the quota.

Method used

Introduce a quota lock control mechanism to obtain the remaining quota of the network disk by allocating the second quota lock, determine whether the file size exceeds the quota, and recalculate the quota after the upload task is completed, and use shard upload logic to process large files to ensure the accuracy of quota management. Sex and effectiveness.

Benefits of technology

It effectively solves the problems of quota interception and invalidity in concurrent uploads, ensures the accuracy and efficiency of quota management, and avoids quota excess and invalid uploads.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271150A_ABST
    Figure CN119271150A_ABST
Patent Text Reader

Abstract

The invention provides a quota management method, a quota management device and a computer storage medium. The quota management method comprises the following steps: allocating a second quota lock to a current uploading request of a target network disk which obtains a first quota lock; obtaining the residual quota of the target network disk based on the second quota lock; in response to the fact that the file size of the current uploading request is smaller than or equal to the residual quota, executing a file uploading task of the current uploading request; and after the file uploading task is executed, unlocking the second quota lock of the current uploading request, and recalculating the residual quota of the target network disk. According to the quota management method, a lock control mechanism is added in quota management for uploading of the same user, and quota detection is realized in a concurrent uploading process, so that the problems of border crossing and invalidation of quota interception in the scene can be well solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of file storage technology, and in particular to a quota management method, a quota management device, and a computer storage medium. Background Art

[0002] At present, the network disk storage system mainly includes business-side file management services and underlying storage services. Among them, the storage service is the core storage module, responsible for the actual storage of files and data. It involves a variety of storage technologies, such as distributed storage and object storage. The business-side file management service is mainly responsible for processing user operations such as uploading, downloading, managing, and sharing files. In order to better manage storage space, it is particularly important to effectively manage storage space in scenarios such as uploading and quota updating.

[0003] In some high-concurrency upload and large file upload scenarios, such as uploading large files, the single upload size is only a part of the total size. Judging whether the quota exceeds the limit based on the quota size verification of the single upload file size will have certain detection loopholes. At the same time, the quota control of the same user in high-concurrency upload scenarios also needs to be controlled to a certain extent. Otherwise, it is very easy to have the problem of over-quota upload. Summary of the invention

[0004] The present application provides a quota management method, a quota management device and a computer storage medium.

[0005] To solve the above technical problems, the present application proposes a quota management method, which includes: allocating a second quota lock to a current upload request of a target network disk that has obtained a first quota lock; obtaining the remaining quota of the target network disk based on the second quota lock; in response to the file size of the current upload request being less than or equal to the remaining quota, executing the file upload task of the current upload request; after the file upload task is completed, unlocking the second quota lock of the current upload request and recalculating the remaining quota of the target network disk.

[0006] The quota management method further includes: in response to the file size of the current upload request being larger than the remaining quota, abandoning the current upload request and returning error information.

[0007] The file upload task for executing the current upload request includes: obtaining the size of the file to be uploaded in the file upload task; in response to the file size being smaller than the preset segment size, uploading the file using the small file upload logic of uploading at one time; in response to the file size being greater than or equal to the preset segment size, uploading the file using the large file upload logic of uploading in segments The quota management method further includes: when a single upload fails or a multi-segment upload fails, deleting the uploaded file record of the file upload task and recalculating the remaining quota of the target network disk.

[0008] Among them, the quota management method also includes: obtaining the quota to be updated and the original quota of the target network disk; in response to the quota to be updated being greater than the original quota and the quota to be updated being less than or equal to the maximum remaining quota of the cluster, updating the quota of the target network disk according to the quota to be updated.

[0009] The quota management method further includes: in response to the quota to be updated being less than or equal to the original quota and the quota to be updated being greater than the usage quota of the target network disk, updating the quota of the target network disk according to the quota to be updated.

[0010] Wherein, the quota management method also includes: in response to the quota to be updated being less than or equal to the original quota, and the quota to be updated being greater than the usage quota of the target network disk, judging whether the quota to be updated is greater than the usage overflow quota; if not, the quota to be updated verification fails, and the current quota of the target network disk is maintained; wherein, the usage overflow quota is greater than the usage quota of the target network disk.

[0011] Among them, in response to the quota to be updated being greater than the original quota, and the quota to be updated being less than or equal to the maximum remaining quota of the cluster, updating the quota of the target network disk according to the quota to be updated, including: in response to the quota to be updated being greater than the original quota, and the quota to be updated being less than or equal to the maximum remaining quota of the cluster, determining whether the quota to be updated is greater than the usage overflow quota; if so, updating the quota of the target network disk according to the quota to be updated; wherein the usage overflow quota is greater than the usage quota of the target network disk.

[0012] To solve the above technical problems, the present application proposes a quota management device, which includes a memory and a processor coupled to the memory; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the above quota management method.

[0013] In order to solve the above technical problem, the present application proposes a computer storage medium, wherein the computer storage medium is used to store program data, and the program data is used to implement the above quota management method when executed by a computer.

[0014] Different from the prior art, the beneficial effects of the present application are: the quota management device allocates a second quota lock to the current upload request of the target network disk that has obtained the first quota lock; obtains the remaining quota of the target network disk based on the second quota lock; in response to the file size of the current upload request being less than or equal to the remaining quota, executes the file upload task of the current upload request; after the file upload task is completed, unlocks the second quota lock of the current upload request and recalculates the remaining quota of the target network disk. The present application adds a lock control mechanism to the quota management for the upload of the same user through the quota management method, realizes quota detection during concurrent uploads, and can well solve the problems of quota interception out of bounds and invalidity in this scenario. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0016] Figure 1 It is a flowchart of the first embodiment of the quota management method provided by this application; Figure 2 It is a schematic diagram of the core process of quota management provided by this application; Figure 3 It is a flowchart of the second embodiment of the quota management method provided by this application; Figure 4 It is a schematic diagram of the user quota update process provided by this application; Figure 5 It is a flowchart of the third embodiment of the quota management method provided by this application; Figure 6 It is a schematic diagram of an embodiment of an abnormal upload quota management process provided by the present application; Figure 7 It is a schematic diagram of another embodiment of the upload abnormal quota management process provided by the present application; Figure 8 It is a structural diagram of an embodiment of a quota management device provided by the present application; Fig. 9 It is a structural diagram of an embodiment of a computer storage medium provided by the present application. DETAILED DESCRIPTION

[0017] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0018] In order to solve the problems of the prior art, this application introduces a user concurrent upload quota management and control mechanism. In network disks and some file storage systems, there is a high possibility of concurrent file uploads in folder uploads and API (Application Programming Interface) file upload scenarios. When designing this application, a lock control mechanism is added to the quota management for the same user uploads, and quota detection is handled in an orderly manner during the concurrent upload process, aiming to solve problems such as quota interception out of bounds and invalidity in this scenario.

[0019] This application proposes a quota management method, please refer to Figure 1 and Figure 2 , Figure 1 is a flowchart of the first embodiment of the quota management method provided by this application, Figure 2 It is a schematic diagram of the core process of quota management provided by this application.

[0020] The quota management method of the present application is applied to a quota management device, wherein the quota management device of the present application can be a server, or a system composed of a server and a local terminal. Accordingly, the various parts of the quota management device, such as various units, sub-units, modules, and sub-modules, can all be set in the server, or can be set in the server and the local terminal respectively.

[0021] Furthermore, the above-mentioned server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules, such as software or software modules used to provide distributed servers, or it can be implemented as a single software or software module, which is not specifically limited here. In some possible implementations, the quota management method of the embodiment of the present application can be implemented by a processor calling computer-readable instructions stored in a memory.

[0022] like Figure 1 As shown, the specific steps are as follows: Step S11: allocating a second quota lock to the current upload request of the target network disk that has obtained the first quota lock.

[0023] In the embodiments of the present application, Figure 2 In step 6 shown, the user obtains the second quota lock and locks the current upload request to ensure that only one request is allowed to perform the following business processing at this moment.

[0024] like Figure 2 In step 5 shown, if the second quota lock has been used by other upload requests of the same user, the current upload request needs to wait until the quota lock is released.

[0025] Specifically, the user assigned the first quota lock can further assign the second quota lock to the current upload request. The current upload request can perform subsequent file upload actions after obtaining the second quota lock. If the user's second quota lock is still occupied by other upload requests, the current upload request needs to wait until the second quota lock is released.

[0026] The first quota lock of the present application is used to allocate the file upload permission of the user, and the second quota lock is used to allocate the file upload permission of the request.

[0027] For further information, see Figure 2 Steps 1 to 5 are shown below. The specific contents of each step in the core process of quota management are as follows: Step 1: Parse the file upload request. The business side uses MultipartParser (multi-part data parser) to parse the form and file data. The specific parsing content includes but is not limited to: Figure 2 Parameters in the description: file: file object (small file or large file fragment content); taskId: task id; fileObjectId: file id; parentId: parent node id; name: file name; current: current transfer fragment; total: total transfer fragments (small files generally have a total of 1); totalSize: total file size (in KB); thumbNail: thumbnail.

[0028] Step 2: Verify the legitimacy of the parsing parameters: whether the single-shard size exceeds the default value; whether the upload parent node is valid; whether it is the first upload. Only when all the verification conditions are met can the logic of step 3 be continued.

[0029] Step 3: Determine whether the user quota lock object exists. Here, a Map structure is used for identification, where the key is the network disk user id and the value is the lock object. This step mainly determines whether the lock object has been allocated by determining whether the multi-object is empty. If the multi-object is empty, go to step 4. If the multi-object is not empty, go to step 5.

[0030] Step 4: When the lock object is empty, that is, does not exist, start creating and allocating quota locks. To prevent the impact of concurrent uploads, introduce Figure 2 The double-check locking method in the description file is used to initialize the user quota lock object.

[0031] Specifically, the contents of anti-concurrency and double-check locking are as follows: 1. Define the userUploadGlobalLock global lock; 2. Lock userUploadGlobalLock.Lock(); 3. Execute in the lock code segment: UserQuotaLockMap[uId] = &userLock, where userLock is the newly created lock structure object; 4. After the quota lock is allocated, the double-check lock is released userUploadGlobalLock.Lock().

[0032] Step S12: Obtain the remaining quota of the target network disk based on the second quota lock.

[0033] Specifically, the quota management device queries and counts the total size of all files currently being uploaded or uploaded, sum(fileSize), obtains the total quota of the user, and finally calculates the remaining quota remainQuota.

[0034] Step S13: in response to the file size of the current upload request being less than or equal to the remaining quota, executing the file upload task of the current upload request.

[0035] Specifically, the quota management device checks whether the current uploaded file size totalSize is less than or equal to the remaining quota size remainingQuota. If so, a new file record is added and written into MySQL (relational database management system), and the file status is set to uploading. Figure 2 Step 13 shown: record the error, return error information, and abandon the current upload request.

[0036] Step S14: After the file upload task is completed, the second quota lock of the current upload request is unlocked, and the remaining quota of the target network disk is recalculated.

[0037] In the embodiment of the present application, after the quota management device records the data into the database, it unlocks the quota lock for use by other upload tasks and recalculates the remaining quota of the target network disk. After the file is uploaded, the file record status is set to complete (upload completed).

[0038] In the present application, the quota management device allocates a second quota lock to the current upload request of the target network disk that has obtained the first quota lock; obtains the remaining quota of the target network disk based on the second quota lock; executes the file upload task of the current upload request in response to the file size of the current upload request being less than or equal to the remaining quota; after the file upload task is completed, unlocks the second quota lock of the current upload request and recalculates the remaining quota of the target network disk. The present application adds a lock control mechanism to the quota management for the upload of the same user through the quota management method, realizes quota detection during concurrent uploads, and can well solve the problems of quota interception out of bounds and invalidity in this scenario.

[0039] Furthermore, each user's file upload action in the network disk system is based on the original allocated quota limit. If the storage capacity of the managed file list exceeds the quota limit, the capacity will be expanded. If the original quota capacity is too large and the usage is too small, it can be reduced. The setting of 1.2 times the size can solve the quota gain problem caused by the critical quota value due to uploading.

[0040] Therefore, this application proposes an embodiment for updating the quota of the target network disk. For details, please refer to Figure 3 and Figure 4 , Figure 3 is a flow chart of the second embodiment of the quota management method provided by the present application. Figure 4 It is a schematic diagram of the user quota update process provided by this application.

[0041] like Figure 3 As shown, the specific steps are as follows: Step S21: Obtain the quota to be updated and the original quota of the target network disk.

[0042] In the embodiment of the present application, the quota management device obtains the size of the quota to be updated and identifies it as: updatedQuota.

[0043] The quota management device obtains the network original quota or the used quota or the cluster remaining quota, which are recorded as srcQuota, usedQuota, and clusterRemainQuota respectively.

[0044] Step S22: In response to the quota to be updated being greater than the original quota and the updated quota being less than or equal to the maximum remaining quota of the cluster, the quota of the target network disk is updated according to the quota to be updated.

[0045] Specifically, the quota management device determines the relationship between the quota to be updated and the original quota, such as Figure 4As shown, when the quota to be updated is greater than the original quota, the quota management device continues to determine the relationship between the quota to be updated and the maximum remaining quota of the cluster. When the quota to be updated is less than or equal to the maximum remaining quota of the cluster, the quota management device can update the quota of the target network disk according to the quota to be updated, and write the updated target network disk quota into the MySQL database.

[0046] In other embodiments of the present application, when the quota to be updated is greater than the original quota and the quota to be updated is greater than the maximum remaining quota of the cluster, the quota to be updated fails to be verified and the current quota of the target network disk is maintained.

[0047] In other embodiments of the present application, when the quota to be updated is greater than the original quota and the quota to be updated is less than or equal to the maximum remaining quota of the cluster, the quota management device needs to further determine whether the quota to be updated is greater than the usage overflow quota. The usage overflow quota is greater than the usage quota of the target network disk. Specifically, the usage overflow quota can be as follows: Figure 4 1.2*usage quota shown. When the quota to be updated is greater than the usage overflow quota, the quota management device can update the quota of the target network disk according to the quota to be updated, and write the updated target network disk quota into the MySQL database.

[0048] In other embodiments of the present application, when the quota to be updated is greater than the original quota, and the quota to be updated is less than or equal to the maximum remaining quota of the cluster, and the quota to be updated is less than or equal to the overflow quota, the quota to be updated fails to be checked, and the current quota of the target network disk is maintained.

[0049] It should be noted that, considering that the quota usage is growing in real time during the uploading process, updating the quota at this time may cause a quota overflow problem. Here, we use 1.2 times the quota for calculation, or other design schemes that set the overflow quota to be greater than the quota, to reduce the conversion error of the unit of the quota value and the overflow problem caused by the synchronous growth of the quota during the upload process.

[0050] In other embodiments of the present application, when the quota to be updated is less than the original quota, the quota management device further determines the relationship between the quota to be updated and the usage quota of the target network disk. When the quota to be updated is less than or equal to the usage quota, the quota to be updated fails to be verified and the current quota of the target network disk is maintained.

[0051] When the quota to be updated is greater than the used quota, the quota management device further determines whether the quota to be updated is greater than the used overflow quota. If so, the quota to be updated fails to be verified, and the current quota of the target network disk is maintained. If not, the quota management device can update the quota of the target network disk according to the quota to be updated, and write the updated target network disk quota into the MySQL database.

[0052] Through the above method, this application supports user quota management mechanism for upload specifications of different sizes, configures storage space quota, and supports subsequent expansion. In addition, when transferring files, for large and small file scenarios, the same upload interface is reused, with a single shard size of 80MB as the critical value. If it is less than the critical value, the interface performs a complete one-time upload logic, and the file upload usage is recorded as the current actual file upload size, which is recorded as the usage quota; if it is greater than the critical value, the business side divides the file content according to the critical size, and implements the complete file upload directory through multiple shard interface calls. The file upload usage is recorded as the actual file upload size with the total size of the first shard upload interface file, which is recorded as the usage quota. The interface call after the first shard upload is not processed; during the whole process, the usage quota is compared with the configured space quota, and if it exceeds, it will prompt that the quota has been exceeded.

[0053] Furthermore, the present application proposes an embodiment for uploading files in pieces. For details, please refer to Figure 5 and Figure 6 , Figure 5 is a flowchart of the third embodiment of the quota management method provided by this application. Figure 6 It is a schematic diagram of an embodiment of an upload abnormal quota management process provided by the present application.

[0054] It should be noted that Figure 6 The upload exception quota management process shown is the main process of the first shard upload exception quota recovery management.

[0055] like Figure 5 As shown, the specific steps are as follows: Step S31: Obtain the size of the file to be uploaded in the file upload task.

[0056] Specifically, after the quota management device processes the parsing and quota verification logic on the business side, it starts the segmented upload business logic, obtains the file size to be uploaded in the file upload task, and determines whether the subsequent S3 object upload is a one-time upload or a segmented upload based on whether the file size is smaller than the segment size.

[0057] Step S32: In response to the file size being smaller than the preset segment size, the file is uploaded using a one-time small file upload logic.

[0058] When the file size is smaller than the preset segment size, the small file upload logic is entered.

[0059] The small file upload logic is as follows: the quota management device obtains the AWS S3 storage client connection for subsequent storage API interaction and calls S3 PutObject to complete a one-time object upload.

[0060] If the upload is successful, execute Figure 6Step 7 in: Complete the update operation of MySQL file records in the scenario where the upload and cleanup are successful.

[0061] If the upload fails, execute Figure 6 Step 5: Clean up abnormal shards caused by API call failure during upload, mainly by calling S3 API AbortMultipartUpload interface. When the cleanup interface fails, the uploaded file record is deleted in MySQL, so that the subsequent request quota usage = sum (fileSize), and the intermediate upload failure record is removed, which is similar to the purpose of quota recovery when the upload is abnormal.

[0062] Step S33: in response to the file size being greater than or equal to the preset segment size, the file is uploaded using the large file upload logic of segment upload.

[0063] Specifically, when the file size is larger than the minimum fragment size, the large file upload logic is adopted.

[0064] The logic of uploading large files is as follows: the single quota management device obtains the AWS S3 storage client connection for subsequent storage API interaction; the S3 API MultipartUpload generates an upload record and generates an uploadId as the subsequent multipart upload identifier to verify whether the multipart upload is successful.

[0065] If the upload is successful, execute Figure 6 Step 7 in: Complete the update operation of MySQL file records in the scenario where the upload and cleanup are successful.

[0066] If the upload fails, execute Figure 6 Step 5: Clean up abnormal shards caused by API call failure during upload, mainly by calling S3 API AbortMultipartUpload interface. When the cleanup interface fails, the uploaded file record is deleted in MySQL, so that the subsequent request quota usage = sum (fileSize), and the intermediate upload failure record is removed, which is similar to the purpose of quota recovery when the upload is abnormal.

[0067] Please continue reading Figure 7 , Figure 7 It is a schematic diagram of another embodiment of the upload exception quota management process provided by the present application.

[0068] It should be noted that Figure 7 The upload exception quota management process shown is the main process of the final shard exception quota recovery management.

[0069] Compared to Figure 6 The process, Figure 7 The process mainly describes the quota recovery management process in the abnormal scenario of large file final multi-part upload, which is an important part of abnormal quota management.

[0070] Upload the last shard of a large file (the size is less than or equal to the minimum shard size). Obtain the AWS S3 storage client connection for subsequent storage API interactions. Call the S3 API UploadPart to upload the last shard to the object storage. Finally, determine whether the shard upload is successful. If successful, clean up successfully and complete the update operation of the file record in MySQL. If unsuccessful, delete the file record and further update the quota usage = sum(fileSize) to achieve the purpose of quota usage recovery.

[0071] Specifically, in the scenario of failed cleanup, the uploaded file records are deleted in MySQL, and the subsequent request quota usage = sum(fileSize) will remove the intermediate upload failure records, which is similar to achieving the purpose of quota recovery when the upload is abnormal.

[0072] Through the above method, a shard upload interface is implemented. The interface also supports uploading files of different size categories. The interface implements and supports concurrent upload quota control processing, which ensures the interception of over-quota file upload tasks in advance and improves file upload efficiency. In addition, in the case of storage interaction failure caused by storage RPC (Remote Procedure Call) calls and network failures in the middle of the upload process, large files are sliced ​​and then the storage shard fragments are cleaned up and the entire file quota usage resources are recycled to achieve consistency between the quota record size and actual usage.

[0073] This application proposes a new quota management solution for network disk storage systems; first, the storage resource quota is divided, and then a reusable API is designed for upload file sizes of different specifications. By introducing user isolation locks and shard quota management mechanisms, large file transfer quota management in concurrent scenarios is implemented and supported, solving the quota overrun problem that occurs in quota management in common upload scenarios; at the same time, the internal processing and storage API interactions of the entire upload process are monitored, and quota recovery is performed when storage write failure occurs due to network or other reasons, and the updated quota usage is fed back to the subsequent upload quota usage, so as to perform more accurate interception.

[0074] Furthermore, different from the prior art, the quota management method of this application is not limited to the use in the underlying object storage scenario, but can also be used for the underlying storage as other storage media management platforms, which has certain use value. The risk of exceeding the upload quota capacity is pre-empted to the greatest extent, greatly reducing the possibility of gradually exposing the insufficient quota in the later stage of the upload process, and achieving consistency between the actual use and the quota statistical size.

[0075] In order to implement the quota management method of the above embodiment, this application also provides a quota management device. Figure 8 , Figure 8 It is a structural diagram of an embodiment of a quota management device provided by the present application.

[0076] like Figure 8 As shown, the quota management device 600 of this embodiment includes a processor 61 , a memory 62 , an input / output device 63 , and a bus 64 .

[0077] The processor 61 , the memory 62 , and the input / output device 63 are respectively connected to the bus 64 . The memory 62 stores a computer program. The processor 61 is used to execute the computer program to implement the quota management method of the above embodiment.

[0078] In this embodiment, the processor 61 may also be referred to as a CPU (Central Processing Unit). The processor 61 may be an integrated circuit chip with signal processing capabilities. The processor 61 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components. The processor 61 may also be a GPU (Graphics Processing Unit), also known as a display core, a visual processor, or a display chip, which is a microprocessor that is specifically used for image computing on computers, workstations, game consoles, and some mobile devices (such as tablet computers, smart phones, etc.). The purpose of the GPU is to convert and drive the display information required by the computer system, and to provide a line scan signal to the display to control the correct display of the display. It is an important component that connects the display and the computer motherboard. As an important component of the computer host, the graphics card is responsible for outputting display graphics. The general-purpose processor may be a microprocessor or the processor 61 may also be any conventional processor, etc.

[0079] The present application also provides a computer storage medium, such as Fig. 9As shown, the computer storage medium 700 is used to store a computer program 71. When the computer program 71 is executed by a processor, it is used to implement the method described in the embodiment of the quota management method of the present application.

[0080] The method involved in the quota management method embodiment of the present application, when implemented in the form of a software functional unit and sold or used as an independent product, can be stored in a device, such as a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

[0081] The above description is only an implementation mode of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A quota management method, characterized in that: The quota management method comprises: Allocate a second quota lock to the current upload request of the target network disk that has obtained the first quota lock; Acquire the remaining quota of the target network disk based on the second quota lock; In response to the file size of the current upload request being less than or equal to the remaining quota, executing the file upload task of the current upload request; After the file upload task is completed, the second quota lock of the current upload request is unlocked, and the remaining quota of the target network disk is recalculated.

2. The quota management method according to claim 1, characterized in that: The quota management method further includes: In response to the file size of the current upload request being greater than the remaining quota, the current upload request is abandoned and an error message is returned.

3. The quota management method according to claim 1, characterized in that: The executing the file upload task of the current upload request includes: Obtain the size of the file to be uploaded in the file upload task; In response to the file size being smaller than a preset fragment size, uploading the file using a one-time small file upload logic; In response to the file size being greater than or equal to the preset segment size, the file is uploaded using the large file upload logic of segment upload.

4. The quota management method according to claim 3, characterized in that: The quota management method further includes: When an upload fails or a multi-segment upload fails, the uploaded file record of the file upload task is deleted, and the remaining quota of the target network disk is recalculated.

5. The quota management method according to claim 1, characterized in that: The quota management method further includes: Obtain the quota to be updated and the original quota of the target network disk; In response to the quota to be updated being greater than the original quota and the quota to be updated being less than or equal to the maximum remaining quota of the cluster, the quota of the target network disk is updated according to the quota to be updated.

6. The quota management method according to claim 5, characterized in that: The quota management method further includes: In response to the quota to be updated being less than or equal to the original quota, and the quota to be updated being greater than the usage quota of the target network disk, updating the quota of the target network disk according to the quota to be updated.

7. The quota management method according to claim 6, characterized in that: The quota management method further includes: In response to the quota to be updated being less than or equal to the original quota, and the quota to be updated being greater than the usage quota of the target network disk, determining whether the quota to be updated is greater than the usage overflow quota; If not, the quota verification to be updated fails, and the current quota of the target network disk is maintained; The usage overflow quota is greater than the usage quota of the target network disk.

8. The quota management method according to claim 5, characterized in that: In response to the quota to be updated being greater than the original quota and the quota to be updated being less than or equal to the maximum remaining quota of the cluster, updating the quota of the target network disk according to the quota to be updated includes: In response to the quota to be updated being greater than the original quota, and the quota to be updated being less than or equal to the maximum remaining quota of the cluster, determining whether the quota to be updated is greater than the overflow quota; If yes, update the quota of the target network disk according to the quota to be updated; The usage overflow quota is greater than the usage quota of the target network disk.

9. A quota management device, characterized in that: The quota management device includes a memory and a processor coupled to the memory; The memory is used to store program data, and the processor is used to execute the program data to implement the quota management method according to any one of claims 1 to 8.

10. A computer storage medium, characterized in that: The computer storage medium is used to store program data, and when the program data is executed by a computer, it is used to implement the quota management method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method and system for accelerating file uploading based on HTTP (Hyper Text Transport Protocol)

    CN115277594A

  • Quota control method, device, system, equipment and medium

    CN115543953A

  • Method, system and equipment for optimizing directory capacity nesting quota and medium

    CN117076416A