Management method and device of file storage space in SAAS platform
By introducing user resource management module, file storage module, message queue module and file operation interfaces into the SAAS platform, asynchronous processing of file storage event messages is realized, solving the problem of real-time and low management efficiency of file storage space quota update in the SAAS platform, and improving the efficiency and real-time nature of storage space management.
Patent Information
- Application Number
- CN202411549810.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-04-01
AI Technical Summary
The real-time update of file storage space quota in the SAAS platform is poor and the management efficiency is low, resulting in waste of computing resources and conflict risks.
By introducing user resource management module, file storage module, message queue module and file operation interfaces into the SAAS platform, file storage event messages are generated and asynchronously processed through message queues to ensure real-time update of file storage status.
It improves the real-time update of storage space quota, simplifies file operation logic, reduces the risk of waste of computing resources and conflicts, and improves the efficiency of storage space management.
Smart Images

Figure CN119739685A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of storage space management, and in particular to a method and device for managing file storage space in a SAAS platform. Background Art
[0002] With the development of cloud computing technology, SAAS (Software as a Service) platform is also built and developed based on cloud computing technology. In the SAAS platform architecture, in order to meet the needs of system scalability and reliability, a distributed storage system is usually used as a file storage solution, which brings the following problems: 1. The distributed file storage system has low efficiency in calculating the space under the user storage path and takes a lot of time.
[0003] 2. In a distributed platform, the file operation logic is scattered in the services of various business modules. If each business module independently handles the checking and updating of the user's file storage quota, each business module needs to call the above-mentioned calculation logic for calculating the user's storage file space when checking the file storage quota, which is not only inefficient but also causes a waste of computing resources. When updating the user's used storage quota, a synchronization mechanism needs to be adopted, otherwise there is a risk of conflict, which will make the storage space quota control logic invalid.
[0004] 3. The file management system connected to the SAAS platform may adopt a variety of different storage solutions. If each business module is connected separately, each business module needs to adjust the connected storage components.
[0005] Therefore, the current file storage space management method of the SAAS platform makes the real-time update of the file storage space quota poor and the management efficiency low. How to improve the real-time update of the storage space quota and the efficiency of storage space management has become an urgent problem to be solved. Summary of the invention
[0006] The present application provides a method and device for managing file storage space in a SAAS platform to improve the real-time update of storage space quota and the efficiency of storage space management.
[0007] In a first aspect, the present application provides a method for managing file storage space in a SAAS platform, wherein the method for managing file storage space in a SAAS platform is applied to a file storage space management system, wherein the file storage space management system includes a user resource management module, a file storage module, a message queue module, a file operation interface, and a business module, and the method for managing file storage space in a SAAS platform includes: Upon receiving a file storage request from a user, calling the file operation interface based on the business module to obtain a remaining storage amount of the file storage space of the user; When the remaining storage amount is greater than or equal to the size of the file to be stored, storing the file to be stored based on the file storage module; Generate a file storage event message based on the file information and storage status of the file to be stored; Based on the message queue module, sending the file storage event message to the message queue corresponding to the file storage; Based on the user resource management module, the file storage event message is obtained from the message queue, and based on the file storage event message, the file storage space quota of the user is updated.
[0008] In a second aspect, the present application further provides a device for managing file storage space in a SAAS platform, the device comprising: A storage remaining quota acquisition module is used to, upon receiving a file storage request from a user, call the file operation interface based on the business module to acquire the storage remaining quota of the file storage space of the user; A file storage module to be stored, used for storing the file to be stored based on the file storage module when the remaining storage amount is greater than or equal to the size of the file to be stored; A file storage message generating module, used for generating a file storage message based on the file information and storage status of the file to be stored; A file storage message sending module, used for sending the file storage message to a message queue corresponding to the file storage based on the message queue module; The storage space quota updating module is used to obtain the file storage event message from the message queue based on the user resource management module, and update the file storage space quota of the user based on the file storage event message.
[0009] In a third aspect, the present application also provides a computer software component, which includes a memory and a processor; the memory is used to store computer program code; the processor is used to execute the computer program code and implement the file storage space management method in the SAAS platform as described above when executing the computer program.
[0010] In a fourth aspect, the present application further provides a computer program code, which is stored in a computer storage medium, and when the computer program code is executed by a processor, enables the processor to implement a method for managing file storage space in the SAAS platform as described above.
[0011] The present application discloses a method and device for managing file storage space in a SAAS platform. The method for managing file storage space in a SAAS platform is applied to a file storage space management system. The file storage space management system includes a user resource management module, a file storage module, a message queue module, a file operation interface and a business module. The method for managing file storage space in the SAAS platform includes: upon receiving a file storage request from a user, based on the business module, calling the file operation interface to obtain a remaining storage amount of the file storage space of the user; when the remaining storage amount is greater than or equal to the size of the file to be stored, storing the file to be stored based on the file storage module; generating a file storage event message based on the file information and storage status of the file to be stored; based on the message queue module, sending the file storage event message to a message queue corresponding to the file storage; based on the user resource management module, obtaining the file storage event message from the message queue, and updating the file storage space amount of the user based on the file storage event message. In this application, file storage event messages are generated and sent to the message queue through the message queue module, thereby realizing asynchronous processing of file storage operations, ensuring real-time updating of file storage status, and solving the timeliness problem of updating user storage space quotas. At the same time, through the file operation interface, user storage space quotas are uniformly managed, which simplifies file operation logic and improves storage space management efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0013] Figure 1 This is a schematic flow chart of a first embodiment of a method for managing file storage space in a SAAS platform provided by an embodiment of the present application; Figure 2 This is a schematic flow chart of a second embodiment of a method for managing file storage space in a SAAS platform provided by an embodiment of the present application; Figure 3 It is a schematic flow chart of a third embodiment of a method for managing file storage space in a SAAS platform provided by an embodiment of the present application; Figure 4 A schematic block diagram of a device for managing file storage space in a SAAS platform provided in an embodiment of the present application. DETAILED DESCRIPTION
[0014] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0015] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0016] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0017] It should be further understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0018] The embodiment of the present application provides a method and device for managing file storage space in a SAAS platform. The method for managing file storage space in the SAAS platform can be applied to a server, and by generating a file storage event message and sending it to a message queue through a message queue module, asynchronous processing of file storage operations is realized, ensuring real-time updates of file storage status, solving the timeliness problem of updating user storage space quotas, and at the same time, through a file operation interface, unified management of user storage space quotas is performed, simplifying file operation logic and improving storage space management efficiency. The server can be an independent server or a server cluster.
[0019] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0020] See also Figure 1 , Figure 1 It is a schematic flow chart of a method for managing file storage space in a SAAS platform provided in an embodiment of the present application.
[0021] like Figure 1 As shown, the method for managing file storage space in the SAAS platform specifically includes steps S101 to S105.
[0022] S101. Upon receiving a file storage request from a user, calling the file operation interface based on the business module to obtain a remaining storage amount of the file storage space of the user; Furthermore, based on the business module, the file operation interface is called to obtain the remaining storage amount of the user's file storage space, including: based on the business module, the file operation interface is called; based on the file operation interface, the storage capacity quota acquisition interface and the used storage capacity acquisition interface of the user resource management module are called to respectively obtain the storage capacity quota and the used storage capacity of the user's file storage space; based on the storage capacity quota and the used storage capacity, the remaining storage amount is obtained.
[0023] In one embodiment, the method for managing file storage space in the SAAS platform is applied to a file storage space management system, which includes: a user resource management module, a file storage module, a message queue module, and a file operation interface.
[0024] Among them, the user resource management module has functions including setting and managing user file storage space quotas, and provides the following interfaces to the outside world: setting the user's file storage capacity quota, obtaining the user's file storage capacity quota, obtaining the user's used file storage capacity, adjusting the user's used file storage capacity, and recalculating the user's used file storage capacity.
[0025] The file storage module is used to store user files and provides the following interfaces: store files, replace files, delete files, obtain file information, and calculate storage capacity.
[0026] The message queue module is used to send file operation event messages and should provide the following interfaces: create message queues, send messages to topics, and subscribe to message topics.
[0027] The file operation interface is internally connected to the interface of the above-mentioned file storage module, and provides the following file operation interfaces to the business module: store files, update files, delete files, obtain file information, obtain file storage capacity, and obtain file storage quota.
[0028] In one embodiment, the above-mentioned user resource management module is constructed. In the SAAS platform, it is usually in the same module as the user management module, provides a user resource configuration management interface, and stores data in a persistent storage service such as a relational database; the interface of the above-mentioned user resource management module is implemented, which is usually provided as a RestAPI or RPC interface.
[0029] In one embodiment, the file storage module may be constructed using an open source solution or a cloud service, and the interface function provided by the module should meet the above interface requirements.
[0030] In one embodiment, the message queue module may be constructed by adopting an open source message queue solution or using cloud services, and its functions shall meet the message queue interface requirements.
[0031] In one embodiment, the above-mentioned file operation interface is constructed, connected to the external interfaces of the above-mentioned user resource management module and file storage module, and the above-mentioned file operation interface is implemented.
[0032] S102: When the remaining storage amount is greater than or equal to the size of the file to be stored, storing the file to be stored based on the file storage module; S103: Generate a file storage event message based on the file information and storage status of the file to be stored; S104: Based on the message queue module, sending the file storage event message to a message queue corresponding to the file storage; S105: Based on the user resource management module, obtain the file storage event message from the message queue, and based on the file storage event message, update the file storage space quota of the user.
[0033] In one embodiment, SAAS (Software as a Service) is a software distribution model in which software applications are hosted in the cloud and users can access these applications through the Internet without installing and running them on local computers. In a SAAS platform, storage space generally refers to the virtual space provided by the platform to users for storing files, data and other information.
[0034] In one embodiment, the business module is responsible for processing user requests and calling the file operation interface when receiving a file storage request. The file operation interface then calls the storage capacity quota acquisition interface and the used storage capacity acquisition interface of the user resource management module. These two interfaces return the user's storage space quota (such as 10GB) and the current amount of storage space used (such as 5GB) respectively. Through arithmetic operations (storage space quota - used storage capacity), the system calculates the user's current remaining storage quota (such as 10GB - 5GB = 5GB).
[0035] In one embodiment, if the calculated remaining storage amount is greater than or equal to the size of the file to be stored (e.g., 5GB>3GB), the file storage module will start processing the uploaded file to be stored. The file storage module is responsible for actually writing the file into the storage system, which may include pre-processing steps such as file encryption, compression, and segmentation, as well as writing the file data into a physical or virtual storage location.
[0036] In one embodiment, after a file is successfully stored, the system generates a file storage event message based on the stored file information and storage status. The message may include information such as the file name, file size, storage location, storage timestamp, and the status of the storage operation (success or failure).
[0037] In one embodiment, the generated file storage event message will be sent to a specific queue in the message queue module. This queue is used to process events related to file storage, ensuring that all system components that need to know the file storage status can receive this event.
[0038] In one embodiment, the user resource management module monitors messages about file storage in the message queue. When a storage event message is detected, the message is extracted from the queue. Then, the user resource management module updates the user's file storage space quota according to the content of the message, and increases the user's used storage quota by the corresponding file size.
[0039] In a specific embodiment, the business module calls the storage file interface of the above-mentioned file operation interface. The interface checks whether the remaining quota can store the current file by calling the above-mentioned user resource management module to obtain the user's file storage capacity quota and obtain the user's used file storage capacity. If the quota is exceeded, an error message is returned. If the limit has not been reached, the file is stored through the storage file interface of the above-mentioned file storage module, and then a file storage event message is generated and sent to the message queue of the corresponding topic through the publishing message interface of the above-mentioned message queue module.
[0040] In one embodiment, the user resource management module subscribes to the file storage event message in the message queue module, obtains the storage file size, and adds it to the user's used storage space quota.
[0041] See also Figure 2 , Figure 2 It is a schematic flow chart of a method for managing file storage space in a SAAS platform provided in an embodiment of the present application.
[0042] like Figure 2 As shown, the method for managing file storage space in the SAAS platform specifically includes steps S201 to S206.
[0043] S201. Upon receiving a file update request from the user, determining a file to be updated, and based on the business module, calling the file operation interface to obtain an original file corresponding to the file to be updated and file information of the original file; S202: comparing the file sizes of the original file and the file to be updated based on the file information of the original file; S203: When the file size of the file to be updated is smaller than or equal to the file size of the original file, updating the original file to the file to be updated; S204: Generate a file update event message based on the file information and update status of the file to be updated; S205, based on the message queue module, sending the file update event message to the message queue corresponding to the file update; S206: Based on the user resource management module, obtain the file update event message from the message queue, and based on the file update event message, update the file storage space quota of the user.
[0044] In one embodiment, when a user performs a file update operation (e.g., uploading a new version of a file) through an operation interface, the system will receive a file update request. The system will verify the user's authority and determine the specific file that needs to be updated, including identifying the unique identifier of the file, such as the file name or ID.
[0045] In one embodiment, the system calls the file operation interface to obtain the original version information of the file to be updated, including its size, and then compares the file size of the original file with the size of the file to be updated to determine whether the user's available storage space quota can meet the capacity requirement after replacing the new file.
[0046] In one embodiment, if the file size of the file to be updated is less than or equal to the file size of the original file, the system replaces the original file with the new version, including rewriting the file content to the storage device and updating the file-related metadata (such as modification date, version number, etc.).
[0047] In one embodiment, after the file update is completed, a file update event message is generated based on the updated file information and update status, including information such as the updated file name, new version number, file size before update, and file size after update.
[0048] In one embodiment, the generated file update event message will be sent to a specific queue in the message queue module. This queue is used to process events related to file updates and ensure that all system components that need to be updated can receive this event. The message queue ensures the order of messages and the stability of the system, and provides a buffer to reduce the direct communication pressure of system components.
[0049] In one embodiment, the user resource management module monitors the messages about file updates in the message queue. When an update event message is detected, the message is extracted from the queue. Then, the user resource management module updates the user's file storage space quota according to the content of the message. If the updated file is smaller than the original file, the user's available storage space will increase; if the updated file is larger than the original file, the user's available storage space will decrease.
[0050] Furthermore, after comparing the file sizes of the original file and the file to be updated based on the file information of the original file, the method also includes: when the file size of the file to be updated is larger than the file size of the original file, obtaining the remaining storage amount of the file storage space of the user; when the difference between the file size of the file to be updated and the file size of the original file is smaller than the remaining storage amount, updating the original file to the file to be updated; based on the file information and update status of the file to be updated, generating the file update event message; based on the message queue module, sending the file update event message to the message queue corresponding to the file update; based on the user resource management module, obtaining the file update event message from the message queue, and updating the file storage space amount of the user based on the file update event message.
[0051] In one embodiment, if the file size of the file to be updated is larger than the file size of the original file, first check whether the remaining amount of the user's file storage space is sufficient to store the new file. The remaining amount check is to prevent the user from updating the file when the storage space is insufficient, and to ensure the feasibility of the update.
[0052] In one embodiment, if (file size of the file to be updated - file size of the original file) < (storage capacity quota of the file storage space - used storage capacity), where the storage capacity quota of the file storage space - used storage capacity is the remaining storage quota of the file storage space, then the original file is replaced with the new version. Otherwise, an error message is returned to inform the user that the storage space is insufficient and the update cannot be completed.
[0053] In one embodiment, after the file update is completed, the system will generate a file update event message based on the updated file information and update status, which may include information such as the updated file name, new version number, file size before update, file size after update, and update status.
[0054] In one embodiment, the generated file update event message will be sent to a specific queue in the message queue module. This queue is used to process events related to file updates to ensure that all system components that need to be updated can receive the event.
[0055] In one embodiment, the user resource management module monitors the messages about file updates in the message queue. When an update event message is detected, the message is extracted from the queue. Then, the user resource management module updates the user's file storage space quota according to the content of the message. If the updated file is larger than the original file, the corresponding difference is subtracted from the user's available storage space.
[0056] In a specific embodiment, the business module calls the file replacement interface of the above-mentioned file operation interface, and the interface calls the file information acquisition interface of the above-mentioned file storage module to obtain the original file information, and compares it with the new file. If the new file is larger than the original file, the user resource management module is called to obtain the user file storage capacity quota interface and the user used file storage capacity quota interface to obtain the current user storage space quota and the used quota, and check whether the difference between the remaining quota and the file size can store the current file. If the limit is exceeded, an error message is returned. If the new file is smaller than the original file, or the storage quota can meet the file storage, the file is updated through the file update interface; after the file is updated, a file update message notification is generated according to the original file information and the new file information, and sent to the message queue of the corresponding topic through the message publishing interface of the above-mentioned message queue module.
[0057] In one embodiment, the user resource management module subscribes to the file update event message in the message queue module, obtains the difference in file size, and adjusts the user's used storage space file storage usage quota.
[0058] See also Figure 3 , Figure 3 It is a schematic flow chart of a method for managing file storage space in a SAAS platform provided in an embodiment of the present application.
[0059] like Figure 3 As shown, the method for managing file storage space in the SAAS platform specifically includes steps S301 to S305.
[0060] S301, upon receiving a file deletion request from a user, calling the file operation interface based on a business module; S302: Based on the file operation interface, call the file information acquisition interface of the file storage module to acquire file information of the file to be deleted, and call the file deletion interface of the file storage module to delete the file to be deleted; S303: Generate a file deletion event message based on the file information and deletion status of the file to be deleted; S304: Based on the message queue module, send the file deletion event message to the message queue corresponding to the file deletion; S305: Based on the user resource management module, obtain the file deletion event message from the message queue, and based on the file deletion event message, update the file storage space quota of the user.
[0061] In one embodiment, when a user initiates a file deletion request, the request is usually triggered through a user interface, such as clicking a delete button. After receiving the request, the system calls the corresponding file operation interface according to the needs of the business module. This interface is pre-defined and is used to perform file-related operations. The system will determine whether the user has the authority to delete the file based on the current business process (business module) and which file operation interface needs to be called to perform the deletion operation.
[0062] In one embodiment, the file operation interface is used to call the file information acquisition interface of the file storage module to obtain detailed information of the file to be deleted, such as the file name, path, size, etc. Then, the file deletion interface of the file storage module is called to actually delete the file from the storage medium.
[0063] In one embodiment, during the deletion process, the system checks whether the file exists and its deletion status to ensure the correctness of the operation.
[0064] In one embodiment, after a file is successfully deleted, the system generates a file deletion event message based on the file information and deletion status of the file to be deleted. This message contains all necessary information about the deletion operation for use in subsequent steps. It can include basic information about the file, such as the file name, path, size, and the timestamp of the deletion operation.
[0065] In one embodiment, the system sends the generated file deletion event message to a corresponding message queue.
[0066] In one embodiment, the user resource management module listens to and obtains file deletion event messages from the message queue. After obtaining the message, the module updates the user's file storage space quota based on the file information in the message, including reducing the user's storage quota or releasing corresponding storage resources.
[0067] In a specific embodiment, the business module calls the file deletion interface of the above-mentioned file operation interface, and the interface calls the file information acquisition interface of the above-mentioned file storage module to obtain the file information, and then deletes the file through the file deletion interface. After deleting the file, a file deletion message notification is generated and sent to the message queue of the corresponding topic through the message publishing interface of the above-mentioned message queue module.
[0068] In one embodiment, the user resource management module subscribes to the file deletion event message in the message queue module, obtains the deleted file information, and reduces the user's used storage space quota.
[0069] In the above embodiment, it is ensured that files are correctly removed from storage, system components are notified, and the user's storage space quota is updated in a timely manner, thereby reducing data loss and quota management errors and providing users with a smooth and reliable service experience.
[0070] In one embodiment, through a public file operation interface, the business module only needs to call the interface corresponding to the current file operation. There is no need to handle the user storage space quota management separately, nor is there any need to handle the differences in file storage modules. This simplifies the file operation logic of the business module and improves management efficiency.
[0071] Furthermore, after obtaining the file storage event message from the message queue based on the user resource management module and updating the file storage space quota of the user based on the file storage event message, it also includes: when a preset storage capacity statistics time arrives, calling the storage capacity calculation interface of the file storage module, counting the storage space usage information of each user, and updating the file storage space quota of each user.
[0072] In one embodiment, to achieve decoupling, message notifications of file operations are sent asynchronously through a message queue. If a message queue failure or a network failure occurs, the user's used storage space quota may be incorrectly updated. Therefore, the user resource management module periodically calls the storage capacity calculation interface of the above-mentioned file storage module, re-counts the storage space usage quota of each user, and updates it to the persistent storage information.
[0073] See also Figure 4 , Figure 4 The embodiment of the present application provides a schematic block diagram of a file storage space management device in a SAAS platform, and the file storage space management device in the SAAS platform is used to execute the aforementioned file storage space management method in the SAAS platform. The file storage space management device in the SAAS platform can be configured on a server.
[0074] like Figure 4As shown, the management device 400 for file storage space in the SAAS platform includes: The storage remaining quota acquisition module 401 is used to call the file operation interface based on the business module to acquire the storage remaining quota of the file storage space of the user when receiving a file storage request from the user; The to-be-stored file storage module 402 is used to store the to-be-stored file based on the file storage module when the remaining storage amount is greater than or equal to the size of the to-be-stored file; A file storage message generating module 403, configured to generate a file storage message based on the file information and storage status of the file to be stored; A file storage message sending module 404, configured to send the file storage message to a message queue corresponding to the file storage based on the message queue module; The storage space quota updating module 405 is used to obtain the file storage event message from the message queue based on the user resource management module, and update the file storage space quota of the user based on the file storage event message.
[0075] Furthermore, the storage remaining amount acquisition module 401 includes: An operation interface calling unit, used to call the file operation interface based on the business module; A storage information acquisition unit, configured to call the storage capacity quota acquisition interface and the used storage capacity acquisition interface of the user resource management module based on the file operation interface, and respectively acquire the storage capacity quota and the used storage capacity of the file storage space of the user; The remaining quota obtaining unit is used to obtain the storage remaining quota based on the storage capacity quota and the used storage capacity.
[0076] Furthermore, the file storage space management device 400 in the SAAS platform further includes a file update module, and the file update module includes: A file information acquisition unit, configured to determine a file to be updated upon receiving a file update request from the user, and based on the business module, call the file operation interface to acquire an original file corresponding to the file to be updated and file information of the original file; A file size comparison unit, configured to compare the file sizes of the original file and the file to be updated based on the file information of the original file; A file updating unit, configured to update the original file to the file to be updated when the file size of the file to be updated is less than or equal to the file size of the original file; An event message generating unit, configured to generate a file update event message based on the file information and update status of the file to be updated; A message sending unit, configured to send the file update event message to a message queue corresponding to the file update based on the message queue module; The quota updating unit is used to obtain the file update event message from the message queue based on the user resource management module, and update the file storage space quota of the user based on the file update event message.
[0077] Furthermore, the file update module further includes: A remaining amount acquisition unit, configured to acquire a remaining amount of storage of the file storage space of the user when the file size of the file to be updated is larger than the file size of the original file; A file updating unit, configured to update the original file to the file to be updated when the difference between the file size of the file to be updated and the file size of the original file is less than the remaining storage amount; An event message generating unit, configured to generate the file update event message based on the file information and update status of the file to be updated; An event message sending unit, configured to send the file update event message to a message queue corresponding to the file update based on the message queue module; The space quota updating unit is used to obtain the file update event message from the message queue based on the user resource management module, and update the file storage space quota of the user based on the file update event message.
[0078] Furthermore, the file storage space management device 400 in the SAAS platform further includes a file deletion module, and the file deletion module includes: An operation interface calling unit, configured to call the file operation interface based on the business module upon receiving a file deletion request from a user; A file deleting unit, configured to call the file information acquisition interface of the file storage module based on the file operation interface to acquire file information of the file to be deleted, and call the file deletion interface of the file storage module to delete the file to be deleted; An event message generating unit, configured to generate a file deletion event message based on the file information and deletion status of the file to be deleted; An event message sending unit, configured to send the file deletion event message to a message queue corresponding to the file deletion based on the message queue module; The quota updating unit is used to obtain the file deletion event message from the message queue based on the user resource management module, and update the file storage space quota of the user based on the file deletion event message.
[0079] Furthermore, the file storage space management device 400 in the SAAS platform further includes: The timing statistics module is used to call the storage capacity calculation interface of the file storage module when the preset storage capacity statistics time arrives, count the storage space usage information of each user, and update the file storage space quota of each user.
[0080] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0081] The above-mentioned device can be implemented in the form of a computer program code, and the computer program can be run on a computer software component.
[0082] A computer program code is also provided in an embodiment of the present application. The computer program code is stored in a computer-readable storage medium. The computer program code includes program instructions. The processor executes the program instructions to implement a method for managing file storage space in any SAAS platform provided in an embodiment of the present application.
[0083] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for managing file storage space in a SAAS platform, characterized in that: The method for managing file storage space in the SAAS platform is applied to a file storage space management system, which includes a user resource management module, a file storage module, a message queue module, a file operation interface and a business module. The method for managing file storage space in the SAAS platform includes: Upon receiving a file storage request from a user, calling the file operation interface based on the business module to obtain a remaining storage amount of the file storage space of the user; When the remaining storage amount is greater than or equal to the size of the file to be stored, storing the file to be stored based on the file storage module; Generate a file storage event message based on the file information and storage status of the file to be stored; Based on the message queue module, sending the file storage event message to the message queue corresponding to the file storage; Based on the user resource management module, the file storage event message is obtained from the message queue, and based on the file storage event message, the file storage space quota of the user is updated.
2. The method for managing file storage space in a SAAS platform according to claim 1, characterized in that: The calling the file operation interface based on the business module to obtain the remaining storage amount of the file storage space of the user includes: Based on the business module, calling the file operation interface; Based on the file operation interface, calling the storage capacity quota acquisition interface and the used storage capacity acquisition interface of the user resource management module to respectively acquire the storage capacity quota and the used storage capacity of the file storage space of the user; The storage remaining quota is obtained based on the storage capacity quota and the used storage capacity.
3. The method for managing file storage space in a SAAS platform according to claim 1, characterized in that: After obtaining the file storage event message from the message queue based on the user resource management module and updating the file storage space quota of the user based on the file storage event message, the method further includes: Upon receiving a file update request from the user, determining a file to be updated, and based on the business module, calling the file operation interface to obtain an original file corresponding to the file to be updated and file information of the original file; Based on the file information of the original file, comparing the file sizes of the original file and the file to be updated; When the file size of the file to be updated is smaller than or equal to the file size of the original file, updating the original file to the file to be updated; Generate a file update event message based on the file information and update status of the file to be updated; Based on the message queue module, sending the file update event message to the message queue corresponding to the file update; Based on the user resource management module, the file update event message is obtained from the message queue, and based on the file update event message, the file storage space quota of the user is updated.
4. The method for managing file storage space in a SAAS platform according to claim 3, characterized in that: After comparing the file size of the original file with the file to be updated based on the file information of the original file, the method further includes: When the file size of the file to be updated is larger than the file size of the original file, obtaining the remaining storage amount of the file storage space of the user; When the difference between the file size of the to-be-updated file and the file size of the original file is less than the remaining storage amount, updating the original file to the to-be-updated file; Generate the file update event message based on the file information and update status of the file to be updated; Based on the message queue module, sending the file update event message to the message queue corresponding to the file update; Based on the user resource management module, the file update event message is obtained from the message queue, and based on the file update event message, the file storage space quota of the user is updated.
5. The method for managing file storage space in a SAAS platform according to claim 1, characterized in that: After obtaining the file storage event message from the message queue based on the user resource management module and updating the file storage space quota of the user based on the file storage event message, the method further includes: Upon receiving a file deletion request from a user, calling the file operation interface based on the business module; Based on the file operation interface, calling the file information acquisition interface of the file storage module to acquire the file information of the file to be deleted, and calling the file deletion interface of the file storage module to delete the file to be deleted; Generate a file deletion event message based on the file information and deletion status of the file to be deleted; Based on the message queue module, sending the file deletion event message to the message queue corresponding to the file deletion; Based on the user resource management module, the file deletion event message is obtained from the message queue, and based on the file deletion event message, the file storage space quota of the user is updated.
6. The method for managing file storage space in a SAAS platform according to any one of claims 1 to 5, characterized in that: After obtaining the file storage event message from the message queue based on the user resource management module and updating the file storage space quota of the user based on the file storage event message, the method further includes: When the preset storage capacity statistics time arrives, the storage capacity calculation interface of the file storage module is called to count the storage space usage information of each user, and update the file storage space quota of each user.
7. A file storage space management device in a SAAS platform, characterized in that: include: A storage remaining quota acquisition module is used to, upon receiving a file storage request from a user, call the file operation interface based on the business module to acquire the storage remaining quota of the file storage space of the user; A file storage module to be stored, used for storing the file to be stored based on the file storage module when the remaining storage amount is greater than or equal to the size of the file to be stored; A file storage message generating module, used for generating a file storage message based on the file information and storage status of the file to be stored; A file storage message sending module, used for sending the file storage message to a message queue corresponding to the file storage based on the message queue module; The storage space quota updating module is used to obtain the file storage event message from the message queue based on the user resource management module, and update the file storage space quota of the user based on the file storage event message.
8. The method for managing file storage space in a SAAS platform according to claim 1, characterized in that: The storage remaining amount acquisition module includes: An operation interface calling unit, used to call the file operation interface based on the business module; A storage information acquisition unit, configured to call the storage capacity quota acquisition interface and the used storage capacity acquisition interface of the user resource management module based on the file operation interface, and respectively acquire the storage capacity quota and the used storage capacity of the file storage space of the user; The remaining amount obtaining unit is used to obtain the storage remaining amount based on the storage capacity quota and the used storage capacity.
9. The method for managing file storage space in a SAAS platform according to claim 1, characterized in that: The management device of the file storage space in the SAAS platform further includes a file update module, and the file update module includes: A file information acquisition unit, configured to determine a file to be updated upon receiving a file update request from the user, and based on the business module, call the file operation interface to acquire an original file corresponding to the file to be updated and file information of the original file; A file size comparison unit, configured to compare the file sizes of the original file and the file to be updated based on the file information of the original file; A file updating unit, configured to update the original file to the file to be updated when the file size of the file to be updated is less than or equal to the file size of the original file; An event message generating unit, configured to generate a file update event message based on the file information and update status of the file to be updated; A message sending unit, configured to send the file update event message to a message queue corresponding to the file update based on the message queue module; The quota updating unit is used to obtain the file update event message from the message queue based on the user resource management module, and update the file storage space quota of the user based on the file update event message.
10. The method for managing file storage space in a SAAS platform according to claim 9, characterized in that: The file update module further includes: A remaining amount acquisition unit, configured to acquire a remaining amount of storage of the file storage space of the user when the file size of the file to be updated is larger than the file size of the original file; A file updating unit, configured to update the original file to the file to be updated when the difference between the file size of the file to be updated and the file size of the original file is less than the remaining storage amount; An event message generating unit, configured to generate the file update event message based on the file information and update status of the file to be updated; An event message sending unit, configured to send the file update event message to a message queue corresponding to the file update based on the message queue module; The space quota updating unit is used to obtain the file update event message from the message queue based on the user resource management module, and update the file storage space quota of the user based on the file update event message.