Method and device for adjusting backup capacity
By generating time-series features in the database and using a hybrid model for capacity prediction, the problem that existing backup storage management methods cannot dynamically adapt to data changes is solved, achieving more accurate capacity prediction and resource optimization.
Patent Information
- Application Number
- CN202511440516.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-09
- Publication Date
- 2026-01-30
AI Technical Summary
Existing backup storage management methods cannot dynamically adapt to data changes and business needs, resulting in wasted resources or insufficient storage.
By acquiring historical data from the database, time series features are generated and input into a hybrid model for capacity prediction. The hybrid model includes models that handle nonlinear short-term features and linear long-term features, and the predicted capacity for future time periods is calculated and output.
It improves the accuracy of backup capacity prediction, optimizes the use of storage resources, reduces resource waste, and enhances the availability and reliability of the database system.
Smart Images

Figure CN121433972A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] One or more embodiments of the present specification relate to the technical field of adjusting backup capacity, and in particular to a method and device for adjusting backup capacity. BACKGROUND
[0002] Backup capacity generally refers to the size of storage space required to store backup data, and is one of the core indicators in database backup scheme design. With the continuous growth of data volume, the demand of enterprises for database backup storage is also increasing. The backup storage management method in the related art is usually based on fixed time intervals and predetermined backup capacity, which cannot dynamically adapt to data changes and business demands, and is prone to cause problems of resource waste or storage shortage. SUMMARY
[0003] Therefore, one or more embodiments of the present specification provide a method and device for adjusting backup capacity.
[0004] To achieve the above-mentioned purpose, one or more embodiments of the present specification provide technical solutions as follows: According to a first aspect of one or more embodiments of the present specification, a method for adjusting backup capacity is provided, comprising: obtaining historical data related to backup capacity of a database in a target historical time period; generating time series features arranged in time sequence based on the historical data, and generating model input data based on the time series features; processing the model input data by a hybrid model obtained by training, to generate a predicted capacity of the database in a future time period; the hybrid model includes a first model for processing nonlinear short-term features and a second model for processing linear long-term features; each model in the hybrid model outputs a prediction result according to the model input data, and the output result of the hybrid model is determined by comprehensive calculation of the output results of all models included in the hybrid model; adjusting the backup capacity of the database in the future time period based on the predicted capacity.
[0005] According to a second aspect of one or more embodiments of the present specification, a device for adjusting backup capacity is provided, comprising: an obtaining module, configured to obtain historical data related to backup capacity of a database in a target historical time period; a feature generation module, configured to generate time series features arranged in time sequence based on the historical data, and generate model input data based on the time series features; a prediction module configured to process the model input data by using a hybrid model obtained by training to generate a predicted capacity of the database in a future time period; the hybrid model comprises a first model configured to process nonlinear short-term features and a second model configured to process linear long-term features; each model in the hybrid model outputs a prediction result according to the model input data, and an output result of the hybrid model is determined by comprehensive calculation of output results of all the models comprised in the hybrid model; an adjustment module configured to adjust a backup capacity of the database in the future time period based on the predicted capacity.
[0006] According to a third aspect of one or more embodiments of the present specification, an electronic device is provided, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor implements the method of the first aspect by running the executable instructions.
[0007] According to a fourth aspect of one or more embodiments of the present specification, a computer readable storage medium is provided, having stored thereon computer instructions which, when executed by a processor, implement the steps of the method of the first aspect.
[0008] According to a fifth aspect of one or more embodiments of the present specification, a computer program product is provided, comprising: computer program / instructions which, when executed by a processor, implement the method of the first aspect.
[0009] As can be seen from the above embodiments, the method and device for adjusting backup capacity provided by one or more embodiments of the present specification first obtain historical data related to backup capacity of a database in a target historical time period, then generate time series features arranged in time sequence according to the historical data, and generate model input data by using the time series features as input of a hybrid model. After generating the model input data, the model input data is input into the hybrid model for capacity prediction to obtain a predicted capacity of the database in a future time period, wherein the hybrid model comprises a first model configured to process nonlinear short-term features and a second model configured to process linear long-term features, each model outputs a prediction result according to the model input data, and the output results of all the models are comprehensively calculated to obtain the predicted capacity of the database in the future time period output by the hybrid model. At the same time, the first model configured to process nonlinear short-term features and the second model configured to process linear long-term features are used to predict the capacity of the database in the future time period, which improves the accuracy of the predicted capacity. After obtaining the predicted capacity, the backup capacity of the database in the future time period can be dynamically adjusted according to the predicted capacity, which further optimizes the use of storage resources, reduces the waste of resources, and improves the availability and reliability of the database system. BRIEF DESCRIPTION OF DRAWINGS
[0010] Figure 1 FIG. 1 is a schematic diagram of an application scenario of adjusting backup capacity provided by an example embodiment.
[0011] Figure 2 FIG. 2 is a flowchart of a method of adjusting backup capacity provided by an example embodiment.
[0012] Figure 3 FIG. 3 is a flowchart of a hybrid model processing model input data provided by an example embodiment.
[0013] Figure 4 FIG. 4 is a flowchart of another method of adjusting backup capacity provided by an example embodiment.
[0014] Figure 5 FIG. 5 is a structural diagram of a device provided by an example embodiment.
[0015] Figure 6 FIG. 6 is a block diagram of an apparatus for adjusting backup capacity provided by an example embodiment. DETAILED DESCRIPTION
[0016] In order to enable persons skilled in the art to better understand the technical solutions in the specification, the technical solutions in the specification will be clearly and completely described below in conjunction with the drawings in the embodiments of the specification. Obviously, the described embodiments are only some of the embodiments of the specification, not all the embodiments. Based on the embodiments in the specification, all other embodiments obtained by persons skilled in the art without creative labor should be within the protection scope of the specification.
[0017] The user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the specification are information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portal for user to choose authorization or refusal.
[0018] As described in the background, the backup storage management method in the related art is usually based on fixed time interval and predetermined backup capacity, that is, capacity management is performed according to predefined rules and thresholds. This backup capacity management method, although easy to implement, has poor adaptability as the predefined rules are difficult to cover all cases and cannot dynamically adapt to data changes and business requirements, which may easily lead to problems of resource waste or insufficient storage.
[0019] In summary, the embodiment of the present specification proposes a method for adjusting backup capacity, obtains historical data related to backup capacity of a database in a target historical time period, generates time series features arranged in time sequence according to the historical data, and generates model input data through the time series features to serve as input of a hybrid model. After generating production model input data, the model input data is input into the hybrid model for capacity prediction to obtain predicted capacity of the database in a future time period, wherein the hybrid model includes a first model for processing nonlinear short-term features and a second model for processing linear long-term features, each model outputs a prediction result according to the model input data, and the output results of all models are comprehensively calculated to obtain the predicted capacity of the database in the future time period output by the final hybrid model. At the same time, the first model for processing nonlinear short-term features and the second model for processing linear long-term features are used to predict the capacity of the database in the future time period, so that the hybrid model can simultaneously focus on the nonlinear short-term features and the linear long-term features in the historical data, further improving the accuracy of model prediction. After obtaining the predicted capacity, the backup capacity of the database in the future time period can be dynamically adjusted according to the predicted capacity, further optimizing the use of storage resources, reducing resource waste, and improving the availability and reliability of the database system.
[0020] Figure 1 FIG. 1 is a schematic diagram of an application scenario for adjusting backup capacity provided by an exemplary embodiment. As shown in FIG. 1, the application scenario can include a server 11, a database system 12, a communication network 13, and an electronic device 14. The electronic device 14 can include a PC (Personal Computer), a mobile phone, etc. Figure 1
[0021] The server 11 can be a physical server containing a standalone host, or the server 11 can be a virtual server carried by a host cluster. In the running process, the server 11 can run a server-side program of an application to realize the related functions of the application. For example, when the server 11 runs an execution program for adjusting backup capacity, it can realize a corresponding server for adjusting backup capacity. In some embodiments, when the server 11 runs the execution program for adjusting backup capacity, it can obtain historical data related to backup capacity of a database in a target historical time period from the database system 12, and send the adjustment result of the backup capacity to the database system 12.
[0022] As a carrier of the database, the database system 12 can include a stand-alone host single-database or a distributed database composed of multiple data nodes. Each data node can be regarded as a stand-alone host, and is only responsible for a part of the global data. In some embodiments, a large amount of data is stored in the database, and the data can be partitioned according to different uses and types of data. The sources of the data include but are not limited to existing databases, data crawled from the Internet, or data uploaded by users when using the client. In some embodiments, the execution program for adjusting the backup capacity can be directly run in the database system 12.
[0023] PC, mobile phone is only part of the type of electronic device that users can use. In fact, users can obviously also use electronic devices of the following types: tablet devices, notebook computers, personal digital assistants (PDAs), wearable devices (such as smart glasses, smart watches, etc.), and the like, and the embodiments of the present specification are not limited in this regard. During operation, the electronic device can run a client-side program of an application to implement the related functions of the application, such as when the electronic device runs a program for obtaining data from the database, it can be implemented as a client for the program, and in some embodiments, the program can be an access to the database in the database system 12. The application program of the client of the related program service can be started and run on the electronic device. The client-side program can be a native application installed on the electronic device, or the client-side program can be an applet, a fast application, or other similar forms. Of course, when using web page technologies such as HTML5 or the like, the related functions can be implemented through a page displayed by a browser, and the browser can be a stand-alone browser application or a browser module embedded in some application.
[0024] As for the communication network 13 for interaction between the server 11, the database system 12, and the electronic device 14, the communication can be realized based on the communication mode supported by the corresponding electronic device, and the communication can be realized through wired or wireless networks, and the present specification is not limited in this regard. For example, the PC 13 can support wired and wireless communication at the same time, and the communication can be realized through wired or wireless networks as needed, while the mobile phone usually only supports wireless communication, and the communication can be realized through wireless networks.
[0025] Reference Figure 2 A flowchart of a method for adjusting backup capacity provided by an embodiment of the present specification is shown, and the method includes the following steps: S202, obtaining historical data related to backup capacity of the database in a target historical time period.
[0026] The target historical time period can be a historical time period before the current time, and the target historical time period determines the length of historical data used in capacity prediction. The end time of the target historical time period can be the current time or a time before the current time, and the end time is not limited. In some embodiments, the current time can be the start time of the method for adjusting backup capacity. It should be noted that the length of the target historical time period and the time at both ends thereof can be set as needed, and the time at both ends is not limited. The historical data can be data related to backup capacity of the database in the target historical time period. For example, in some embodiments, the historical data can include historical backup capacity data and system index data. The historical backup capacity data can be a plurality of historical backup capacities of the database in the target historical time period. The system index data can be indexes of the system in which the database is located in the target historical time period. In some embodiments, the system index data generally refers to index data that can affect the backup capacity in the target historical time period, for example, database transaction volume, user activity, system performance index (CPU / IO / network throughput), and the like.
[0027] In some embodiments, the database transaction volume can be a historical business load index of the database in the target historical time period, such as transactions per second (TPS), commit / rollback times, and the like. The user activity can refer to the use intensity index of the business user side of the database, such as the number of active accounts, the number of requests, the number of logins, and the like, which can be used to indirectly reflect the rate of business data generation. The system performance index includes CPU usage, disk IO throughput, network traffic, and the like of the system in which the database is located, and the system performance index can be used as an external constraint and evidence of data growth.
[0028] In some embodiments of the present specification, the method for adjusting backup capacity further includes: determining a variance of historical data of the database in a preset historical time period, and obtaining a fluctuation value of the database in the preset historical time period based on the variance; wherein the preset historical time period and the target historical time period both have a target time before the future time period as an end time; determining the length of the target historical time period based on the fluctuation value; wherein the length of the target historical time period is inversely proportional to the fluctuation value.
[0029] In order to accurately determine the length of the target historical time period, and provide an effective data source for capacity prediction, in the embodiments of the present disclosure, when determining the length of the target historical time period, the variance of the historical data of the database in a preset historical time period, i.e., a time period before the current time, is determined first. In order to ensure that the data fluctuation in the preset historical time period can better reflect the length of the target historical time period, the preset historical time period and the target historical time period both have a target time point before the future time period as the end time point, i.e., the end time points of the preset historical time period and the future time period are the same, and both are before the future time period. After determining the variance of the historical data of the database in the preset historical time period, the fluctuation value of the database in the preset historical time period is determined according to the variance value, In some embodiments, the variance can be normalized and used as the fluctuation value of the database in the preset historical time period. The size of the fluctuation value reflects the change of the data of the database in the preset historical time period. After determining the fluctuation value, the length of the target historical time period can be determined according to the fluctuation value. Generally, the length of the target historical time period is inversely proportional to the fluctuation value, i.e., the larger the fluctuation value, the longer the length of the target historical time period. In some embodiments, in order to more accurately determine the length of the target historical time period through the fluctuation value of the database in the preset historical time period, a plurality of fluctuation value threshold intervals can be set, and each fluctuation value threshold interval corresponds to a length of the target historical time period. It should be noted that when the fluctuation value of the database in the preset historical time period is large, the sensitivity of capacity prediction can be enhanced by shortening the length of the target historical time period. When the fluctuation value of the database in the preset historical time period is small, the robustness and seasonality of the model to historical data can be enhanced by increasing the length of the target historical time period.
[0030] S204, generating time series features arranged in time sequence based on the historical data, and generating model input data based on the time series features.
[0031] After obtaining the historical data of the database related to the backup capacity in the target historical time period, the historical data can be cleaned and time series features arranged in chronological order can be generated, so that the model can better predict the capacity in the future time period through the time series features. In some embodiments, algorithms such as isolation forest can be used to eliminate abnormal peaks in the historical data to complete data cleaning and avoid polluting the entire historical data. In some embodiments, after cleaning the historical data in the target historical time period, the cleaned historical data is arranged in chronological order to obtain time series features. In some embodiments, the cleaned historical data can also be encoded to help the model better identify the time series features. The specific encoding method can be selected as needed, and is not limited, for example, one-hot encoding can be used. After obtaining the time series features, the time series features can be directly used as model input data, or the time series features and other features can be used together as model input data, and the model input data is not limited.
[0032] In some embodiments of the present specification, the method of adjusting the backup capacity further comprises: extracting distribution features and trend features from the historical data; the distribution features include the distribution law of the historical data in a preset period, and the trend features include the change trend of the historical data in the target historical time period; the model input data further includes the distribution features and the trend features.
[0033] In view of the fact that directly using the time series features generated from the historical data as the model input data can result in poor capturing ability of the hybrid model for some complex periodic patterns, and thus the model can hardly pay attention to the distributional features and the trend features contained in the historical data according to the model input data, and for the backup capacity, the distribution rule of the historical data in the preset period and the change trend of the historical data in the historical time period have an indiscernible influence on the capacity change of the database, therefore, in order to improve the accuracy of the model in predicting the capacity, in the embodiments of the present specification, the model input data further includes distributional features and trend features, both of which are extracted from the historical data, wherein the distributional features can include the distribution rule of the historical data in a preset period, and the preset period can be set according to the needs, and in general cases, the preset period is less than the target historical time period, for example, in some embodiments, the length of the target historical time period can be 1 month, and the corresponding preset period can be one week. In some embodiments, the distribution rule of the historical data in the preset period can be represented by the average amount, variance and the like of the historical data in the preset period, that is, the distributional features can include the average value and the variance of the historical data in the preset period. The trend features can include the change trend of the historical data in the target historical time period, and the change trend mainly refers to the growth or decline trend of the historical data in the target historical time period. In some embodiments, the change trend can be determined by the linear regression slope, cumulative moving average growth rate and the like of the historical data. In some embodiments, the model input data further includes the seasonal features extracted from the historical data, and the seasonal features are used to reflect the periodic change of the historical data in a year, for example, quarterly settlement, year-end backup and the like.
[0034] In some embodiments of the present specification, the historical data includes data corresponding to each time unit, and the data corresponding to each time unit includes a time type label, and the time type label represents the influence type of the time unit corresponding to the labeled data on the predicted capacity; and the model input data further includes a time type label corresponding to the future time period.
[0035] The time unit can be the minimum unit of time for data division of the historical data in the target historical time period. For example, in some embodiments, the time unit can be one day, half a day, one hour, etc. Considering that different time types of data can have different impacts on the backup capacity, for example, the backup capacity required for a database on weekdays is completely different from that on non-weekdays. Therefore, in order to further improve the accuracy of the predicted capacity, the model input data further includes a time type label corresponding to the future time period, and the historical data includes data corresponding to each time unit, and each time unit includes a time type label indicating the influence type of the time unit on the predicted capacity. The specific actual type label can be set according to the application scenario of the database. For example, in some embodiments, the time type label can include weekdays, holidays, special activity days, etc.
[0036] In some embodiments of the present specification, the method of adjusting the backup capacity further comprises: performing fast Fourier transform on the time series feature to obtain a target frequency spectrum; determining a plurality of target frequencies from the target frequency spectrum, wherein the amplitude of the frequency of each target frequency is greater than a preset amplitude; determining the frequency difference between adjacent two target frequencies, and determining the frequency period of the historical data based on the frequency difference; wherein the model input data further includes the frequency period.
[0037] In order to capture the periodic length hidden in the time series feature, in the embodiments of the present specification, fast Fourier transform (FFT) is first performed on the time series feature corresponding to the historical data to obtain a target frequency spectrum. The abscissa of the target frequency spectrum generally represents the frequency corresponding to the time series feature, and the ordinate of the target frequency spectrum generally represents the amplitude of each frequency. After obtaining the target frequency spectrum, a plurality of target frequencies are first determined from the target frequency spectrum, wherein the amplitude of the frequency of each target frequency is greater than a preset amplitude. Then, the frequency difference between adjacent two target frequencies is determined, and the frequency period corresponding to the historical data is determined according to the reciprocal of the frequency difference. After obtaining the frequency period corresponding to the historical data, the frequency period and other data such as the time series feature are taken as model input data, so as to mine the periodic characteristics in the historical data, and further improve the accuracy of the predicted capacity. It should be noted that the above-mentioned preset amplitude is mainly used to filter out the wave crest in the target frequency spectrum, and the specific preset amplitude can be set according to the needs, which is not limited.
[0038] S206, processing the model input data by the obtained hybrid model to generate the predicted capacity of the database in the future time period; the hybrid model comprises a first model for processing nonlinear short-term features and a second model for processing linear long-term features; each model in the hybrid model outputs a prediction result according to the model input data, and the output result of the hybrid model is determined by comprehensive calculation of the output results of all the models included therein.
[0039] After the model input data is generated, the model input data is input into the obtained hybrid model, and the hybrid model performs prediction of the predicted capacity in the future time period. The hybrid model comprises a first model for processing nonlinear short-term features and a second model for processing linear long-term features, each model in the hybrid model outputs a prediction result according to the model input data, and then the prediction results output by each model are comprehensively calculated to obtain the output result of the hybrid model. It should be noted that the above comprehensive calculation can be set as needed, for example, the average of the prediction results output by multiple models can be directly calculated, or the prediction results output by each model can be weighted and summed. The training process of the hybrid model can refer to the training process of the model in the related art, and each model included in the hybrid model is trained separately. In some embodiments, the first model can be an LSTM (Long Short-Term Memory) model or other model for processing nonlinear short-term features, and the second model can be an ARIMA (Autoregressive Integrated Moving Average) model or other model for processing linear long-term features.
[0040] In some embodiments, the predicted capacity output by the hybrid model can include a capacity value with the highest confidence and a confidence interval corresponding to the predicted capacity, which can be used to quantify the prediction risk and assist in capacity reservation decision-making. For example, when the database is expanded, a certain range of safety buffer can be reserved according to the confidence interval to smooth the sudden capacity demand.
[0041] In some embodiments, training samples can be generated according to the historical data of the database in the historical time period, and then the training samples are used to train each model in the hybrid model, and the parameters of each model are adjusted by a loss function to make each model converge. In some embodiments, the training samples can include distribution feature samples, trend feature samples, and time type labels of the samples. In some embodiments, in order to further improve the accuracy of model prediction, multiple versions of training results can be reserved for each model in the hybrid model, and then the prediction effects of each version of the model are compared in the test stage, and finally the model with the prediction effect meeting the demand is reserved as the model training result.
[0042] In some embodiments of the present specification, the mixed model further comprises a third model for processing abnormal peak features, and a fourth model for processing seasonal features. It should be noted that in the embodiments of the present specification, in addition to the first model and the second model described above, the third model for processing abnormal peak features and the fourth model for processing seasonal features are added to the mixed model. Through the third model, the mixed model can pay more attention to short-term sudden fluctuations, and through the fourth model, the mixed model can pay more attention to seasonal effects, thereby further improving the accuracy of the prediction capacity output by the mixed model. In some embodiments, the third model described above can be an XGBoost (Extreme Gradient Boosting) model or other models for processing abnormal peak features, and the fourth model described above can be a Prophet model or other models for processing seasonal features.
[0043] Reference Figure 3 For a flowchart of a mixed model in an embodiment of the present specification processing model input data, the model input data is input into the first model, the second model, the third model, and the fourth model respectively, and then the four models process the model input data respectively and output prediction results individually. After all the models output prediction results, the prediction results output by the four models are weighted and summed, and the result of the weighted sum is taken as the model prediction result of the mixed model, i.e., the prediction capacity.
[0044] In some embodiments of the present specification, the method of adjusting the backup capacity further comprises: determining a first historical prediction error of the first model in the target historical time period, and a second historical prediction error of the second model in the target historical time period; adjusting the weight corresponding to the prediction result of each of the first model and the second model based on the first historical prediction error and the second historical prediction error; wherein the weight corresponding to the prediction result and the historical prediction error are in inverse proportional relationship.
[0045] In order to improve the accuracy of the prediction capacity, it is necessary to accurately determine the weight corresponding to each model in the mixed model. In this embodiment, the weight corresponding to each model can be determined first, and then the weight of each model is adjusted through the historical prediction error of each model in the target historical time period, wherein the weight corresponding to the prediction result and the historical prediction error are in inverse proportional relationship, i.e., the greater the historical prediction error of a certain model, the smaller the weight corresponding to it. The historical prediction error is generally determined by the difference between the prediction result of the model in the target historical time period and the true capacity corresponding to the prediction result in the historical data.
[0046] It should be noted that, for the convenience of calculation, in some embodiments, the weight corresponding to each model can also be set in advance according to the needs, and then the weighted sum is directly performed according to the set weight.
[0047] In some embodiments of the present specification, the predicted capacity includes a total predicted capacity corresponding to all data in the database and a predicted capacity corresponding to data of each data type; the first model includes an encoder and multiple decoders, the multiple decoders include a decoder for generating the total predicted capacity, and a decoder for generating the predicted capacity corresponding to data of each data type, each data type corresponding to a decoder; the hybrid model obtained by training is used to process the model input data to generate the predicted capacity of the database in the future time period, including: the first model is used to process the model input data to generate a first prediction result corresponding to the total predicted capacity and a predicted capacity corresponding to data of each data type; the second model is used to process the model input data to generate a second prediction result corresponding to the total predicted capacity; the first prediction result and the second prediction result are weighted and summed to obtain the total predicted capacity.
[0048] Considering that different data types have different consumption modes of capacity, for example, log data has a high backup frequency but a small capacity, and full backup has a low backup frequency but a large capacity, therefore, a single total capacity prediction cannot provide fine decision-making for capacity scheduling. Therefore, in the embodiments of the present specification, the predicted capacity includes a total predicted capacity corresponding to all data in the database and a predicted capacity corresponding to data of each data type, so that the backup capacity can be accurately adjusted according to the predicted capacity corresponding to data of different data types, for example, the high-frequency write IO bandwidth of reserved log data can be extracted, and / or long-term cold storage space can be arranged for full backup data. It should be noted that the capacity prediction of data of different data types can be realized by the first model, specifically, the first model can include an encoder and multiple decoders, the multiple decoders include a decoder for generating the total predicted capacity, and a decoder for generating the predicted capacity corresponding to data of each data type, each data type corresponding to a decoder, so that when the model input data is input into the first model, the encoder is used for encoding first, and then each decoder is used for decoding the encoding result respectively, thereby obtaining multiple decoding results, each decoding result corresponding to a data type. It should be noted that since the second model also directly outputs the total predicted capacity, when the first model outputs the first prediction result corresponding to the total predicted capacity, the second prediction result corresponding to the total predicted capacity output by the second model is weighted and summed, and the result of the weighted sum is taken as the total predicted capacity output by the hybrid model.
[0049] In some embodiments of the present specification, the method of adjusting the backup capacity further comprises: obtaining a plurality of historical predicted capacities of the database in the target historical time period predicted by the hybrid model, and a historical real capacity corresponding to each historical predicted capacity; for each historical predicted capacity, determining a difference between the historical predicted capacity and the historical real capacity corresponding to the historical predicted capacity; determining a bias value of the predicted capacity based on the difference corresponding to each historical predicted capacity; calibrating the predicted capacity based on the bias value.
[0050] In order to further improve the accuracy of the predicted capacity, in the embodiments of the present specification, a plurality of historical predicted capacities of the database in the target historical time period predicted by the hybrid model, and a historical real capacity corresponding to each historical predicted capacity are obtained, and then the difference between each historical predicted capacity and the historical real capacity corresponding to the historical predicted capacity is compared. After determining the difference of each historical predicted capacity, the difference corresponding to the historical predicted capacity is weighted and summed to obtain a bias value of the predicted capacity, and the predicted capacity is calibrated using the bias value. Optionally, in some embodiments, the calibration of the predicted capacity can be directly completed by subtracting the bias value from the predicted capacity.
[0051] In some embodiments of the present specification, the first model comprises a long short-term memory network layer, a multi-head attention layer and an output layer; and the process of outputting a prediction result by the first model according to the model input data comprises: performing time series encoding on the model input data through the long short-term memory network layer to obtain a time series hidden state sequence; performing key feature enhancement on the time series hidden state sequence through the multi-head attention layer to obtain an enhanced time series hidden state sequence; processing the enhanced time series hidden state sequence through the output layer to output a first prediction value corresponding to the predicted capacity of the database in the future time period.
[0052] To further improve the accuracy of the prediction result of the first model, in the embodiments of the present specification, a multi-head attention mechanism is added to the first model, so that the first model can automatically locate the time segment in the historical data that is critical for future prediction, thereby focusing on key information such as recent sudden increase / sudden decrease during reasoning. In specific implementation, the first model can include a long short-term memory network layer, a multi-head attention layer, and an output layer. When the model input data is input into the first model, the model input data is first encoded in time sequence by the long short-term memory network layer to obtain a time sequence hidden state sequence, then the time sequence hidden state sequence is strengthened by the multi-head attention layer to obtain a strengthened time sequence hidden state sequence, and finally the strengthened time sequence hidden state sequence is converted into the first prediction value corresponding to the prediction capacity of the database in the future time period by the output layer. In some embodiments, the output layer can be composed of a fully connected layer or a global pooling layer.
[0053] In some embodiments of the present specification, to further improve the accuracy of the prediction capacity output by the hybrid model, the prediction capacity can also be recorded after the hybrid model outputs the prediction capacity, and after the prediction capacity generates the corresponding real capacity, the prediction error of the hybrid model can be determined through the difference between the prediction capacity and the real capacity, and the target historical time period can be adjusted through the prediction error of the hybrid model. Wherein, the target historical time period can be inversely proportional to the prediction error of the hybrid model, that is, the greater the prediction error of the hybrid model, the shorter the length of the corresponding target historical data period. It should be noted that when the error of the prediction capacity of the hybrid model increases, it can be explained from the side that the data fluctuation of the database is large. At this time, in order to improve the accuracy of the hybrid model, more attention needs to be paid to the historical data in the short term, so the length of the target historical time period can be reduced.
[0054] S208, adjusting the backup capacity of the database in the future time period based on the prediction capacity.
[0055] After obtaining the prediction capacity of the database in the future time period through the hybrid model, the backup capacity of the database in the future time period can be dynamically adjusted through the prediction capacity, so that the backup capacity is greater than or equal to the prediction capacity, thereby optimizing the use of database storage resources, while meeting the database storage demand, and minimizing resource waste.
[0056] In some embodiments of the present specification, adjusting the backup capacity of the database in the future time period based on the prediction capacity comprises: obtaining a plurality of adjustment mechanisms for adjusting the backup capacity of the database in the future time period; arrange and combine the plurality of adjustment mechanisms to obtain a plurality of adjustment strategies, wherein each adjustment strategy corresponds to one arrangement and combination; Calculate the cost score corresponding to each adjustment strategy, and adjust the backup capacity of the database in the future time period based on the adjustment strategy with the lowest cost score.
[0057] Considering that when the predicted capacity of the database in the future time period is obtained, a plurality of adjustment mechanisms can be used to make the backup capacity of the database in the future time period greater than or equal to the predicted capacity, for example, the database can be directly expanded, or the excess capacity in the database can be made by compressing the data in the database. At the same time, considering that different adjustment mechanisms also need to bear different costs, for example, the hardware cost required for expansion, the system performance cost required for compression, etc. Therefore, in the embodiments of the present specification, in order to find an adjustment strategy with the highest cost performance for the backup capacity, a plurality of adjustment mechanisms for adjusting the backup capacity of the database in the future time period are first obtained, and then the plurality of adjustment mechanisms are arranged and combined to obtain a plurality of adjustment strategies, with the constraint condition that the adjusted backup capacity of the database in the future time period is greater than or equal to the predicted capacity. Wherein each adjustment strategy corresponds to one arrangement and combination. After obtaining a plurality of adjustment strategies, the cost score corresponding to each adjustment strategy is further calculated. When calculating the cost score, the scoring criteria between different costs can be unified according to experiments or preset rules first, for example, how many cost scores correspond to an increase of one unit of hardware cost, how many cost scores correspond to an increase of one unit of system performance consumption. After unifying the scoring criteria between different costs, the cost score corresponding to each adjustment strategy can be calculated according to each adjustment mechanism included in the adjustment strategy, and finally the adjustment strategy with the lowest cost score is selected, and the backup capacity of the database in the future time period is adjusted using the adjustment strategy with the lowest cost score.
[0058] In some embodiments of the present specification, the adjustment mechanism can include mechanisms such as data migration, database expansion, and compression rate adjustment. Among them, data migration can be the migration of data between hot storage, warm storage, and cold storage in the database to meet the storage capacity needs of different data types of data. Generally, hot storage can be used for backup of frequently accessed data in the near future. Warm storage can be used for the storage of medium-speed objects, for example, data accessed occasionally in the past month. Cold storage is mainly used for high-latency low-cost storage for the storage of historical archive data. Database expansion generally expands the database by adding hardware devices (such as hard disks). The compression rate adjustment can be to increase the compression level of the data, and save space by occupying more CPU. In some embodiments, a global storage resource pool can also be constructed in the database, and the capacity is dynamically allocated according to the task priority to realize on-demand scheduling.
[0059] In some embodiments of the present specification, an emergency plan mechanism can also be added in the database to increase the anti-risk ability of the database when facing various emergency states. For example, different emergency strategies can be set according to the occupied proportion of the backup capacity of the database, wherein when the occupied proportion of the backup capacity reaches 70%, the corresponding emergency strategy can include prompting operation and maintenance, increasing the compression level, delaying low-priority tasks, etc. When the occupied proportion of the backup capacity reaches 80%, the corresponding emergency strategy can include suspending non-critical tenant backup, migrating historical backup to cold storage, triggering cloud expansion preparation, etc. When the occupied proportion of the backup capacity reaches 90%, the corresponding emergency strategy can include immediately mounting a temporary cloud volume, forcibly interrupting low-priority tasks, and only allowing incremental backup to continue, etc.
[0060] Reference Figure 4 Another method for adjusting backup capacity proposed by the embodiments of the present specification is shown in the flowchart, and the method includes the following steps: S402, obtaining historical data.
[0061] The historical data can be historical data related to backup capacity of the database in a target historical time period, and in some embodiments, the historical data can include historical backup capacity data and system index data.
[0062] S404, data cleaning.
[0063] After obtaining the historical data, the historical data can be cleaned to remove noise data in the historical data to improve the quality of the model input data. In some embodiments, algorithms such as isolation forest can be used to remove abnormal peaks in the historical data to complete data cleaning.
[0064] S406, mixed model predicts future capacity.
[0065] The hybrid model can include a plurality of independently running models, each of which outputs a prediction result according to the model input data, and the output result of the hybrid model is determined by a weighted sum of the output results of all the models included therein. In some embodiments, the hybrid model can include a first model for processing nonlinear short-term features, a second model for processing linear long-term features, a third model for processing abnormal peak features, and a fourth model for processing seasonal features.
[0066] S408, dynamically adjusting the backup capacity.
[0067] After obtaining the predicted capacity of the database in the future time period through the hybrid model, the backup capacity of the database can be dynamically adjusted according to the predicted capacity.
[0068] S410, allocating and managing storage resources.
[0069] After dynamically adjusting the backup capacity of the database according to the predicted capacity, capacity budgets can be further allocated to different projects / departments using the database, and quota sharing and trading can be supported to improve resource utilization. In some embodiments, capacity load balancing and backup between multiple data centers can also be implemented to improve disaster recovery capabilities.
[0070] In an embodiment of the present specification, a method for adjusting backup capacity is provided. Historical data related to backup capacity of a database in a target historical time period is obtained, time series features arranged in chronological order are generated according to the historical data, and model input data is generated through the time series features to serve as input of a hybrid model. After generating the model input data, the model input data is input into the hybrid model for capacity prediction to obtain a predicted capacity of the database in a future time period, wherein the hybrid model includes a first model for processing nonlinear short-term features and a second model for processing linear long-term features. Each model outputs a prediction result according to the model input data, and the output results of all the models are calculated to obtain the predicted capacity of the database in the future time period output by the final hybrid model. At the same time, the capacity of the database in the future time period is predicted through the first model for processing nonlinear short-term features and the second model for processing linear long-term features, so that the hybrid model can simultaneously focus on the nonlinear short-term features and the linear long-term features in the historical data, further improving the accuracy of model prediction. After obtaining the predicted capacity, the backup capacity of the database in the future time period can be dynamically adjusted according to the predicted capacity, further optimizing the use of storage resources, reducing resource waste, and improving the availability and reliability of the database system.
[0071] Figure 5 is a schematic structural diagram of a device provided by an exemplary embodiment. As shown in Figure 5As shown, device 500 mainly consists of a communication interface 502, a user interface 504, a processor 506, and a data storage 508. These components are interconnected and communicate with each other via a system bus, network, or other connection mechanism 510. The communication interface 502 enables device 500 to communicate with other devices, access networks, and transmission networks via analog or digital modulation. For example, the communication interface 502 may include a chipset and antenna for wireless communication with a radio access network or access point. Furthermore, the communication interface 502 can be a wired interface such as Ethernet, Token Ring, or a USB port, or a wireless interface such as Wi-Fi, Bluetooth, Global Positioning System (GPS), or a wide-area wireless interface (e.g., WiMAX or LTE). Of course, the communication interface 502 can also support other forms of physical layer interfaces and standard or proprietary communication protocols. The communication interface 502 may also include multiple physical communication interfaces, such as Wi-Fi interfaces, Bluetooth interfaces, and wide-area wireless interfaces.
[0072] User interface 504 includes receiving user input and providing output to the user. Therefore, user interface 504 may include input components such as a keypad, keyboard, touch-sensitive or presence-sensitive panel, computer mouse, trackball, joystick, microphone, still camera, and video camera, and output components such as a display screen (which may be combined with a touch-sensitive panel), CRT, LCD, LED, display using DLP technology, printer, and other similar devices known or developed in the future. User interface 504 may also generate auditory output via speakers, speaker jacks, audio output ports, audio output devices, headphones, and other similar devices known or developed in the future. In some embodiments, user interface 504 may include software, circuitry, or other forms of logic capable of transmitting and receiving data from external user input / output devices. Additionally or alternatively, device 500 may support remote access from other devices via communication interface 502 or another physical interface (not shown). User interface 504 may be configured to receive user input, the position and movement of which may be indicated by indicators or cursors described herein. User interface 504 may also be configured as a display device for rendering or displaying text fragments.
[0073] Processor 506 may contain one or more general-purpose processors and / or special-purpose processors.
[0074] Data storage 508 may include one or more volatile and / or non-volatile storage components and may be integrated wholly or partially with processor 506. Data storage 508 may include removable and non-removable components.
[0075] The processor 506 can execute program instructions stored in the data storage 508 (e.g., compiled or interpreted program logic and / or machine code) to implement various functionality described herein. The data storage 508 can include a non-transitory computer- readable medium having stored thereon program instructions that, if executed by the device 500, can cause the device 500 to perform any of the methods, processes, or functions disclosed in the specification and / or drawings. Execution of the program instructions 518 by the processor 506 can cause the processor 506 to utilize the data 512.
[0076] For example, the program instructions 518 can include an operating system 522 (e.g., an operating system kernel, device drivers, and / or other modules) installed on the device 500 as well as one or more application programs 520 (e.g., a browser, a social application, or a game application). Similarly, the data 512 can include operating system data 516 and application data 514. The operating system data 516 is primarily accessible to the operating system 522, while the application data 514 is primarily accessible to the one or more application programs 520. The application data 514 can be in a file system that is visible to or hidden from the device 500 user.
[0077] The application programs 520 can communicate with the operating system 522 through one or more application programming interfaces (APIs). These APIs facilitate the application programs 520 reading and / or writing application data 514, transmitting or receiving information via the communication interface 502, receiving or displaying information on the user interface 504, and the like.
[0078] In some terminology, the application programs 520 can be referred to simply as “apps.” Furthermore, the application programs 520 can be downloaded to the device 500 through one or more online application stores or application markets. However, the application programs can also be installed on the device 500 through other means, such as through a web browser or a physical interface (e.g., a USB port) on the device 500.
[0079] Reference is made to Figure 6 The device for adjusting backup capacity can be applied to the device as shown in Figure 5 The device for adjusting backup capacity can include: The obtaining module 602 obtains historical data related to backup capacity of the database in a target historical time period; The feature generation module 604 generates time series features arranged in time sequence based on the historical data, and generates model input data based on the time series features; The prediction module 606 processes the model input data using a trained hybrid model to generate the prediction capacity of the database for a future time period. The hybrid model includes a first model for processing nonlinear short-term features and a second model for processing linear long-term features. Each model in the hybrid model outputs a prediction result based on the model input data, and the output result of the hybrid model is determined by a comprehensive calculation of the output results of all the models it includes. The adjustment module 608 adjusts the backup capacity of the database in the future time period based on the predicted capacity.
[0080] In some embodiments of this specification, the apparatus for adjusting backup capacity further includes a feature mining module, used for: The model extracts distributional and trend features from the historical data. The distributional features include the distribution pattern of the historical data within a preset period, and the trend features include the changing trend of the historical data within the target historical time period. The model input data also includes the distributional and trend features.
[0081] In some embodiments of this specification, the apparatus for adjusting backup capacity further includes a weight determination module, used for: Determine the first historical prediction error of the first model within the target historical time period, and the second historical prediction error of the second model within the target historical time period; Based on the first historical prediction error and the second historical prediction error, the weights corresponding to the prediction results of the first model and the second model are adjusted; wherein, the historical prediction error and the weights corresponding to the prediction results are inversely proportional.
[0082] In some embodiments of this specification, the historical data includes data corresponding to each time unit, and each time unit includes a time type label, which indicates the type of influence of the time unit corresponding to the labeled data on the prediction capacity; the model input data also includes time type labels corresponding to the future time period.
[0083] In some embodiments of this specification, the prediction capacity includes the total prediction capacity corresponding to all data in the database and the prediction capacity corresponding to data of each data type; the first model includes an encoder and multiple decoders, the multiple decoders including a decoder for generating the total prediction capacity and a decoder for generating the prediction capacity corresponding to data of each data type, with one decoder corresponding to each data type; the prediction module is specifically used for: processing the model input data through the first model to generate a first prediction result corresponding to the total predicted capacity and a predicted capacity corresponding to data of each data type; processing the model input data through the second model to generate a second prediction result corresponding to the total predicted capacity; performing weighted summation on the first prediction result and the second prediction result to obtain the total predicted capacity.
[0084] In some embodiments of the present specification, the device for adjusting backup capacity further comprises a time period length determination module, configured to: determine a variance of historical data of the database in a preset historical time period, and obtain a fluctuation value of the database in the preset historical time period based on the variance; wherein, the preset historical time period and the target historical time period both end at a target time point before the future time period; determine the length of the target historical time period based on the fluctuation value; wherein, the length of the target historical time period is inversely proportional to the fluctuation value.
[0085] In some embodiments of the present specification, the device for adjusting backup capacity further comprises a calibration module, configured to: obtain a plurality of historical predicted capacities of the database in the target historical time period predicted by the hybrid model, and a historical real capacity corresponding to each historical predicted capacity; for each historical predicted capacity, determine a difference value between the historical predicted capacity and the historical real capacity corresponding to the historical predicted capacity; determine a bias value of the predicted capacity based on the difference value corresponding to each historical predicted capacity; calibrate the predicted capacity based on the bias value.
[0086] In some embodiments of the present specification, the device for adjusting backup capacity further comprises a period determination module, configured to: perform fast Fourier transform on the time series feature to obtain a target frequency spectrum; determine a plurality of target frequencies from the target frequency spectrum, whose amplitude is greater than a preset amplitude; determine a frequency difference value between adjacent two target frequencies, and determine a frequency period of the historical data based on the frequency difference value; wherein, the model input data further comprises the frequency period.
[0087] In some embodiments of the present specification, the first model comprises a long short-term memory network layer, a multi-head attention layer and an output layer; the prediction module comprises a first model prediction unit, configured to: encoding the model input data in time sequence through the long short-term memory network layer to obtain a time sequence hidden state sequence; enhancing the time sequence hidden state sequence through the multi-head attention layer to obtain an enhanced time sequence hidden state sequence; processing the enhanced time sequence hidden state sequence through the output layer to output a first prediction value corresponding to a prediction capacity of the database in a future time period.
[0088] In some embodiments of the present specification, the mixed model further comprises a third model for processing abnormal peak features, and a fourth model for processing seasonal features.
[0089] In some embodiments of the present specification, the adjustment module is specifically configured to: obtain a plurality of adjustment mechanisms for adjusting the backup capacity of the database in the future time period; arrange and combine the plurality of adjustment mechanisms under the constraint condition that the adjusted backup capacity of the database in the future time period is greater than or equal to the prediction capacity, to obtain a plurality of adjustment strategies; wherein each adjustment strategy corresponds to one arrangement and combination; calculate a cost score corresponding to each adjustment strategy, and adjust the backup capacity of the database in the future time period based on the adjustment strategy with the lowest cost score.
[0090] In some embodiments of the present specification, the adjustment mechanism comprises data migration, database expansion, and compression rate adjustment.
[0091] For the convenience of description, the above device is described as various modules or units respectively described in function. Of course, when implementing one or more of the present specification, the functions of each module or unit can be implemented in the same or more software and / or hardware, or the modules implementing the same function can be combined or implemented by a combination of multiple sub-modules or sub-units. The above described device embodiments are only illustrative, for example, the division of the units is only a logical function division, and actual implementation can have another division method, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0092] Based on the same concept as the above method, the present specification also provides an electronic device comprising: a processor; a memory for storing processor executable instructions; wherein the processor implements the steps of the method for adjusting the backup capacity as described in any of the above embodiments by running the executable instructions.
[0093] Based on the same idea as the above method, the specification also provides a computer readable storage medium, which stores computer instructions, and the instructions are executed by a processor to implement the steps of the method for adjusting backup capacity according to any one of the above embodiments.
[0094] Based on the same idea as the above method, the specification also provides a computer program product, which includes computer program / instructions, and the instructions are executed by a processor to implement the steps of the method for adjusting backup capacity according to any one of the above embodiments.
[0095] Those skilled in the art can understand that: In the specification, the term "comprise", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, product or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, product or device. Without more limitations, it does not exclude the presence of other same or equivalent elements in the process, method, product or device including the elements.
[0096] In the specification, "one", "a" and "the" do not refer to the singular, but also include the plural.
[0097] In the specification, the first, second, etc. ordinal numbers do not necessarily represent the order, and are often used for the convenience of distinguishing objects. For example, the first server and the second server usually refer to two servers. In order to distinguish the two servers, they are expressed as the first server and the second server. Of course, sometimes the two servers can be the same server.
[0098] In the specification, unless specifically stated, "receiving and sending of data" is not necessarily direct receiving and sending, but can be indirect receiving and sending. For example, A receives data sent by B, which can be understood as A directly receiving data sent by B, or A indirectly receiving data sent by B through C and other subjects. Similarly, B sends data to A, which can be understood as B directly sending data to A, or B indirectly sending data to A through C and other subjects. Here C can be one subject, or two or more subjects.
[0099] In this specification, unless expressly stated otherwise, the connection relationship between structures can be a direct connection relationship or an indirect connection relationship. For example, when describing "A is connected with B", unless it is expressly stated that A is directly connected with B, it should be understood that A can be directly connected with B or indirectly connected with B; for another example, when describing "A is on B", unless it is expressly stated that A is directly on B (AB is adjacent and A is on B), it should be understood that A can be directly on B or A can be indirectly on B (there are other elements between AB and A is on B). By analogy.
[0100] The present specification uses specific terms to describe the embodiments of the present specification. As "one embodiment", "an embodiment", and / or "some embodiments" means a certain feature, structure, or characteristic in relation to at least one embodiment of the present specification. Therefore, it should be emphasized and noted that the "an embodiment" or "one embodiment" or "one alternative embodiment" mentioned in different positions in the present specification does not necessarily refer to the same embodiment. In addition, the skilled in the art can combine and combine the different embodiments or examples described in the present specification and the features of the different embodiments or examples without contradiction.
[0101] Although one or more embodiments of the present specification provide method steps as described in the embodiments or flowcharts, it can be understood that the order of steps listed in the embodiments or flowcharts is only one of the many execution orders, and does not represent the only execution order. Therefore, when the claims involve method steps, the adjustment of the order of the steps or the parallelism between the steps is also within the scope of protection of the claims.
Claims
1. A method for adjusting backup capacity, comprising: obtaining historical data of a database related to backup capacity in a target historical time period; generating time series features arranged in time sequence based on the historical data, and generating model input data based on the time series features; processing the model input data by a hybrid model obtained by training, to generate a predicted capacity of the database in a future time period; the hybrid model comprises a first model for processing nonlinear short-term features and a second model for processing linear long-term features; each model in the hybrid model outputs a prediction result according to the model input data, and an output result of the hybrid model is determined by comprehensive calculation of output results of all models included in the hybrid model; adjusting backup capacity of the database in the future time period based on the predicted capacity.
2. The method of claim 1, further comprising: extracting distribution features and trend features from the historical data; the distribution features include distribution rules of the historical data in a preset period, and the trend features include a change trend of the historical data in the target historical time period; the model input data further includes the distribution features and the trend features.
3. The method of claim 1, further comprising: determining a first historical prediction error of the first model in the target historical time period, and a second historical prediction error of the second model in the target historical time period; adjusting weights corresponding to prediction results of the first model and the second model based on the first historical prediction error and the second historical prediction error; wherein the weight corresponding to the prediction result and the historical prediction error are in inverse proportional relationship.
4. The method of claim 1, wherein the historical data includes data corresponding to each time unit, and each data corresponding to a time unit includes a time type label indicating an influence type of the prediction capacity of the time unit to which the labeled data corresponds; the model input data further includes a time type label corresponding to the future time period.
5. The method of claim 1, wherein the predicted capacity comprises a total predicted capacity corresponding to all data in the database and a predicted capacity corresponding to data of each data type, and wherein the first model comprises an encoder and a plurality of decoders, the plurality of decoders comprising a decoder for generating the total predicted capacity and a decoder for generating the predicted capacity corresponding to data of each data type, one decoder for each data type. processing the model input data by the hybrid model obtained by training, to generate a predicted capacity of the database in a future time period, comprises: processing the model input data by the first model to generate a first prediction result corresponding to the total predicted capacity, and a predicted capacity corresponding to data of each data type; processing the model input data by the second model to generate a second prediction result corresponding to the total predicted capacity; performing weighted summation on the first prediction result and the second prediction result to obtain the total predicted capacity.
6. The method of claim 1, further comprising: determining a variance of historical data of the database in a preset historical time period, and obtaining a fluctuation value of the database in the preset historical time period based on the variance; wherein the preset historical time period and the target historical time period both end at a target time point before the future time period. determine a length of the target historical time period based on the fluctuation value, wherein the length of the target historical time period is inversely proportional to the fluctuation value.
7. The method of claim 1, further comprising: obtaining a plurality of historical predicted capacities of the database in the target historical time period predicted by the hybrid model, and a historical real capacity corresponding to each historical predicted capacity; for each historical predicted capacity, determining a difference between the historical predicted capacity and the historical real capacity corresponding to the historical predicted capacity; determining a bias value of the predicted capacity based on the difference corresponding to each historical predicted capacity; calibrating the predicted capacity based on the bias value.
8. The method of claim 1, further comprising: performing fast Fourier transform on the time series feature to obtain a target frequency spectrum; determining a plurality of target frequencies from the target frequency spectrum, wherein an amplitude of each target frequency is greater than a preset amplitude; determining a frequency difference between two adjacent target frequencies, and determining a frequency period of the historical data based on the frequency difference; wherein the model input data further comprises the frequency period.
9. The method of claim 1, the first model comprising a long short-term memory network layer, a multi-head attention layer, and an output layer; the process of outputting a prediction result by the first model based on the model input data comprises: performing time sequence encoding on the model input data by the long short-term memory network layer to obtain a time sequence hidden state sequence; performing key feature strengthening on the time sequence hidden state sequence by the multi-head attention layer to obtain a strengthened time sequence hidden state sequence; processing the strengthened time sequence hidden state sequence by the output layer to output a first predicted value corresponding to the predicted capacity of the database in the future time period.
10. The method of claim 1, wherein the hybrid model further comprises a third model for processing abnormal peak features, and a fourth model for processing seasonal features.
11. The method of claim 1, wherein adjusting the backup capacity of the database in the future time period based on the predicted capacity comprises: obtaining a plurality of adjustment mechanisms for adjusting the backup capacity of the database in the future time period; performing permutation and combination on the plurality of adjustment mechanisms under the constraint that the adjusted backup capacity of the database in the future time period is greater than or equal to the predicted capacity, to obtain a plurality of adjustment strategies; wherein each adjustment strategy corresponds to one permutation and combination; calculating a cost score corresponding to each adjustment strategy, and adjusting the backup capacity of the database in the future time period based on the adjustment strategy with the lowest cost score.
12. The method of claim 11, the adjustment mechanism comprising: data migration, database expansion, and compression rate adjustment.
13. An apparatus for adjusting backup capacity, comprising: an obtaining module, configured to obtain historical data of a database related to backup capacity in a target historical time period; a feature generation module, configured to generate time series features arranged in time sequence based on the historical data, and generate model input data based on the time series features; a prediction module configured to process the model input data by a hybrid model obtained through training to generate a predicted capacity of the database in a future time period; the hybrid model comprises a first model configured to process nonlinear short-term features and a second model configured to process linear long-term features; each model in the hybrid model outputs a prediction result according to the model input data, and an output result of the hybrid model is determined by a comprehensive calculation of output results of all models comprised therein; an adjustment module configured to adjust a backup capacity of the database in the future time period based on the predicted capacity. 14.An electronic device comprising: a processor; a memory for storing processor-executable instructions; wherein the processor implements the method of any one of claims 1-12 by running the executable instructions. 15.A computer-readable storage medium having stored thereon computer instructions that, when executed by a processor, implement the steps of the method of any one of claims 1-12.
16. A computer program product, comprising: computer program / instructions that, when executed by a processor, implement the method of any one of claims 1-12.
