Table capacity adjustment method and device, storage medium and electronic equipment
By obtaining the target capacity data of the database application table, calculating and predicting the peak space utilization rate, and outputting adjustment prompts, the storage problem caused by the fixed capacity of the database application table is solved, dynamic adjustment is achieved, and insufficient storage demand and waste are avoided.
Patent Information
- Application Number
- CN202210268672.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-18
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2042-03-18
AI Technical Summary
In existing technologies, the capacity of database application tables is fixed, which can easily lead to problems such as insufficient storage capacity or wasted storage space when the amount of data changes.
By acquiring the target capacity data of the database application table within a preset time period, calculating the peak space utilization rate, and adjusting the conditions based on the predicted peak space utilization rate for future time periods, the system outputs capacity adjustment prompts and receives user instructions to adjust the capacity.
Dynamically adjust the capacity of database application tables to avoid insufficient storage or wasted space, thereby improving storage efficiency.
Smart Images

Figure CN114647644B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, in particular to a table capacity adjustment method and device, a storage medium and an electronic device. BACKGROUND
[0002] With the development of computer science and technology, databases are increasingly widely used in various fields. A database is a "warehouse that organizes, stores and manages data according to a data structure". It is a long-term storage in a computer, an organized, shareable and unified management of a large amount of data. An application table is provided in the database and can be used to store various types of application data.
[0003] At present, the amount of data stored in the database application table often fluctuates. In the prior art, a fixed space size of the database application table is usually given for data storage. This can cause the database application table to be unable to meet the data storage requirements or cause storage space waste when the amount of data to be stored changes. SUMMARY
[0004] The technical problem to be solved by the present application is to provide a table capacity adjustment method that can dynamically adjust the capacity of a database application table to avoid the situation of being unable to meet the data storage requirements and storage space waste.
[0005] The present application also provides a table capacity adjustment device to ensure the implementation and application of the above method in practice.
[0006] A table capacity adjustment method comprises the following steps:
[0007] Obtaining target capacity data of a database application table collected in a preset period; the target capacity data includes a data amount peak value and a table space size;
[0008] According to the data amount peak value and the table space size, the peak space utilization rate of the database application table in the period is calculated;
[0009] According to the peak space utilization rate of the period, the peak space utilization rate of the future period is predicted;
[0010] If the peak space utilization rate of the future period meets the preset adjustment condition, output a capacity adjustment prompt information of the database application table, the capacity adjustment prompt information is used to prompt the user to adjust the capacity of the database application table;
[0011] Receiving a capacity adjustment instruction triggered by the user in response to the capacity adjustment prompt information;
[0012] Applying capacity adjustment on the database application table based on a capacity adjustment parameter in the capacity adjustment instruction.
[0013] The method can further include:
[0014] Obtaining capacity data of the database application table collected at each collection time in each sub-period of the period, wherein the capacity data includes data volume and table space size of the database application table.
[0015] Filtering the capacity data collected at each collection time in each sub-period to eliminate capacity data of the database application table in a changing state and / or a maintaining state.
[0016] In a case where the database application table does not undergo capacity adjustment in the period, selecting capacity data with the largest data volume from the filtered capacity data as the target capacity data.
[0017] The method can further include:
[0018] In a case where the database application table undergoes capacity adjustment in the period, determining a time when the database application table undergoes capacity adjustment.
[0019] Determining a collection time after the time as a target collection time, and selecting capacity data with the largest data volume from the filtered capacity data at each target collection time as the target capacity data.
[0020] The method can further include:
[0021] Calculating a space usage rate peak value growth rate according to the space usage rate peak values of the historical periods.
[0022] Calculating the space usage rate peak value of the future period according to the space usage rate peak value of the period and the space usage rate peak value growth rate.
[0023] The method can further include:
[0024] If the space usage rate peak value of the future period is greater than a preset first type threshold value or the space usage rate peak value of the future period is less than a preset second type threshold value, it is determined that the space usage rate peak value of the future period satisfies the adjustment condition.
[0025] The first type threshold value is greater than the second type threshold value.
[0026] The method, optionally, the outputting the capacity adjustment prompt information of the database application table comprises:
[0027] In a case where the space usage rate peak value of the future period is greater than the first type threshold value, determining an expansion capacity corresponding to the space usage rate peak value, generating capacity adjustment prompt information according to the expansion capacity, and outputting the capacity adjustment prompt information;
[0028] In a case where the space usage rate peak value of the future period is less than the second type threshold value, determining a contraction capacity corresponding to the space usage rate, generating capacity adjustment prompt information according to the contraction capacity, and outputting the capacity adjustment prompt information.
[0029] A table capacity adjustment apparatus comprises:
[0030] An acquisition unit is configured to acquire target capacity data of a database application table collected in a preset period; the target capacity data comprises a data volume peak value and a table space size;
[0031] A calculation unit is configured to calculate a space usage rate peak value of the database application table in the period according to the data volume peak value and the table space size;
[0032] A prediction unit is configured to predict a space usage rate peak value of a future period according to the space usage rate peak value of the period;
[0033] An output unit is configured to output capacity adjustment prompt information of the database application table in a case where it is determined that the space usage rate peak value of the future period satisfies a preset adjustment condition; the capacity adjustment prompt information is used to prompt a user to perform capacity adjustment on the database application table;
[0034] A receiving unit is configured to receive a capacity adjustment instruction triggered by the user in response to the capacity adjustment prompt information;
[0035] A capacity adjustment unit is configured to perform capacity adjustment on the database application table based on a capacity adjustment parameter in the capacity adjustment instruction.
[0036] The apparatus, optionally, the acquisition unit comprises:
[0037] An acquisition subunit is configured to acquire capacity data of the database application table collected at each collection time in each sub-period of the period; the capacity data comprises a data volume and a table space size of the database application table;
[0038] a filtering unit configured to filter the volume data collected at each collection time in each of the sub-periods to eliminate the volume data of the database application table in a changing state and / or a maintaining state;
[0039] a selecting unit configured to select, in the case that no volume adjustment of the database application table occurs in the period, the volume data with the largest data volume from the filtered volume data as target volume data.
[0040] A storage medium comprising a storage instruction, wherein the storage instruction, when executed, controls a device where the storage medium is located to perform the table volume adjustment method as described above.
[0041] An electronic device comprising a memory, and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors to perform the table volume adjustment method as described above.
[0042] Compared with the prior art, the present application has the following advantages:
[0043] The present application provides a table volume adjustment method and device, a storage medium and an electronic device, the method comprising: obtaining target volume data of a database application table collected in a preset period; the target volume data comprising a data volume peak value and a table space size; calculating a space usage rate peak value of the database application table in the period according to the data volume peak value and the table space size; predicting a space usage rate peak value of a future period according to the space usage rate peak value of the period; in the case that the space usage rate peak value of the future period meets a preset adjustment condition, outputting a volume adjustment prompt information of the database application table, the volume adjustment prompt information being used to prompt a user to perform volume adjustment on the database application table; receiving a volume adjustment instruction triggered by the user in response to the volume adjustment prompt information; and performing volume adjustment on the database application table based on a volume adjustment parameter in the volume adjustment instruction. The method provided by the present application embodiment can dynamically adjust the volume of the database application table, and avoid the problems of failing to meet the data storage requirement and wasting storage space. BRIEF DESCRIPTION OF DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor based on the provided drawings.
[0045] Figure 1A method flow chart of a table capacity adjustment method provided by the present application is shown in the figure;
[0046] Figure 2 A process flow chart of obtaining target capacity data of a database application table collected in a preset period provided by the present application is shown in the figure;
[0047] Figure 3 A structural schematic diagram of a table capacity adjustment device provided by the present application is shown in the figure;
[0048] Figure 4 A structural schematic diagram of an electronic device provided by the present application is shown in the figure. DETAILED DESCRIPTION
[0049] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0050] In the present application, the term “comprising”, “containing” or any other variant thereof is intended to cover non-exclusive containing, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the sentence “including a…” does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0051] The embodiments of the present application provide a table capacity adjustment method, which can be applied to an electronic device, and a method flow chart of the method is shown in the figure Figure 1 , and specifically includes:
[0052] S101: Obtain target capacity data of a database application table collected in a preset period; the target capacity data includes a data volume peak value and a table space size.
[0053] In the present embodiment, the size of the period can be set according to actual needs, for example, it can be one day, one month, half a year or one year, etc.
[0054] Optionally, the database application table can be a table in various types of databases, for example, it can be an application table of an ORACLE database.
[0055] Optionally, the data volume peak value can be a maximum value of the data volumes stored in the application table, the data volume peak value can be a maximum value of target data meeting preset analysis conditions in each data volume collected in the time period, and the table space size can refer to a table space size of the database application table.
[0056] S102: According to the data volume peak value and the table space size, a space usage rate peak value of the database application table in the time period is calculated.
[0057] In this embodiment, the data volume peak value can be divided by the table space size to obtain the space usage rate peak value of the database application table in the time period.
[0058] S103: According to the space usage rate peak value of the time period, a space usage rate peak value of a future time period is predicted.
[0059] In this embodiment, the future time period can be a time period after the time period, and can be a next time period of the preset time period, for example, the preset time period can be a current month, and the future time period can be a next month. According to the space usage rate peak value of the database application table in the time period, the space usage rate peak value of the database application table in the future time period can be calculated.
[0060] S104: In a case where it is determined that the space usage rate peak value of the future time period meets a preset adjustment condition, capacity adjustment prompt information of the database application table is output, and the capacity adjustment prompt information is used to prompt a user to perform capacity adjustment on the database application table.
[0061] In this embodiment, the adjustment condition can be that the space usage rate peak value of the future time period is greater than a preset first type threshold value or less than a preset second type threshold value, that is, the space usage rate of the future time period is not in a preset reasonable space usage rate interval. The adjustment condition can also include that the space usage rate peak value of the future time period is less than the preset second type threshold value, and the database application table is not in a target business state, and the target business state includes one or more of a to-be-online state, a to-be-promoted state, a promoted state, and a to-be-offline state.
[0062] Optionally, in a case where it is determined that the space usage rate peak value of the future time period does not meet the adjustment condition, a capacity analysis result is generated according to the space usage rate peak value, and the capacity analysis result is output to prompt the user that the database application table does not need to be adjusted.
[0063] S105: A capacity adjustment instruction triggered by the user in response to the capacity adjustment prompt information is received.
[0064] In the embodiment, after receiving the capacity adjustment prompt information, the user can select whether to perform capacity adjustment according to the capacity prompt information. After the user selects to perform capacity adjustment, a capacity adjustment instruction is triggered according to the capacity adjustment mode and size selected by the user.
[0065] S106: performing capacity adjustment on the database application table based on the capacity adjustment parameter in the capacity adjustment instruction.
[0066] In the embodiment, the capacity adjustment parameter can include a capacity adjustment mode and a capacity size, and the capacity adjustment mode includes one of an expansion mode and a shrinkage mode.
[0067] Optionally, after performing capacity adjustment on the database application table, a capacity report of the database capacity table can be generated.
[0068] By using the method provided in the embodiments, the capacity of the database application table can be dynamically adjusted, and the situation that the data storage requirement cannot be met or the storage space is wasted can be avoided.
[0069] In some embodiments, after calculating the space usage peak value in the preset period, the space usage peak value in the period is compared with the first type threshold value and the second type threshold value respectively. In the case that the space usage peak value in the period is greater than the first type threshold value or less than the second type threshold value, the capacity of the database application table is adjusted.
[0070] In an embodiment provided in the application, based on the above-mentioned implementation process, optionally, the process of obtaining the target capacity data of the database application table collected in the preset period, as shown in Figure 2 , specifically includes:
[0071] S201: obtaining the capacity data of the database application table collected at each collection time in each sub-period of the period; the capacity data includes the data volume and the table space size of the database application table.
[0072] In the embodiment, one period includes multiple sub-periods, each sub-period is provided with multiple collection times, and the capacity data of the database application table is collected at each collection time based on a preset data collection tool and collection parameters, and the physical subsystem name, deployment unit name and deployment site to which the database belongs are saved.
[0073] Among them, the time interval of two adjacent collection times can be any length, for example, 30 minutes, 60 minutes, etc.
[0074] Optionally, the capacity data of the database application table collected at each collection time in each sub-period of the period is obtained according to the physical subsystem name, the deployment unit name, the deployment site and the database application table identifier.
[0075] S202: filtering the capacity data collected at each collection time in each of the sub-periods to remove the capacity data in which the database application table is in a change state and / or a maintenance state.
[0076] In the embodiment, the database application table is changed and maintained at some time, and the filtering of the collected capacity data can avoid the influence of the capacity data of the database application table in the change and maintenance phase.
[0077] S203: selecting the capacity data with the largest data amount from the filtered capacity data as target capacity data in the case that the database application table is not adjusted in capacity in the period.
[0078] In the embodiment, whether the database application table is adjusted in capacity can be determined according to whether the database table space size in each of the capacity data in the period is changed.
[0079] In an embodiment provided by the application, based on the above implementation process, optionally, the method further comprises:
[0080] in the case that the database application table is adjusted in capacity in the period, determining the time at which the database application table is adjusted in capacity;
[0081] determining the collection time after the time as a target collection time, and selecting the capacity data with the largest data amount from the filtered capacity data at each of the target collection time as target capacity data.
[0082] In the embodiment, the capacity data with the largest data amount collected after the capacity adjustment can be selected as the target capacity data.
[0083] In an embodiment provided by the application, based on the above implementation process, optionally, the predicting the space usage rate peak value of the future period according to the space usage rate peak value of the period comprises:
[0084] calculating a space usage rate peak value growth rate according to the space usage rate peak value of each of the historical periods;
[0085] calculating the space usage rate peak value of the future period according to the space usage rate peak value of the period and the space usage rate peak value growth rate.
[0086] In the embodiment, the space usage peak growth rate can be determined according to the space usage peaks between consecutive historical periods, and specifically, the space usage peak growth rate between at least one pair of adjacent historical periods can be calculated, and in the case that there are multiple pairs of adjacent historical periods, the average of the growth rates is taken as the space usage peak growth rate, or in the case that there is only one pair of adjacent historical periods, the growth rate is taken as the space usage peak growth rate.
[0087] The space usage peak of the future period can be obtained by multiplying the space usage peak of the period by (1+space usage peak growth rate).
[0088] In an embodiment provided by the present application, based on the above implementation process, the space usage peak of the future period is predicted according to the space usage peak of the period, which comprises:
[0089] The space usage peak of the period is processed by using a preset prediction model to obtain a prediction result output by the prediction model, the prediction result comprises the space usage peak of the future period of the period, and the prediction model is trained according to the space usage peaks of the historical periods.
[0090] In the embodiment, the prediction model can be various types of neural network models, for example, a long short-term memory neural network model, and the space usage peak of the period and the space usage peaks of at least one historical period before the period and continuous to the period can be input into the prediction model to obtain the space usage peak of the future period output by the prediction model.
[0091] In an embodiment provided by the present application, based on the above implementation process, the process of determining whether the space usage peak of the future period meets the preset adjustment condition comprises:
[0092] If the space usage peak of the future period is greater than a preset first type threshold or the space usage peak of the future period is less than a preset second type threshold, it is determined that the space usage peak of the future period meets the adjustment condition.
[0093] The first type threshold is greater than the second type threshold.
[0094] In the embodiment, the number of first type thresholds can be one or more, and the number of second type thresholds can also be one or more, and if the space usage peak of the future period is greater than at least one first type threshold or less than at least one second type threshold, it is determined that the space usage of the future period meets the adjustment condition.
[0095] In one embodiment of the present invention, based on the above implementation process, optionally, the step of outputting the capacity adjustment prompt information of the database application table includes:
[0096] If the peak space utilization rate in the future period is greater than the first type threshold, determine the expansion capacity corresponding to the peak space utilization rate, generate capacity adjustment prompt information based on the expansion capacity, and output the capacity adjustment prompt information.
[0097] If the peak space utilization rate in the future period is less than the second type threshold, determine the reduced capacity corresponding to the space utilization rate, generate a capacity adjustment prompt based on the reduced capacity, and output the capacity adjustment prompt.
[0098] In this embodiment, there are one or more first-type thresholds, for example, they may include 60%, 70%, and 80%; there are one or more second-type thresholds, for example, they may include 10%, 20%, and 30%.
[0099] Specifically, if the peak space utilization rate in the future period is greater than at least one first-type threshold, the expansion capacity can be calculated as follows: M = P / LQ, where M is the expansion capacity, P is the peak quantity, L is the largest first-type threshold among all first-type thresholds that the peak space utilization rate in the future period is greater than, and Q is the current tablespace size.
[0100] If the peak space utilization rate in the future period is less than at least one second-type threshold, the reduced capacity can be calculated as N = QP / K, where N is the reduced capacity and K is the smallest second-type threshold among all second-type thresholds to which the peak space utilization rate in the future period is less.
[0101] In this embodiment, outputting a capacity adjustment prompt message generated based on the expanded capacity can prompt the user to expand the database application table; outputting a capacity adjustment prompt message generated based on the reduced capacity can prompt the user to reduce the database application table.
[0102] and Figure 1 Corresponding to the method described above, embodiments of the present invention also provide a capacity adjustment device for adjusting the capacity of a meter. Figure 1 The specific implementation of the method, the capacity adjustment device provided in this embodiment of the invention, can be applied to electronic devices, and its structural schematic diagram is shown below. Figure 3 As shown, it specifically includes:
[0103] The acquisition unit 301 is used to acquire target capacity data of database application tables collected within a preset time period; the target capacity data includes peak data volume and table space size;
[0104] a calculating unit 302, configured to calculate a peak value of space usage of the database application table in the time period according to the data volume peak value and the table space size;
[0105] a predicting unit 303, configured to predict a peak value of space usage of a future time period according to the peak value of space usage of the time period;
[0106] an output unit 304, configured to output a capacity adjustment prompt information of the database application table in a case where it is determined that the peak value of space usage of the future time period meets a preset adjustment condition, the capacity adjustment prompt information being used to prompt a user to perform capacity adjustment on the database application table;
[0107] a receiving unit 305, configured to receive a capacity adjustment instruction triggered by the user in response to the capacity adjustment prompt information;
[0108] a capacity adjustment unit 306, configured to perform capacity adjustment on the database application table based on a capacity adjustment parameter in the capacity adjustment instruction.
[0109] In an embodiment provided by the present application, based on the above scheme, optionally, the obtaining unit 301 comprises:
[0110] an obtaining sub-unit, configured to obtain capacity data of the database application table collected at each collection time in each sub-time period of the time period, the capacity data comprising a data volume and a table space size of the database application table;
[0111] a filtering unit, configured to filter the capacity data collected at each collection time in each sub-time period to eliminate capacity data of the database application table in a changing state and / or a maintaining state;
[0112] a selecting unit, configured to select, in a case where the database application table does not undergo capacity adjustment in the time period, capacity data with the largest data volume from the filtered capacity data as target capacity data.
[0113] In an embodiment provided by the present application, based on the above scheme, optionally, the obtaining unit further comprises:
[0114] a first determining sub-unit, configured to determine a time at which the database application table undergoes capacity adjustment in a case where the database application table undergoes capacity adjustment in the time period;
[0115] an executing sub-unit, configured to determine a collection time after the time as a target collection time, and select, from the filtered capacity data at each target collection time, capacity data with the largest data volume as target capacity data.
[0116] In an embodiment provided by the present application, based on the above scheme, optionally, the prediction unit 303 comprises:
[0117] The first calculation sub-unit is configured to calculate a space usage rate peak value growth rate according to the space usage rate peak values of the respective historical time periods;
[0118] The second calculation sub-unit is configured to calculate a space usage rate peak value of a future time period according to the space usage rate peak value of the time period and the space usage rate peak value growth rate.
[0119] In an embodiment provided by the present application, based on the above scheme, optionally, the output unit 304 comprises:
[0120] The second determination sub-unit is configured to determine that the space usage rate peak value of the future time period satisfies the adjustment condition if the space usage rate peak value of the future time period is greater than a preset first type threshold value or the space usage rate peak value of the future time period is less than a preset second type threshold value.
[0121] The first type threshold value is greater than the second type threshold value.
[0122] In an embodiment provided by the present application, based on the above scheme, optionally, the output unit 304 comprises:
[0123] The first output sub-unit is configured to determine an expansion capacity corresponding to the space usage rate peak value of the future time period, generate capacity adjustment prompt information according to the expansion capacity, and output the capacity adjustment prompt information if the space usage rate peak value of the future time period is greater than the first type threshold value.
[0124] The second output sub-unit is configured to determine a contraction capacity corresponding to the space usage rate of the future time period, generate capacity adjustment prompt information according to the contraction capacity, and output the capacity adjustment prompt information if the space usage rate peak value of the future time period is less than the second type threshold value.
[0125] The specific principles and execution processes of each unit and module in the table capacity adjustment device disclosed in the embodiments of the present application are the same as those of the table capacity adjustment method disclosed in the embodiments of the present application, and can be referred to the corresponding parts in the table capacity adjustment method provided by the embodiments of the present application, which will not be described here.
[0126] The embodiments of the present application further provide a storage medium comprising stored instructions, wherein the instructions control a device where the storage medium is located to execute the above table capacity adjustment method when the instructions are executed.
[0127] The embodiments of the present application further provide an electronic device, a structural schematic diagram of which is shown in Figure 4As shown, specifically includes a memory 401, and one or more instructions 402, wherein one or more instructions 402 stored in the memory 401, and configured to be executed by one or more processors 403 said one or more instructions 402 to perform the following operations:
[0128] Obtaining target capacity data of the database application table collected in a preset period; the target capacity data includes a data volume peak value and a table space size;
[0129] According to the data volume peak value and the table space size, the space usage rate peak value of the database application table in the period is calculated;
[0130] According to the space usage rate peak value of the period, the space usage rate peak value of the future period is predicted;
[0131] In the case where the space usage rate peak value of the future period meets the preset adjustment condition, output the capacity adjustment prompt information of the database application table, the capacity adjustment prompt information is used to prompt the user to perform capacity adjustment on the database application table;
[0132] Receiving the capacity adjustment instruction triggered by the user in response to the capacity adjustment prompt information;
[0133] Based on the capacity adjustment parameter in the capacity adjustment instruction, the capacity of the database application table is adjusted.
[0134] It should be noted that each embodiment in the specification adopts a progressive manner, and each embodiment focuses on the difference from other embodiments. The same and similar parts of each embodiment can be referred to each other. For device embodiments, since they are basically similar to method embodiments, the description is relatively simple, and the relevant parts are referred to the part of the method embodiment.
[0135] Finally, it should be noted that in this paper, relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or equipment. Without more limitations, the element defined by the statement "including one" does not exclude the presence of other identical elements in the process, method, article or equipment including the element.
[0136] For ease of description, the above apparatus is described in various units by function and described separately. Of course, the functions of the units can be implemented in one or more software and / or hardware in implementing the present application.
[0137] From the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software and the necessary general hardware platform. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in various embodiments or some parts of the embodiments of the present application.
[0138] The above provides a detailed description of a table capacity adjustment method provided by the present application, and the principles and implementation manners of the present application are described by applying specific examples. The above embodiment description is only used to help understand the method of the present application and its core idea; meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manner and application range will have changes, and the above description should not be understood as a limitation on the present application.
Claims
1. A table size adjustment method characterized by comprising: The method comprises the following steps: obtaining target capacity data of a database application table collected in a preset period; the target capacity data comprises a data volume peak value and a table space size; wherein the data volume peak value is the maximum value of the data volume stored in the application table; calculating a space usage rate peak value of the database application table in the period according to the data volume peak value and the table space size; predicting a space usage rate peak value of a future period according to the space usage rate peak value of the period; outputting a capacity adjustment prompt information of the database application table if it is determined that the space usage rate peak value of the future period meets a preset adjustment condition; the capacity adjustment prompt information is used to prompt a user to perform capacity adjustment on the database application table; receiving a capacity adjustment instruction triggered by the user in response to the capacity adjustment prompt information; performing capacity adjustment on the database application table based on a capacity adjustment parameter in the capacity adjustment instruction; wherein the step of predicting the space usage rate peak value of the future period according to the space usage rate peak value of the period comprises: calculating a space usage rate peak value growth rate according to the space usage rate peak values of each historical period; calculating the space usage rate peak value of the future period according to the space usage rate peak value of the period and the space usage rate peak value growth rate.
2. The method of claim 1, wherein, The step of obtaining the target capacity data of the database application table collected in the preset period comprises: obtaining capacity data of the database application table collected at each collection time in each sub-period of the period; the capacity data comprises a data volume and a table space size of the database application table; filtering the capacity data collected at each collection time in each sub-period to eliminate the capacity data of the database application table in a changing state and / or a maintaining state; selecting the capacity data with the largest data volume from the filtered capacity data as the target capacity data if no capacity adjustment occurs to the database application table in the period.
3. The method of claim 2, wherein, The method further comprises: determining a time when the capacity adjustment occurs to the database application table if the capacity adjustment occurs to the database application table in the period; determining a target collection time after the time, and selecting the capacity data with the largest data volume from the filtered capacity data at each target collection time as the target capacity data.
4. The method of claim 1, wherein, The process of determining that the space usage rate peak value of the future period meets the preset adjustment condition comprises: if the space usage rate peak value of the future period is greater than a preset first type threshold value or the space usage rate peak value of the future period is less than a preset second type threshold value, it is determined that the space usage rate peak value of the future period meets the adjustment condition; wherein the first type threshold value is greater than the second type threshold value.
5. The method of claim 4, wherein, The step of outputting the capacity adjustment prompt information of the database application table comprises: if the space usage rate peak value of the future period is greater than the first type threshold value, determining an expansion capacity corresponding to the space usage rate peak value, generating a capacity adjustment prompt information according to the expansion capacity, and outputting the capacity adjustment prompt information. In a case where the space usage rate peak value of the future time period is less than the second type threshold value, a capacity reduction capacity corresponding to the space usage rate is determined, capacity adjustment prompt information is generated according to the capacity reduction capacity, and the capacity adjustment prompt information is output.
6. A table capacity adjusting apparatus characterized by comprising: Comprise: An acquisition unit is configured to acquire target capacity data of a database application table collected in a preset time period; The target capacity data comprises a data volume peak value and a table space size; wherein the data volume peak value is a maximum value of a data volume stored in the application table; A calculation unit is configured to calculate a space usage rate peak value of the database application table in the time period according to the data volume peak value and the table space size; A prediction unit is configured to predict a space usage rate peak value of a future time period according to the space usage rate peak value of the time period; An output unit is configured to output capacity adjustment prompt information of the database application table in a case where it is determined that the space usage rate peak value of the future time period meets a preset adjustment condition; the capacity adjustment prompt information is used to prompt a user to perform capacity adjustment on the database application table; A receiving unit is configured to receive a capacity adjustment instruction triggered by the user in response to the capacity adjustment prompt information; A capacity adjustment unit is configured to perform capacity adjustment on the database application table based on a capacity adjustment parameter in the capacity adjustment instruction; The calculation unit is further configured to calculate a space usage rate peak value growth rate according to space usage rate peak values of each historical time period; The space usage rate peak value of the future time period is calculated according to the space usage rate peak value of the time period and the space usage rate peak value growth rate.
7. The apparatus of claim 6, wherein, The acquisition unit comprises: An acquisition subunit is configured to acquire capacity data of the database application table collected at each collection time in each sub time period of the time period; the capacity data comprises a data volume and a table space size of the database application table; A filtering unit is configured to filter the capacity data collected at each collection time in each sub time period to eliminate capacity data of the database application table in a change state and / or a maintenance state; A selection unit is configured to select, in a case where no capacity adjustment occurs to the database application table in the time period, capacity data with a maximum data volume from the filtered capacity data as target capacity data.
8. A storage medium, characterized by The storage medium comprises a storage instruction, wherein the instruction controls a device where the storage medium is located to perform the table capacity adjustment method in any one of claims 1-5 when the instruction is executed.
9. An electronic device, comprising: The device comprises a memory, and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors to perform the table capacity adjustment method in any one of claims 1-5.
Citation Information
Patent Citations
Database management method and device, computing equipment and medium
CN111949503A
Cloud calculation system capacity evaluation method and device, equipment and storage medium
CN113010576A