Database expansion method, device, electronic equipment and storage medium

By collecting and analyzing database information by calling the chain monitoring system, automatically judging and executing database capacity expansion, the problems of low database capacity expansion efficiency and waste of resources in the existing technology are solved, and efficient database performance improvement and resource conservation are achieved.

CN114443619BActive Publication Date: 2024-11-05CHINA TELECOM CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210102894.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-27
Publication Date
2024-11-05
Estimated Expiration
2042-01-27

AI Technical Summary

Technical Problem

The existing technology is inefficient and wastes resources when expanding database capacity, especially when there are too many database and data table resources allocation in the early stage of the business, resulting in waste of resources and manual creation of library tables.

Method used

By calling the chain monitoring system, collecting and analyzing the data link information of the database, determining whether to expand the database based on the preset thresholds of the data volume of the data table, the request response time and the number of concurrent requests, automatically generating capacity expansion requests and dividing databases and tables to achieve Automatic database expansion.

Benefits of technology

Improves the efficiency of database expansion, saves resources, improves database performance, and reduces the time and cost of manual operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114443619B_ABST
    Figure CN114443619B_ABST
Patent Text Reader

Abstract

The present disclosure provides a database expansion method, device, electronic device and storage medium. The database expansion method includes: obtaining data link information of a target database; parsing the data link information; determining whether to expand the target database according to the parsing result, wherein the parsing result includes at least one of the following: the amount of data in the data table in the target database, the request response time and the number of concurrent requests. The present disclosure monitors and analyzes the data in the target database. When any one or more of the amount of data in the data table in the target database, the request response time or the number of concurrent requests reaches a threshold, the call chain monitoring system server sends an expansion request to the database management module. The database management module completes the expansion of the target database based on the expansion request, thereby improving the efficiency of database expansion and improving the performance of the database.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] A database is a warehouse built on a computer storage device that organizes, stores, and manages data according to data structures. As the business continues to grow, the business data of the application system also accumulates over time. In the process of developing enterprise-level applications, the retrieval performance of a relational database will drop sharply when the amount of data exceeds a certain value. When it is necessary to operate on massive amounts of data, if all the data is stored in a data table, it will often exceed the storage threshold of the data table. In addition, when too many concurrent requests access the same database, the database response will also slow down.

[0003] In solving the above problems, the existing technology usually creates multiple databases and data tables when building a database, distributes concurrent requests to different databases and data tables, or manually creates new databases and data tables when the data volume and the number of concurrent requests exceed the threshold. However, in the early stage of business development, the amount of data and concurrent requests in the database are relatively small. If a large number of database and data table resources are allocated in the early stage, it will cause a waste of resources, and manually creating databases and data tables is time-consuming and labor-intensive.

[0004] Based on this, how to improve the efficiency of database expansion and save database and data table resources has become a technical problem that needs to be solved urgently.

[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0006] The present disclosure provides a database expansion method, device, electronic device and storage medium, which at least to a certain extent overcome the problem of low database expansion efficiency in the related art.

[0007] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0008] According to one aspect of the present disclosure, a method for expanding a database is provided, the method comprising: obtaining data link information of a target database; parsing the data link information; and determining whether to expand the target database based on a parsing result, wherein the parsing result includes at least one of the following: the amount of data in a data table in the target database, request response time, and the number of concurrent requests.

[0009] In one embodiment of the present disclosure, determining whether to expand the target database based on the analysis results includes: judging whether the amount of data in the data table in the target database exceeds a first preset threshold; if the amount of data in the data table exceeds the first preset threshold, expanding the target database.

[0010] In one embodiment of the present disclosure, the method further includes: if the data volume of the data table does not exceed the first preset threshold, determining whether the request response time exceeds a second preset threshold; if the request response time exceeds the second preset threshold, expanding the target database.

[0011] In one embodiment of the present disclosure, the method further includes: if the request response time does not exceed the second preset threshold, determining whether the number of concurrent requests exceeds a third preset threshold; if the number of concurrent requests exceeds the third preset threshold, expanding the capacity of the target database.

[0012] In one embodiment of the present disclosure, data link information of a target database is obtained, including: adding the following data fields to a SQL (structured query language) node of a monitoring message of a call chain monitoring system client: fields for a database name, a data table name, a data volume of a data table, a request start time, a response end time, and a number of concurrent requests; using the monitoring message to collect data of the target database; and summarizing the data collected by the monitoring message to obtain data link information, wherein the data link information includes the database name, the data table name, the data volume of a data table, the request start time, the response end time, and the number of concurrent requests of the target database.

[0013] In one embodiment of the present disclosure, the method further includes: when determining to expand the capacity of the target database, generating the expansion request according to the database name and the data table name; sending the expansion request to the database management module so that the database management module expands the target database according to the expansion request.

[0014] According to another aspect of the present disclosure, another database expansion method is provided, including: receiving an expansion request sent by a call chain monitoring system server, wherein the call chain monitoring system server obtains data link information of a target database, parses the data link information, and generates an expansion request when it is determined based on the analysis result that the target database is to be expanded, the analysis result including at least one of the following: the amount of data in a data table in the target database, request response time, and the number of concurrent requests; and expanding the target database based on the expansion request.

[0015] In one embodiment of the present disclosure, the target database is expanded based on the expansion request, including: obtaining the library and table sharding rules to be executed according to the database name and data table name contained in the expansion request; calling the corresponding new library and table script according to the database name, the data table name and the library and table sharding rules to be executed, wherein the new library and table script is used to shard the target database according to the library and table sharding rules to be executed; and executing the new library and table script.

[0016] According to another aspect of the present disclosure, a database expansion device is provided, including: a data link information acquisition module, used to acquire data link information of a target database; a data link information parsing module, used to parse the data link information; an expansion result determination module, used to determine whether to expand the target database according to the parsing result, wherein the parsing result includes at least one of the following: the amount of data in a data table in the target database, the request response time, and the number of concurrent requests.

[0017] In one embodiment of the present disclosure, the above-mentioned expansion result determination module is also used to determine whether the data volume of the data table in the target database exceeds a first preset threshold; if the data volume of the data table exceeds the first preset threshold, the target database is expanded.

[0018] In one embodiment of the present disclosure, the above-mentioned expansion result determination module is also used to determine whether the request response time exceeds the second preset threshold if the data volume of the data table does not exceed the first preset threshold; if the request response time exceeds the second preset threshold, the target database is expanded.

[0019] In one embodiment of the present disclosure, the above-mentioned expansion result determination module is also used to determine whether the number of concurrent requests exceeds a third preset threshold if the request response time does not exceed the second preset threshold; if the number of concurrent requests exceeds the third preset threshold, the target database is expanded.

[0020] In one embodiment of the present disclosure, the above-mentioned data link information acquisition module is also used to add the following data fields in the SQL node of the monitoring message of the call chain monitoring system client: fields for database name, data table name, data volume of the data table, request start time, response end time and number of concurrent requests; use the monitoring message to collect data of the target database; summarize the data collected by the monitoring message to obtain data link information, wherein the data link information includes the database name, data table name, data volume of the data table, request start time, response end time and number of concurrent requests of the target database.

[0021] In one embodiment of the present disclosure, the above-mentioned device also includes a request generation module, which is used to generate the expansion request according to the database name and the data table name when it is determined that the target database is to be expanded; and send the expansion request to the database management module so that the database management module expands the target database according to the expansion request.

[0022] According to another aspect of the present disclosure, another database expansion device is provided, including: an expansion request receiving module, used to receive an expansion request sent by a call chain monitoring system server, wherein the call chain monitoring system server obtains data link information of a target database, parses the data link information, and generates an expansion request when it is determined according to the analysis result that the target database is to be expanded, the analysis result includes at least one of the following: the amount of data in a data table in the target database, the request response time, and the number of concurrent requests; an expansion module, used to expand the target database based on the expansion request.

[0023] According to another aspect of the present disclosure, a database expansion system is also provided, which includes: a call chain monitoring system client, used to collect data link information of a target database and send the data link information to a call chain monitoring system server; a call chain monitoring system server, used to receive the data link information sent by the call chain monitoring system client, and parse the data link information; determine whether to expand the target database based on the parsing result, wherein the parsing result includes at least one of the following: the amount of data in the data table in the target database, the request response time and the number of concurrent requests; a database management module, used to expand the target database.

[0024] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any of the above-mentioned database expansion methods by executing the executable instructions.

[0025] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for expanding the database described in any one of the above is implemented.

[0026] The embodiments of the present disclosure provide a database expansion method, device, electronic device and storage medium. By collecting and parsing data link information in a target database, an expansion request is generated when any one of the data volume, request response time and concurrent request number of a data table in the target database meets a preset condition, and the expansion of the target database is completed based on the expansion request, thereby improving the expansion efficiency of the database and enhancing the performance of the database.

[0027] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0029] Figure 1 A flowchart of a method for expanding database capacity in an embodiment of the present disclosure is shown;

[0030] Figure 2 A flowchart showing another method for expanding the capacity of a database in an embodiment of the present disclosure is shown;

[0031] Figure 3 A flowchart showing another method for expanding the capacity of a database in an embodiment of the present disclosure is shown;

[0032] Figure 4 A flowchart showing another method for expanding the capacity of a database in an embodiment of the present disclosure is shown;

[0033] Figure 5 A flowchart showing another method for expanding the capacity of a database in an embodiment of the present disclosure is shown;

[0034] Figure 6 A flowchart showing another method for expanding the capacity of a database in an embodiment of the present disclosure is shown;

[0035] Figure 7 A flowchart showing another method for expanding database capacity in an embodiment of the present disclosure is shown;

[0036] Figure 8 A flowchart showing another method for expanding database capacity in an embodiment of the present disclosure is shown;

[0037] Fig. 9 A schematic diagram showing another database expansion method in an embodiment of the present disclosure;

[0038] Fig.10A schematic diagram showing another database expansion method in an embodiment of the present disclosure;

[0039] Fig.11 A schematic diagram showing another database expansion method in an embodiment of the present disclosure;

[0040] Fig.12 A schematic diagram showing the structure of a database expansion device in an embodiment of the present disclosure is shown;

[0041] Fig.13 A schematic diagram showing the structure of another database expansion device in an embodiment of the present disclosure is shown;

[0042] Fig.14 A schematic diagram showing the structure of a database expansion system according to an embodiment of the present disclosure is shown;

[0043] Fig.15 A structural block diagram of an electronic device in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0044] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0045] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0046] As mentioned in the background technology, the inventors found that the retrieval performance of a relational database will drop sharply when the amount of data exceeds a threshold; when there are too many concurrent requests, the response time of the database will also increase. The prior art usually adopts the following two methods to solve the above problems. One is to create multiple databases and data tables when building a database, and distribute concurrent requests to different databases and data tables. The second is to manually create a new library table when the amount of data or the number of concurrent requests exceeds the threshold.

[0047] Generally speaking, when a business is just launched, the amount of data and concurrent requests in the database are relatively small. As the business expands, the amount of data and concurrent requests will gradually increase. Therefore, if a large number of database and data table resources are allocated at the beginning, it will waste resources, and manually creating database tables will be time-consuming and labor-intensive.

[0048] The inventors also discovered that the existing call link monitoring system only monitors and displays the call relationship and performance between microservices, but does not monitor the database data volume, concurrency and other information, nor does it involve the database sub-library and table sub-table.

[0049] Based on this, the present invention utilizes the call chain monitoring system to collect database information of the database, analyzes the data, and automatically expands the database when certain parameters in the database information meet preset conditions, so as to improve the efficiency of automatic expansion of the database.

[0050] The present exemplary implementation is described in detail below with reference to the accompanying drawings and embodiments.

[0051] First, a method for expanding database capacity is provided in an embodiment of the present disclosure. The method can be executed by any electronic device with computing and processing capabilities.

[0052] Figure 1 A flow chart of a method for expanding database capacity in an embodiment of the present disclosure is shown as follows: Figure 1 As shown, the database expansion method provided in the embodiment of the present disclosure can be applied to but not limited to the call chain monitoring system server, including the following steps:

[0053] S102, obtaining data link information of the target database.

[0054] In this step, the target database can be a relational database, which is a warehouse that organizes, stores and manages data according to the data structure; the target database can be one or more databases. Data link information refers to the database information of the target database collected by the call chain monitoring system, which may include but is not limited to: the database name of the target database, the name of the data table, the amount of data in the data table, the request start time, the response end time and the number of concurrent requests, etc.

[0055] It should be noted that the call chain monitoring system is a system for obtaining and monitoring the call relationship between businesses and microservices, and generating call chain logs corresponding to the businesses. The present invention adds database information collection and analysis functions based on the existing functions of the call chain monitoring system. Specifically, the data link information of the target database can be collected through the client, the data link information sent by the client can be received through the server, and the data link information can be analyzed to complete the database information collection and analysis process.

[0056] The data link information in the above S102 can be collected directly or input from other devices. In one embodiment of the present disclosure, the data link information of the target database can be collected with the help of the call chain monitoring system client deployed at each node in the call chain monitoring system, wherein the call chain monitoring system client can collect the data link information by asynchronously sending monitoring messages, and the call chain monitoring system client sends the collected data link information to the call chain monitoring system server, and the call chain monitoring system server receives the data link information of the target database.

[0057] S104, parsing the data link information.

[0058] In this step, by parsing the data link information, it is determined whether certain data in the data link information meets the preset expansion conditions. In one embodiment of the present disclosure, the data link information can be parsed by the call chain monitoring system server to analyze whether the data in the target database exceeds the preset threshold. The data volume, request response time and number of concurrent requests of the data table in the target database can be analyzed, wherein the request response time can be calculated based on the request start time and the response end time. The call chain monitoring system server can determine whether the data in the target database meets the preset database expansion conditions based on the data contained in the data link information.

[0059] S106, determining whether to expand the target database according to the analysis result, wherein the analysis result includes at least one of the following: the amount of data in the data table of the target database, the request response time, and the number of concurrent requests.

[0060] In this step, based on the analysis result of the data link information in S104, it is determined whether to expand the target database. For example, when the amount of data in the data table in the target database reaches a preset condition, it is determined to expand the target database, or when the request response time reaches a preset condition, it is determined to expand the target database. It can also be determined to expand the target database when the number of concurrent requests reaches a preset condition.

[0061] From the above, it can be seen that the above-mentioned database expansion method provided in the embodiment of the present disclosure monitors and analyzes the data link information of the target database. In one embodiment of the present disclosure, when any one of the data volume, request response time and concurrent request number of the data table in the target database meets the preset conditions, the call chain monitoring system server sends an expansion request to the database management module, and the database management module completes the expansion of the target database based on the expansion request, realizes automatic database sub-library and table sub-division, improves the efficiency of database expansion and database performance, and saves database resources.

[0062] In one embodiment of the present disclosure, determining whether to expand the target database according to the analysis result may also include: Figure 2 The steps disclosed in Figure 2 The flowchart of another method for expanding the capacity of a database shown may specifically include:

[0063] S202, determining whether the amount of data in the data table in the target database exceeds a first preset threshold;

[0064] In this step, the first preset threshold is a preset threshold. In one embodiment of the present disclosure, the first preset threshold may also be the value of the maximum data volume of a single table in the data table of the target database multiplied by the first preset ratio. For example, if the maximum data volume of a single table in the data table is 1 million data items, and the first preset ratio is 90%, then the first preset threshold is 900,000 data items. Under this condition, it is determined whether the data volume of the data table in the target database exceeds 900,000 data items. The first preset ratio can be freely set according to the database expansion requirements, and is not specifically limited here.

[0065] S204: If the data volume of the data table exceeds a first preset threshold, the target database is expanded.

[0066] In this step, as mentioned above, when the first preset threshold is set to 900,000, it is determined whether the amount of data in the data table in the target database exceeds 900,000 data. If the amount of data in the data table exceeds 900,000 data, the target database needs to be expanded; if the amount of data in the data table does not exceed 900,000 data, the target database does not need to be expanded.

[0067] The present disclosure monitors the data volume of a data table in a target database, and when the data volume of the data table exceeds a first preset threshold, expands the target database, thereby improving the efficiency of automatic expansion of the database.

[0068] In one embodiment of the present disclosure, if the amount of data in the data table does not exceed the first preset threshold, it can continue to determine whether the request response time meets the condition, see Figure 3 The flowchart of another method for expanding the capacity of a database shown may specifically include:

[0069] S302, if the amount of data in the data table does not exceed the first preset threshold, determine whether the request response time exceeds the second preset threshold;

[0070] In this step, the second preset threshold is a preset threshold. In one embodiment of the present disclosure, the second preset threshold can also be the maximum response time of the target database processing request multiplied by the second preset ratio. For example, if the maximum response time of the target database processing request is 10 minutes and the second preset ratio is set to 90%, the second preset threshold is 9 minutes. Under this condition, if the data volume of the data table does not exceed the first preset threshold, it is continued to determine whether the request response time exceeds 9 minutes. Among them, the second preset ratio can be freely set according to the database expansion requirements, and is not specifically limited here.

[0071] S304: If the request response time exceeds a second preset threshold, the target database is expanded.

[0072] In this step, when the second preset threshold is set to 9 minutes as described above, it is determined whether the request response time exceeds 9 minutes. If the request response time exceeds 9 minutes, the target database needs to be expanded.

[0073] The present disclosure monitors the request response time in the target database, and expands the target database when the request response time exceeds a second preset threshold, thereby improving the efficiency of automatic database expansion.

[0074] In one embodiment of the present disclosure, after the above-mentioned determination that the request response time exceeds the second preset threshold, it can be further determined whether the number of concurrent requests meets the condition, see Figure 4 A flowchart of another disclosed method for expanding database capacity may specifically include:

[0075] S402, if the request response time does not exceed the second preset threshold, determine whether the number of concurrent requests exceeds the third preset threshold;

[0076] In this step, the third preset threshold is a preset threshold. In one embodiment of the present disclosure, the third preset threshold may also be the value of the maximum number of concurrent requests that the target database can support processing multiplied by the third preset ratio. For example, if the maximum number of concurrent requests that the target database can support processing is 50 and the third preset ratio is set to 80%, the third preset threshold is 40. Under this condition, if the request response time does not exceed the second preset threshold, it is necessary to continue to determine whether the number of concurrent requests exceeds 40. Among them, the third preset ratio can be freely set according to the database expansion requirements, and is not specifically limited here.

[0077] S404: If the number of concurrent requests exceeds a third preset threshold, the target database is expanded.

[0078] In this step, when the third preset threshold is set to 40 as described above, it is determined whether the number of concurrent requests exceeds 40. If the number of concurrent requests exceeds 40, the target database needs to be expanded.

[0079] The present disclosure monitors the number of concurrent requests in a target database, and when the number of concurrent requests exceeds a third preset threshold, expands the target database, thereby improving the efficiency of automatic expansion of the database.

[0080] In one embodiment of the present disclosure, the data link information of the target database can be obtained by referring to Figure 5 For the steps disclosed in Figure 5 The flowchart of another method for expanding the capacity of a database shown may specifically include:

[0081] S502, adding the following data fields to the SQL node of the monitoring message of the call chain monitoring system client: fields for database name, data table name, data volume of the data table, request start time, response end time and concurrent request quantity;

[0082] In this step, the data field is used to obtain the corresponding data in the target database, such as the database name field is used to obtain the database name of the target database; the data table name field is used to obtain the data table name of the target database; the data volume field of the data table is used to obtain the data volume of the data table in the target database; here, other fields can also be added according to actual needs to obtain other data of the target database, which will not be listed in detail here. You can add the request start time and response end time to the SQL node of the monitoring message, and add the library name, table name, method name, data volume and parallel request count calculation request to the Event and Metric fields of the node to obtain the database information of the target database.

[0083] S504, using monitoring messages to collect data from the target database;

[0084] In this step, the call chain monitoring system client can use asynchronous sending of monitoring messages to collect database information of the database.

[0085] S506, summarizing the data collected by the monitoring message to obtain data link information, wherein the data link information includes the database name of the target database, the data table name, the data volume of the data table, the request start time, the response end time and the number of concurrent requests.

[0086] In one embodiment of the present disclosure, it is determined whether to expand the target database according to the analysis result. If it is determined that the target database is to be expanded, it may also include Figure 6 For the steps disclosed in Figure 6The flowchart of another method for expanding the capacity of a database shown may specifically include:

[0087] S602, when it is determined that the target database needs to be expanded, generating an expansion request according to the database name and the data table name;

[0088] In this step, when the call chain monitoring system server determines to expand the target database based on the analysis result, it can generate an expansion request based on the database name and data table name of the target database in the data link information, and the expansion request is used to expand the target database.

[0089] S604: Send the capacity expansion request to the database management module, so that the database management module expands the target database according to the capacity expansion request.

[0090] In this step, the call chain monitoring system server sends the expansion request to the database management module. The database management module receives the expansion request, obtains the corresponding library and table sharding rules based on the database name and data table name contained in the expansion request, and then obtains the corresponding script based on the database name, data table name, and library and table sharding rules. The script is used to shard the target database according to the library and table sharding rules. Finally, the script is executed to complete the sharding of the target database.

[0091] When determining to expand the capacity of the target database, the present invention calls the chain monitoring system server to generate an expansion request based on the database name and data table name of the target database, and sends the expansion request to the database management module. The database management module obtains the corresponding library and table sharding rules and the script for executing the library and table sharding rules based on the expansion request, completes the expansion of the target database by running the script, realizes automatic library and table sharding of the database, and improves the efficiency of database expansion.

[0092] In one embodiment of the present disclosure, the present disclosure also provides another database expansion method, see Figure 7 The flowchart of another database expansion method shown may specifically include:

[0093] S702, receiving a capacity expansion request sent by a call chain monitoring system server, wherein the call chain monitoring system server obtains data link information of a target database, parses the data link information, and generates a capacity expansion request when it is determined according to the parsing result that the target database needs to be expanded, wherein the parsing result includes at least one of the following: the amount of data in a data table in the target database, request response time, and the number of concurrent requests;

[0094] S704: Expand the target database based on the expansion request.

[0095] In this step, the database management module receives the expansion request, obtains the corresponding library and table sharding rules according to the database name and data table name contained in the expansion request, and then obtains the corresponding script according to the database name, data table name, and library and table sharding rules. The script is used to shard the target database according to the library and table sharding rules. Finally, the script is executed to complete the sharding of the target database.

[0096] In one embodiment of the present disclosure, the above-mentioned expansion of the target database based on the expansion request can refer to Figure 8 For the steps disclosed in Figure 8 The flowchart of another database expansion method shown may specifically include:

[0097] S802, obtaining the database and table sharding rules to be executed according to the database name and data table name included in the capacity expansion request;

[0098] S804, calling the corresponding new database and table script according to the database name, the data table name and the database and table sharding rule to be executed, wherein the new database and table script is used to shard the target database according to the database and table sharding rule to be executed;

[0099] S806, execute the new library table script.

[0100] In one embodiment of the present disclosure, the present disclosure also provides another database expansion method, see Fig. 9 FIG. 1 is a schematic diagram of another method for expanding database capacity, the method comprising:

[0101] The call chain monitoring system client collects data from multiple applications by asynchronously sending monitoring messages to obtain collected data link information, wherein the multiple applications include application A, application B, and application C, and application A, application B, or application C are various microservices;

[0102] The call chain monitoring system client sends the collected data link information to the call chain monitoring system server, which parses the data link information to obtain the parsing result and determines whether to expand the database based on the parsing result;

[0103] When it is determined to expand the database, the call chain monitoring system server generates an expansion request and sends the expansion request to the database management module to notify the database management module to expand the database. The database management module expands the database based on the expansion request, thereby completing the automatic expansion of the database.

[0104] Another database expansion method disclosed in the present invention solves the same technical problem as the above-mentioned database expansion method, and similarly, achieves the same technical effect, which will not be described in detail here.

[0105] In one embodiment of the present disclosure, reference may be made to Fig.10 Build monitoring messages and use them to collect database information. Fig.10 The schematic diagram of another database expansion method shown in the figure can create a message tree, create a call node, add an SQL node, and add a Cache node after the thread starts to complete the construction of the message, wherein the database name, data table name, method name, data volume, Metric and other fields can be added to the SQL node. After the message construction is completed, the database information collected by monitoring the message is obtained and sent to the server for parsing.

[0106] In one embodiment of the present disclosure, reference may be made to Fig.11 The collected data link information is analyzed in the manner shown in FIG. Fig.11 The schematic diagram of another database expansion method shown may include the following steps:

[0107] S1101: calling the chain monitoring system server to obtain monitoring messages, and obtaining data link information from the monitoring messages;

[0108] S1102: Determine whether the request method in the data link information is newly added, if so, execute S1103, otherwise, execute S1104;

[0109] S1103: Determine whether the amount of data in the data table is greater than a first threshold, if so, execute step S1108, otherwise, execute S1104;

[0110] S1104: Calculate the request response time and continue to execute S1105;

[0111] S1105: Determine whether the request response time is greater than a second threshold, if so, execute S1108, otherwise, execute S1106;

[0112] S1106: Calculate the number of concurrent requests and continue to execute S1107;

[0113] S1107: Determine whether the number of concurrent requests is greater than a third threshold, if so, execute S1108;

[0114] S1108: Send the database name and data table name to the database management module, and notify the database management module to expand the capacity.

[0115] Based on the same inventive concept, the present disclosure also provides a database expansion device, such as the following embodiment. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.

[0116] Fig.12 A schematic diagram of a database expansion device in an embodiment of the present disclosure is shown. Fig.12 As shown, the device comprises:

[0117] The data link information acquisition module 1210 is used to acquire the data link information of the target database;

[0118] The data link information parsing module 1220 is used to parse the data link information;

[0119] The expansion result determination module 1230 is used to determine whether to expand the target database according to the analysis result, wherein the analysis result includes at least one of the following: the data volume of the data table in the target database, the request response time and the number of concurrent requests.

[0120] In one embodiment of the present disclosure, the above-mentioned expansion result determination module 1230 is also used to determine whether the data volume of the data table in the target database exceeds the first preset threshold; if the data volume of the data table exceeds the first preset threshold, the target database is expanded.

[0121] In one embodiment of the present disclosure, the above-mentioned expansion result determination module 1230 is also used to determine whether the request response time exceeds the second preset threshold if the data volume of the data table does not exceed the first preset threshold; if the request response time exceeds the second preset threshold, the target database is expanded.

[0122] In one embodiment of the present disclosure, the above-mentioned expansion result determination module 1230 is also used to determine whether the number of concurrent requests exceeds a third preset threshold if the request response time does not exceed the second preset threshold; if the number of concurrent requests exceeds the third preset threshold, the target database is expanded.

[0123] In one embodiment of the present disclosure, the above-mentioned data link information acquisition module 1210 is also used to add the following data fields in the SQL node of the monitoring message of the call chain monitoring system client: fields for database name, data table name, data volume of the data table, request start time, response end time and number of concurrent requests; use monitoring messages to collect data of the target database; summarize the data collected by the monitoring messages to obtain data link information, wherein the data link information includes the database name, data table name, data volume of the data table, request start time, response end time and number of concurrent requests of the target database.

[0124] In one embodiment of the present disclosure, the above-mentioned device also includes a request generation module, which is used to generate an expansion request according to the database name and the data table name when it is determined that the target database is to be expanded; and send the expansion request to the database management module so that the database management module expands the target database according to the expansion request.

[0125] Fig.13 A schematic diagram of another database expansion device in an embodiment of the present disclosure is shown. Fig.13 As shown, the device comprises:

[0126] The capacity expansion request receiving module 1310 is used to receive the capacity expansion request sent by the call chain monitoring system server, wherein the call chain monitoring system server obtains the data link information of the target database, parses the data link information, and generates the capacity expansion request when it is determined to expand the target database according to the parsing result, and the parsing result includes at least one of the following: the data volume of the data table in the target database, the request response time and the number of concurrent requests;

[0127] The capacity expansion module 1320 is used to expand the target database based on the capacity expansion request.

[0128] Based on the same inventive concept, the present disclosure also provides a database expansion system, such as the following embodiment. Since the principle of solving the problem in the system embodiment is similar to that in the above method embodiment, the implementation of the system embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.

[0129] Fig.14 A schematic diagram of a database expansion system in an embodiment of the present disclosure is shown. Fig.14 As shown, the system includes:

[0130] The call chain monitoring system client 1410 is used to collect data link information of the target database and send the data link information to the call chain monitoring system server 1420;

[0131] The call chain monitoring system server 1420 is used to receive the data link information sent by the call chain monitoring system client 1410, parse the data link information; determine whether to expand the target database according to the parsing result, wherein the parsing result includes at least one of the following: the amount of data in the data table in the target database, the request response time, and the number of concurrent requests;

[0132] The database management module 1430 is used to expand the capacity of the target database.

[0133] The call chain monitoring system server 1420 is also used to generate an expansion request based on the database name and data table name when it is determined that the target database needs to be expanded; and send the expansion request to the database management module so that the database management module expands the target database according to the expansion request.

[0134] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".

[0135] Refer to the following Fig.15 15 to describe the electronic device 1500 according to this embodiment of the present disclosure. Fig.15 The electronic device 1500 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0136] like Fig.15 As shown, the electronic device 1500 is in the form of a general computing device. The components of the electronic device 1500 may include but are not limited to: at least one processing unit 1510, at least one storage unit 1520, and a bus 1530 connecting different system components (including the storage unit 1520 and the processing unit 1510).

[0137] The storage unit stores a program code, and the program code can be executed by the processing unit 1510, so that the processing unit 1510 executes the steps described in the "Exemplary Method" section of this specification according to various exemplary embodiments of the present disclosure. For example, the processing unit 1510 can execute the following steps of the above method embodiment: obtaining data link information of the target database; parsing the data link information; determining whether to expand the target database according to the parsing result, wherein the parsing result includes at least one of the following: the amount of data in the data table of the target database, the request response time, and the number of concurrent requests.

[0138] The storage unit 1520 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 15201 and / or a cache storage unit 15202 , and may further include a read-only storage unit (ROM) 15203 .

[0139] The storage unit 1520 may also include a program / utility 15204 having a set (at least one) of program modules 15205, such program modules 15205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0140] Bus 1530 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0141] The electronic device 1500 may also communicate with one or more external devices 1540 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1500, and / or communicate with any device that enables the electronic device 1500 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1550. Furthermore, the electronic device 1500 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 1560. As shown, the network adapter 1560 communicates with other modules of the electronic device 1500 via a bus 1530. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0142] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0143] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. A program product capable of implementing the above method of the present disclosure is stored thereon. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above “Exemplary Method” section of this specification.

[0144] More specific examples of computer-readable storage media in the present disclosure may include, but are not limited to, an electrical connection having one or more conductors, 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), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0145] In the present disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0146] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0147] In a specific implementation, the program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may 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 may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).

[0148] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0149] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0150] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0151] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.

Claims

1. A database expansion method, It is characterized in that include: Obtain data link information of the target database; parsing the data link information; Determine whether to expand the target database according to the analysis result, wherein the analysis result includes at least one of the following: the amount of data in the data table of the target database, the request response time, and the number of concurrent requests; Among them, obtaining the data link information of the target database includes: using the structured query language SQL node of the monitoring message of the call chain monitoring system client to query the data field of the data; using the monitoring message to collect the data of the target database; and summarizing the data collected by the monitoring message to obtain the data link information.

2. The database expansion method according to claim 1, It is characterized in that Determining whether to expand the target database according to the analysis result includes: Determine whether the amount of data in the data table in the target database exceeds a first preset threshold; If the data volume of the data table exceeds the first preset threshold, the target database is expanded.

3. The database expansion method according to claim 2, It is characterized in that The method further comprises: If the amount of data in the data table does not exceed the first preset threshold, determining whether the request response time exceeds a second preset threshold; If the request response time exceeds the second preset threshold, the target database is expanded.

4. The database expansion method according to claim 3, It is characterized in that The method further comprises: If the request response time does not exceed the second preset threshold, determining whether the number of concurrent requests exceeds a third preset threshold; If the number of concurrent requests exceeds a third preset threshold, the target database is expanded.

5. The database expansion method according to claim 1, It is characterized in that Obtain data link information of the target database, including: The data fields include: database name, data table name, data volume of the data table, request start time, response end time and concurrent request quantity fields; The data link information includes the database name, data table name, data volume of the data table, request start time, response end time and concurrent request quantity of the target database.

6. The method for expanding database capacity according to claim 5, It is characterized in that The method further comprises: In the case of determining to expand the capacity of the target database, generating an expansion request according to the database name and the data table name; The capacity expansion request is sent to a database management module, so that the database management module expands the target database according to the capacity expansion request.

7. A method for expanding database capacity. It is characterized in that include: Receiving a capacity expansion request sent by a call chain monitoring system server, wherein the call chain monitoring system server obtains data link information of a target database, parses the data link information, and generates a capacity expansion request when it is determined according to the parsing result that the target database is to be expanded, wherein the parsing result includes at least one of the following: the amount of data in a data table in the target database, request response time, and the number of concurrent requests; Expanding the target database based on the expansion request; Among them, the call chain monitoring system server obtains data link information of the target database, including: data fields used to query data in the structured query language SQL node of the monitoring message of the call chain monitoring system client; using the monitoring message to collect data of the target database; summarizing the data collected by the monitoring message to obtain data link information.

8. The method for expanding database capacity according to claim 7, It is characterized in that Expanding the target database based on the expansion request includes: According to the database name and data table name included in the expansion request, obtain the database and table sharding rules to be executed; According to the database name, the data table name and the database and table sharding rules to be executed, the corresponding new database and table script is called, wherein the new database and table script is used to shard the target database according to the database and table sharding rules to be executed; Execute the new library table script.

9. A database expansion device, It is characterized in that include: A data link information acquisition module, used to acquire data link information of a target database; A data link information parsing module, used for parsing the data link information; An expansion result determination module, used to determine whether to expand the target database according to the analysis result, wherein the analysis result includes at least one of the following: the amount of data in the data table of the target database, the request response time and the number of concurrent requests; Among them, the data link information acquisition module is also used to query the data field of data in the structured query language SQL node of the monitoring message of the call chain monitoring system client; use the monitoring message to collect data from the target database; summarize the data collected by the monitoring message to obtain data link information.

10. A database expansion device, It is characterized in that include: The capacity expansion request receiving module is used to receive the capacity expansion request sent by the call chain monitoring system server, wherein the call chain monitoring system server obtains data link information of the target database, parses the data link information, and generates a capacity expansion request when it is determined to expand the target database according to the parsing result, and the parsing result includes at least one of the following: the data volume of the data table in the target database, the request response time and the number of concurrent requests; An expansion module, used to expand the target database based on the expansion request; Among them, the expansion request receiving module is also used to query the data field of data in the structured query language SQL node of the monitoring message of the call chain monitoring system client; use the monitoring message to collect data from the target database; summarize the data collected by the monitoring message to obtain data link information.

11. A database expansion system, It is characterized in that include: The call chain monitoring system client is used to collect data link information of the target database and send the data link information to the call chain monitoring system server; The call chain monitoring system server is used to receive the data link information sent by the call chain monitoring system client, parse the data link information; determine whether to expand the target database according to the parsing result, wherein the parsing result includes at least one of the following: the data volume of the data table in the target database, the request response time and the number of concurrent requests; A database management module, used for expanding the capacity of the target database; Among them, the call chain monitoring system client is also used to query the data field of data in the structured query language SQL node of the monitoring message of the call chain monitoring system client; use the monitoring message to collect data from the target database; summarize the data collected by the monitoring message to obtain data link information.

12. An electronic device, It is characterized in that include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the database expansion method according to any one of claims 1 to 8 by executing the executable instructions.

13. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the database expansion method described in any one of claims 1 to 8 is implemented.