Database expansion method and device

The database historical storage information is obtained through interface calls, the data volume is increased, and the capacity expansion script is generated, and the database capacity expansion is automatically expanded, solving the problems of low efficiency and poor accuracy of database capacity expansion in the existing technology, and realizing timely and accurate capacity expansion of the database.

CN113535726BActive Publication Date: 2025-01-14INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110803627.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-15
Publication Date
2025-01-14
Estimated Expiration
2041-07-15

AI Technical Summary

Technical Problem

In the prior art, database capacity expansion mainly relies on manual generation of expansion scripts, which are low efficiency, time-consuming, insufficient initiative and standardization, rely on monitoring, alarm and operation and maintenance experience, and have poor timeliness and accuracy.

Method used

The historical storage information of the database is obtained through interface calls, the amount of growth is estimated based on the historical storage information, and the expansion script is generated, and the database is automatically expanded to reduce manual intervention.

Benefits of technology

It realizes accurate and timely expansion of the database, reduces the number of alarms, improves the timeliness and accuracy of expansion, and reduces the work burden of operation and maintenance personnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113535726B_ABST
    Figure CN113535726B_ABST
Patent Text Reader

Abstract

The present disclosure provides a database expansion method, which can be applied to the financial field and the database technology field. The database expansion method includes: obtaining the historical storage information of the database through an interface call; obtaining the estimated growth data volume of the database within a preset management period according to the historical storage information; generating an expansion script according to the estimated growth data volume; and expanding the database using the expansion script. The present disclosure also provides a database expansion device, equipment, storage medium and program product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the financial field and the database technology field, and more specifically to a database expansion method, device, equipment, medium and program product. Background Art

[0002] Oracle data space management is one of the most basic and important tasks in database maintenance.

[0003] In the process of implementing the concept of the present disclosure, the inventors found that the database maintenance method in the related art mainly relies on manually generating expansion scripts, which mainly has the following problems:

[0004] The demand for capacity expansion mainly relies on monitoring alarms and operation and maintenance experience, and lacks initiative and standardization. Summary of the invention

[0005] In view of the above problems, the present disclosure provides a database expansion method, apparatus, device, medium and program product.

[0006] According to a first aspect of the present disclosure, a method for expanding database capacity is provided, comprising:

[0007] Obtain historical storage information from the database through interface calls;

[0008] According to the above historical storage information, the estimated growth data volume of the above database within the preset management period is obtained;

[0009] Generate a capacity expansion script based on the estimated growth data volume above;

[0010] Use the above expansion script to expand the above database.

[0011] According to an embodiment of the present disclosure, the historical storage information includes a first data volume of a first category storage space and a first historical data volume, wherein the first data volume includes a data volume of the first category storage space at a first time point to be expanded, and the first historical data volume includes a data volume of the first category storage space at a second time point having a first time span with the first time point to be expanded, wherein the first time span is equal to the preset management period;

[0012] The estimated growth data volume of the above database within the preset management period obtained based on the above historical storage information includes:

[0013] Obtaining a first storage threshold of the first category storage space;

[0014] According to the first storage threshold, the first data volume and the first historical data volume, an estimated growth data volume of the first category storage space within a preset management period is obtained.

[0015] According to an embodiment of the present disclosure, obtaining the estimated growth data volume of the first category storage space within a preset management period according to the first storage threshold, the first data volume, and the first historical data volume includes:

[0016] generating a first difference value according to the first data amount and the first historical data amount;

[0017] The estimated growth data volume of the first category storage space within a preset management period is obtained according to the first difference and the first storage threshold.

[0018] According to an embodiment of the present disclosure, after obtaining the estimated growth data volume of the first category storage space within the preset management period, the method further includes:

[0019] Obtaining a first rated capacity of the first category storage space;

[0020] Generate a maximum safe storage capacity according to the first rated capacity and the first storage threshold;

[0021] Generate an estimated total amount of data based on the first amount of data and the estimated growth amount of data;

[0022] When the estimated total amount of data is less than or equal to the maximum safe storage capacity, a capacity expansion script is generated according to the estimated growth data volume.

[0023] According to an embodiment of the present disclosure, the historical storage information includes the total amount of first historical data of the second category storage space, wherein the total amount of first historical data includes the total amount of data of the second category storage space in a historical management period having a second time span with the preset management period; the second category storage space has an initial storage capacity;

[0024] The estimated growth data volume of the above database within the preset management period obtained based on the above historical storage information includes:

[0025] generating a second difference value according to the total amount of the first historical data and the initial storage capacity;

[0026] The second difference is used as the estimated growth data volume.

[0027] According to an embodiment of the present disclosure, the historical storage information includes a second data volume and a second total amount of historical data of the third category storage space, wherein the second data volume includes the data volume of the third category storage space at a second time point to be expanded, and the second total amount of historical data includes the total amount of data of the third category storage space in a historical management period having a third time span with the second time point to be expanded;

[0028] The estimated growth data volume of the above database within the preset management period obtained based on the above historical storage information includes:

[0029] generating an average data volume according to the second total amount of historical data and the third time span;

[0030] Generate a standard data capacity of the third category storage space according to the average data volume and a preset time threshold of the third category storage space;

[0031] The estimated growth data volume is obtained based on the standard data capacity and the second rated data capacity of the third category storage space.

[0032] According to an embodiment of the present disclosure, generating a capacity expansion script according to the estimated growth data volume includes:

[0033] According to the above estimated growth data volume, N data files are obtained, wherein the sum of the data volumes of the above N data files is greater than or equal to the above estimated growth data volume, and N is an integer;

[0034] Obtain identification information of each of the N data files;

[0035] The above identification information is used as a script parameter to generate the above expansion script.

[0036] A second aspect of the present disclosure provides a database expansion device, comprising:

[0037] The acquisition module is used to obtain the historical storage information of the database through interface calling;

[0038] An estimation module, used to obtain an estimated growth data volume of the above database within a preset management period based on the above historical storage information;

[0039] A generation module, used to generate a capacity expansion script according to the above estimated growth data volume; and

[0040] The expansion module is used to expand the database using the expansion script.

[0041] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the database expansion method.

[0042] A fourth aspect of the present disclosure further provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the above-mentioned database expansion method.

[0043] The fifth aspect of the present disclosure also provides a computer program product, including a computer program, which implements the above-mentioned database expansion method when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0045] Figure 1 An application scenario diagram schematically illustrates an application scenario diagram of a database expansion method, apparatus, device, medium, and program product according to an embodiment of the present disclosure;

[0046] Figure 2 A flowchart of a method for expanding database capacity according to an embodiment of the present disclosure is schematically shown;

[0047] Figure 3 A flowchart schematically illustrates a method of obtaining an estimated growth data volume of a database within a preset management period based on historical storage information according to an embodiment of the present disclosure;

[0048] Figure 4 A flowchart schematically illustrates a method of obtaining an estimated growth data volume of a first category storage space within a preset management period according to a first storage threshold, a first data volume, and a first historical data volume according to an embodiment of the present disclosure;

[0049] Figure 5 A flowchart of a method for expanding database capacity according to another embodiment of the present disclosure is schematically shown;

[0050] Figure 6 A flowchart schematically illustrates obtaining an estimated growth data volume of a database within a preset management period based on historical storage information according to another embodiment of the present disclosure;

[0051] Figure 7 A flowchart schematically illustrates obtaining an estimated growth data volume of a database within a preset management period based on historical storage information according to another embodiment of the present disclosure;

[0052] Figure 8 A flowchart of generating a capacity expansion script according to an estimated growth data volume according to an embodiment of the present disclosure is schematically shown;

[0053] Fig. 9 A schematic diagram shows a structural block diagram of a database expansion device according to an embodiment of the present disclosure; and

[0054] Fig.10 A block diagram of an electronic device suitable for implementing a database expansion method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0055] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0056] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0057] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.

[0058] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0059] In the process of implementing the concept of the present disclosure, the inventors found that in the related art, the operation and maintenance of the database is usually mainly based on manually generated expansion scripts, which mainly has the following problems:

[0060] 1. The demand for capacity expansion mainly depends on monitoring alarms and operation and maintenance experience, and lacks initiative and standardization.

[0061] 2. When the database needs to be expanded, the expansion task is usually manually distributed to the corresponding operation and maintenance personnel, who then write the expansion script. This expansion method is inefficient and time-consuming.

[0062] In order to solve the problems existing in the related technologies, the present disclosure provides a database expansion method, which can be applied to the financial field and the database technology field. The database expansion method includes: obtaining the historical storage information of the database through an interface call; obtaining the estimated growth data volume of the database within a preset management period according to the historical storage information; generating an expansion script according to the estimated growth data volume; and expanding the database using the expansion script. The present disclosure also provides a database expansion device, equipment, storage medium and program product.

[0063] It should be noted that the method and device determined in the embodiments of the present disclosure can be used in the financial field and the database technology field, and can also be used in any field other than the financial field and the database technology field. The application field of the method and device determined in the embodiments of the present disclosure is not limited.

[0064] Figure 1 An application scenario diagram schematically illustrates an application scenario diagram of a database expansion method, apparatus, device, medium, and program product according to an embodiment of the present disclosure.

[0065] like Figure 1 As shown, the application scenario 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0066] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).

[0067] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0068] The server 105 may be a server that provides various services, such as a background management server (only an example) that provides support for websites browsed by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0069] It should be noted that the database expansion method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the database expansion device provided in the embodiment of the present disclosure can generally be set in the server 105. The database expansion method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the database expansion device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.

[0070] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0071] The following will be based on Figure 1 The scene described by Figure 2 to Figure 8 The database expansion method of the disclosed embodiment is described in detail.

[0072] Figure 2 The flowchart of the database expansion method according to the embodiment of the present disclosure is schematically shown.

[0073] like Figure 2 As shown, the database expansion method of this embodiment includes operations S201 to S204.

[0074] In operation S201, historical storage information of a database is obtained by calling an interface.

[0075] According to an embodiment of the present disclosure, the historical storage information may include storage information that can characterize the storage situation of the database within a certain period of time.

[0076] According to an embodiment of the present disclosure, the historical storage information may include storage information of various types of storage spaces.

[0077] According to an embodiment of the present disclosure, historical storage information may be stored in a data file of the database in the form of a database table, but is not limited thereto. The historical storage information may also be stored in a data file of another database different from the database in the form of a database table.

[0078] According to an embodiment of the present disclosure, the historical storage information may be stored in a certain database, but is not limited thereto. The historical storage information may also be stored in a plurality of different databases.

[0079] In operation S202, the estimated growth data volume of the database within a preset management period is obtained according to the historical storage information.

[0080] According to an embodiment of the present disclosure, by parsing and analyzing historical storage information, the estimated growth data volume of a certain category of storage space within a preset management cycle can be estimated based on the storage conditions of one or more categories of storage space in the database included in the historical storage information within a certain period of time.

[0081] According to an embodiment of the present disclosure, the preset management period may include the next month, the next quarter, the next day, etc. The embodiment of the present disclosure does not specifically limit the preset management period.

[0082] In operation S203, a capacity expansion script is generated according to the estimated growth data volume.

[0083] In operation S204, the capacity of the database is expanded using the capacity expansion script.

[0084] According to an embodiment of the present disclosure, after obtaining the estimated growth data volume of the database within a preset management period based on historical storage information, an expansion script can be automatically generated based on the estimated growth data volume. In an embodiment of the present disclosure, the expansion script may include one or more, and the total data volume of the one or more expansion scripts is greater than or equal to the estimated growth data volume.

[0085] According to an embodiment of the present disclosure, as users operate applications or new users are registered, the amount of data in the database will increase accordingly. However, the amount of data that the database can store is limited. When the amount of data stored in the database is greater than a preset threshold, it is usually necessary to expand the available space of the database.

[0086] In the related art, a storage threshold is usually set for the database. When the amount of data stored in the database exceeds the storage threshold, the database will alarm to remind the operation and maintenance manager to expand the database. After receiving the alarm information from the database, the operation and maintenance manager can formulate the expansion requirements based on prior experience, and then distribute the expansion requirements to the corresponding operation and maintenance personnel. The operation and maintenance personnel write the expansion script according to the received expansion requirements and use the script to expand the database.

[0087] However, the related art relies on alarm information to expand capacity, and the expansion depends on the database expansion of operation and maintenance management personnel, which has poor timeliness and accuracy.

[0088] In the embodiment of the present disclosure, by analyzing and processing the historical storage information of the database, the estimated growth data volume of the database within the preset management period can be obtained, and the expansion script can be automatically generated according to the estimated growth data volume to expand the database. The database expansion method provided by the embodiment of the present disclosure solves the technical problems of poor timeliness and accuracy existing in the related technology, and achieves the technical effect of accurately and timely expanding the database and reducing the number of database alarms.

[0089] According to an embodiment of the present disclosure, historical storage information includes a first data volume of a first category storage space and a first historical data volume, wherein the first data volume includes the data volume of the first category storage space when it is at a first time point to be expanded, and the first historical data volume includes the data volume of the first category storage space when it is at a second time point with a first time span with the first time point to be expanded, wherein the first time span is equal to a preset management period.

[0090] According to an embodiment of the present disclosure, the first category storage space may include, for example, a common table space.

[0091] In an embodiment of the present disclosure, the preset management period may be, for example, 30 days, and thus, the first time span may also be 30 days.

[0092] According to an embodiment of the present disclosure, the first time point to be expanded may be, for example, June 30th, so that the first data volume may, for example, include the data volume of the database when it is on June 30th, and the first historical data volume may, for example, include the data volume of the database when it is on May 30th.

[0093] Figure 3 The flowchart schematically shows a method of obtaining the estimated growth data volume of a database within a preset management period based on historical storage information according to an embodiment of the present disclosure.

[0094] like Figure 3 As shown, the embodiment of the invention obtains the estimated growth data volume of the database within the preset management period according to the historical storage information, including operations S301 and S302.

[0095] In operation S301, a first storage threshold of a first type of storage space is obtained.

[0096] According to an embodiment of the present disclosure, the first storage threshold may include, for example, 75%, 80% or 90% of the rated storage data volume of the first category storage space.

[0097] According to an embodiment of the present disclosure, the first storage threshold may be, for example, an alarm threshold of a first category storage space, that is, when the amount of data stored in the first category storage space exceeds the alarm threshold, the first category storage space will alarm, but not limited to this, the first storage threshold may also be lower than the alarm threshold of the first category storage space.

[0098] In operation S302, an estimated growth data volume of a first type of storage space within a preset management period is obtained according to a first storage threshold, a first data volume, and a first historical data volume.

[0099] Figure 4 The flowchart schematically shows a method of obtaining an estimated growth data volume of a first category storage space within a preset management period according to a first storage threshold, a first data volume and a first historical data volume according to an embodiment of the present disclosure.

[0100] like Figure 4 As shown, the embodiment includes operations S401 to S402 for obtaining the estimated growth data volume of the first category storage space within a preset management period according to the first storage threshold, the first data volume and the first historical data volume.

[0101] In operation S401 , a first difference value is generated according to a first data amount and a first historical data amount.

[0102] In operation S402, an estimated growth amount of data in a first category storage space within a preset management period is obtained according to the first difference and the first storage threshold.

[0103] According to an embodiment of the present disclosure, the above operations S401 to S402 can be expressed by the following formula (1).

[0104]

[0105] Among them, Y 1 It can represent the estimated growth data volume, x 1 Can represent the first data quantity, x 2 It can represent the first amount of historical data, f 1 A first storage threshold may be represented.

[0106] According to an embodiment of the present disclosure, the data increment of the first category storage space within the first time span can be obtained by generating a first difference value according to the first data volume and the first historical data volume.

[0107] According to an embodiment of the present disclosure, by generating a first ratio according to a first difference, ie, a data increment of the first category storage space within a first time span and a first storage threshold, a buffer storage space may be reserved for the first category storage space.

[0108] Figure 5The following schematically shows a flow chart of a method for expanding database capacity according to another embodiment of the present disclosure.

[0109] like Figure 5 As shown, the database expansion method of this embodiment includes operations S501 to S504.

[0110] In operation S501 , a first rated capacity of a first category storage space is acquired.

[0111] According to an embodiment of the present disclosure, the first rated capacity may be the maximum expandable capacity of the first category storage space.

[0112] In operation S502, a maximum safety storage amount is generated according to a first rated capacity and a first storage threshold.

[0113] According to an embodiment of the present disclosure, the maximum safe storage capacity may be an alarm threshold of the first category storage space, that is, the database will issue an alarm after the amount of data in the first category storage space exceeds the maximum safe storage capacity.

[0114] According to an embodiment of the present disclosure, the maximum safe storage capacity can be obtained by multiplying the first rated capacity by the first storage threshold.

[0115] In operation S503, an estimated total amount of data is generated according to the first amount of data and the estimated growth amount of data.

[0116] According to an embodiment of the present disclosure, the estimated total amount of data may be obtained by adding the first amount of data and the estimated amount of growth data.

[0117] According to an embodiment of the present disclosure, the estimated total amount of data may be the estimated total amount of data in the first category storage space after the first category storage space is expanded according to the estimated growth data amount.

[0118] In operation S504, when the estimated total amount of data is less than or equal to the maximum safe storage amount, a capacity expansion script is generated according to the estimated growth data amount.

[0119] According to an embodiment of the present disclosure, the estimated total amount of data is less than or equal to the maximum safe storage amount, which means that after the first category storage space is expanded according to the estimated growth data amount, the total amount of data stored in the first category storage space does not exceed the alarm threshold, and the database will not issue an alarm, thereby reducing the number of database alarms.

[0120] According to an embodiment of the present disclosure, when the estimated total amount of data is greater than the maximum safe storage capacity, it indicates that the total capacity of the database cannot meet the expansion demand, so that storage gap information can be automatically generated and sent to database maintenance personnel to upgrade the database.

[0121] According to an embodiment of the present disclosure, the storage gap information may include identification information of the first category storage space, the current data volume of the first category storage space, the difference between the rated capacity of the first category storage space and the required capacity for expansion, etc.

[0122] According to an embodiment of the present disclosure, historical storage information includes a first total amount of historical data of a second category storage space, wherein the first total amount of historical data includes a total amount of data of the second category storage space in a historical management period having a second time span with a preset management period; the second category storage space has an initial storage capacity.

[0123] According to an embodiment of the present disclosure, the second type of storage space may include, for example, a time series table space.

[0124] According to an embodiment of the present disclosure, the temporal table space may be, for example, a table space created at a preset time interval, for example, a table space created at the beginning of each month, or a table space created at the beginning of each quarter.

[0125] According to an embodiment of the present disclosure, the second time span may include twelve months, for example.

[0126] According to an embodiment of the present disclosure, the preset management period may be, for example, July 1 to July 30, 2021, so that the historical management period may be July 1 to July 30, 2020.

[0127] Figure 6 The flowchart schematically shows a method of obtaining the estimated growth data volume of a database within a preset management period based on historical storage information according to another embodiment of the present disclosure.

[0128] like Figure 6 As shown, in this embodiment, obtaining the estimated growth data volume of the database within a preset management period according to the historical storage information includes operations S601 to S602.

[0129] In operation S601, a second difference value is generated according to the first total amount of historical data and the initial storage capacity.

[0130] In operation S602, the second difference is used as the estimated growth data amount.

[0131] According to an embodiment of the present disclosure, when performing demand analysis on the second category storage space, a smaller initial storage capacity is often allocated to the second category storage space to meet the basic storage demand of the second category storage space.

[0132] According to the embodiments of the present disclosure, since the amount of data stored in the database each year has a certain regularity, for example, there is a shopping festival or traditional festival in a certain month of the year, then the amount of data in that month will usually increase to a certain extent. Therefore, the amount of data growth in the corresponding month of this year can be estimated based on the amount of data in the same month of the previous year.

[0133] According to an embodiment of the present disclosure, historical storage information includes a second data volume and a second total historical data volume of a third category storage space, wherein the second data volume includes the data volume of the third category storage space when it is at a second time point to be expanded, and the second total historical data volume includes the total data volume of the third category storage space in a historical management period with a third time span with the second time point to be expanded.

[0134] According to an embodiment of the present disclosure, the third type of storage space may include, for example, a log table space.

[0135] According to an embodiment of the present disclosure, the third time span may be, for example, 30 days.

[0136] According to an embodiment of the present disclosure, the second time point to be expanded may be, for example, Monday, June 28, and thus, the historical management period having a third time span with the second time point to be expanded may be from May 28 to June 28.

[0137] Figure 7 The flowchart schematically shows a method of obtaining the estimated growth data volume of a database within a preset management period based on historical storage information according to another embodiment of the present disclosure.

[0138] like Figure 7 As shown, in this embodiment, obtaining the estimated growth data volume of the database within a preset management period according to the historical storage information includes operations S701 to S703.

[0139] In operation S701 , an average data amount is generated according to the second total amount of historical data and the third time span.

[0140] According to an embodiment of the present disclosure, the average data volume can be obtained by dividing the total amount of the second historical data by the third time span.

[0141] In operation S702, a standard data capacity of the third type of storage space is generated according to the average data volume and a preset time threshold of the third type of storage space.

[0142] According to an embodiment of the present disclosure, the third category storage space can generally store only a preset number of days of data, for example, can store only the data of the past three days.

[0143] According to an embodiment of the present disclosure, the third category storage space can, for example, store the data from Monday, Tuesday and Wednesday. At midnight on Wednesday, the data from Monday can be deleted, and the data from Thursday can be received and stored to ensure that only the data from the past three days is stored in the third category storage space.

[0144] According to an embodiment of the present disclosure, the preset time threshold may include the number of days that the third category table space can store data.

[0145] In operation S703, an estimated growth data volume is obtained according to the standard data capacity and the second rated data capacity of the third category storage space.

[0146] According to an embodiment of the present disclosure, the above operations S701 to S703 can be expressed by the following formula (2).

[0147]

[0148] Among them, x 2 It can represent the total amount of the second historical data, d 1 Can represent the third time span, d 2 Can represent the preset time threshold, Y 2 It can indicate the estimated growth data volume.

[0149] Figure 8 The flowchart of generating a capacity expansion script according to the estimated growth data volume according to an embodiment of the present disclosure is schematically shown.

[0150] like Figure 8 As shown, in this embodiment, generating a capacity expansion script according to the estimated growth data volume includes operations S801 to S803.

[0151] In operation S801, N data files are acquired according to the estimated growth data volume, wherein the sum of the data volumes of the N data files is greater than or equal to the estimated growth data volume, and N is an integer.

[0152] In operation S802, identification information of each data file in N data files is obtained.

[0153] In operation S803, the identification information is used as a script parameter to generate a capacity expansion script.

[0154] According to an embodiment of the present disclosure, the amount of data that a single data file can add to a database is generally limited. For example, one data file can add 30 GB of data to a database.

[0155] According to an embodiment of the present disclosure, the number of required data files can be obtained by calculating the ratio between the estimated growth data volume and the augmented data volume of a single data file to the database.

[0156] According to an embodiment of the present disclosure, the identification information may include, for example, a storage path of the data file, a file name of the data file, and other information.

[0157] Based on the above database expansion method, the present disclosure also provides a database expansion device. Fig. 9 The device is described in detail.

[0158] Fig. 9 The structural block diagram of the database expansion device according to an embodiment of the present disclosure is schematically shown.

[0159] like Fig. 9 As shown, the database expansion device 900 of this embodiment includes an acquisition module 901, an estimation module 902, a generation module 903 and an expansion module 904.

[0160] The acquisition module 901 is used to acquire the historical storage information of the database through an interface call. In one embodiment, the acquisition module 901 can be used to perform the operation S201 described above, which will not be described in detail here.

[0161] The estimation module 902 is used to obtain the estimated growth data volume of the database within a preset management period according to the historical storage information. In one embodiment, the estimation module 902 can be used to perform the operation S202 described above, which will not be described in detail here.

[0162] The generation module 903 is used to generate a capacity expansion script according to the estimated growth data volume. In one embodiment, the generation module 903 can be used to perform the operation S203 described above, which will not be described in detail here.

[0163] The expansion module 904 is used to expand the database using the expansion script. In one embodiment, the expansion module 904 can be used to perform the operation S204 described above, which will not be described in detail here.

[0164] According to an embodiment of the present disclosure, historical storage information includes a first data volume of a first category storage space and a first historical data volume, wherein the first data volume includes the data volume of the first category storage space when it is at a first time point to be expanded, and the first historical data volume includes the data volume of the first category storage space when it is at a second time point with a first time span with the first time point to be expanded, wherein the first time span is equal to a preset management period.

[0165] According to an embodiment of the present disclosure, the estimation module 902 includes a first acquisition unit and a generation unit.

[0166] The first acquiring unit is configured to acquire a first storage threshold of a first category storage space.

[0167] The generating unit is used to obtain the estimated growth data volume of the first category storage space within a preset management period according to the first storage threshold, the first data volume and the first historical data volume.

[0168] According to an embodiment of the present disclosure, the generation unit includes a first generation subunit, a second generation subunit and a third generation subunit.

[0169] The first generating subunit is used to generate a first difference value according to the first data volume and the first historical data volume.

[0170] The second generating subunit is used to generate a first ratio according to the first difference and a first storage threshold.

[0171] The third generating subunit is used to obtain the estimated growth data volume of the first category storage space within a preset management period according to the first ratio and the first data volume.

[0172] According to an embodiment of the present disclosure, the database expansion device 900 further includes a first acquisition module, a first generation module, a second generation module, and a third generation module.

[0173] The first acquisition module is used to acquire a first rated capacity and a second storage threshold of a first category storage space.

[0174] The first generating module is used to generate a second ratio according to the first rated capacity and the second storage threshold.

[0175] The second generating module is used to generate an estimated total data amount according to the first data amount and the estimated growth data amount.

[0176] The third generating module is used to generate a capacity expansion script according to the estimated growth data volume when the estimated total data volume is less than or equal to the second ratio.

[0177] According to an embodiment of the present disclosure, historical storage information includes a first total amount of historical data of a second category storage space, wherein the first total amount of historical data includes a total amount of data of the second category storage space in a historical management period having a second time span with a preset management period; the second category storage space has an initial storage capacity.

[0178] According to an embodiment of the present disclosure, the estimation module 902 includes a first generating unit and a determining unit.

[0179] A first generating unit, configured to generate a second difference value according to the first total amount of historical data and the initial storage capacity;

[0180] The determination unit is used to use the second difference as the estimated growth data volume.

[0181] According to an embodiment of the present disclosure, historical storage information includes a second data volume and a second total historical data volume of a third category storage space, wherein the second data volume includes the data volume of the third category storage space when it is at a second time point to be expanded, and the second total historical data volume includes the total data volume of the third category storage space in a historical management period with a third time span with the second time point to be expanded.

[0182] According to an embodiment of the present disclosure, the estimation module 902 further includes a second generating unit, a third generating unit, and a second determining unit.

[0183] A second generating unit, configured to generate an average data volume according to the second total amount of historical data and a third time span;

[0184] A third generating unit, configured to generate a standard data capacity of the third category storage space according to the average data volume and a preset time threshold of the third category storage space;

[0185] The second determining unit is used to obtain the estimated growth data volume according to the standard data capacity and the second rated data capacity of the third category storage space.

[0186] According to an embodiment of the present disclosure, the generation module 903 includes a first acquisition unit, a second acquisition unit, and a fourth generation unit.

[0187] A first acquisition unit is used to acquire N data files according to the estimated growth data volume, wherein the sum of the data volumes of the N data files is greater than or equal to the estimated growth data volume, and N is an integer;

[0188] A second acquisition unit is used to acquire identification information of each data file in the N data files;

[0189] The fourth generating unit is used to use the identification information as a script parameter to generate a capacity expansion script.

[0190] According to an embodiment of the present disclosure, any multiple modules in the acquisition module 901, the estimation module 902, the generation module 903 and the expansion module 904 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the acquisition module 901, the estimation module 902, the generation module 903 and the expansion module 904 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in a suitable combination of any of them. Alternatively, at least one of the acquisition module 901, the estimation module 902, the generation module 903 and the expansion module 904 may be at least partially implemented as a computer program module, and when the computer program module is executed, the corresponding function may be executed.

[0191] Fig.10 A block diagram of an electronic device suitable for implementing a database expansion method according to an embodiment of the present disclosure is schematically shown.

[0192] like Fig.10 As shown, the electronic device 1000 according to an embodiment of the present disclosure includes a processor 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage part 1008 into a random access memory (RAM) 1003. The processor 1001 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1001 may also include an onboard memory for caching purposes. The processor 1001 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0193] In RAM 1003, various programs and data required for the operation of electronic device 1000 are stored. Processor 1001, ROM 1002 and RAM 1003 are connected to each other via bus 1004. Processor 1001 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 1002 and / or RAM 1003. It should be noted that the program can also be stored in one or more memories other than ROM 1002 and RAM 1003. Processor 1001 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.

[0194] According to an embodiment of the present disclosure, the electronic device 1000 may further include an input / output (I / O) interface 1005, which is also connected to the bus 1004. The electronic device 1000 may further include one or more of the following components connected to the I / O interface 1005: an input portion 1006 including a keyboard, a mouse, etc.; an output portion 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 1008 including a hard disk, etc.; and a communication portion 1009 including a network interface card such as a LAN card, a modem, etc. The communication portion 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage portion 1008 as needed.

[0195] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0196] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 1002 and / or RAM 1003 described above and / or one or more memories other than ROM 1002 and RAM 1003.

[0197] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the database expansion method provided by the embodiment of the present disclosure.

[0198] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 1001. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0199] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 1009, and / or installed from the removable medium 1011. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0200] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1009, and / or installed from the removable medium 1011. When the computer program is executed by the processor 1001, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.

[0201] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).

[0202] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0203] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0204] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A method for expanding database capacity, characterized in that: include: Obtain historical storage information from the database through interface calls; Obtaining an estimated growth data volume of the database within a preset management period according to the historical storage information; Generate a capacity expansion script based on the estimated growth data volume; Expanding the database using the expansion script; wherein the historical storage information includes a first data volume and a first historical data volume of a first category storage space, wherein the first data volume includes a data volume of the first category storage space at a first time point to be expanded, and the first historical data volume includes a data volume of the first category storage space at a second time point having a first time span with the first time point to be expanded, wherein the first time span is equal to the preset management period, wherein the first category storage space includes a common table space; The obtaining, according to the historical storage information, an estimated growth data volume of the database within a preset management period comprises: Obtaining a first storage threshold of the first category storage space; Obtaining an estimated growth data volume of the first category storage space within a preset management period according to the first storage threshold, the first data volume, and the first historical data volume; The obtaining, according to the first storage threshold, the first data volume, and the first historical data volume, of an estimated growth data volume of the first category storage space within a preset management period includes: generating a first difference value according to the first data amount and the first historical data amount; Obtaining an estimated growth amount of data in the first category storage space within a preset management period according to the first difference and the first storage threshold; Or, the historical storage information includes a first total amount of historical data of a second category storage space, wherein the first total amount of historical data includes a total amount of data of the second category storage space in a historical management period having a second time span with the preset management period; the second category storage space has an initial storage capacity, wherein the second category storage space includes a time series table space; The obtaining, according to the historical storage information, an estimated growth data volume of the database within a preset management period comprises: generating a second difference value according to the first total amount of historical data and the initial storage capacity; Using the second difference as the estimated growth data amount; Or, the historical storage information includes a second data volume and a second total amount of historical data of a third category storage space, wherein the second data volume includes the data volume of the third category storage space at a second time point to be expanded, and the second total amount of historical data includes the total amount of data of the third category storage space in a historical management period having a third time span with the second time point to be expanded, wherein the third category storage space includes a log table space; The obtaining, according to the historical storage information, an estimated growth data volume of the database within a preset management period comprises: generating an average data amount according to the second total amount of historical data and the third time span; generating a standard data capacity of the third category storage space according to the average data volume and a preset time threshold of the third category storage space; The estimated growth data volume is obtained according to the standard data capacity and the second rated data capacity of the third category storage space.

2. The method according to claim 1, characterized in that After obtaining the estimated growth data volume of the first category storage space within a preset management period, the method further includes: Obtaining a first rated capacity of the first category storage space; generating a maximum safe storage capacity according to the first rated capacity and the first storage threshold; Generate an estimated total amount of data according to the first amount of data and the estimated growth amount of data; When the estimated total amount of data is less than or equal to the maximum safe storage amount, a capacity expansion script is generated according to the estimated growth data amount.

3. The method according to claim 1, characterized in that The generating of the expansion script according to the estimated growth data volume includes: According to the estimated growth data volume, obtaining N data files, wherein the sum of the data volumes of the N data files is greater than or equal to the estimated growth data volume, and N is an integer; Obtain identification information of each of the N data files; The identification information is used as a script parameter to generate the capacity expansion script.

4. A database expansion device, characterized in that: include: The acquisition module is used to obtain the historical storage information of the database through interface calling; An estimation module, used to obtain an estimated growth data volume of the database within a preset management period according to the historical storage information; A generation module, used to generate a capacity expansion script according to the estimated growth data volume; as well as An expansion module, used to expand the database using the expansion script; wherein the historical storage information includes a first data volume and a first historical data volume of a first category storage space, wherein the first data volume includes a data volume of the first category storage space at a first time point to be expanded, and the first historical data volume includes a data volume of the first category storage space at a second time point having a first time span with the first time point to be expanded, wherein the first time span is equal to a preset management period, wherein the first category storage space includes a common table space; The estimation module includes a first acquisition unit and a generation unit; The first acquisition unit is used to acquire a first storage threshold of the first category storage space; The generating unit is configured to obtain an estimated growth data volume of the first category storage space within a preset management period according to the first storage threshold, the first data volume, and the first historical data volume; The generating unit comprises a first generating subunit, a second generating subunit and a third generating subunit; The first generating subunit is used to generate a first difference value according to the first data amount and the first historical data amount; The second generating subunit is used to generate a first ratio according to the first difference and the first storage threshold; The third generating subunit is used to obtain an estimated growth data volume of the first category storage space within a preset management period according to the first ratio and the first data volume; Or, the historical storage information includes a first total amount of historical data of a second category storage space, wherein the first total amount of historical data includes a total amount of data of the second category storage space in a historical management period having a second time span with the preset management period; the second category storage space has an initial storage capacity, wherein the second category storage space includes a time series table space; The estimation module comprises a first generating unit and a determining unit; The first generating unit is used to generate a second difference value according to the first total amount of historical data and the initial storage capacity; The determining unit is configured to use the second difference as the estimated growth data amount; Or, the historical storage information includes a second data volume and a second total amount of historical data of a third category storage space, wherein the second data volume includes the data volume of the third category storage space at a second time point to be expanded, and the second total amount of historical data includes the total amount of data of the third category storage space in a historical management period having a third time span with the second time point to be expanded, wherein the third category storage space includes a log table space; The estimation module includes a second generation unit, a third generation unit, and a second determination unit; The second generating unit is used to generate an average data amount according to the second total amount of historical data and the third time span; The third generating unit is used to generate a standard data capacity of the third category storage space according to the average data volume and a preset time threshold of the third category storage space; The second determining unit is used to obtain the estimated growth data volume according to the standard data capacity and the second rated data capacity of the third category storage space.

5. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors execute the method according to any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that: Executable instructions are stored thereon, and when the instructions are executed by a processor, the processor executes the method according to any one of claims 1 to 3.

7. A computer program product, characterized in that The method comprises a computer program, which implements the method according to any one of claims 1 to 3 when executed by a processor.

Citation Information

Patent Citations

  • A storage space expansion method and device

    CN109885567A