Method and apparatus for managing database capacity

By establishing a multiple linear regression model, the system can automatically monitor and provide early warnings about database capacity, thus solving the system access problems caused by database capacity exceeding limits, enabling timely expansion, and improving system stability and user experience.

CN116089209BActive Publication Date: 2026-08-25FUTAIHUA PRECISION ELECTRONICS (ZHENGZHOU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211687821.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-27
Publication Date
2026-08-25
Estimated Expiration
2042-12-27

AI Technical Summary

Technical Problem

In existing technologies, exceeding the database capacity limit can cause system inaccessibility, easily leading to server performance fluctuations and internal database locking issues, resulting in losses of human and financial resources.

Method used

A multiple linear regression model is established. By collecting correlation data related to database capacity, grouping and standardizing the data, a capacity prediction model is trained to achieve automated monitoring and early warning of database capacity, and timely expansion is carried out.

Benefits of technology

It enables early warnings before the database capacity reaches its limit, reducing system inaccessibility, improving maintenance quality and user experience, and providing support for subsequent server resource planning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116089209B_ABST
    Figure CN116089209B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a database capacity management method and device, and relates to the technical field of databases; a prediction model is established to realize automatic monitoring and early warning of a data growth trend in a database space. The method comprises the following steps: collecting original data of a plurality of associated data related to database capacity; grouping the plurality of original data to obtain a plurality of groups of combined data; performing standardization processing on the plurality of groups of combined data to obtain a plurality of groups of sample data sets; training the plurality of groups of sample data sets by using a multiple linear regression model to obtain a plurality of undetermined prediction models of database capacity; loading the plurality of groups of sample data into corresponding undetermined prediction models to obtain a plurality of output values, comparing the plurality of output values with corresponding database usage values, and selecting a capacity prediction model of the database from the plurality of undetermined prediction models; and loading associated data of a to-be-tested database into the capacity prediction model to obtain a capacity prediction value of the to-be-tested database.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This invention relates to the field of database technology, and in particular to a method and apparatus for managing database capacity. [Background Technology]

[0002] A database is a repository for organizing, storing, and managing data according to data structures. As the system interacts with other terminals, performs related calculations, and receives data sent by other servers or terminals, the database continuously stores more data. When the data stored in the database exceeds its capacity, it will cause system inaccessibility problems. Expanding the database after problems occur can easily cause server performance fluctuations and internal database locking issues, resulting in losses of human and financial resources. [Summary of the Invention]

[0003] This invention provides a method and apparatus for managing database capacity, establishing a predictive model to achieve automated monitoring and early warning of data growth trends in the database space, and to achieve automated adjustment of the database space.

[0004] In a first aspect, embodiments of the present invention provide a method for managing database capacity, the method comprising:

[0005] The process involves collecting raw data related to various database capacity parameters, including database usage values; grouping the raw data into multiple sets of combined data; standardizing the combined data sets to obtain multiple sets of sample data; training the sample data sets using a multiple linear regression model to obtain multiple undetermined prediction models for database capacity; loading the sample data sets into the corresponding undetermined prediction models to obtain multiple output values, and comparing these output values ​​with the corresponding database usage values ​​to select one model as the database capacity prediction model; and loading the associated data of the database to be tested into the capacity prediction model to obtain the predicted capacity value of the database to be tested.

[0006] The database capacity management method proposed in this application trains a multiple linear regression model on multiple sets of sample data formed from different original data that may affect database capacity. This yields a specific set of sample data that has a linear correlation with database capacity, and a capacity prediction model formed from this specific set of sample data. The capacity prediction model predicts the database's usage capacity based on the values ​​corresponding to the aforementioned specific set of sample data generated during database use. This automates database capacity prediction, provides early warnings before the database capacity reaches its limit, reduces instances where the system cannot access the database, improves maintenance quality and user experience, and provides auxiliary support for subsequent server resource planning and consolidation.

[0007] In one possible implementation, the step of comparing the plurality of output values ​​with the corresponding usage values ​​of the database to select one of the plurality of undetermined prediction models as the database capacity prediction model includes:

[0008] Calculate the absolute value of the difference between the multiple output values ​​and the corresponding usage values ​​in the database to obtain multiple sets of absolute values. The undetermined prediction model corresponding to the smallest absolute value among the multiple sets of absolute values ​​is taken as the capacity prediction model.

[0009] In one possible implementation, the step of training the multiple sets of sample data using a multiple linear regression model to obtain multiple undetermined prediction models for the database capacity includes:

[0010] Each set of sample data is input as an independent variable into a multiple linear regression model, and the predicted value of the dependent variable determined by the multiple linear regression model is output. The weight coefficients of the multiple undetermined prediction models are determined based on the multiple sets of predicted values.

[0011] In one possible implementation, the capacity prediction model is y = k1x1 + k2x2 + k3x3 + k4x4, where x1, x2, x3, and x4 are standardized associated data, and k1, k2, k3, and k4 are weighting coefficients.

[0012] In one possible implementation, the raw data also includes the number of users using the database, the predicted time for database capacity, the number of bytes of logs within the database, and the number of database connections.

[0013] The steps of grouping the various raw data to obtain multiple sets of combined data include:

[0014] Select three data points from the following: number of users, predicted time for database capacity, size of logs in the database, and number of database connections, to form a set of combined data. Then select three other data points to form another set of combined data to create the multiple sets of combined data.

[0015] In one possible implementation, the step of standardizing the multiple sets of combined data to obtain multiple sets of sample data includes:

[0016] The predicted time data is converted into timestamp type values, and the size of the data space and log volume, the number of users, and the number of database connections are all converted into values ​​in bytes.

[0017] In one possible implementation, the step of training the multiple sets of sample data includes: taking the Bar-residual values, ND-residual values, and residual standard deviation values ​​of the multiple sets of sample data to form feature values, and training the feature values.

[0018] In one possible implementation, the database resides on a server, and the management method also includes:

[0019] The predicted capacity value is compared with the maximum storage value of the current storage space of the database under test. If the predicted capacity value exceeds the maximum storage value of the current storage space of the database under test, an optional storage space is searched on the server as a backup storage space.

[0020] One possible implementation method includes the following management approach:

[0021] The predicted capacity value is compared with the maximum storage capacity of the current storage space of the database under test.

[0022] When the predicted capacity exceeds the maximum storage value of the current storage space of the database under test, and the number of database connections is less than the preset number of connections, the database capacity is expanded.

[0023] Secondly, embodiments of the present invention provide a database capacity management device, the device comprising:

[0024] Memory, used to store multiple program modules;

[0025] A processor, coupled to the memory, is used to load the plurality of program modules and execute the database capacity management method described in the first aspect.

[0026] Thirdly, embodiments of the present invention provide a computer-readable storage medium storing computer instructions that cause the computer to perform the method provided in the first aspect.

[0027] It should be understood that the second and third aspects of the embodiments of the present invention are consistent with the technical solutions of the first aspect of the embodiments of the present invention, and the beneficial effects achieved by each aspect and the corresponding feasible implementation are similar, and will not be described again. [Attached Image Description]

[0028] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1 This is a flowchart of the database capacity management method proposed in the embodiments of this application;

[0030] Figure 2 This is a flowchart illustrating another database capacity management method proposed in the embodiments of this application;

[0031] Figure 3 This is a schematic diagram of the database capacity management device proposed in the embodiments of this application.

Detailed Implementation Methods

[0032] To better understand the technical solutions in this specification, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0033] It should be understood that the described embodiments are merely some, not all, of the embodiments in this specification. All other embodiments obtained by those skilled in the art based on the embodiments in this specification without inventive effort are within the scope of protection of this specification.

[0034] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of this specification. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0035] This application embodiment establishes a scientific and practical capacity prediction model to monitor the growth trend of database space before the database space capacity reaches its limit and the server becomes inaccessible, thereby achieving early warning of database capacity. Based on the monitoring of the database space growth trend and combined with server load, this application embodiment completes the expansion of the CNC library without affecting server access.

[0036] The database capacity management method proposed in this application can be applied to servers, computer clusters, etc., where databases to be managed are set up. Figure 1 This is a flowchart of the database capacity management method steps proposed in the embodiments of this application, as follows: Figure 1 As shown, the steps include:

[0037] Step S11: Collect raw data of various related data related to database capacity, including database usage values.

[0038] Related data to database capacity can include data that may cause changes in database capacity. This data is then permuted and combined, and the resulting combinations are used to train a multiple linear regression model, yielding data combinations associated with database capacity. These data combinations form the capacity prediction model. The data that may cause changes in database capacity can include {a, b, c, ..., g}.

[0039] In one example of this application, in {a, b, c, ..., g}, a, b, c, ..., g can respectively correspond to various related data such as the number of users in the database, the prediction time of the database capacity, the number of bytes of logs in the database, the number of database connections, the frequency of database redo log switching, the database business type, the database product, the number of device points, application traffic, and data batch processing records.

[0040] In one example of this application, the raw data may include the number of users using the database, the predicted time for database capacity, the number of bytes of log data within the database, and the number of database connections.

[0041] Raw data is data generated and stored in the database during server operation. It can be obtained by calling historical data from the server and database, such as database capacity monitoring data, internal database numeric dictionary, application logs, and data operation records. Database usage value represents the capacity that the database has used.

[0042] Step S12: Group the various original data to obtain multiple sets of combined data.

[0043] One embodiment of this application proposes an optional method for grouping raw data:

[0044] The steps of grouping the various raw data to obtain multiple sets of combined data include:

[0045] Select three data points from the following: number of users, predicted time for database capacity, size of logs in the database, and number of database connections, to form a set of combined data. Then select three other data points to form another set of combined data to create the multiple sets of combined data.

[0046] In one embodiment of this application, the original data of various related data includes {a, b, c, d, e, f, g}, and the multiple sets of combined data obtained after grouping the above-mentioned original data include: {a, b, c, d}, {a, e, f, g}, {b, c, d, e}, {a, c, d, f}, etc., as shown in Table 1 below.

[0047] Table 1. Original data grouping diagram of related data.

[0048] Step S13: Standardize the multiple sets of combined data to obtain multiple sets of sample data.

[0049] The multiple sets of combined data are standardized to obtain multiple sets of sample data to meet the requirements of machine learning systems for sample data; one embodiment of this application illustrates an optional method for standardizing the original data:

[0050] The predicted time data is converted into timestamp type values, and the size of the data space and log volume, the number of users, and the number of database connections are all converted into values ​​in bytes.

[0051] For example, date and time data is converted to UNIX timestamp values, and data space and log space monitoring values ​​are converted to bytes.

[0052] Step S14: Use a multiple linear regression model to train the multiple sets of sample data to obtain multiple undetermined prediction models for the database capacity.

[0053] Machine learning is used to determine the degree of influence of each independent variable on the dependent variable.

[0054] A multiple linear regression model is used to train the multiple sets of sample data. The model is repeatedly trained under different combinations of independent variables to obtain the dependent variable predicted based on different sets of sample data. This yields a linear model of each set of sample data and the dependent variable, serving as multiple undetermined prediction models. After obtaining multiple undetermined prediction models, the model prediction results are compared and verified with the usage values ​​in the database, and the sample data set with the most accurate prediction results is retained.

[0055] One embodiment of this application illustrates an optional method for training the multiple sets of sample data using a multiple linear regression model:

[0056] Each set of sample data is input as an independent variable into a multiple linear regression model, and the predicted value of the dependent variable determined by the multiple linear regression model is output. The weight coefficients of the multiple undetermined prediction models are determined based on the multiple sets of predicted values.

[0057] In one example of this application, multiple sets of sample data include {a, b, c, d}, {a, e, f, g}, and {b, c, d, e}. A multiple linear regression model is used to train these multiple sets of sample data to obtain multiple undetermined prediction models for predicting the database capacity: y = f(a, b, c, d), y = f(a, e, f, g), and y = f(b, c, d, e). Each undetermined prediction model is a functional relationship with these related data, as shown in Table 2 below.

[0058]

[0059]

[0060] Table 2 shows the undetermined prediction models determined by each combination of data.

[0061] In one example of this application, a multiple linear regression model is trained based on multiple sets of sample data formed by permutations and combinations of the original data: "number of users in the corresponding database, prediction time of database capacity, number of bytes of logs in the database, number of database connections, database redo log switching frequency, database business type, database product, number of device points, application traffic, and data batch processing records". The resulting capacity prediction model is trained from the original data "number of users, prediction time of database capacity, number of bytes of logs in the database, and number of database connections". In the stage of predicting the database capacity through the capacity prediction model, the associated data loaded into the capacity prediction model is: "number of users, prediction time of database capacity, number of bytes of logs in the database, and number of database connections".

[0062] Another embodiment of this application proposes that training multiple sets of sample data can be performed in the following way:

[0063] Take the Bar-residual values, ND-residual values, and residual standard deviation values ​​of multiple sets of the sample data to form feature values, and train the feature values.

[0064] Step S15: Load multiple sets of sample data into the corresponding undetermined prediction model to obtain multiple output values, and compare the multiple output values ​​with the usage values ​​of the corresponding database to select one model from the multiple undetermined prediction models as the database capacity prediction model.

[0065] One embodiment of this application illustrates an optional method for selecting one model from a plurality of undetermined prediction models as a database capacity prediction model:

[0066] Calculate the absolute value of the difference between the multiple output values ​​and the corresponding usage values ​​in the database to obtain multiple sets of absolute values. The undetermined prediction model corresponding to the smallest absolute value among the multiple sets of absolute values ​​is taken as the capacity prediction model.

[0067] In one example of this application, the database usage value of the acquisition system within a specified time period is Y. The raw data related to database capacity is grouped to obtain multiple sets of combined data, including: {a, b, c, d}, {a, e, f, g}, {b, c, d, e}. A multiple linear regression model is used to train the above multiple sets of sample data: {a, b, c, d}, {a, e, f, g}, {b, c, d, e}, resulting in multiple undetermined prediction models, including f(a, b, c, d) = y1, f(a, e, f, g) = y2, f(b, c, d, d) = y3, f(b, c, d) = y4, f(b, c, d) = y5, f(b, c, d) = y6, f(b, c, d) = y7, f(b, c, d) = y8, f(b, c, d) = y9, f(b, c, d) = y1, f(b, e, f, g) = y2, f(b, c, d) = y3, f(b, c, d) = y4, f(b, c, d) = y5, f(b, c, d) = y6, f(b, c, d) = y7, f(b, c, d) = y8, f(b, c, d) = y9, f(b, c, d) = y1, f(b, c, d) = y2, f(b, c, d) = y3, f(b, c, d) = y4, f(b, c, d) = y5, f(b, c, d) = y6, f(b, c, d) = y7, f(b, c, d) = y8, f(b d, e) = y3, where the absolute value of Y-y1 is less than the absolute value of Y-y2, and the absolute value of Y-y3 is less than the absolute value of Y-y3, indicating that the output value of f(a, b, c, d) is closest to the database usage value, that is, closest to the actual database usage. The undetermined prediction model f(a, b, c, d) = y corresponding to {a, b, c, d} is determined as the database capacity prediction model; where the independent variable a represents the date and time, the independent variable b represents the data space usage value, the independent variable c represents the log volume size, the independent variable d represents the number of database connections, and the dependent variable y represents the predicted value of the data space.

[0068] Step S16: Load the associated data of the database under test into the capacity prediction model to obtain the capacity prediction value of the database under test.

[0069] After obtaining the capacity prediction values, the capacity prediction values ​​can be exported from the machine learning system and uploaded to the data capacity prediction system server for use by the capacity prediction function interface.

[0070] This application proposes that, during multiple training processes, the weight coefficients of the basic model can be adjusted by comparing the output values ​​of the multiple linear regression model with the actual database usage, thus obtaining the capacity prediction model y = k1x1 + k2x2 + k3x3 + k4x4, where x1, x2, x3, and x4 are standardized associated data, and k1, k2, k3, and k4 are weight coefficients. During the application of the capacity prediction model, the associated data called by the server are x1, x2, x3, and x4. The weight coefficients k1, k2, k3, and k4 are adjusted based on multiple sets of sample data during the training of the multiple linear regression model.

[0071] In one example of this application, a capacity prediction model is obtained: y = k1x1 + k2x2 + k3x3 + k4x4, where x1 represents the number of bytes of log data in the database, x2 represents the number of users in the database, x3 represents the prediction time of the database capacity, and x4 represents the number of database connections. The corresponding weighting coefficients are obtained: k1 = 0.0002, k2 = 0.00005, k3 = 0.00008, and k4 = 0.009. The larger the k value, the higher the weight of the corresponding x value.

[0072] This application embodiment trains multiple sets of sample data using a multiple linear regression model to obtain the relationship between different original data and the impact of combining different original data on database capacity. Based on the impact of combining different original data on database capacity, multiple target original data that can linearly express the trend of database capacity change are selected, i.e., target sample data sets that can linearly express the trend of database capacity change are selected. During the training process, a linear relationship between the target sample data sets and database capacity is established and adjusted to obtain a capacity prediction model that can accurately output the capacity prediction value of the database to be tested, thereby realizing automated prediction of database capacity without the need for manual judgment of database capacity based on experience.

[0073] This application also proposes to use a capacity prediction model to calculate the associated data of the database under test, and to provide early warnings on the capacity usage of the database under test based on the capacity prediction value during the monitoring process.

[0074] The system calls an interface program to obtain the upper limit of database space allocation and loads it into the computing system running the capacity prediction model. It also calls an interface program to obtain associated data for the database space. For example, if the capacity prediction model is f(a, b, c, d), then the interface program retrieves a, b, c, and d for the database space. The computing system running the capacity prediction model loads the associated data into the capacity prediction model to obtain the predicted capacity value of the database under test. It compares the difference between the predicted capacity value and the upper limit of database space allocation and triggers different types of alarms. For example, when the predicted capacity value is greater than or equal to 70% of the upper limit of database space allocation, a level 3 alarm is triggered: an alarm email is sent to the administrator's internal email address. When the predicted capacity value is greater than or equal to 75% of the upper limit of database space allocation, a level 2 alarm is triggered, sending an alarm email to the administrator's internal email address and an alarm SMS to the administrator's registered mobile phone number. When the predicted capacity value is greater than or equal to 80% of the upper limit of database space allocation, a level 1 alarm is triggered, sending both SMS and email alarm information to the administrator and their direct supervisor.

[0075] This application embodiment also proposes that during the process of using the capacity prediction model to predict the capacity of the database under test, the actual usage of the database under test and the raw data generated during the operation of the database under test can also be collected: the number of database users, the prediction time of database capacity, the number of bytes of logs in the database, and the number of database connections, so as to optimize the capacity prediction model.

[0076] This application also proposes another method for managing database capacity. Figure 2 This is a flowchart illustrating another database capacity management method proposed in the embodiments of this application, such as... Figure 2 As shown, implementing another database capacity management method proposed in this application requires performing the following steps:

[0077] K21: Collect raw data from various related data sets associated with database capacity. Group these raw data sets to obtain multiple sets of combined data.

[0078] K22: Standardize the multiple sets of combined data to obtain multiple sets of sample data. Standardizing the multiple sets of combined data can be done through data cleaning; for example, removing noise points from the original data, converting the data type, and converting the data format.

[0079] K23: Multiple linear regression models are used to train the multiple sets of sample data to obtain multiple undetermined prediction models for predicting the database capacity.

[0080] K24: Determine whether each undetermined prediction model can accurately predict the database capacity; based on the difference between the output value of each undetermined prediction model and the actual database capacity, verify the accuracy of each undetermined prediction model in predicting the database capacity. When no undetermined prediction model that accurately predicts the database capacity is obtained, the multiple linear regression model can be trained multiple times based on different sample data sets until an undetermined prediction model that can accurately predict the database capacity is obtained, which can then be used as the capacity prediction model.

[0081] K25: Call the capacity prediction model and load the associated data of the database under test into the capacity prediction model to obtain the capacity prediction value of the database under test.

[0082] K26: Obtain the maximum capacity of the database under test, and output a warning message before the predicted capacity exceeds the maximum capacity. The maximum capacity represents the maximum storage value of the current storage space.

[0083] K27: Obtain the number of database connections, compare the predicted capacity value with the maximum storage capacity of the current storage space of the database under test, and if the predicted capacity value exceeds the maximum storage capacity of the current storage space of the database under test, and the number of database connections is less than a preset number of connections, expand the database capacity.

[0084] The number of database connections can be the number of users accessing the database, the number of devices connected to the database, etc.

[0085] This application embodiment uses the above-described database capacity management method to predict the usage of the database under test and collect the number of connections to the database under test in real time. When the usage of the database under test reaches the maximum storage value of the current storage space of the database under test, the expansion time is selected to determine that the database expansion is completed during the low peak of database traffic, so as to avoid the expansion operation from causing server performance jitter and database internal locking problems.

[0086] This application embodiment also proposes an optional real-time method for expanding the database, which compares the predicted capacity value with the maximum storage value of the current storage space of the database under test. When the predicted capacity value exceeds the maximum storage value of the current storage space of the database under test, an optional storage space is searched on the server as a backup storage space.

[0087] To expand the database, you can find alternative storage space on the server as backup storage space, which can be achieved by creating a tablespace or a mirror table.

[0088] In one example of this application, the database under test is Oracle. The system determines whether the current partition has sufficient free space. If the current partition has sufficient free space, a data file is directly added to the current partition. If the current partition does not have sufficient free space, the system iterates through each disk partition in the data disk partition list, finds a partition with sufficient available space, and uses Oracle database management commands to add a data file under this partition, thus increasing the capacity allocation limit. After calculating the latest capacity limit, the system returns v_ops_result (where v_ops_result = "0" indicates success, and v_ops_result = "1" indicates failure).

[0089] In one example of this application, the database under test is PostgreSQL. The system iterates through each disk partition in the data disk partition list. A disk partition with sufficient available space is found, and a tablespace is created under this partition. PostgreSQL database management commands are then used to migrate the table with the highest space usage to the new tablespace. After calculating the latest capacity limit, the system returns v_ops_result (where v_ops_result = "0" indicates success, and v_ops_result = "1" indicates failure).

[0090] Once the expansion is complete, information such as the maximum storage value of the expanded database (v_new_data_upperlmt_size), the actual job start time, the actual job end time, and the server IP address can be written to the operation log table.

[0091] In this embodiment of the application, an optional storage space is found on the server as a backup storage space. After the expansion is achieved, the associated data of the expanded database under test can be loaded into the capacity prediction model, and the capacity prediction value is output. The maximum storage value of the expanded database under test is compared with the capacity prediction value. When the capacity prediction value is less than the maximum storage value of the expanded database under test, a contact warning instruction can be generated.

[0092] Figure 3 This is a schematic diagram of the database capacity management device proposed in this application embodiment, which is installed on a server that uses the database to be tested. The device includes:

[0093] Memory 31 is used to store multiple program modules;

[0094] Processor 32, coupled to the memory, is used to load the plurality of program modules and execute the specification. Figures 1 to 2 The method for managing database capacity is shown.

[0095] The apparatus provided in the above embodiments is used to execute the technical solutions of the above method embodiments. Its implementation principle and technical effects can be further referred to the relevant descriptions in the method embodiments, and will not be repeated here.

[0096] The apparatus provided in the above embodiments may be, for example, a chip or a chip module. The apparatus provided in the above embodiments is used to execute the technical solutions of the above-described method embodiments. Its implementation principles and technical effects can be further referred to the relevant descriptions in the method embodiments, and will not be repeated here.

[0097] Regarding the modules / units included in the various devices described in the above embodiments, they can be software modules / units, hardware modules / units, or a combination of both. For example, for devices applied to or integrated into a chip, all modules / units can be implemented using hardware methods such as circuits, or at least some modules / units can be implemented using software programs running on a processor integrated within the chip, while the remaining modules / units can be implemented using hardware methods such as circuits. For devices applied to or integrated into a chip module, all modules / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components of the chip module, or at least some modules / units can be implemented using software programs. The software program runs on the processor integrated inside the chip module, and the remaining modules / units can be implemented using hardware methods such as circuits. For each device applied to or integrated into an electronic terminal device, each of its modules / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components within the electronic terminal device. Alternatively, at least some modules / units can be implemented using software programs that run on the processor integrated inside the electronic terminal device, and the remaining (if any) modules / units can be implemented using hardware methods such as circuits.

[0098] This invention provides a computer-readable storage medium storing computer instructions that cause a computer to execute the present specification. Figures 1-2 The illustrated embodiment provides a method for managing database capacity. Computer-readable storage media can refer to non-volatile computer storage media.

[0099] The aforementioned computer-readable storage medium may be any combination of one or more computer-readable media. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory, optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium that contains or stores a program that may be used by or in connection with an instruction execution system, apparatus, or device.

[0100] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0101] In the description of the embodiments of the present invention, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this specification. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0102] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this specification, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0103] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this specification includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which the embodiments of this specification pertain.

[0104] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this specification. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0105] The above description is merely a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of protection of this specification.

Claims

1. A method for managing database capacity, characterized in that, The management method includes: Collect raw data from various related data sets concerning database capacity, including database usage values. The original data are grouped to obtain multiple sets of combined data. The multiple sets of combined data are standardized to obtain multiple sets of sample data. Multiple linear regression models are used to train the multiple sets of sample data to obtain multiple undetermined prediction models for predicting database capacity. Multiple sets of sample data are loaded into the corresponding undetermined prediction models to obtain multiple output values, and the multiple output values ​​are compared with the usage values ​​of the corresponding database to select one model from the multiple undetermined prediction models as the database capacity prediction model. The associated data of the database under test is loaded into the capacity prediction model to obtain the capacity prediction value of the database under test. Among these multiple sets of combined data, the categories of the original data contained in each set of combined data are not completely the same; The step of comparing the plurality of output values ​​with the corresponding usage values ​​of the database to select one of the plurality of undetermined prediction models as the database capacity prediction model includes: Calculate the absolute value of the difference between the multiple output values ​​and the corresponding usage values ​​in the database to obtain multiple sets of absolute values. The undetermined prediction model corresponding to the smallest absolute value among the multiple sets of absolute values ​​is taken as the capacity prediction model.

2. The database capacity management method as described in claim 1, characterized in that, The steps of training the multiple sets of sample data using a multiple linear regression model to obtain multiple undetermined prediction models for the database capacity include: Each set of sample data is input as an independent variable into a multiple linear regression model, and the predicted value of the dependent variable determined by the multiple linear regression model is output. The weight coefficients of the multiple undetermined prediction models are determined based on the multiple sets of predicted values.

3. The database capacity management method as described in claim 2, characterized in that, The capacity prediction model is y=k1x1+k2x2+k3x3+k4x4, where x1, x2, x3, and x4 are standardized associated data, and k1, k2, k3, and k4 are weighting coefficients.

4. The database capacity management method as described in claim 1, characterized in that, The associated data also includes the number of users using the database, the predicted time for database capacity, the number of bytes of logs within the database, and the number of database connections; The steps of grouping the various raw data to obtain multiple sets of combined data include: Select three data points from the following: number of users, predicted time for database capacity, size of logs in the database, and number of database connections, to form a set of combined data. Then select three other data points to form another set of combined data to create the multiple sets of combined data.

5. The database capacity management method as described in claim 3, characterized in that, The steps of standardizing the multiple sets of combined data to obtain multiple sets of sample data include: The predicted time data of the database capacity is converted into a timestamp type value, and the size of the data space and log volume, the number of users, and the number of database connections are converted into values ​​in bytes.

6. The database capacity management method as described in claim 1, characterized in that, The steps for training the multiple sets of sample data include: taking the Bar-residual values, ND-residual values, and residual standard deviation values ​​of the multiple sets of sample data to form feature values, and training the feature values.

7. The database capacity management method as described in claim 1, characterized in that, The database resides on a server, and management methods also include: The predicted capacity value is compared with the maximum storage value of the current storage space of the database under test. If the predicted capacity value exceeds the maximum storage value of the current storage space of the database under test, an optional storage space is searched on the server as a backup storage space.

8. The database capacity management method as described in claim 1, characterized in that, Management methods also include: The predicted capacity value is compared with the maximum storage capacity of the current storage space of the database under test. When the predicted capacity exceeds the maximum storage value of the current storage space of the database under test, and the number of database connections is less than the preset number of connections, the database capacity is expanded.

9. A database capacity management device, characterized in that, The management device includes: Memory, used to store multiple program modules; A processor, coupled to the memory, is configured to load the plurality of program modules and execute the database capacity management method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Server performance prediction method and device, computer system and medium

    CN111897706A

  • Cluster capacity prediction method and device

    CN112115036A