Method, apparatus, device, medium and program product for adjusting storage space
Patent Information
- Application Number
- CN202611041236.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-14
- Publication Date
- 2026-10-09
AI Technical Summary
简单的数据清理操作所释放的存储空间容量很难达到预期效果,可能出现存储空间被快速写满,进而引发数据库写入中断等问题,影响业务运行的稳定性
Smart Images

Figure CN122884673A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of big data and distributed technology, specifically to emergency data backup processing, and more specifically to a method, apparatus, device, medium, and program product for adjusting storage space. Background Technology
[0002] In the field of database management, in order to ensure data security and recoverability, a data backup mechanism is usually adopted, which uses preset storage space to store archived data generated by the database.
[0003] In some cases, there may be a sudden increase in the rate at which archived data is generated. Simple data cleanup operations may not release the expected amount of storage space, potentially leading to storage space being filled up quickly, causing database write interruptions and affecting the stability of business operations. Summary of the Invention
[0004] In view of the above problems, embodiments of this application provide a method, apparatus, device, medium, and program product for adjusting storage space.
[0005] According to a first aspect of this application, a method for adjusting storage space is provided, comprising: acquiring a first state parameter of the storage space; performing an i-th capacity adjustment operation on the storage space when the first state parameter satisfies the triggering condition of the i-th capacity adjustment operation, wherein i is any positive integer; acquiring a second state parameter of the storage space after the i-th adjustment in response to the completion of the i-th capacity adjustment operation; and performing an (i+1)-th capacity adjustment operation on the storage space after the i-th adjustment when the second state parameter satisfies the triggering condition of the (i+1)-th capacity adjustment operation; wherein the first state parameter and the second state parameter respectively indicate the estimated duration information of the corresponding storage space reaching a preset warning state.
[0006] According to an embodiment of this application, the storage space is used to store archived data; obtaining the first state parameter of the storage space includes: determining the initial estimated duration for the storage space to reach a preset warning state based on the current remaining capacity of the storage space and the data archiving rate; and adjusting the initial estimated duration using a first correction coefficient matched with the i-th adjustment process, wherein the adjusted estimated duration constitutes the first state parameter.
[0007] According to an embodiment of this application, the initial estimated duration is adjusted using a first correction coefficient matched with the i-th adjustment process. The adjusted estimated duration constitutes a first state parameter, including: determining a fluctuation correction coefficient indicated by the historical data archiving rate based on the historical data archiving rate of the reference time period matched with the i-th adjustment process; determining a cycle correction coefficient indicated by the business cycle type based on the business cycle type matched with the i-th adjustment process; determining a load correction coefficient indicated by the server load status based on the server load status matched with the i-th adjustment process; fusing the fluctuation correction coefficient, the cycle correction coefficient, and the load correction coefficient to obtain a first correction coefficient; and performing deviation calibration on the initial estimated duration based on the first correction coefficient to obtain the first state parameter.
[0008] According to an embodiment of this application, when the first state parameter satisfies the triggering condition for the i-th capacity adjustment operation, the i-th capacity adjustment operation is performed on the storage space, including: when i=1, in response to the adjusted estimated duration being less than the remaining waiting time before performing the next backup operation, determining that the triggering condition for the first capacity adjustment operation is satisfied; and deleting the backed-up data in the storage space to complete the first capacity adjustment operation.
[0009] According to an embodiment of this application, the storage space is used to store archived data; in response to the completion of the i-th capacity adjustment operation, a second state parameter of the storage space after the i-th adjustment is obtained, including: in response to the completion of the i-th capacity adjustment operation, determining the initial estimated duration for the storage space after the i-th adjustment to reach a preset warning state based on the current remaining capacity of the storage space after the i-th adjustment and the data archiving rate; and adjusting the initial estimated duration using a second correction coefficient matched with the (i+1)-th adjustment process, wherein the adjusted estimated duration constitutes the second state parameter.
[0010] According to an embodiment of this application, when the second state parameter satisfies the triggering condition for the (i+1)th capacity adjustment operation, the (i+1)th capacity adjustment operation is performed on the storage space after the i-th adjustment, including: when i=1, in response to the estimated duration after adjustment being less than a first preset duration threshold, backing up at least a portion of the archived data in the storage space that has not been backed up; and deleting the corresponding archived data that has been backed up.
[0011] According to an embodiment of this application, when the second state parameter satisfies the triggering condition for the (i+1)th capacity adjustment operation, the (i+1)th capacity adjustment operation is performed on the storage space after the i-th adjustment, including: when i=2, in response to the estimated duration after adjustment being less than a second preset duration threshold, the target archived data in the storage space is deleted, wherein the archived time corresponding to the target archived data is earlier than the preset time threshold.
[0012] According to embodiments of this application, the (i+1)th capacity adjustment operation and the ith capacity adjustment operation differ in at least one aspect of data security level, operation time, and the amount of storage space released.
[0013] According to a second aspect of this application, a storage space adjustment device is provided, comprising:
[0014] A status parameter acquisition module is used to acquire a first status parameter of the storage space; and a storage space adjustment module is used to perform an i-th capacity adjustment operation on the storage space when the first status parameter satisfies the triggering condition of the i-th capacity adjustment operation, where i is any positive integer; in response to the completion of the i-th capacity adjustment operation, acquire a second status parameter of the storage space after the i-th adjustment; and perform an i+1-th capacity adjustment operation on the storage space after the i-th adjustment when the second status parameter satisfies the triggering condition of the (i+1)-th capacity adjustment operation; wherein the first status parameter and the second status parameter respectively indicate the estimated duration information of the corresponding storage space reaching the preset warning state.
[0015] According to a third aspect of this application, an electronic device is provided, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.
[0016] According to a fourth aspect of this application, a computer-readable storage medium is also provided, on which a computer program or instructions are stored, wherein the computer program or instructions, when executed by a processor, implement the steps of the above-described method.
[0017] According to a fifth aspect of this application, a computer program product is also provided, comprising a computer program or instructions that, when executed by a processor, implement the steps of the above-described method. Attached Figure Description
[0018] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0019] Figure 1 The illustration schematically depicts application scenarios of storage space adjustment methods, apparatuses, devices, media, and program products according to embodiments of this application;
[0020] Figure 2 A flowchart illustrating a method for adjusting storage space according to an embodiment of this application is shown schematically;
[0021] Figure 3This schematically illustrates another flowchart of a method for adjusting storage space according to an embodiment of this application;
[0022] Figure 4 The schematic diagram illustrates the architecture of a backup system for an application storage space adjustment method according to an embodiment of this application;
[0023] Figure 5 This schematic diagram illustrates a structural block diagram of a storage space adjustment device according to an embodiment of the present application;
[0024] Figure 6 A block diagram schematically illustrates an electronic device suitable for implementing a method for adjusting storage space according to an embodiment of this application. Detailed Implementation
[0025] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.
[0026] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0027] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0028] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0029] Figure 1 The illustration schematically depicts application scenarios of storage space adjustment methods, apparatuses, devices, media, and program products according to embodiments of this application.
[0030] like Figure 1As shown, application scenario 100 according to an embodiment of this application may include a first terminal device 101, a second terminal device 102, a database 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the database 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables. For example, a user can use the first terminal device 101 and the second terminal device 102 to interact with the server 105 and / or the database 103 through the network 104 to receive or send information, etc.
[0031] The first terminal device 101 and the second terminal device 102 can be electronic devices such as smartphones, wearable devices, personal computers, intelligent voice interaction devices, smart home appliances, intelligent vehicles, in-vehicle terminals, aircraft, unmanned vending terminals, and extended reality devices. Extended reality devices can include virtual reality devices, augmented reality devices, and mixed reality devices. A client application for the target application can be installed and run on the terminal device. This target application can include, but is not limited to, financial transaction applications, payment applications, shopping applications, web browser applications, search applications, instant messaging tools, email clients, and social media platform software (these are just examples). Furthermore, this application embodiment does not limit the form of the target application, including but not limited to applications, mini-programs, etc., installed on the terminal device, and can also be in web page form.
[0032] Server 105 can be a server providing various services, such as a backend management server supporting websites browsed by users using the first terminal device 101 and the second terminal device 102 (this is just an example). The backend management server can analyze and process received user requests and other data, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services such as cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks, and big data. The server can be a backend server for the aforementioned target application, used to provide backend services to the clients of the target application.
[0033] Database 103 is a professional storage system for storing and managing data. It can store various types of data related to the target application, such as user account information, business transaction records, and content resource data. It supports structured, semi-structured, or unstructured data storage and has management capabilities such as adding, deleting, modifying, querying, backing up, and restoring data. In this application scenario, database 103 can be connected to server 105 via a communication link. Server 104 can retrieve the required data from database 103 for processing based on requests from the first terminal device 101 and the second terminal device 102. It can also synchronously store new data generated by the operations of the first terminal device 101 and the second terminal device 102 into database 103, thereby achieving data persistence and efficient retrieval.
[0034] It should be noted that the storage space adjustment method provided in this application embodiment can generally be executed by server 105 and / or terminal devices 101-102. Accordingly, the storage space adjustment device provided in this application embodiment can generally be set in server 105 and / or terminal devices 101-102.
[0035] It should be understood that Figure 1 The number of terminal devices, networks, databases, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, databases, and servers can be included.
[0036] In database operation scenarios, there are business continuity risks due to storage space management failures: during peak business periods, a sudden increase in data archiving rate can easily cause the file system to fill up, leading to database failure. Existing emergency measures have significant drawbacks: manually cleaning up unbacked-up archived files can compromise backup integrity, forcing a full backup to rebuild the recovery baseline; temporarily adjusting backup strategies can consume significant I / O bandwidth, causing business blockage issues such as online transaction timeouts. Furthermore, the fixed directory capacity cannot be dynamically expanded according to business load, further exacerbating the risk of space exhaustion and the limitations of emergency handling. When the archived data generation rate surges during peak business periods, the capacity released in a single cleanup is insufficient to support the next scheduled backup task, easily leading to rapid storage filling and subsequent database write interruptions and business shutdowns.
[0037] Figure 2 A flowchart illustrating a method for adjusting storage space according to an embodiment of this application is shown schematically. Figure 2 As shown, the storage space adjustment method according to the embodiments of this application may include steps S210 to S240.
[0038] In step S210, the first state parameters of the storage space are obtained.
[0039] Storage space can be a dedicated storage area for storing archived database data. For example, storage space can be deployed on the local disk of the database server, mounted on a network storage device of the database server, or a designated storage volume in a distributed storage cluster. Storage space can be used to temporarily store archived files generated during database operation, enabling the database to archive and save redo logs after transaction commits, supporting data recovery and backup processes. Storage space can also be used to persistently store various archived files continuously generated during business operations, such as logs, images, and snapshots. The generation rate can be related to the volume of business transactions and transaction complexity. For example, archived files can be binary log files divided into fixed-size segments or continuous log sequences named by timestamps.
[0040] The first status parameter can be the estimated duration data calculated for the storage space before the adjustment operation is initiated. It can indicate the estimated duration for the corresponding storage space to reach the preset warning state. The first status parameter can be determined based on the current remaining capacity and / or data archiving rate, or it can be obtained by first determining the preliminary status parameter based on the current remaining capacity and / or data archiving rate and then correcting it using a correction coefficient.
[0041] In the embodiments of this application, the preset warning state can be an operating state where the current remaining capacity of the storage space is lower than a preset capacity threshold. The preset capacity threshold can be flexibly configured according to the service level, storage medium read / write performance, and fault tolerance standards. For example, the value of the preset capacity threshold can be set to 80%, 85%, 90%, or 95% of the total storage space capacity, etc.
[0042] The data archiving rate can be the total number of newly generated archived files per unit time. For example, the data archiving rate can be obtained by counting the cumulative size of newly added archived files in the last hour, or by using a sliding window to count the average generation rate in the last 30 minutes, or by taking the average value after calculating the instantaneous rate by sampling the generation time interval of two adjacent archived files in real time.
[0043] Correction factors can be a set of parameters used to dynamically adjust the base forecast value, which can be used to improve the accuracy of the archived alert time forecast, making it more consistent with changes in the actual operating environment. For example, correction factors can be determined by incorporating at least one of the following: historical operating data, real-time hardware load, and business fluctuation characteristics.
[0044] The entity that retrieves the initial status parameters of the storage space can be a monitoring agent deployed on the database server. This agent can poll the storage space at fixed time intervals to collect capacity occupancy and data write rate metrics. For example, the polling interval can be set to 5 minutes, 10 minutes, 15 minutes, 30 minutes, etc. During the polling process, historical archiving rate samples, business time period markers, and server hardware load metrics can be collected simultaneously for subsequent status parameter calibration.
[0045] In step S220, if the first state parameter satisfies the triggering condition for the i-th capacity adjustment operation, the i-th capacity adjustment operation is performed on the storage space, where i is any positive integer.
[0046] The i-th capacity adjustment operation can be an automated process to release available storage space. i can be any positive integer such as 1, 2, 3, 4, etc. The adjustment operations corresponding to different i can be differentiated in terms of processing logic, data processing range, resource consumption, and data security control standards, so as to achieve differentiated capacity adjustment operations and produce different capacity adjustment effects.
[0047] The trigger condition can be a numerical comparison rule used to determine whether to start the corresponding capacity adjustment operation. The trigger condition can be constructed based on the relationship between the estimated duration value and the preset duration threshold. Different duration thresholds can be configured for different rounds of adjustment operations.
[0048] If the first state parameter meets the triggering conditions of the corresponding round, the storage management tool can be automatically invoked to start the capacity adjustment process. The execution priority of the adjustment process can be higher than that of regular scheduled backup tasks and regular data read and write tasks.
[0049] In step S230, in response to the completion of the i-th capacity adjustment operation, the second state parameter of the storage space after the i-th adjustment is obtained.
[0050] In this embodiment, the second state parameter can be the estimated duration data recalculated after a single capacity adjustment operation is completed, which can indicate the estimated duration for which the corresponding storage space has reached a preset warning state. Similarly, the calculation method of the second state parameter can be the same as or different from that of the first state parameter. That is, the second state parameter can also be determined based on the current remaining capacity and / or data archiving rate, or a preliminary state parameter can be determined based on the current remaining capacity and / or data archiving rate and then corrected using a correction coefficient.
[0051] In response to the completion of the i-th capacity adjustment operation, the used capacity, current remaining capacity, real-time data write rate and other indicators of the storage space can be refreshed. Based on the refreshed indicators, the estimated duration is recalculated and a second state parameter is generated.
[0052] In step S240, if the second state parameter satisfies the triggering condition for the (i+1)th capacity adjustment operation, the (i+1)th capacity adjustment operation is performed on the storage space after the i-th adjustment.
[0053] The (i+1)th capacity adjustment operation can be the next round of capacity release triggered based on the updated storage space state after the completion of the (i)th adjustment operation. The judgment threshold and data processing rules of the (i+1)th capacity adjustment operation may differ from those of the (i)th capacity adjustment operation.
[0054] If the second state parameter meets the trigger condition for the next round of adjustment, the (i+1)th capacity adjustment operation can be executed to complete a new round of storage space release processing.
[0055] The embodiments of this application can adopt a cyclic determination mode. After each round of capacity adjustment operation is completed, the storage space status parameters can be updated, and it is continuously determined whether the next level of adjustment operation needs to be started, until the estimated storage space duration value is higher than the duration threshold of the corresponding round.
[0056] For example, in some embodiments, the storage space uses local solid-state drive partitions to store archived data, and the monitoring agent collects capacity data every 15 minutes. First, it collects the current remaining capacity of the partition and the data archiving rate. Combined with historical business fluctuations and server load data, it calculates a first status parameter, which represents the estimated time it will take for the partition to reach the 90% capacity warning threshold. If this estimated time is less than the countdown time for the next scheduled backup, the first capacity adjustment operation is triggered, cleaning up the archived data that has been backed up remotely within the partition. After the first adjustment operation is completed, the partition capacity and data archiving rate are collected again, and the second status parameter is calculated and corrected. If the estimated time corresponding to the second status parameter is less than the first preset time threshold, the second capacity adjustment operation is initiated, performing an emergency backup of the locally unbacked-up archived data and then deleting it.
[0057] In other embodiments, the storage space is an independent storage volume of a distributed storage cluster, used for storing archived data of distributed business databases, with a warning threshold set to 85% of the total capacity. The monitoring program uses a sliding window to statistically analyze the archiving rate every 30 minutes, integrating 7-day historical rate fluctuations, monthly settlement cycle markers, and cluster node processor and disk I / O load coefficients to generate a first status parameter. If the value of the first status parameter is less than the normal backup waiting time, the first round of space adjustment is executed, batch deleting verified and completed archived data. After adjustment, the storage volume capacity index is refreshed, a second status parameter is recalculated and generated, and compared with a second preset time threshold. If the threshold is not met, a second round of deep space adjustment is executed.
[0058] In some embodiments, the storage space is a network-attached storage device used to store archived data from high-frequency trading transactions, with a warning threshold set to 95% of the total capacity. The monitoring program collects the instantaneous archive generation rate every 5 minutes and corrects the base estimated duration using the coefficient of variation to obtain a first status parameter. When the value of the first status parameter is lower than the remaining waiting time for the backup task, a first round of light space adjustment is performed, deleting only image files older than 3 days that have been backed up. After adjustment, the remaining storage capacity is updated, and the estimated duration is recalibrated to obtain a second status parameter. If the value of the second status parameter is lower than the secondary duration threshold, a second round of emergency backup and cleanup adjustment is initiated.
[0059] In the embodiments of this application, when collecting storage space indicators, an outlier filtering mechanism can be introduced to filter out instantaneous peak rate data that is more than 3 times the standard deviation, so as to avoid distortion of the estimated duration calculation caused by sudden business traffic. The filtered rate data participates in the calculation of the first state parameter and the second state parameter, which can improve the stability of the estimated duration.
[0060] In the embodiments of this application, by collecting storage space status parameters in multiple rounds, determining in stages whether the storage space status parameters meet the corresponding early warning triggering conditions, and executing multiple capacity adjustment operations step by step, this approach is well-suited for scenarios where storage space is continuously filled by a large influx of data. It can reduce the risk of storage space being quickly filled, thus preventing business interruptions. By using storage space status parameters collected in multiple rounds as the basis for early warning determination and performing multiple rounds of storage space capacity adjustment operations, the effect of storage space capacity adjustment can be effectively improved, ensuring the stability of business operations.
[0061] According to an embodiment of this application, the storage space can be used to store archived data; obtaining the first state parameter of the storage space may include: determining the initial estimated duration for the storage space to reach a preset warning state based on the current remaining capacity of the storage space and the data archiving rate; adjusting the initial estimated duration using a first correction coefficient matched with the i-th adjustment process, wherein the adjusted estimated duration constitutes the first state parameter.
[0062] The current remaining capacity can be the total storage capacity minus the currently occupied capacity to obtain the available storage space value.
[0063] The initial estimated duration can be the base time value without adding correction coefficients. The initial estimated duration can be equal to the current remaining capacity divided by the data archiving rate. This value is only theoretically calculated based on the current static capacity and write rate.
[0064] The first correction coefficient matched in the i-th adjustment process can be a comprehensive correction parameter adapted to the current round of adjustment scenario. The value range of the first correction coefficient can be set between 0 and 1.2. When the value of the first correction coefficient is less than 1, the initial estimated duration can be calibrated downward. When the value of the first correction coefficient is greater than 1, the initial estimated duration can be calibrated upward.
[0065] The first correction coefficient can be calculated by integrating sub-coefficients of multiple dimensions. For example, the dimensions of its sub-coefficients can include data archiving rate fluctuation dimension, business cycle dimension, or server hardware load dimension, etc.
[0066] The calculation method for adjusting the initial estimated duration can include multiplication, addition / subtraction compensation, and segmented mapping. Multiplication can directly multiply the initial estimated duration by the first correction coefficient to obtain the adjusted duration. Addition / subtraction compensation can calculate a fixed duration compensation based on the first correction coefficient and add it to the initial estimated duration. The adjusted estimated duration can be used as the first state parameter in the trigger condition determination.
[0067] In some embodiments, the storage space stores archived data from a financial business database. The monitoring program collects data showing that the remaining capacity of the storage partition is 200 gigabytes, and the average archiving rate over the past hour is 5 gigabytes per hour. An initial estimated duration of 40 hours is calculated using division. Currently, the first round of capacity adjustment is underway. The first correction coefficient for this first round of adjustment is obtained by fusing the fluctuation correction coefficient, the cycle correction coefficient, and the load correction coefficient. The fused first correction coefficient is 0.79 × 0.7 × 0.84. Multiplying the initial estimated duration of 40 hours by the fused first correction coefficient yields an adjusted estimated duration of 18.6 hours. This 18.6-hour value is used as the first state parameter.
[0068] In other embodiments, the distributed storage volume stores distributed database archive shards, with a current remaining capacity of 750 gigabytes. The average archiving rate is 267 gigabytes per hour within a 30-minute sliding window, resulting in an initial estimated duration of 2.8 hours. Currently, we are in the second round of adjustment. Assuming the first correction coefficient for the second round of adjustment is 0.92, a multiplicative model is used to calibrate the initial estimated duration, resulting in an adjusted estimated duration of 2.576 hours. This value serves as the first state parameter for this adjustment.
[0069] In the embodiments of this application, when calculating the initial estimated duration, the write rates of cold archived data and hot archived data can be distinguished. The write rate of hot data is given a higher weight in the average rate calculation. The first correction coefficient can simultaneously increase the cold and hot data ratio sub-coefficient, further reducing the deviation between the initial estimated duration and the actual storage space consumption time.
[0070] In the embodiments of this application, the initial estimated duration can be calculated based on the remaining capacity and the archiving rate. Then, the deviation calibration is completed by adapting the first correction coefficient to the current adjustment to generate the first state parameter. This can increase the degree to which the estimated duration value matches the fluctuations of the actual business operation, reduce the judgment deviation caused by relying solely on static rate calculation, and improve the rationality of the judgment of the capacity adjustment triggering time.
[0071] According to an embodiment of this application, the initial estimated duration is adjusted using a first correction coefficient matched with the i-th adjustment process. The adjusted estimated duration constitutes a first state parameter, which may include: determining a fluctuation correction coefficient indicated by the historical data archiving rate based on the historical data archiving rate of the reference time period matched with the i-th adjustment process; determining a cycle correction coefficient indicated by the business cycle type based on the business cycle type matched with the i-th adjustment process; determining a load correction coefficient indicated by the server load status based on the server load status matched with the i-th adjustment process; fusing the fluctuation correction coefficient, the cycle correction coefficient, and the load correction coefficient to obtain a first correction coefficient; and performing deviation calibration on the initial estimated duration based on the first correction coefficient to obtain the first state parameter.
[0072] The baseline time period can be a fixed time window used to collect historical archive rate samples. For example, the window length can be set to 7 days, 30 days, 24 hours or 4 weeks, which is the same as the business cycle duration, and the sampling interval can be 1 hour, 10 minutes or 30 minutes, etc.
[0073] Historical data archiving rate can be multiple sets of archiving capacity write rate data collected at fixed intervals within a benchmark time period. It can be used to calculate statistical indicators such as standard deviation, coefficient of variation, and range to determine the fluctuation range of data writing.
[0074] The volatility correction factor can be used to quantify the instability of data archiving rate. The higher the dispersion of the data archiving rate, the smaller the value of the volatility correction factor can be; the lower the dispersion, the closer the value of the volatility correction factor is to 1. The volatility correction factor can be calculated using exponential mapping models, linear mapping models, standard deviation normalization models, etc.
[0075] For example, in some embodiments, multiple data archiving rates within a historical time window can be obtained, the rate standard deviation can be calculated based on the multiple data archiving rates, and the fluctuation correction coefficient can be determined based on the rate standard deviation. The rate standard deviation is negatively correlated with the fluctuation correction coefficient.
[0076] For example, in some embodiments, the volatility correction factor can be expressed as: Volatility Correction Factor = e -k×CVWhere e is the natural constant and k is the adjustment constant. CV is the coefficient of variation; for example, when the fluctuation is large, CV can be 0.5, and when the fluctuation is small, CV can be 0.1.
[0077] Business cycle types can be categorized by the periodic changes in business operations. For example, business cycle types can include weekday peak hours, weekday off-peak hours, holiday hours, monthly settlement hours, quarterly clearing hours, and nighttime off-peak hours. Different cycle types can correspond to different historical average archiving rates, with the average archiving rate of peak cycles being higher than that of off-peak and low-peak cycles.
[0078] The periodic correction factor can be used to compensate for rate deviations caused by periodic changes in business traffic. When the current time period's archiving rate is higher than the historical average for the same period, the periodic correction factor can be set to less than 1. When the current time period's archiving rate is lower than the historical average for the same period, the periodic correction factor can be set to close to 1 or greater than 1.
[0079] For example, the statistical average of historical data archiving rates for the corresponding business cycle type can be obtained. If the data archiving rate for the current time is greater than the statistical average, the cycle correction coefficient is set to a value less than 1 according to a preset rule.
[0080] Server load status can be a set of real-time operating metrics for the hardware devices that support storage space and database services. These metrics can include hardware operating parameters such as processor utilization, disk I / O wait rate, memory utilization, storage read / write throughput, and network transmission latency.
[0081] The load correction factor can be used to compensate for the impact of hardware operating pressure on archive writing speed. When the overall server load index is higher than the preset threshold, the load correction factor value can be reduced. When all hardware load indexes are lower than the threshold, the load correction factor value can be maintained between 0.95 and 1.
[0082] For example, the current hardware load status can be obtained, and the load correction coefficient can be determined based on the comparison between the hardware load status and the preset load threshold.
[0083] The calculation method for fusing at least two of the fluctuation correction coefficient, period correction coefficient, and load correction coefficient can employ multiplicative fusion, weighted summation fusion, or segmented threshold fusion. Multiplicative fusion multiplies the coefficients to obtain a comprehensive first correction coefficient; weighted summation fusion assigns different weights to different correction coefficients, and the weighted summation is then normalized to obtain the first correction coefficient.
[0084] Deviation calibration can be achieved by performing numerical calculations on the initial estimated duration and the first correction coefficient after fusion, thus completing the dynamic correction of the theoretical duration. The calibrated duration value can simultaneously reflect the combined impact of three types of variables—data fluctuation, business cycle, and hardware load—on the storage space consumption rate.
[0085] For example, in some embodiments, the first state parameter can be expressed as a formula: First state parameter = initial estimated duration × fluctuation correction coefficient × cycle correction coefficient × load correction coefficient.
[0086] For example, in some embodiments, the baseline time period is selected from the hourly archiving rate samples of the past 7 days, and the rate standard deviation is calculated to obtain a fluctuation correction coefficient of 0.79; the current time period belongs to the weekday business peak cycle type, and a cycle correction coefficient of 0.7 is obtained; the server processor utilization is 70% and the disk I / O wait rate is 60%, and a load correction coefficient of 0.84 is obtained by comprehensive calculation; the three correction coefficients are multiplied and fused to obtain a first correction coefficient of 0.46452; the initial estimated duration of 40 hours is multiplied by the first correction coefficient to complete the deviation calibration, and the adjusted estimated duration of about 18.5 hours is obtained, which is used as the first state parameter.
[0087] In other embodiments, the initial estimated duration can be calculated by dividing the remaining capacity by the average data archiving rate over the most recent hour. The fluctuation correction factor is the coefficient of variation, obtained by collecting the hourly data archiving rates over the past 7 days, calculating the standard deviation, and then dividing it by the average rate. For example, if the rates for the same period over the past 7 days were 4.8 gigabytes per hour, 5.2 gigabytes per hour, 5.0 gigabytes per hour, 5.5 gigabytes per hour, 4.9 gigabytes per hour, 5.1 gigabytes per hour, and 5.3 gigabytes per hour, respectively, the average rate is 5.11 gigabytes per hour, the standard deviation is approximately 0.25 gigabytes per hour, and the coefficient of variation is 0.049. The fluctuation correction factor can be set to e. -0.8×0.049 ≈0.96, where e is the natural constant. The periodic correction coefficient is determined based on whether the current time is during peak business hours. If the current time is 14:30, it belongs to the 14:00-18:00 peak period, so it is set to 0.7; otherwise, it is set to 1.0. The load correction coefficient is calculated by collecting processor utilization of 70% and input / output wait rate of 60%, with a processor weight of 0.6 and an input / output weight of 0.4. The comprehensive load index is (70×0.6+60×0.4) / 100=0.66, which is then mapped to 1.2-0.5×0.66=0.87. The final archiving warning time can be expressed as: First state parameter = Initial estimated duration × 0.96×0.7×0.87.
[0088] In the embodiments of this application, a correction coefficient can be generated based on at least one of historical rate, business cycle, and hardware load, and the first correction coefficient can be fused to complete the initial estimated duration calibration. This can cover the impact of at least one of data write fluctuations, business periodic traffic, and hardware operating pressure on the storage space consumption rate, increase the matching degree between the first state parameter and the actual storage consumption rate, and reduce the probability of false triggering or missed triggering of capacity adjustment operations.
[0089] According to an embodiment of this application, when the first state parameter satisfies the triggering condition for the i-th capacity adjustment operation, performing the i-th capacity adjustment operation on the storage space may include: when i=1, in response to the estimated time after adjustment being less than the remaining waiting time before performing the next backup operation, determining that the triggering condition for the first capacity adjustment operation is satisfied; deleting the backed-up data in the storage space to complete the first capacity adjustment operation.
[0090] i=1 can represent the first capacity adjustment operation, which can be used as a first-level handling process, and the cleanup logic with no risk of data loss can be given priority.
[0091] The remaining waiting time before the next backup operation can be the countdown value of the scheduled backup task. The starting point of the countdown can be the current monitoring sampling time, and the ending point of the countdown can be the scheduled start time of the preset backup task.
[0092] The adjusted estimated duration is the first state parameter. If the adjusted estimated duration is less than the remaining waiting time, it can be determined that the regular backup scheduling cannot complete the data transfer before the storage is exhausted, and there is a risk of the storage space being full and the system shutting down. The trigger condition for the first capacity adjustment operation is met.
[0093] Backup data can be archived files that have been verified on remote storage media and have complete and traceable archived serial numbers. The backup completion status of each archived file can be marked through backup ledger records.
[0094] The execution logic for deleting backed-up data can be configured with various filtering rules. These rules can include batch deletion based on archive generation time (from oldest to newest), priority deletion based on file size (from largest to smallest), or retaining the latest N archive files without deleting them. For example, the number of the latest archive files to retain can be set to 2, 3, 5, etc. The retained files can be used to maintain the database instance's ability to read the active archive chain and prevent database operation chain breaks.
[0095] For example, in some embodiments, the storage space can be a local solid-state drive partition used to store archived logs of the business database. Metrics are collected every 15 minutes to generate a first status parameter of 18.6 hours. The remaining wait time for the next scheduled backup is 22 hours. Since 18.6 hours is less than 22 hours, the conditions for triggering the first capacity adjustment operation are met. The cleanup program reads the archived backup ledger, filters all old log files marked as backed up within the partition, retains only the two most recent archived logs, and batch deletes the remaining backed-up logs, freeing up approximately 45 gigabytes of storage space, thus completing the first capacity adjustment operation.
[0096] In the embodiments of this application, the first-level handling process can only perform the deletion operation of the backed-up archived files without modifying the unbacked-up archived data, which can reduce the probability of data loss. By comparing the calibrated estimated time with the remaining backup waiting time as the basis for the first round of triggering, the risk of storage exhaustion that cannot be covered by regular backups can be identified in advance, and storage space can be released in advance to extend the normal operation time of the database.
[0097] According to an embodiment of this application, the storage space is used to store archived data; in response to the completion of the i-th capacity adjustment operation, obtaining the second state parameter of the storage space after the i-th adjustment may include: in response to the completion of the i-th capacity adjustment operation, determining the initial estimated duration for the storage space after the i-th adjustment to reach a preset warning state based on the current remaining capacity of the storage space after the i-th adjustment and the data archiving rate; adjusting the initial estimated duration using a second correction coefficient matched with the (i+1)-th adjustment process, and the adjusted estimated duration constitutes the second state parameter.
[0098] The remaining available capacity, occupied capacity, and file distribution status of the storage space after the i-th adjustment may all be updated. The initial estimated time for the storage space to reach the preset warning state after the i-th adjustment can be determined according to the method in the embodiments of this application.
[0099] The current remaining capacity can be the available storage space value obtained by rescanning and statistics after the i-th adjustment and deletion of files. The scanning operation can be automatically triggered after the capacity adjustment process is completed. The scanning interval can be set to a short period such as 30 seconds or 1 minute.
[0100] The second correction coefficient, which is matched with the (i+1)th adjustment process, can be adapted to the risk handling level of the next round of capacity adjustment. The sub-coefficient types fused by the second correction coefficient can be consistent with the first correction coefficient, including volatility correction coefficient, cycle correction coefficient, and load correction coefficient. The weighting ratio and numerical mapping rules of the second correction coefficient can be different from those of the first correction coefficient, and can be adapted to the risk judgment standards of different adjustment levels.
[0101] The calculation method for adjusting the initial estimated duration after adjustment can adopt the calculation model of multiplication fusion, segmented mapping, and duration compensation. The calculation model can be unified with the first state parameter calibration logic to reduce the development cost of program logic.
[0102] The adjusted estimated duration, after the full load adjustment is completed, is used as the predicted storage capacity consumption result as the second state parameter to determine the trigger condition for the (i+1)th capacity adjustment operation.
[0103] For example, in some embodiments, i=1. After the first capacity adjustment operation deletes the backed-up archived logs, the remaining available capacity of the local solid-state partition is rescanned to increase to 120 gigabytes. The average archiving rate over the past hour is 5 gigabytes per hour, and the initial estimated duration after adjustment is calculated to be 24 hours. The trigger condition for the second capacity adjustment operation is determined by the second correction coefficient, which is obtained by fusing the fluctuation correction coefficient of 0.79, the cycle correction coefficient of 0.7, and the load correction coefficient of 0.84 to obtain 0.46452. Multiplying 24 hours by the second correction coefficient yields the estimated duration after adjustment of 11.148 hours, which is used as the second state parameter.
[0104] In other embodiments, i=2. After the second capacity adjustment operation is completed, the remaining capacity of the distributed storage volume is increased to 60 gigabytes, the 5-minute moving average archive rate is 7.8125 gigabytes per hour, and the initial estimated duration after adjustment is 7.68 hours. The second correction coefficient matching the third adjustment is taken as 0.75, and the estimated duration after calibration is 5.76 hours, which is used as the second state parameter for comparison of the three-level adjustment threshold.
[0105] In the embodiments of this application, after each round of capacity adjustment is completed, the updated capacity and rate indicators can be collected again, the initial estimated duration can be recalculated, and the second state parameters can be generated by calibrating with the second correction coefficient adapted to the next round of adjustment. This can adapt to the scenario of dynamic changes in storage space capacity after each round of adjustment, and can make the judgment of the next round of adjustment based on the latest real storage state, thereby reducing the probability of missed or false triggering of capacity adjustment operations.
[0106] According to an embodiment of this application, when the second state parameter satisfies the triggering condition for the (i+1)th capacity adjustment operation, performing the (i+1)th capacity adjustment operation on the storage space after the i-th adjustment may include: when i=1, in response to the estimated duration after adjustment being less than a first preset duration threshold, backing up at least a portion of the archived data in the storage space that has not been backed up; deleting the corresponding archived data after the backup is completed, so as to complete the (i+1)th adjustment process.
[0107] When i=1, the i-th capacity adjustment operation corresponds to the first capacity adjustment operation and can be used as a primary handling procedure. The (i+1)-th capacity adjustment operation corresponds to the second capacity adjustment operation and can be used as a secondary handling procedure, applicable to scenarios where the risk has not been completely eliminated after the first round of cleanup.
[0108] The first preset duration threshold can be a critical time value that distinguishes between Level 1 mild handling and Level 2 deep handling. The threshold can be flexibly configured according to the importance level of business data, for example, the value can be 1 hour, 1.5 hours, 2 hours, 3 hours, etc.
[0109] The adjusted estimated duration is the second state parameter. In this embodiment, the value of the second state parameter represents the remaining estimated duration for the storage space to reach the warning threshold after the first capacity adjustment operation is completed.
[0110] Unbacked-up archived data can be local archived files that have not been verified and transferred from remote storage media. These files are marked as pending backup in the backup log. Directly deleting them may cause a break in the archived data link and result in missing backup data.
[0111] Emergency backup operations performed on unbacked-up archived data are not subject to the constraints of regular backup scheduling policies. Scheduling constraints may include timed execution windows, backup resource locks, task queuing and rate limiting rules, etc. Emergency backup tasks can skip all constraints and start immediately.
[0112] Deleting archived data after backup is complete frees up local storage space while preserving the complete remote backup copy, preventing any gaps in data recovery.
[0113] Rules for filtering at least some unbacked-up archived data can include prioritizing the backup of unbacked-up files generated earlier, prioritizing the backup of unbacked-up files that occupy more space, or retaining the latest N unbacked-up archives without participating in emergency backup cleanup, etc.
[0114] For example, in some embodiments, i=1. After the first capacity adjustment operation is completed, a second status parameter of 1.2 hours is generated. Assuming a first preset duration threshold of 2 hours is configured, 1.2 hours is less than 2 hours, and the triggering condition for the second capacity adjustment operation is determined to be met. Skipping the regular scheduling rule of prohibiting backups during the day, the emergency backup program is started, all unbacked-up archived logs generated earlier than 1 hour in the storage partition are read, remote backup and integrity verification are completed, the backup mark is updated in the ledger, and these archived files are deleted in batches, releasing approximately 30 gigabytes of local storage space, thus completing the second capacity adjustment operation.
[0115] In other embodiments, i=1, the second state parameter is 1.4 hours after the first capacity adjustment operation is completed, and the first preset duration threshold is set to 1.5 hours, satisfying the trigger judgment for the second capacity adjustment operation. Emergency backup prioritizes processing unbacked-up archive fragments with single files exceeding 5 gigabytes. After all fragments are verified remotely, they are deleted locally. Unbacked-up archive files generated within the last 30 minutes are retained without processing, completing the second capacity adjustment operation.
[0116] In the embodiments of this application, the second capacity adjustment operation can first perform emergency backup on the unbacked archive and then perform local deletion, which can completely preserve the remote copy of the archived data and will not disrupt the backup continuity link; setting a first preset duration threshold to distinguish between the first-level and second-level handling processes can realize gradient risk handling. For mild risks, only lossless cleaning is performed, and for moderate risks, the emergency backup process is restarted, which can balance the storage space release speed and data security.
[0117] According to an embodiment of this application, when the second state parameter satisfies the triggering condition for the (i+1)th capacity adjustment operation, performing the (i+1)th capacity adjustment operation on the storage space after the i-th adjustment may include: when i=2, in response to the estimated duration after adjustment being less than a second preset duration threshold, deleting the target archived data in the storage space to complete the (i+1)th adjustment process, wherein the archived time corresponding to the target archived data is earlier than a preset time threshold.
[0118] When i=2, the (i+1)th capacity adjustment operation corresponds to the third capacity adjustment operation, which can be used as a three-level emergency response process. It is suitable for extreme scenarios where the risk of storage exhaustion still exists after the execution of the first and second level response processes.
[0119] The second preset duration threshold can be a critical time value that distinguishes between secondary and tertiary treatment. The value of the second preset duration threshold can be greater than the first preset duration threshold, for example, it can be 4 hours, 5 hours, 6 hours, 8 hours, etc.
[0120] The adjusted estimated duration can be the second state parameter generated after the second round of adjustment, or the remaining estimated duration after the storage space reaches the warning threshold after two-level processing.
[0121] The target archive data can be archive files stored in the local storage space whose creation time is earlier than a preset time threshold. These files have an earlier creation period and therefore have a relatively lower impact on the database's real-time archiving process. The target archive data can include backed-up archive files and / or unbacked-up archive files.
[0122] The preset time threshold can be a time range used to filter old archived files. It can be configured to 1 hour, 2 hours, 3 hours, 6 hours, 24 hours, etc. It can read the generated timestamp in the metadata of the archived file to complete the time comparison and filtering.
[0123] The operation of directly deleting target archived data can quickly free up a large amount of storage space, prioritize the continuous operation of the database, and avoid the failure of shutdown when the storage is completely full.
[0124] After the Level 3 adjustment is completed, the archive backup continuity verification process can be automatically triggered to identify backup gaps caused by the deletion of old and unbacked-up archived data, and then perform a backup repair operation to restore the data link.
[0125] When filtering target archived data, retention rules can be configured. The rules can be to retain all archived files generated within a preset time threshold and / or retain archived files within a fixed sequence number range, and only delete old archived files before the time threshold.
[0126] For example, in some embodiments, i=2, and a second state parameter of 4.1 hours is generated after the second capacity adjustment operation. Assuming a second preset duration threshold of 6 hours, since 4.1 hours is less than 6 hours, the trigger condition for the third capacity adjustment operation is determined to be met. The preset time threshold is set to 1 hour. The generation timestamps of all archived files in the storage partition are read, and all archived files whose generation time is earlier than 1 hour of the current time are selected as target archived data. Batch deletion operations are performed to quickly release approximately one hour of local storage space, completing the third capacity adjustment operation.
[0127] In other embodiments, i=2, the second state parameter after the second capacity adjustment operation is 3.5 hours, and assuming the second preset duration threshold is 4 hours, the trigger determination for the third capacity adjustment operation is met. The preset time threshold is set to 30 minutes, all old archive fragments with a generation time exceeding 30 minutes are deleted, and only archive files generated within the last 30 minutes are retained, thus completing the third capacity adjustment operation.
[0128] In the embodiments of this application, the third capacity adjustment operation deletes the target archived data in the storage space. The archiving time corresponding to the target archived data is earlier than the preset time threshold, which can ensure the continuous operation of the business. By distinguishing the secondary and tertiary handling processes through an independent second preset duration threshold, the deletion operation is initiated when the secondary handling cannot resolve the risk, which can reduce the frequency of deletion of unbacked-up archived files and reduce the probability of backup link failure.
[0129] According to embodiments of this application, the (i+1)th capacity adjustment operation and the ith capacity adjustment operation may differ in at least one aspect of data security level, operation time, and the amount of storage space released.
[0130] Data security level can be a classification standard used to distinguish the degree of impact of different capacity adjustment operations on the integrity of archived data and the continuity of backup links. The classification dimensions can include whether the operation deletes unbacked-up archived files, whether it will cause backup gaps, whether it is necessary to make up the backup afterward, or the level of risk of data loss.
[0131] Different adjustment operations correspond to different data security levels, which can be divided into multiple tiers, including high security, medium security, and low security. High security level operations may only process archived data that has already been backed up remotely, without disrupting the archive backup sequence. Medium security level operations may first perform a full remote backup of unbacked-up archives and then clean up local files, incurring only temporary data transfer overhead and avoiding permanent data loss. Low security level operations may directly delete unbacked-up old archive files, posing a possibility of archive link disruption.
[0132] Operation time can be the total time consumed from starting a single round of capacity adjustment process to the completion of the entire process. Factors affecting the time consumption may include the total number of archive files to be processed, backup transmission bandwidth, disk read / write speed, remote storage verification time, and the number of file deletion traversals. For example, deleting only some backed-up archive data takes relatively little time, while deleting both some backed-up archive data and unbacked-up archive data takes a lot of time.
[0133] The released storage space capacity can be the newly added available storage space after a single round of capacity adjustment operation is completed. The value is determined by the total size of the archive files that are filtered and deleted in this round of operation.
[0134] The i-th capacity adjustment operation and the (i+1)-th capacity adjustment operation may differ only in one of the following aspects: data security level, operation time, and released storage space capacity, or they may differ in two or three aspects.
[0135] In some embodiments, when i=1, the i-th capacity adjustment operation corresponds to the first capacity adjustment operation, which can delete only the backed-up archive files, corresponding to a high data security level. No remote backup transfer is required; the disk only performs file deletion, resulting in a shorter overall operation time and a limited amount of storage space that can be released in a single operation. The second capacity adjustment operation first performs a remote backup of the unbacked-up archives before deleting local files, corresponding to a medium data security level. This involves file reading, network transmission, and remote verification steps, resulting in a longer overall operation time and a higher amount of storage space that can be released in a single operation compared to the first-level adjustment. The two sets of operations differ in data security level, operation time, and the amount of storage space released.
[0136] In some embodiments, when i=2, the i-th capacity adjustment operation corresponds to the second capacity adjustment operation, which corresponds to a medium data security level and has a medium operation time, for example, releasing about 30 gigabytes of space in a single operation. The (i+1)-th capacity adjustment corresponds to the third capacity adjustment operation, which directly deletes old, unbacked-up archives, corresponds to a low data security level, does not require backup and transfer steps, has a short operation time, and can release about 60 gigabytes of storage space in a single operation. The two sets of operations differ in both the data security level and the amount of storage space released.
[0137] In the embodiments of this application, different capacity adjustment operations can be differentiated in at least one of data security level, operation time, and freed space capacity. A tiered risk handling process can be established, where high-security and low-time adjustment operations can be selected for mild storage risks, while fallback adjustment operations with more freed space can be selected for severe storage risks. The corresponding handling intensity can be matched according to the degree of storage space tension, and data security and space release efficiency can be balanced in different risk scenarios.
[0138] Figure 3 This schematically illustrates another flowchart of a method for adjusting storage space according to an embodiment of this application.
[0139] For example, such as Figure 3 As shown, in some embodiments, in step S301, the monitoring agent polls and collects data every 15 minutes at a preset interval to obtain the current remaining capacity of the storage space, the data archiving rate, and can also collect historical rate samples, current business time period attributes, and hardware load status.
[0140] For example, in step S302, the archiving warning time T is calculated. 警 In this embodiment, the archiving alert time can be used as both a first state parameter and a second state parameter. The archiving alert time can be determined based on the remaining capacity and generation rate as a base time, and then adjusted using fluctuation correction coefficients, period correction coefficients, and load correction coefficients to obtain the archiving alert time T. 警 At the same time, it obtains the remaining wait time for the next backup.
[0141] In step S303, determine T 警 Is it less than the remaining waiting time (i.e., is it T?) 警 (Next backup time). If not, return to step S301 to continue monitoring; if yes, proceed to step S304.
[0142] In step S304, initiate the first capacity adjustment operation, deleting successfully backed-up archive files from the storage space, while retaining at least two of the most recent archives. After completion, T can be recalculated according to step S302. 警 .
[0143] In step S305, determine the recalculated T. 警 Is it less than the first preset duration (e.g., determining whether it is T)? 警 If the time limit is less than 2 hours, proceed to step S313 to continue normal monitoring; if the time limit is 2 hours, proceed to step S306.
[0144] In step S306, the second capacity adjustment operation is initiated, and the backup tool is invoked to perform a backup operation on the unbacked-up data. This operation is not subject to the preset scheduling strategy. After the backup is completed, the backed-up files are deleted. After completion, T is calculated again according to step S302. 警 .
[0145] In step S307, determine T 警 Is it less than the second preset duration (e.g., determining if it is T)? 警 If the backup is less than 6 hours old, proceed to step S308 to restore the normal backup; if so, proceed to step S309.
[0146] In step S309, the third capacity adjustment operation is initiated. This can delete all archived files except for data generated in the most recent hour. In step S310, a prompt message containing the results of the active session query can be sent to the management terminal. After receiving the confirmation instruction, the relevant business operations are stopped.
[0147] In some embodiments, in step S310, an alarm notification is sent, and a prompt message is sent to the maintenance personnel via an instant messaging tool. In step S311, manual intervention is initiated to confirm the continuation of the emergency procedure, and the process proceeds to step S312. In step S312, a full backup is immediately triggered. After the full backup is completed, some of the backed-up archive files are deleted, and the process proceeds to step S313 to continue normal monitoring.
[0148] According to an embodiment of this application, the method for adjusting storage space may further include: checking the continuity of the backup of the archived file based on the records of the archived file; if there are gaps in the backup of the archived file, performing a backup operation based on the source files of the archived file to complete the backup.
[0149] Archived records can be a ledger of all locally archived files. For example, archived files can be generated synchronously during database operation, or during file backup and deletion operations. Archived records can include information such as file creation time, sequential number, storage path, and whether a remote backup was completed, and can completely restore the order in which archived files were created.
[0150] Archive continuity refers to the completeness of the sequence of archive files within an archive. Checking continuity can involve comparing archive file sequence numbers, verifying the generation time order of archive files, validating the forward and backward pointer relationships in the archive file header metadata, and querying the database's data dictionary view to obtain archive registration information. Data gaps can occur due to missing files in the archive sequence, discontinuous gaps in the generation time of archive files, or invalid pointers in the metadata. This check can be used to assess the impact of emergency cleanup on backup integrity and provide a basis for adjusting subsequent backup strategies.
[0151] The source files for archived files can be the original database business data files that generated the archived files. Performing backup operations based on the source files of the archived files can be a full backup or an incremental backup. A full backup can back up all data files, control files, and archived logs of the database, and can be used to rebuild a complete backup baseline after a break in the archive chain. Full backups can be performed during off-peak hours, can utilize parallel processing to improve backup speed, can compress backup data to reduce storage usage, and can encrypt backup data to improve security. After performing a full backup, a new backup baseline can be generated, allowing subsequent incremental backups to be performed based on this baseline. Incremental backups, which perform data recovery, can back up data or archived logs that have changed since the last backup, and can be used to supplement missing backup data when the archive chain is continuous. Incremental backups can be first-level incremental backups, backing up data that has changed since the last full backup; second-level incremental backups, backing up data that has changed since the last incremental backup; or dedicated incremental backups of archived logs, backing up only missing archived files, etc. Data recovery can be performed asynchronously in the background, without blocking normal database business operations.
[0152] Figure 4 The diagram illustrates the architecture of a backup system for an application storage space adjustment method according to an embodiment of this application.
[0153] For example, such as Figure 4As shown, in some embodiments, the architecture for implementing the storage space adjustment method of this application embodiment may include a database 410, a monitoring agent 420, and a backup server 430. The archive directory analysis 411 associated with the database 410 can be responsible for traversing the sequence numbers of archived file records to verify the continuity of the backup. The database 410 may have storage space. The monitoring agent 420 can poll and collect data such as the remaining storage space capacity, archive generation rate, business time period attributes, and hardware load status at preset intervals, and report this data to the policy engine 431 within the backup server 430. The strategy engine 431 can calculate the base time based on the remaining capacity and archive generation rate, and combine the fluctuation correction parameters, period correction parameters, and load correction parameters to obtain the archive warning time. When it is determined that the archive warning time is less than the remaining waiting time for the next backup, an emergency command is issued to the emergency controller 412. The emergency controller 412 can execute three-level gradient emergency operations in sequence. After executing the third emergency step, it can call the archive directory analysis 411 to confirm the archive chain status. If the archive file sequence number is continuous, the daily backup status is restored. If there is a gap, the backup server 430 is linked to perform a full backup to complete the backup. The alarm center 432 can send a prompt containing fault location information to the management terminal and receive manual confirmation commands during the emergency, realizing the fully automated processing from risk prediction, graded intervention to post-disaster recovery, ensuring the survival of the database while maintaining data recoverability.
[0154] In other embodiments, after the third emergency step is completed, the remaining archive files in the storage space can be traversed, and the serial number of each file can be extracted and sorted in ascending order. For example, if the check finds that the serial numbers are consecutive from 11001 to 11010 without any missing numbers, the archive files are determined to be continuous. At this time, incremental backup is started to restore the data. The backup tool is called to scan the existing archive backup records in the backup storage medium and identify the archive files corresponding to the missing serial numbers 11005 to 11008. The backup tool reads the source files of these archive files from the database and restores them to the backup to complete the backup. After restoration is completed, the continuity can be verified again. After confirmation, normal backup scheduling can be resumed. This embodiment is suitable for scenarios where emergency cleanup only deletes backed-up archives without disrupting the archive chain. It quickly restores the integrity of local archives through incremental restoration without performing a full backup.
[0155] In the embodiments of this application, after the third emergency step is completed, the backup sequence can be verified according to the archived file records to identify backup gaps caused by cleaning up unbacked archives in a timely manner; backup incompleteness can be automatically repaired, taking into account both business continuity and the ability to recover complete data, and greatly reducing the risk of data loss and recovery failure.
[0156] Based on the above-described method for adjusting storage space, embodiments of this application also provide a device for adjusting storage space. The following will be combined with... Figure 5 The device is described in detail.
[0157] Figure 5 A schematic block diagram of a storage space adjustment device according to an embodiment of this application is shown.
[0158] like Figure 5 As shown, the storage space adjustment device 500 of this embodiment includes a status parameter acquisition module 510 and a storage space adjustment module 520.
[0159] The status parameter acquisition module 510 is used to acquire the first status parameter of the storage space.
[0160] The storage space adjustment module 520 is used to perform an i-th capacity adjustment operation on the storage space when the first state parameter meets the triggering condition of the i-th capacity adjustment operation, where i is any positive integer; in response to the completion of the i-th capacity adjustment operation, it obtains the second state parameter of the storage space after the i-th adjustment; and when the second state parameter meets the triggering condition of the (i+1)-th capacity adjustment operation, it performs an (i+1)-th capacity adjustment operation on the storage space after the i-th adjustment; wherein the first state parameter and the second state parameter respectively indicate the estimated duration information of the corresponding storage space reaching the preset warning state.
[0161] According to an embodiment of this application, the state parameter acquisition module 510 can also be used to determine the initial estimated duration for the storage space to reach a preset warning state based on the current remaining capacity of the storage space and the data archiving rate; and to adjust the initial estimated duration using a first correction coefficient that matches the i-th adjustment process, wherein the adjusted estimated duration constitutes the first state parameter.
[0162] According to an embodiment of this application, the state parameter acquisition module 510 can also be used to determine a fluctuation correction coefficient indicated by the historical data archiving rate based on the historical data archiving rate of the reference time period matched with the i-th adjustment process; determine a cycle correction coefficient indicated by the business cycle type based on the business cycle type matched with the i-th adjustment process; determine a load correction coefficient indicated by the server load status based on the server load status matched with the i-th adjustment process; fuse the fluctuation correction coefficient, the cycle correction coefficient, and the load correction coefficient to obtain a first correction coefficient; and perform deviation calibration on the initial estimated duration based on the first correction coefficient to obtain a first state parameter.
[0163] According to an embodiment of this application, the storage space adjustment module 520 can also be used to determine that the triggering condition for the first capacity adjustment operation is met when i=1, in response to the adjusted estimated duration being less than the remaining waiting time before performing the next backup operation; and to delete the backed-up data in the storage space to complete the first capacity adjustment operation.
[0164] According to an embodiment of this application, the storage space adjustment module 520 can also be used to respond to the completion of the i-th capacity adjustment operation, determine the initial estimated duration for the storage space after the i-th adjustment to reach a preset warning state based on the current remaining capacity of the storage space after the i-th adjustment and the data archiving rate; and adjust the initial estimated duration using a second correction coefficient matched with the i+1-th adjustment process, wherein the adjusted estimated duration constitutes a second state parameter.
[0165] According to an embodiment of this application, the storage space adjustment module 520 can also be used to back up at least a portion of the archived data that has not been backed up in the storage space when i=1, in response to the adjusted estimated duration being less than a first preset duration threshold; and to delete the corresponding archived data that has been backed up.
[0166] According to an embodiment of this application, the storage space adjustment module 520 can also be used to delete target archived data in the storage space when i=2, in response to the adjusted estimated duration being less than a second preset duration threshold, wherein the archiving time corresponding to the target archived data is earlier than the preset time threshold.
[0167] According to embodiments of this application, the (i+1)th capacity adjustment operation and the ith capacity adjustment operation of the storage space adjustment module 520 may differ in at least one aspect of data security level, operation time, and the released storage space capacity.
[0168] According to embodiments of this application, any plurality of modules in the state parameter acquisition module 510 and the storage space adjustment module 520 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules can be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of this application, at least one of the state parameter acquisition module 510 and the storage space adjustment module 520 can be at least partially implemented as hardware circuits, such as field-programmable gate arrays, programmable logic arrays, systems-on-a-chip, systems-on-a-substrate, systems-on-package, application-specific integrated circuits, or any other reasonable means of integrating or packaging circuits, or implemented in any one of software, hardware, and firmware, or in a suitable combination of any of these. Alternatively, at least one of the state parameter acquisition module 510 and the storage space adjustment module 520 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.
[0169] Figure 6 A block diagram schematically illustrates an electronic device suitable for implementing a method for adjusting storage space according to an embodiment of this application.
[0170] like Figure 6 As shown, an electronic device 600 according to an embodiment of this application includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory 602 or a program loaded from a storage portion 608 into a random access memory 603. The processor 601 may include, for example, a general-purpose microprocessor, an instruction set processor and / or an associated chipset and / or a dedicated microprocessor. The processor 601 may also include onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for executing different steps of the method flow according to an embodiment of this application.
[0171] Random access memory 603 stores various programs and data required for the operation of electronic device 600. Processor 601, read-only memory 602, and random access memory 603 are interconnected via bus 604. Processor 601 executes various steps of the method flow according to embodiments of this application by executing programs in read-only memory 602 and / or random access memory 603. It should be noted that programs may also be stored in one or more memories other than read-only memory 602 and random access memory 603. Processor 601 may also execute various steps of the method flow according to embodiments of this application by executing programs stored in one or more memories.
[0172] According to embodiments of this application, the electronic device 600 may further include an input / output interface 605, which is also connected to a bus 604. The electronic device 600 may also include one or more of the following components connected to the input / output interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube, liquid crystal display, etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card, such as a local area network card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the input / output interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 610 as needed so that computer programs read from it can be installed into the storage section 608 as needed.
[0173] Embodiments of this application also provide a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.
[0174] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination thereof. In embodiments of this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include the read-only memory 602 described above, and / or random access memory 603, and / or one or more memories other than read-only memory 602 and random access memory 603.
[0175] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the methods provided in the embodiments of this application.
[0176] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and downloaded and installed via the communication section 609, and / or installed from the removable medium 611. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0177] In embodiments of this application, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611. When the computer program is executed by processor 601, it performs the functions defined in the system of embodiments of this application. According to embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0178] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0179] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0180] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.
Claims
1. A method for adjusting storage space, characterized in that, include: Obtain the first state parameters of the storage space; If the first state parameter satisfies the triggering condition for the i-th capacity adjustment operation, the i-th capacity adjustment operation is performed on the storage space, where i is any positive integer; In response to the completion of the i-th capacity adjustment operation, the second state parameters of the storage space after the i-th adjustment are obtained; and If the second state parameter satisfies the triggering condition for the (i+1)th capacity adjustment operation, the (i+1)th capacity adjustment operation is performed on the storage space after the i-th adjustment. The first state parameter and the second state parameter respectively indicate the estimated time for the corresponding storage space to reach the preset warning state.
2. The method according to claim 1, characterized in that, The storage space is used to store archived data; obtaining the first status parameter of the storage space includes: Based on the current remaining capacity of the storage space and the data archiving rate, determine the initial estimated duration for the storage space to reach a preset warning state; and The initial estimated duration is adjusted using a first correction coefficient that matches the i-th adjustment process, and the adjusted estimated duration constitutes the first state parameter.
3. The method according to claim 2, characterized in that, The initial estimated duration is adjusted using a first correction coefficient matched with the i-th adjustment process. The adjusted estimated duration constitutes the first state parameter, including: Based on the historical data archiving rate of the reference time period matched with the i-th adjustment process, determine the fluctuation correction coefficient indicated by the historical data archiving rate; Based on the business cycle type that matches the i-th adjustment process, determine the cycle correction coefficient indicated by the business cycle type; Based on the server load state that matches the i-th adjustment process, determine the load correction coefficient indicated by the server load state; The fluctuation correction coefficient, the period correction coefficient, and the load correction coefficient are fused to obtain the first correction coefficient; and Based on the first correction coefficient, the initial estimated duration is calibrated to obtain the first state parameter.
4. The method according to any one of claims 1 to 3, characterized in that, The step of performing the i-th capacity adjustment operation on the storage space when the first state parameter satisfies the triggering condition for the i-th capacity adjustment operation includes: When i=1, in response to the adjusted estimated duration being less than the remaining waiting time before executing the next backup operation, it is determined that the triggering condition for the first capacity adjustment operation is met; and The backed-up data in the storage space is deleted to complete the first capacity adjustment operation.
5. The method according to any one of claims 1 to 3, characterized in that, The storage space is used to store archived data; In response to the completion of the i-th capacity adjustment operation, the second state parameters of the storage space after the i-th adjustment are obtained, including: In response to the completion of the i-th capacity adjustment operation, the initial estimated duration for the i-th adjusted storage space to reach the preset warning state is determined based on the current remaining capacity of the storage space after the i-th adjustment and the data archiving rate. as well as The initial estimated duration is adjusted using a second correction coefficient that matches the (i+1)th adjustment process, and the adjusted estimated duration constitutes the second state parameter.
6. The method according to claim 5, characterized in that, When the second state parameter satisfies the triggering condition for the (i+1)th capacity adjustment operation, the (i+1)th capacity adjustment operation is performed on the storage space after the i-th adjustment, including: When i=1, in response to the adjusted estimated duration being less than a first preset duration threshold, at least a portion of the archived data that has not been backed up in the storage space is backed up; and Delete the corresponding archived data after backup is complete.
7. The method according to claim 5, characterized in that, When the second state parameter satisfies the triggering condition for the (i+1)th capacity adjustment operation, the (i+1)th capacity adjustment operation is performed on the storage space after the i-th adjustment, including: When i=2, in response to the adjusted estimated duration being less than the second preset duration threshold, the target archived data in the storage space is deleted. Wherein, the archiving time corresponding to the target archived data is earlier than a preset time threshold.
8. The method according to any one of claims 1 to 3, characterized in that, The (i+1)th capacity adjustment operation and the ith capacity adjustment operation differ in at least one aspect: data security level, operation time, and the amount of storage space released.
9. A storage space adjustment device, characterized in that, The device includes: A status parameter acquisition module is used to acquire the first status parameter of the storage space; and A storage space adjustment module is configured to perform the i-th capacity adjustment operation on the storage space when the first state parameter satisfies the triggering condition for the i-th capacity adjustment operation, where i is any positive integer; in response to the completion of the i-th capacity adjustment operation, obtain the second state parameter of the storage space after the i-th adjustment; and perform the (i+1)-th capacity adjustment operation on the storage space after the i-th adjustment when the second state parameter satisfies the triggering condition for the (i+1)-th capacity adjustment operation. The first state parameter and the second state parameter respectively indicate the estimated time for the corresponding storage space to reach the preset warning state.
10. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 8.
12. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 8.