Quota alarm method and device, electronic equipment and medium
By setting multiple quota ranges and corresponding alarm increments in the object storage system, the alarm frequency is gradually increased, which solves the problem of lack of early warning in the traditional hard quota alarm mechanism, achieves more flexible and controllable storage quota management, and avoids the need for resources. Risks arising from overuse.
Patent Information
- Application Number
- CN202410650469.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-23
- Publication Date
- 2024-09-20
AI Technical Summary
The traditional hard quota alarm mechanism of object storage systems suddenly blocks uploads when users reach the upper limit of the quota. It lacks an effective early warning function and cannot gradually urge users to reasonably manage storage space.
By setting multiple non-overlapping quota ranges, each range corresponds to an alarm increment, and detects and gradually increases the alarm frequency at fixed intervals based on the used quota, providing more precise control and monitoring to ensure that users' storage usage is close to the quota. Receive alerts in a timely manner within a limited time to avoid sudden failure to upload.
This method enables users to better manage storage space, avoid system crashes or performance degradation caused by resource overuse, provide a flexible and controllable storage quota management method, and reduce the risk of sudden data overflow or unexpected large-scale writes. security risks.
Smart Images

Figure CN118672497A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of quota alarm, and in particular to a quota alarm method, device, electronic equipment and medium. Background Art
[0002] The quota alarms of traditional object storage systems are divided into soft quota alarms and hard quota alarms. When the objects uploaded by users reach the alarm threshold, an alarm is reported. Once a hard quota alarm is reported, users will not be able to upload objects. This alarm mechanism does not play a sufficient early warning role and cannot gradually urge users to manage their space reasonably. Summary of the invention
[0003] In order to overcome the problems existing in the related art, the present disclosure provides a quota warning method, device, electronic device and medium. The technical solution of the present disclosure is as follows:
[0004] According to a first aspect of an embodiment of the present disclosure, a quota alarm method is provided, including:
[0005] Obtaining a correspondence between multiple quota ranges and alarm increments; wherein, a quota range having a larger quota value has a smaller corresponding alarm increment; and the multiple quota ranges do not overlap;
[0006] Check the used quota of the object storage system at regular intervals;
[0007] Determine the target quota range in which the used quota is located, and determine the target alarm increment corresponding to the target quota range according to the corresponding relationship;
[0008] Determining whether the used quota triggers an alarm based on the target quota range and the target alarm increment. Optionally, determining whether the used quota triggers an alarm based on the target quota range and the target alarm increment includes:
[0009] Dividing the target quota range into a plurality of sub-ranges according to the target alarm increment;
[0010] When the used quota is currently in any target sub-range and the used quota obtained in the last detection is not in the target sub-range, an alarm is triggered; the alarm carries an alarm description, and the alarm description at least includes: the value of the used quota and the proportion of the used quota to the total quota.
[0011] Optionally, after determining whether the used quota triggers an alarm, the method further comprises:
[0012] In each case where the alarm is triggered, canceling the alarm that was triggered last time;
[0013] In the case where the currently used quota is within the safety quota range and there is an alarm triggered by the used quota detected last time, canceling the alarm triggered by the used quota detected last time;
[0014] The cancelled alarm is added to the historical alarms.
[0015] Optionally, obtaining the correspondence between multiple quota ranges and alarm increments includes:
[0016] Obtaining a preset hard quota threshold and at least one quota ratio corresponding to the preset hard quota threshold;
[0017] determining the multiple quota ranges according to the hard quota threshold and the quota ratio of any two adjacent values;
[0018] Obtaining at least one preset alarm increment;
[0019] According to the alarm increment and the quota range, a corresponding relationship between the alarm increment and the quota range is established; wherein one quota range corresponds to one alarm increment.
[0020] Optionally, the hard quota threshold includes a capacity hard quota threshold and an object number hard quota threshold; the capacity hard quota threshold represents: the maximum data capacity stored by the object storage system; the object number hard quota threshold represents: the maximum number of objects stored by the object storage system; the target quota range includes: a target capacity quota range and a target object number quota range; the target alarm increment includes a target capacity alarm increment and an object number alarm increment; the used quota includes: a used capacity quota and a used object number quota; the determination of the multiple quota ranges according to the hard quota threshold and the quota ratio of any two adjacent values includes:
[0021] Obtaining the capacity hard quota threshold and the quota ratio corresponding to the capacity hard quota threshold;
[0022] Determining the capacity quota range according to the capacity hard quota threshold and the quota ratio corresponding to the capacity hard quota threshold;
[0023] Obtaining the hard quota threshold for the number of objects and the quota ratio corresponding to the hard quota threshold for the number of objects;
[0024] Determining the object number quota range according to the object number hard quota threshold and the quota ratio corresponding to the object number hard quota threshold;
[0025] The determining, according to the target quota range and the target alarm increment, whether the used quota triggers an alarm includes:
[0026] determining whether the used capacity quota triggers an alarm according to the target capacity quota range and the target capacity alarm increment; and / or,
[0027] It is determined whether the used object number quota triggers an alarm according to the target object number quota range and the target object number alarm increment.
[0028] Optionally, the method further comprises:
[0029] When the currently used capacity quota is greater than or equal to the capacity hard quota threshold, triggering a capacity hard quota alarm, and refusing to upload data to the object storage system;
[0030] When the currently used object number quota is greater than or equal to the object number hard quota threshold, an object number hard quota alarm is triggered, and uploading data to the object storage system is refused.
[0031] Optionally, the method further comprises:
[0032] Collecting each of the used quotas detected within a preset time period;
[0033] According to each of the used quotas, obtaining a quota growth rate of the used quota;
[0034] According to the quota growth rate, a predicted time when the used quota reaches a hard quota threshold is obtained; and a prediction alarm is reported regularly, wherein the prediction alarm carries the predicted time.
[0035] Optionally, the method further comprises:
[0036] The used quota is changed by uploading data to the object storage system and / or deleting data in the object storage system.
[0037] According to a second aspect of an embodiment of the present disclosure, a quota alarm device is provided, including:
[0038] An acquisition module, used to acquire a correspondence between multiple quota ranges and alarm increments; wherein, a quota range having a larger quota value has a smaller corresponding alarm increment; and the multiple quota ranges do not overlap;
[0039] A detection module, used for detecting the used quota of the object storage system at fixed time intervals;
[0040] A determination module, configured to determine a target quota range in which the used quota is located, and determine a target alarm increment corresponding to the target quota range according to the corresponding relationship;
[0041] The trigger module is used to determine whether the used quota triggers an alarm according to the target quota range and the target alarm increment.
[0042] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the quota alarm method described in the first aspect are implemented.
[0043] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the quota warning method described in the first aspect are implemented.
[0044] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the quota warning method described in the first aspect are implemented.
[0045] The present disclosure provides more precise control and monitoring by setting multiple non-overlapping quota ranges, and each range has a corresponding alarm increment. Since the alarm increment decreases as the quota value increases, the system can provide more frequent alarms when the user's storage usage approaches the quota limit, which helps the user better manage its storage space. Traditional hard quota alarms suddenly block more uploads when the user reaches the quota limit, which may cause sudden inconvenience to the user. In contrast, this method detects at fixed time intervals and gradually increases the alarm frequency based on usage, giving the user time to respond and adjust storage usage to avoid sudden inability to upload. Such an early warning mechanism effectively prompts users to gradually optimize and manage storage resources, rather than suddenly realizing the problem after reaching the hard limit. The present disclosure provides a more flexible and controllable way to manage users' storage quotas. By adjusting the alarm increment corresponding to each quota range, the administrator can flexibly adjust the alarm strategy according to the actual situation and the specific needs of the user, thereby more effectively managing the overall capacity and performance of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the description of the embodiments of the present disclosure will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0047] Figure 1 It is a schematic diagram of the steps of a quota alarm method shown in an embodiment of the present disclosure;
[0048] Figure 2 This is a flowchart of alarm reporting step by step shown in an embodiment of the present disclosure;
[0049] Figure 3 is a flowchart of a step-by-step alarm recovery process shown in an embodiment of the present disclosure;
[0050] Figure 4 is a block diagram of a quota alarm device shown in an embodiment of the present disclosure;
[0051] Figure 5 is a schematic diagram of an electronic device shown in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0053] The terms "first", "second", etc. in the specification and claims of the present disclosure are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable when appropriate, so that the embodiments of the present disclosure can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0054] In the related art, the quota alarm of the object storage system is divided into soft quota alarm and hard quota alarm. When the objects uploaded by the user reach the alarm threshold, an alarm is reported. Once the hard quota alarm is reported, the user will not be able to upload objects. The alarm mechanism does not play a sufficient early warning role and cannot gradually urge users to reasonably manage their own space.
[0055] In order to solve the above technical problems, the present disclosure proposes a quota alarm method and system, which can report the occupancy status of the object storage system step by step, and can help users better manage their storage space. Before the used amount equals the hard quota and data cannot be written, the user can respond in advance through alarm information of varying degrees.
[0056] Figure 1 FIG. 1 is a schematic diagram of the steps of a quota warning method shown in an embodiment of the present disclosure. Figure 1As shown, the quota warning method may specifically include the following steps:
[0057] Step S11: Obtaining a correspondence between multiple quota ranges and alarm increments; wherein, a quota range having a larger quota value has a smaller corresponding alarm increment; and the multiple quota ranges do not overlap.
[0058] First, obtain the hard quota threshold, which indicates that when the used quota reaches the hard quota, uploading of objects is not allowed. According to the hard quota threshold, determine the quota range that can trigger the alarm. For example, when the hard quota threshold is 100, the quota range can be 70-100, quota range A: 70-95, quota range B: 95-100. The quota ranges are continuous but do not overlap.
[0059] Get the alarm increment, and design a calculation method for the alarm increment based on the relationship between the quota value and the alarm increment. For example, the alarm increment can be determined by using an inverse relationship (such as 1 / x) or a linear reduction method (such as the maximum value minus a ratio of the current quota range). For example, the alarm increment A can be 10, and the alarm increment B can be 1.
[0060] A correspondence between the quota range and the alarm increment is established, wherein the correspondence is obtained according to the value of the alarm increment and the value included in the quota range. The smaller the value included in the quota range, the larger the alarm increment corresponding to the quota range. For example, the value included in quota range A is 70-95, and the value included in quota range B is 95-100; then the alarm increment corresponding to quota range A is alarm increment A, and the alarm increment corresponding to quota range B is alarm increment B. A table or data structure can be established to map each quota range and the corresponding alarm increment. For example, a dictionary can be used for storage, wherein the key is the quota range (using the starting value of the range or the representation of the range), and the value is the corresponding alarm increment.
[0061] Step S12: Detect the used quota of the object storage system at fixed time intervals.
[0062] The space occupied by the used quota in the object storage system is obtained at fixed time intervals, including the used capacity quota and the used object number quota. When configuring the hard quota threshold for the object storage system, it is necessary to configure the capacity hard quota and the object number hard quota; the capacity hard quota threshold represents: the maximum data capacity stored by the object storage system; the object number hard quota threshold represents: the maximum number of objects stored by the object storage system. It is necessary to determine whether to trigger an alarm based on the used capacity quota and the used object number quota.
[0063] Step S13: determining the target quota range in which the used quota is located, and determining the target alarm increment corresponding to the target quota range according to the corresponding relationship.
[0064] According to the obtained used quota, determine whether the used quota is within the quota range. If the used quota is not within the quota range but within the safety quota range, no alarm is issued. The safety quota range is a range with a low proportion of occupied hard quota. For example, when the hard quota threshold is 100, the safety quota range is 0-70.
[0065] If the used quota is within the target quota range, the target quota increment corresponding to the target quota range is determined according to the correspondence between the quota range and the quota increment. A data structure can be designed to store the quota range and the corresponding alarm increment, which can be implemented using an array, a list, or a database table; a function or method can be written to return the quota range and the corresponding alarm increment according to the current used quota; the function should traverse or query the previously configured data structure to find the first quota range that contains the current used quota.
[0066] Among them, in an optional embodiment, the obtaining of the correspondence between multiple quota ranges and alarm increments includes: obtaining a preset hard quota threshold and at least one quota ratio corresponding to the preset hard quota threshold; determining the multiple quota ranges according to the hard quota threshold and the quota ratio of any two adjacent values; obtaining at least one preset alarm increment; establishing a correspondence between the alarm increment and the quota range according to the alarm increment and the quota range; wherein, one quota range corresponds to one alarm increment.
[0067] In the related art, the administrator will manually fill in the soft quota threshold and the hard quota threshold. The system only prompts that the soft quota needs to be smaller than the hard quota and recommends configuring it as 70% of the hard quota. When the user sets the soft quota, he needs to calculate and fill it in by himself. Therefore, the usability in this aspect needs to be improved. Therefore, in order to improve the usability of the alarm threshold, the present disclosure proposes a solution to overcome this problem.
[0068] First, obtain the preset hard quota threshold. The hard quota threshold is the upper limit value, that is, the maximum value that the current object storage space can store. Exceeding this value may cause system performance degradation or service interruption. Obtain one or more quota ratios corresponding to the hard quota threshold. Hard quotas include capacity hard quotas and object number hard quotas. Obtain one or more quota ratios corresponding to capacity hard quotas, and obtain one or more quota ratios corresponding to object number hard quotas; for example, reaching 75% or 90% of the quota ratios. These ratios are used to warn that the system is approaching the limit.
[0069] According to the hard quota threshold and the quota ratio of any two adjacent values, a specific value range is calculated to determine the multiple quota ranges, ensuring that the calculation of each quota range is continuous and non-overlapping, covering the entire quota interval that can trigger an alarm. For example, if the capacity hard quota is 100GB, and the quota ratios corresponding to the capacity hard quota include 70%, 95% and 100%, then the quota range 1 is 70-95GB, and the quota range 2 is 95-100GB.
[0070] Obtain at least one preset alarm increment; wherein, according to the relationship between the quota value and the alarm increment, a calculation method for the alarm increment can be designed to obtain the corresponding alarm increment; it can also be set based on risk assessment, business needs or historical data statistics. In addition, the alarm increment can be a fixed value (such as issuing an alarm for every increase of 10GB) or a percentage increment (such as issuing an alarm for every increase of 10% in usage).
[0071] Assign an appropriate alarm increment to each quota range. For example, for the range of 70GB to 95GB, an alarm may be triggered every 10GB increase; while for the range of 95GB to 100GB, an alarm may be triggered every 1GB increase due to the higher risk. Ensuring this correspondence helps to alert system administrators or automated monitoring systems in a timely manner so that they can take necessary actions to prevent quota overflow.
[0072] The embodiments of the present disclosure allow the quota range and the corresponding alarm increment to be customized according to different needs and scenarios, which is highly scalable and flexible; the system can perform more refined management and allocation according to resource usage, thereby optimizing resource utilization. By automatically establishing a corresponding relationship between the alarm increment and the quota range, the automation of resource management and monitoring can be achieved. The system can automatically adjust the quota range and alarm strategy according to preset rules and algorithms, thereby reducing manual intervention and improving management efficiency.
[0073] Step S14: Determine whether the used quota triggers an alarm according to the target quota range and the target alarm increment.
[0074] According to the target quota range and the target alarm increment to which the used quota belongs, and the occupancy of the used quota in the object storage system obtained by the last detection, it is determined whether the used quota triggers an alarm. Using the embodiments of the present disclosure, by setting different quota ranges and corresponding alarm increments, the system can manage storage resources more finely. A larger quota range with a smaller alarm increment means that the system can gradually increase the alarm frequency as the used quota increases, thereby achieving stricter monitoring of storage space. By regularly detecting the used quota and comparing it with the preset alarm threshold, the risk of resource exhaustion can be discovered in time. This early warning mechanism helps to avoid system crashes or performance degradation caused by excessive use. Real-time monitoring and management of quotas can reduce security risks caused by sudden data overflow or unexpected large amounts of data writing. System administrators can take timely measures based on alarms, such as expanding capacity or migrating data, to ensure data integrity and security.
[0075] Figure 2 This is a flowchart of a step-by-step alarm reporting process shown in an embodiment of the present disclosure. Figure 2 As shown, set the hard quota threshold, and the soft quota threshold is automatically filled at 70% of the hard quota threshold, and the filling ratio can be modified; continue to upload objects through the S3 protocol; the used quota reaches the soft quota threshold; report the soft quota alarm; continue to upload objects; determine whether the used quota is lower than 95% of the hard quota threshold; if the used quota is lower than 95% of the hard quota threshold, again determine whether the used quota is greater than or equal to the soft quota threshold + n*10% of the hard quota threshold, and if it is determined to be yes, report A new alarm is generated, the previous alarm is canceled, and writing to the object continues; when the used quota is not less than 95% of the hard quota threshold, it is determined again whether the used quota is less than the hard quota threshold; when the used quota is greater than or equal to the hard quota threshold, the object cannot be written; when the used quota is lower than the hard quota threshold, it is determined whether the used quota is greater than the soft quota threshold + n*1% of the hard quota threshold. If the judgment is yes, a new alarm is reported, the previous alarm is canceled, and writing to the object continues.
[0076] Among them, in an optional embodiment, determining whether the used quota triggers an alarm based on the target quota range and the target alarm increment includes: dividing the target quota range into multiple sub-ranges based on the target alarm increment; triggering an alarm when the used quota is currently in any target sub-range and the used quota obtained in the last detection is not in the target sub-range; the alarm carries an alarm description, and the alarm description includes at least: the value of the used quota and the proportion of the used quota to the total quota.
[0077] For each quota range, each quota range is divided into multiple sub-ranges according to the alarm increment corresponding to each quota range. Each sub-range represents a section of the alarm threshold, which is used to finely monitor changes in quota usage; the left endpoint of each sub-range is used as the alarm threshold. When the used quota is in the target sub-range, and the used quota obtained in the last detection is not in the target sub-range, it is considered that there is a significant change in quota usage, and an alarm is triggered; and the alarm carries an alarm description, which at least includes: the value of the used quota and the proportion of the total quota occupied. In actual use, it can also include other information such as timestamps, affected system components, and recommended response measures.
[0078] For example, when the target quota range is 70-95 and the target alarm increment is 10, the sub-ranges are 70-80, 80-90 and 90-95; when the used quota is 75 and is located in the sub-range 70-80, and the used quota detected last time is not located in the sub-range 70-80, an alarm is triggered and carries an alarm description, which may be: the current used quota is 75, the proportion of the total quota occupied is 75%, and the quota level has changed; when the used quota is 78 and the used quota detected last time was 75, the used quota obtained in this detection and the last detection are both in the sub-range 70-80, and the used quota obtained in this detection does not trigger an alarm.
[0079] By adopting the embodiments of the present disclosure, the target quota range is divided into multiple sub-ranges according to the target alarm increment, so that the resource usage can be monitored more carefully. This division enables the system to detect small changes in resource usage in a timely manner, thereby avoiding resource usage from accidentally exceeding the approved upper limit. When the used quota enters a new sub-range and the last detection is not within this range, an alarm is triggered. This mechanism ensures that the administrator is notified only when a significant change actually occurs. Such a design reduces frequent and unnecessary alarms, making alarms more practical and operationally valuable. The alarm description contains the specific value of the used quota and its proportion of the total quota, helping administrators to quickly and accurately understand the current resource usage status. This transparent information provision can help decision makers adjust resource configuration, optimize resource allocation, ensure the continuous operation of key businesses, and avoid cost increases caused by excessive resource use.
[0080] Among them, in an optional embodiment, after determining whether the used quota triggers an alarm, it includes: canceling the alarm triggered last time each time the alarm is triggered; when the current used quota is within the security quota range and there is an alarm triggered by the used quota detected last time, canceling the alarm triggered by the used quota detected last time; and adding the canceled alarm to the historical alarms.
[0081] The system first needs to determine whether the current used quota has reached the condition for triggering a new alarm, that is, whether it has entered a new sub-range and is different from the sub-range detected last time. When a new alarm is triggered, the system needs to find and confirm whether there are alarms triggered by the last detection and are still active; if there are such alarms, the system marks these alarms as canceled and stops further processing or notification actions for these alarms. If the current used quota falls back to the safe quota range, the system needs to check whether there are alarms triggered by the previous detection; if such alarms exist, cancel the alarms to reflect the current safe status. Move the canceled alarms to the historical alarm records. Move the canceled alarms to the historical alarm records; the historical alarm records can save the entire life cycle data of the alarm, including the trigger time, cancel time, alarm reason, alarm duration, etc. Alarms can carry status tags, including activated and canceled. When they are canceled and added to the historical alarms, the status of the alarm can be changed from activated to canceled, and the status information of the alarm can be updated, including the update time, etc.
[0082] By adopting the embodiments of the present disclosure, by canceling alarms that are no longer relevant or have expired, the system can reduce the number of false alarms and focus on current and effective alarms. In addition, clearing invalid alarms can help the system release the resources occupied by processing these alarms, which can improve the overall performance of the system. When the quota falls back to a safe range, timely canceling the alarm can reflect the latest status of the system and can timely reflect that the current quota in use is in a safe state. Recording the canceled alarms in a historical database is helpful for subsequent data analysis and review. By analyzing historical alarm data, potential problems of the system can be identified, monitoring strategies can be improved, and resource usage and configuration can be optimized.
[0083] Among them, in an optional embodiment, the hard quota threshold includes a capacity hard quota threshold and an object number hard quota threshold; the capacity hard quota threshold represents: the maximum data capacity stored by the object storage system; the object number hard quota threshold represents: the maximum number of objects stored by the object storage system; the target quota range includes: a target capacity quota range and a target object number quota range; the target alarm increment includes a target capacity alarm increment and an object number alarm increment; the used quota includes: a used capacity quota and a used object number quota; the determination of the multiple quota ranges based on the hard quota threshold and the quota ratio of any two adjacent values includes: obtaining the capacity hard quota threshold and the quota ratio corresponding to the capacity hard quota threshold quota ratio; determining the capacity quota range according to the capacity hard quota threshold and the quota ratio corresponding to the capacity hard quota threshold; obtaining the object number hard quota threshold and the quota ratio corresponding to the object number hard quota threshold; determining the object number quota range according to the object number hard quota threshold and the quota ratio corresponding to the object number hard quota threshold; determining whether the used quota triggers an alarm according to the target quota range and the target alarm increment, including: determining whether the used capacity quota triggers an alarm according to the target capacity quota range and the target capacity alarm increment; and / or determining whether the used object number quota triggers an alarm according to the target object number quota range and the target object number alarm increment.
[0084] When limiting the storage capacity of the object storage space, the capacity and the number of objects are limited; a capacity hard quota and an object number hard quota are set; the capacity hard quota threshold represents: the maximum data capacity stored by the object storage system; the object number hard quota threshold represents: the maximum number of objects stored by the object storage system; when the used quota is greater than or equal to the capacity hard quota, and / or when the used quota is greater than or equal to the object number hard quota, objects cannot be uploaded to the object storage system.
[0085] Obtain one or more quota ratios corresponding to the capacity hard quota threshold, and determine multiple capacity quota ranges; determine the capacity alarm increment corresponding to each capacity quota range based on the correspondence between the capacity quota range and the capacity alarm increment. Obtain one or more quota ratios corresponding to the object number hard quota threshold, and determine multiple object number hard quota ranges; determine the object number alarm increment corresponding to each object number quota range based on the correspondence between the object number quota range and the object number alarm increment.
[0086] By detecting the used quota, the used capacity quota and the used object number quota are obtained; the used capacity quota and the used object number quota are analyzed respectively to determine whether the used capacity quota triggers an alarm and / or whether the used object number quota triggers an alarm. Alarms triggered by the used object number quota and the used capacity quota both need to be noted. When updating the alarm, they are updated separately. For example, the alarms currently in the activated state include alarms triggered by the used object number quota and alarms triggered by the used capacity quota. When the used capacity quota re-triggers the alarm, only the alarm triggered by the used capacity quota is updated, the alarm triggered by the last used capacity quota is canceled, and added to the historical alarm; the alarm triggered by the used object number quota is retained and not processed. Using the embodiments of the present disclosure, by setting hard quota thresholds for capacity and number of objects, the system can limit the use of storage resources to prevent system performance degradation or service interruption caused by excessive use. By analyzing the capacity quota and object number quota of the object storage system, you can manage the object storage system more comprehensively and finely, and set appropriate limits for different application scenarios, such as large file storage or processing of a large number of small files.
[0087] Wherein, in an optional embodiment, the method further comprises: triggering a capacity hard quota alarm and refusing to upload data to the object storage system when the current used capacity quota is greater than or equal to the capacity hard quota threshold; triggering an object number hard quota alarm and refusing to upload data to the object storage system when the current used object number quota is greater than or equal to the object number hard quota threshold. In the storage system, a hard quota threshold is set for the capacity and the number of objects respectively. The capacity hard quota is usually defined by the total amount of data (such as GB or TB), while the object number hard quota is set by the maximum number of files or objects that can be stored. When the monitoring system detects that the used storage capacity is greater than or equal to the preset capacity hard quota threshold, the system will trigger a capacity hard quota alarm; similarly, if the number of used objects reaches or exceeds the object number hard quota threshold, the system will also trigger an object number hard quota alarm. When the capacity or object number hard quota alarm is triggered, the system will prevent any new data from being uploaded to prevent exceeding the quota limit. This typically means that any attempt to add new data to the system will be rejected until enough space is freed or the quota is increased.
[0088] By adopting the embodiments of the present disclosure, the storage system can effectively manage resource usage, ensure the stability and reliability of services, and avoid system failures caused by resource exhaustion. This mechanism can ensure the reasonable allocation and use of precious storage resources.
[0089] Among them, in an optional embodiment, the method also includes: collecting each of the used quotas detected within a preset time period; obtaining the quota growth rate of the used quota based on each of the used quotas; obtaining the predicted time when the used quota reaches the hard quota threshold based on the quota growth rate; and regularly reporting a prediction alarm, the prediction alarm carrying the prediction time.
[0090] To achieve efficient storage management and preventive system maintenance, you can collect and analyze quota usage data to predict when the hard quota threshold is reached, and report prediction alarms regularly.
[0091] Set a reasonable time period, such as every hour or every day, to collect the quota usage data. This period can be adjusted according to business needs and system load. In each period, the system automatically collects the quota usage data about storage capacity and number of objects. This usually involves reading the current usage from the database or storage management system. Through the growth data in the period, calculate the average growth rate or use more complex statistical models to determine the growth trend of quota usage. Based on the known growth rate and the current usage quota, apply a prediction model (such as linear regression, time series analysis, etc.) to estimate when the set hard quota threshold will be reached. Prediction alarms should contain key information, such as the specific time when the hard quota is predicted to be reached, the identification information of the storage system, including: bucket identification information, user identification information and tenant identification information, and recommended action steps. For example: Object service bucket (name: bucket name, user: user name, tenant: tenant name) is expected to reach the bucket capacity hard quota on x year x month x day (calculated based on the capacity increment rate within the current 24 hours).
[0092] If the user takes measures on the storage space, including transferring data or changing quotas, etc., after taking the measures, the quota usage and growth rate will continue to be monitored, and the prediction model will be adjusted to adapt to the new data and changes. The embodiments of the present disclosure can not only identify and respond to potential storage problems in a timely manner, but also help avoid system overload or service interruption through predictive maintenance, optimize resource management, and improve the overall reliability and efficiency of the system.
[0093] In an optional embodiment, the used quota is changed by uploading data to the object storage system and / or deleting data in the object storage system.
[0094] The present disclosure can monitor data upload and deletion operations to capture quota changes; in addition, it can also monitor the adjustment of the hard quota threshold, and update the alarm-related parameters according to the adjustment of the hard quota threshold. For example, when the capacity quota is adjusted from 100GB to 200GB, the quota range 1 is updated from 70-95GB to 140-190GB, and the quota increment 1 is updated from 10GB to 20GB. It should be noted that after the hard quota threshold is adjusted, the relevant alarm parameters can be changed proportionally or set according to the actual situation.
[0095] When checking the used quota at fixed time intervals, relevant parameters of the object storage system corresponding to the current check are synchronously updated, including the used quota, the current quota range, and the current alarm increment, to determine whether the used quota triggers an alarm.
[0096] By adopting the embodiments of the present disclosure, by regularly monitoring the object storage space, by changing the amount of stored data, and by changing the proportion of the used quota to the total quota, the used quota of the object storage system is detected at fixed time intervals each time, and it is possible to determine whether to trigger an alarm according to the current quota range, the used quota, and the alarm increment. The used quota and the alarm threshold can be dynamically adjusted according to the actual data usage, making storage management more flexible and responsive. The stability and reliability of the object storage system are guaranteed, and the automatically adjusted alarm mechanism helps to avoid additional expenses caused by storage overload.
[0097] Figure 3 This is a flowchart of a step-by-step alarm recovery process shown in an embodiment of the present disclosure. Figure 3 As shown: when the used quota is greater than or equal to the hard quota threshold, continue to delete objects; determine whether the used quota is lower than 95% of the hard quota threshold; when the used quota obtained by the regular detection is lower than 95% of the hard quota threshold; again determine whether the used quota is greater than or equal to the soft quota threshold + n*10% of the hard quota threshold; if the judgment is yes, cancel the last alarm and report a new alarm; if the judgment is no, do not report an alarm and cancel the last alarm; when the used quota obtained by the regular detection is not lower than 95% of the hard quota threshold; again determine whether the used quota is greater than the soft quota threshold + n*1% of the hard quota threshold; if the judgment is yes, cancel the last alarm and report a new alarm.
[0098] The quota alarm solution provided by the present disclosure is applied to bucket quota alarms, user quota alarms and tenant quota alarms of object storage space. Users can notice the alarms corresponding to buckets, users and tenants at the same time, further strengthening the management of the object storage system.
[0099] Figure 41 is a block diagram of a quota warning device shown in an embodiment of the present disclosure. Figure 4 As shown, the quota warning device includes an acquisition module, a detection module, a determination module and a triggering module.
[0100] An acquisition module, used to acquire a correspondence between multiple quota ranges and alarm increments; wherein, a quota range having a larger quota value has a smaller corresponding alarm increment; and the multiple quota ranges do not overlap;
[0101] A detection module, used for detecting the used quota of the object storage system at fixed time intervals;
[0102] A determination module, configured to determine a target quota range in which the used quota is located, and determine a target alarm increment corresponding to the target quota range according to the corresponding relationship;
[0103] The trigger module is used to determine whether the used quota triggers an alarm according to the target quota range and the target alarm increment.
[0104] Optionally, the trigger module is specifically used to execute:
[0105] Dividing the target quota range into a plurality of sub-ranges according to the target alarm increment;
[0106] When the used quota is currently in any target sub-range, and the used quota obtained in the last detection is not in the target sub-range, an alarm is triggered; the alarm carries an alarm description, and the alarm description at least includes: the value of the used quota and the ratio of the used quota to the total quota. Optionally, after determining whether the used quota triggers an alarm, the trigger module is specifically used to execute:
[0107] In each case where the alarm is triggered, canceling the alarm that was triggered last time;
[0108] In the case where the currently used quota is within the safety quota range and there is an alarm triggered by the used quota detected last time, canceling the alarm triggered by the used quota detected last time;
[0109] The cancelled alarm is added to the historical alarms.
[0110] Optionally, the determining module is specifically configured to execute:
[0111] Obtaining a preset hard quota threshold and at least one quota ratio corresponding to the preset hard quota threshold;
[0112] determining the multiple quota ranges according to the hard quota threshold and the quota ratio of any two adjacent values;
[0113] Obtaining at least one preset alarm increment;
[0114] According to the alarm increment and the quota range, a corresponding relationship between the alarm increment and the quota range is established; wherein one quota range corresponds to one alarm increment.
[0115] Optionally, the hard quota threshold includes a capacity hard quota threshold and an object number hard quota threshold; the capacity hard quota threshold represents: the maximum data capacity stored by the object storage system; the object number hard quota threshold represents: the maximum number of objects stored by the object storage system; the target quota range includes: a target capacity quota range and a target object number quota range; the target alarm increment includes a target capacity alarm increment and an object number alarm increment; the used quota includes: a used capacity quota and a used object number quota, and the determination module is specifically used to execute:
[0116] Obtaining the capacity hard quota threshold and the quota ratio corresponding to the capacity hard quota threshold;
[0117] Determining the capacity quota range according to the capacity hard quota threshold and the quota ratio corresponding to the capacity hard quota threshold;
[0118] Obtaining the hard quota threshold for the number of objects and the quota ratio corresponding to the hard quota threshold for the number of objects;
[0119] Determining the object number quota range according to the object number hard quota threshold and the quota ratio corresponding to the object number hard quota threshold;
[0120] The determining, according to the target quota range and the target alarm increment, whether the used quota triggers an alarm includes:
[0121] determining whether the used capacity quota triggers an alarm according to the target capacity quota range and the target capacity alarm increment; and / or,
[0122] It is determined whether the used object number quota triggers an alarm according to the target object number quota range and the target object number alarm increment.
[0123] Optionally, the quota warning device further includes:
[0124] The first trigger module of the hard quota alarm is used to trigger the capacity hard quota alarm and refuse to upload data to the object storage system when the currently used capacity quota is greater than or equal to the capacity hard quota threshold; the second trigger module of the hard quota alarm is used to trigger the object number hard quota alarm and refuse to upload data to the object storage system when the currently used object number quota is greater than or equal to the object number hard quota threshold.
[0125] Optionally, the quota warning device further includes:
[0126] A collection module, used to collect each of the used quotas detected within a preset time period;
[0127] a calculation module, used to obtain the quota growth rate of the used quota according to each of the used quotas; a prediction module, used to obtain the predicted time when the used quota reaches the hard quota threshold according to the quota growth rate;
[0128] A prediction alarm module is used to regularly report a prediction alarm, wherein the prediction alarm carries the prediction time. Optionally, the quota alarm device further includes:
[0129] The adjustment module is used to change the used quota by uploading data to the object storage system and / or deleting data in the object storage system.
[0130] It should be noted that the system embodiment is similar to the method embodiment, so the description is relatively simple, and the relevant parts can be referred to the method embodiment.
[0131] The present disclosure also provides an electronic device, referring to Figure 5 , Figure 5 Schematic diagram of an electronic device shown in an embodiment of the present disclosure. Figure 5 As shown, the electronic device 100 includes: a memory 110 and a processor 120. The memory 110 and the processor 120 are connected via a bus communication. A computer program is stored in the memory 110. The computer program can be run on the processor 120 to implement the steps in the quota alarm method disclosed in the embodiment of the present disclosure.
[0132] The embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the quota warning method disclosed in the embodiment of the present disclosure are implemented.
[0133] The present disclosure also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the quota alarm method described in the first aspect. The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0134] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, devices or computer program products. Therefore, the embodiments of the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0135] The embodiments of the present disclosure are described with reference to the flowcharts and / or block diagrams of the methods, apparatuses, electronic devices, and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0136] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0137] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1The steps of the functions specified in a box or multiple boxes. Although some embodiments of the present disclosure have been described, those skilled in the art may make additional changes and modifications to these embodiments once they know the basic creative concepts. Therefore, the attached claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present disclosure. The quota alarm method, device, electronic device and storage medium provided by the present disclosure are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present disclosure. The description of the above embodiments is only used to help understand the method of the present disclosure and its core idea. At the same time, for those of ordinary skill in the art, according to the ideas of the present disclosure, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present disclosure.
Claims
1. A quota warning method, It is characterized in that include: Obtaining a correspondence between multiple quota ranges and alarm increments; wherein, a quota range having a larger quota value has a smaller corresponding alarm increment; and the multiple quota ranges do not overlap; Check the used quota of the object storage system at regular intervals; Determine the target quota range in which the used quota is located, and determine the target alarm increment corresponding to the target quota range according to the corresponding relationship; It is determined whether the used quota triggers an alarm according to the target quota range and the target alarm increment.
2. The method according to claim 1, It is characterized in that The determining, according to the target quota range and the target alarm increment, whether the used quota triggers an alarm includes: Dividing the target quota range into a plurality of sub-ranges according to the target alarm increment; When the used quota is currently in any target sub-range and the used quota obtained in the last detection is not in the target sub-range, an alarm is triggered; the alarm carries an alarm description, and the alarm description at least includes: the value of the used quota and the proportion of the used quota to the total quota.
3. The method according to claim 2, It is characterized in that After determining whether the used quota triggers an alarm, the method further includes: In each case where the alarm is triggered, canceling the alarm that was triggered last time; In the case where the currently used quota is within the safety quota range and there is an alarm triggered by the used quota detected last time, canceling the alarm triggered by the used quota detected last time; The cancelled alarm is added to the historical alarms.
4. The method according to claim 1, It is characterized in that The obtaining of the correspondence between the multiple quota ranges and the alarm increments includes: Obtaining a preset hard quota threshold and at least one quota ratio corresponding to the preset hard quota threshold; determining the multiple quota ranges according to the hard quota threshold and the quota ratio of any two adjacent values; Obtaining at least one preset alarm increment; According to the alarm increment and the quota range, a corresponding relationship between the alarm increment and the quota range is established; wherein one quota range corresponds to one alarm increment.
5. The method according to claim 4, It is characterized in that The hard quota threshold includes a capacity hard quota threshold and an object number hard quota threshold; the capacity hard quota threshold represents: the maximum data capacity stored in the object storage system; The hard quota threshold for the number of objects represents: the maximum number of objects stored in the object storage system; The target quota range includes: a target capacity quota range and a target object number quota range; the target alarm increment includes a target capacity alarm increment and an object number alarm increment; the used quota includes a used capacity quota and a used object number quota; The determining the multiple quota ranges according to the hard quota threshold and the quota ratio of any two adjacent values includes: Obtaining the capacity hard quota threshold and the quota ratio corresponding to the capacity hard quota threshold; Determining the capacity quota range according to the capacity hard quota threshold and the quota ratio corresponding to the capacity hard quota threshold; Obtaining the hard quota threshold for the number of objects and the quota ratio corresponding to the hard quota threshold for the number of objects; Determining the object number quota range according to the object number hard quota threshold and the quota ratio corresponding to the object number hard quota threshold; The determining, according to the target quota range and the target alarm increment, whether the used quota triggers an alarm includes: determining whether the used capacity quota triggers an alarm according to the target capacity quota range and the target capacity alarm increment; and / or, It is determined whether the used object number quota triggers an alarm according to the target object number quota range and the target object number alarm increment.
6. The method according to claim 5, It is characterized in that The method further comprises: When the currently used capacity quota is greater than or equal to the capacity hard quota threshold, triggering a capacity hard quota alarm, and refusing to upload data to the object storage system; When the currently used object number quota is greater than or equal to the object number hard quota threshold, an object number hard quota alarm is triggered, and uploading data to the object storage system is refused.
7. The method according to claim 1, It is characterized in that The method further comprises: Collecting each of the used quotas detected within a preset time period; According to each of the used quotas, obtaining a quota growth rate of the used quota; Obtaining a predicted time when the used quota reaches a hard quota threshold according to the quota growth rate; The prediction alarm is reported regularly, and the prediction alarm carries the prediction time.
8. The method according to claim 1, It is characterized in that The method further comprises: The used quota is changed by uploading data to the object storage system and / or deleting data in the object storage system.
9. A quota warning device, It is characterized in that include: An acquisition module, used to acquire a correspondence between multiple quota ranges and alarm increments; wherein, a quota range having a larger quota value has a smaller corresponding alarm increment; and the multiple quota ranges do not overlap; A detection module, used for detecting the used quota of the object storage system at fixed time intervals; A determination module, configured to determine a target quota range in which the used quota is located, and determine a target alarm increment corresponding to the target quota range according to the corresponding relationship; The trigger module is used to determine whether the used quota triggers an alarm according to the target quota range and the target alarm increment.
10. An electronic device, It is characterized in that include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the quota warning method according to any one of claims 1 to 8 are implemented.
11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the quota warning method according to any one of claims 1 to 8 are implemented.
