A method, apparatus, and related product for adjusting a database

By identifying and analyzing application access behavior information, the database's data indexes and preprocessing rules are automatically adjusted, solving the database efficiency problem in different application scenarios and achieving more efficient data processing.

CN117093563BActive Publication Date: 2026-01-06ZHEJIANG LANZHUO IND INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310839222.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-07
Publication Date
2026-01-06
Estimated Expiration
2043-07-07

AI Technical Summary

Technical Problem

In existing technologies, the data processing efficiency of databases remains low when the actual application scenario does not match the preset application scenario, and cannot be effectively improved.

Method used

By identifying access behavior information corresponding to multiple data usage request commands initiated by the application, preset adjustment rules are determined based on the access behavior information, and the database's data index information and preprocessing rules are automatically adjusted, including data de-frequencying and hot/cold data separation, to improve the database's operating efficiency.

Benefits of technology

When application scenarios change, the database's data indexes and preprocessing are automatically adjusted, improving the database's data processing efficiency, reducing the number of records used in the final application, and without relying on manual intervention or application scenario limitations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117093563B_ABST
    Figure CN117093563B_ABST
Patent Text Reader

Abstract

The application provides a method, device and related product for adjusting a database. The method comprises: in response to a plurality of data usage request instructions continuously initiated by an application end, identifying a plurality of access behavior information corresponding to the plurality of data usage request instructions. When a plurality of single response times in the plurality of access behavior information continuously increase, determining a preset adjustment rule according to the plurality of access behavior information. Adjusting the database according to the determined preset adjustment rule. In this way, the continuously increasing plurality of single response times in the plurality of access behavior information indicates that the database processing data efficiency is declining. When the database processing data efficiency is declining, the preset adjustment rule is determined through the plurality of access behavior information, and the database is automatically adjusted according to the preset adjustment rule, thereby improving the data processing efficiency of the database. No manual intervention is required, and the adjustment process is not limited by the application scenario.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of database technology, and in particular to a method, apparatus and related products for adjusting a database. Background Technology

[0002] A database is a repository for storing data according to a fixed data structure. When a user initiates a data usage request command corresponding to an application scenario on the application side, the database receives the data usage request command, retrieves the data information from the database according to the data usage request command, and sends the data information to the application side for user use. Improving the data processing efficiency of databases has become a key focus.

[0003] Existing solutions aim to improve database data processing efficiency by pre-setting data index information on the application side. This data index is created according to preset rules when records are entered into the database. During retrieval, the corresponding data information is directly retrieved from the database using this index. However, in practice, this approach relies on a pre-set indexing process tailored to a specific application scenario. When the actual application scenario differs from the pre-set scenario, the database's data processing efficiency remains relatively low.

[0004] Therefore, how to improve the data processing efficiency of databases and make the data processing efficiency not limited by application scenarios has become an urgent technical problem to be solved. Summary of the Invention

[0005] In view of this, this application provides a method, apparatus and related products for adjusting a database, which aims to automatically adjust the database performance according to the application scenario, so as to improve the data processing efficiency of the database and make the data processing efficiency of the database not limited by the application scenario.

[0006] Firstly, a method for adjusting a database, characterized in that the method includes:

[0007] In response to multiple data usage request instructions continuously initiated by the application, identify multiple access behavior information corresponding to the multiple data application requests;

[0008] When multiple single response times among the multiple access behavior information continue to increase, a preset adjustment rule is determined based on the multiple access behavior information; the preset adjustment rule includes at least one of the following: an index creation rule for adjusting data index information, or a preprocessing rule for preprocessing data in the database;

[0009] The database is adjusted according to the preset adjustment rules to improve its operating efficiency.

[0010] Optionally, the access behavior information may also include the data record size and the number of records affected in a single instance;

[0011] The step of determining preset adjustment rules based on multiple access behavior information includes:

[0012] Based on the data record size and single response time of each of the multiple access behavior information, a first continuous trend of change of the data record size and single response time of the multiple access behavior information is determined;

[0013] When the first continuous change trend is a continuous synchronous increase, a preset adjustment rule is determined based on the single impact record of each of the multiple access behavior information.

[0014] Optionally, determining the preset adjustment rule based on the single impact record quantity of each of the multiple access behavior information includes:

[0015] Based on the single impact record quantity and single response time of each of the multiple access behavior information, a second continuous trend of change of the single impact record quantity and single response time of the multiple access behavior information is determined;

[0016] When the second continuous change trend is a continuous synchronous growth, the preset adjustment rule is determined to be the preprocessing rule;

[0017] The step of adjusting the database according to the preset adjustment rules includes:

[0018] The data in the database is preprocessed according to the preprocessing rules.

[0019] Optionally, preprocessing the data in the database according to the preprocessing rules includes:

[0020] When the preprocessing rule is a data down-frequency rule, the data in the database is down-frequency processed; and / or when the preprocessing rule is a hot-cold separation rule, the data in the database is separated into hot and cold data; the hot-cold separation means storing the data in the database in different locations according to the usage frequency and modification frequency.

[0021] Optionally, the second continuous trend of the single impact record quantity and the single response time in the multiple access behavior information is determined based on the single impact record quantity and the single response time of each access information in the multiple access behavior information.

[0022] Determine a first ratio of the single impact record quantity to the single response time for each of the multiple access behavior information;

[0023] Determine a second continuous rate of change for multiple first ratios among multiple access behavior information;

[0024] When the second continuous rate of change is within a first preset range, the second continuous trend of change of the single impact record quantity and the single response time in the multiple access behavior information is determined to be a continuous synchronous increase.

[0025] Optionally, the access behavior information further includes access data field information, and the step of determining the preset adjustment rule based on the single impact record volume of each access behavior information among the multiple access behavior information further includes:

[0026] Based on the single impact record quantity of each of the multiple access behavior information, a third continuous change rate of the single impact record quantity is determined;

[0027] When the third continuous change rate is within the second preset change range, and the access data field information of each of the multiple access behavior information does not match the data index information, the preset adjustment rule is determined to be the index creation rule;

[0028] The step of adjusting the database according to the preset adjustment rules includes:

[0029] Adjust the data index information of the database according to the index creation rules.

[0030] Optionally, determining the first continuous trend of the data record size and single response time among the multiple access behavior information based on the data record size and single response time of each access behavior information includes:

[0031] Determine a second ratio between the data record size and the single response time for each of the multiple access behavior information;

[0032] Determine a first continuous rate of change of multiple second ratios among multiple access behavior information;

[0033] When the first continuous rate of change is within a third preset range, the first continuous trend of change of the data record size and the single response time in the multiple access behavior information is determined to be a continuous synchronous growth.

[0034] Secondly, this application provides an apparatus for adjusting a database, characterized in that the method includes:

[0035] The identification unit is used to identify multiple access behavior information corresponding to the multiple data application requests in response to multiple data usage request instructions continuously initiated by the application terminal.

[0036] The rule determination unit is used to determine a preset adjustment rule based on the multiple access behavior information when the single response time of multiple access behavior information continues to increase; the preset adjustment rule includes at least one of the following: an index creation rule for adjusting the data index, or a preprocessing rule for preprocessing the data in the database.

[0037] The adjustment unit is used to adjust the database according to the preset adjustment rules in order to improve the operating efficiency of the database.

[0038] Thirdly, embodiments of this application provide an electronic device. The device includes a memory and a processor.

[0039] The memory is used to store program code and transfer program code to the processor.

[0040] Processor: Used to execute the method steps for adjusting the database as described in any of the first aspects, according to instructions in the program code.

[0041] Fourthly, embodiments of this application provide a computer-readable storage medium storing code that, when executed by a processor, implements the steps of the method for adjusting a database as described in any of the first aspects.

[0042] This application provides a method, apparatus, and related products for adjusting a database. When executing the method, in response to multiple data usage request commands continuously initiated by an application, multiple access behavior information corresponding to the multiple data usage request commands is identified. When multiple single response times among the multiple access behavior information continuously increase, a preset adjustment rule is determined based on the multiple access behavior information. The data index information and preprocessed data of the database are adjusted according to the determined preset adjustment rule. Thus, when the application scenario changes, the continuous increase in multiple single response times among the multiple access behavior information indicates a decrease in database data processing efficiency. When the database data processing efficiency decreases, the preset adjustment rule is determined through the multiple access behavior information, and the data index information and preprocessed data of the database are automatically adjusted according to the preset adjustment rule. That is, without manual intervention, and the adjustment process is not dependent on application scenario limitations, the database data processing efficiency can be improved in terms of retrieval efficiency or reducing the final number of records used. Attached Figure Description

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

[0044] Figure 1 A flowchart illustrating a method for adjusting a database, as provided in an embodiment of this application;

[0045] Figure 2 A flowchart illustrating a method for determining preset adjustment rules provided in this application embodiment;

[0046] Figure 3 This is a schematic diagram of a device 300 for adjusting a database, provided in an embodiment of this application. Detailed Implementation

[0047] The terms “first,” “second,” “third,” and “fourth,” etc., used in this application specification, claims, and drawings are used to distinguish different objects, not to limit a specific order.

[0048] In the embodiments of this application, the terms "as an example" or "for example" are used to indicate that they are examples, illustrations, or explanations. Any embodiment or design that is described as "as an example" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design options. Specifically, the use of terms such as "as an example" or "for example" is intended to present the relevant concepts in a specific manner.

[0049] The terminology used in the implementation section of this application is for the purpose of explaining specific embodiments of this application only, and is not intended to limit this application.

[0050] To enable those skilled in the art to better understand the embodiments of this application, the technical terms involved in the embodiments of this application will first be explained.

[0051] Application side: The initiator of data usage request instructions. For the database that provides the data, the application side is the initiator of data requests and the user of responding data, and it initiates data usage request instructions as needed.

[0052] Database: Responsible for responding to data usage request commands initiated by the application, retrieving the data corresponding to the data usage request command, and outputting it to the application.

[0053] Data index information: Information used to identify search criteria and data correspondence.

[0054] Currently, data index information is pre-set on the application side, and the data index information is created according to preset rules when data is completely entered into the database. During retrieval, the data information corresponding to the data index information is directly retrieved from the database and sent to the application side for use.

[0055] However, in practical use, the preset process of data indexing information corresponds to the preset application scenario. When the actual application scenario does not correspond to the preset application scenario, the data processing efficiency of the database is still relatively low.

[0056] Based on this, this application provides a method for adjusting a database. The method aims to identify a decrease in database processing efficiency by utilizing the continuous increase in single response times across multiple access behavior data when the application scenario changes. When the database processing efficiency decreases, a preset adjustment rule is determined based on multiple access behavior data, and the database's data index information and preprocessing are automatically adjusted according to this rule. This eliminates the need for manual intervention, and the adjustment process is independent of application scenario limitations, thereby improving database processing efficiency in terms of retrieval efficiency or reducing the number of records ultimately used.

[0057] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0058] See Figure 1 This is a flowchart illustrating a method for adjusting a database according to an embodiment of this application. The method can be executed by a terminal device, a server, or both. The following description uses a terminal device as the executing entity. The method includes at least the following steps:

[0059] S101: The application continuously initiates multiple data usage request commands.

[0060] When data needs to be retrieved from the database, the application first generates a data usage request command corresponding to the application scenario, and continuously sends multiple data usage request commands to the database. Each data usage request command carries data index information, which allows the corresponding data to be retrieved from the database.

[0061] S102: Database identification and multiple access behavior information corresponding to multiple data usage request instructions.

[0062] The database receives multiple data usage request commands continuously initiated by the application. It first identifies multiple access behavior information corresponding to these requests to determine if database performance has decreased. Access behavior information refers to information related to the application's database access, including: the accessed data table, accessed data field information, data record size, single response time, and the number of records affected per access.

[0063] In this context, single response time refers to the time required to complete a single data retrieval from the database. A longer single response time indicates that the database takes a longer time to complete a single data retrieval. Therefore, changes in single response time can indicate the database's data processing efficiency.

[0064] The data record size refers to the total number of data records that need to be traversed in a single database access. For example, if the data record size for this database access is 100,000 records, it means that 100,000 data records need to be traversed. Changes in the data record size indicate changes in the amount of data that needs to be traversed in a single database access. If the single response time and data record size continuously increase in tandem, it indicates a decrease in database operating efficiency.

[0065] The number of records affected per access refers to the total number of data records retrieved in a single database access. If the single response time and the size of the data records continuously increase in tandem, but the number of records affected per access remains unchanged, or the change is less than a preset threshold, it indicates a low hit rate for data index information and low data retrieval efficiency. For example, in this database access, the single response time increased from 10ms to 12ms, and the size of the data records increased from 100,000 to 120,000. This means the single response time and the size of the data records increased in tandem, but the number of records affected per access remained the same at 10. Previously, it took 10ms to retrieve 10 records from 100,000; now it takes 12ms to retrieve 10 records from 120,000. Clearly, the data retrieval efficiency is lower.

[0066] If the single response time, data record size, and number of records affected per access all increase synchronously, it means that while data retrieval efficiency remains unchanged, the increased data volume leads to lower database operating efficiency. For example, in this database access, the single response time increased from 10ms to 12ms, and the data record size increased from 100,000 to 120,000. This means the single response time and data record size increased synchronously, but the number of records affected per access increased from 10 to 12. Previously, it took 10ms to find 10 records out of 100,000 (meaning 1ms to iterate through 10,000 records and find 1 record). Now, it takes 12ms to find 12 records out of 120,000 (meaning 1ms to iterate through 10,000 records and find 1 record). In other words, while data retrieval efficiency remains the same, the larger data volume still impacts database operating efficiency.

[0067] This application embodiment uses multiple access behavior information to determine whether data processing efficiency has decreased, and determines adjustment rules based on specific impact relationships to automatically adjust the database.

[0068] S103: Determine whether the single response time of multiple access behavior information continues to increase. If yes, execute S104; otherwise, execute S106.

[0069] To improve database operating efficiency, this application first uses the changing trends of multiple single response times to preliminarily determine whether the database operating efficiency has decreased. If it has decreased, database adjustments are required. Otherwise, no adjustments are made.

[0070] In the embodiments of this application, it can be determined in various ways whether multiple single response times are continuously increasing. In one possible implementation, multiple single response times are curve-fitted; if the fitted curve shows a continuous upward trend, it indicates that the multiple single response times are continuously increasing. Furthermore, other methods can also be used for determination; this application does not limit whether specific multiple single response times are continuously increasing.

[0071] S104: Determine the preset adjustment rules based on multiple access behavior information.

[0072] When multiple single response times continue to increase, preset adjustment rules are determined based on multiple access behavior information. These preset adjustment rules include index creation rules for adjusting data index information, or preprocessing rules for preprocessing data in the database.

[0073] The preprocessing rules can be one or both of the following: data down-frequency rules, or hot / cold data separation rules. Down-frequency processing involves converting fine-grained data records in the database into coarse-grained data records. Fine-grained and coarse-grained data are relative concepts; fine-grained data refers to data with more detailed subdivisions, while coarse-grained data refers to data with less detailed subdivisions compared to fine-grained data.

[0074] The hot / cold data separation rule is used to separate data in the database into hot and cold data. Hot / cold data separation means placing data in different locations based on usage frequency and modification frequency. Specifically, data with a modification frequency higher than a first preset threshold and a usage frequency higher than a second preset threshold is stored in the hot database, while other data is placed in the cold database. Accessing data in the database only requires retrieving data from the hot database, reducing the amount of data that needs to be traversed.

[0075] In this embodiment of the application, the preset adjustment rule can be determined as the index creation rule based on the data record size in multiple access behavior information. For example, if the data record size increases and the rate of change per unit time is within a preset change threshold range (e.g., a preset change threshold range [-1,1]), the preset adjustment rule is determined as the preprocessing rule. Otherwise, the preset adjustment rule is determined as the preprocessing rule.

[0076] To further determine the reasons for the decline in database operating efficiency, this application may use a comprehensive approach, considering data record size, single response time, and the number of records affected per instance, to determine preset adjustment rules. See below for details on the determination method. Figure 2 This will not be discussed further here.

[0077] S105: Adjust the database according to the preset adjustment rules.

[0078] In this embodiment, the database can be adjusted using preset adjustment rules. Specifically: when the preset adjustment rule is a preprocessing rule, the database data is preprocessed according to the preprocessing rule. When the preset adjustment rule is an index creation rule, the database data index information is automatically updated according to the preset index creation rule. That is, the database is adjusted using preset adjustment rules to improve database operating efficiency.

[0079] Among them, preprocessing rules refer to the rules for preprocessing data in the database, which specifically include reducing the number of records used for data processing, or updating data index information to better establish the relationship between data index information and the database.

[0080] In one possible implementation, when the preprocessing rule is a data reduction rule, fine-grained data records are converted into coarse-grained data records. This means that the original data might be fine-grained records of type A, B, C, D, E, F, G. The records of type ABC are converted into type M records, and the records of type DEFG are converted into type N records. During data processing, only these types of data are processed to reduce the number of records used.

[0081] When the preprocessing rule is a hot and cold separation rule, the data records are placed in the hot storage and cold storage according to the frequency of use and modification, and only the data records in the cold storage are processed, thereby reducing the amount of records used in the end.

[0082] In one possible implementation, the preprocessing rules include both data down-frequency rules and hot / cold separation rules. Specifically, the hot / cold separation rules are first used to divide the data records into hot and cold storage. For the data records in the hot storage, the data down-frequency rules are then used to convert the fine-grained data records into coarse-grained data records, thereby reducing the amount of records used in the end.

[0083] S106: Do not adjust the database.

[0084] In this embodiment of the application, when the single response time of multiple access behavior information does not increase continuously, such as remaining basically unchanged, or only increasing at certain points, it indicates that the database operating efficiency has not decreased, and no adjustment to the database is required.

[0085] This application provides a method for adjusting a database. First, in response to multiple data usage request commands continuously initiated by the application, multiple access behavior information corresponding to these requests is identified. When the single response time of multiple access behavior commands continuously increases, a preset adjustment rule is determined based on this information. The database's data index information and preprocessed data are then adjusted according to this preset adjustment rule. Thus, when the application scenario changes, the continuous increase in the single response time of multiple access behavior commands indicates a decrease in database data processing efficiency. When database data processing efficiency decreases, the preset adjustment rule is determined based on the multiple access behavior commands, and the database's data index information and preprocessed data are automatically adjusted according to this rule. This method improves database data processing efficiency by reducing retrieval efficiency or decreasing the number of records ultimately used, without requiring manual intervention and without being dependent on application scenario limitations.

[0086] See Figure 2 The following is a flowchart illustrating a method for determining preset adjustment rules, provided in an embodiment of this application. The method includes:

[0087] S201: Determine the first persistent trend in the size of multiple data records and the duration of multiple single responses in a series of access behavior information.

[0088] In the embodiments of this application, a first continuous trend of change of multiple data recording rules and multiple single response times can be determined through various implementations.

[0089] In one possible implementation, the first sustained trend can be determined through curve fitting. Specifically, this involves determining whether the curves for multiple consecutive data recording rules and multiple consecutive single response times both show a continuous increase over time with almost identical upward trends. If the curves show a continuous increase over time with almost identical upward trends, it indicates that the first sustained trend is a continuous synchronous growth.

[0090] In one possible implementation, the rate of change can be determined in the following way:

[0091] S2011: Determine a second ratio between the size of each data record and the single response time;

[0092] The second ratio v is:

[0093]

[0094] Where R represents the size of the data records, and C t represents the single response time, and v represents the second ratio of the data record size to the single response time.

[0095] S2012: Determine whether the rate of change of the second ratio is within the third preset range.

[0096] Determine if the rate of change of the second ratio falls within the third preset range, that is, determine:

[0097]

[0098] Is it true? If yes, it means it belongs to the third preset range of changes; otherwise, it does not belong to the third preset range of changes. Where, [-a d a d [] indicates the third preset range of variation. a d The values ​​can be adjusted by those skilled in the art as needed.

[0099] S2013: If present, determine that the first persistent trend is synchronous growth. If not, determine that the first persistent trend is not synchronous growth.

[0100] When the rate of change of the second ratio falls within the third preset range, the first continuous trend of change is determined to satisfy continuous synchronous growth. When the rate of change of the second ratio does not fall within the third preset range, the first continuous trend of change is determined not to be continuous synchronous growth.

[0101] S202: When the first continuous change trend is continuous synchronous growth, determine the preset adjustment rule based on the number of single impact records in multiple access behavior information.

[0102] If the first continuous trend is continuous synchronous growth, determine the trend of multiple single-influence record volume changes, and determine the preset adjustment rules based on the trend of multiple single-influence record volume changes.

[0103] In one possible implementation, a third continuous rate of change affecting the number of records in a single instance is determined. If the third continuous rate of change is within a second preset range, i.e., when the accessed data field information matches the data index information, it indicates low data retrieval efficiency, and the preset adjustment rule is determined to be the index creation rule.

[0104] Example: Single impact record size E f The third rate of change for the amount of data affected by a single event is: The second preset range of variation is [-a] f ,a f ].

[0105] when This indicates that the third rate of change is within the second preset range.

[0106] In one possible implementation, a preprocessing rule is defined when the second continuous trend of change in the number of single-influence records and the number of single-response times is a continuous synchronous increase.

[0107] In one possible implementation, the second persistent trend can be determined through curve fitting. Specifically, by determining whether the curves representing multiple consecutive single impacts on the recorded data and the curves representing multiple consecutive single response times are both continuously increasing over time with almost identical upward trends, the second persistent trend can be identified as a continuous synchronous growth.

[0108] In one possible implementation, it can be determined in the following way:

[0109] S2021: Determine the first ratio of the single impact record amount to the single response time for each instance;

[0110] The first ratio is:

[0111]

[0112] Among them, E fC represents the number of records affected in a single instance. t This represents the single response time, and Ve represents the first ratio of the number of records affected in a single instance to the single response time.

[0113] S2022: Determine whether the second continuous rate of change of the first ratio is within the first preset range.

[0114] Determine whether the second sustained rate of change of the first ratio falls within the first preset range of change, that is, determine:

[0115]

[0116] Is it true? If yes, it means it belongs to the first preset range of change; otherwise, it does not belong to the first preset range of change. Where, [-a de a de [] indicates the first preset range of variation. a de The values ​​can be adjusted by those skilled in the art as needed.

[0117] S2023: If present, determine that the second persistent trend is synchronous growth. If not, determine that the second persistent trend is not synchronous growth.

[0118] When the second sustained rate of change of the first ratio falls within the first preset range, the second sustained trend is determined to satisfy sustained synchronous growth. When the second sustained rate of change of the second ratio does not fall within the second preset range, the second sustained trend is determined not to be sustained synchronous growth.

[0119] This application uses access behavior information from multiple application terminals to determine the database processing principles, namely, selecting index creation rules or processing rules, dynamically updating data index information, or preprocessing database data to improve database operating efficiency.

[0120] Furthermore, embodiments of this application also provide an apparatus for adjusting a database. See also Figure 3 This is a schematic diagram of a database adjustment device 300 provided in an embodiment of this application. The device 300 includes:

[0121] The identification unit 301 is used to identify multiple access behavior information corresponding to multiple data application requests in response to multiple data usage request instructions continuously initiated by the application.

[0122] The rule determination unit 302 is used to determine a preset adjustment rule based on multiple access behavior information when multiple single response times in multiple access behavior information continue to increase; the preset adjustment rule includes one of the following: an index creation rule for adjusting the data index, or a preprocessing rule for preprocessing data in the database;

[0123] The adjustment unit 303 is used to adjust the database according to preset adjustment rules in order to improve the database's operating efficiency.

[0124] Optionally, access behavior information may also include the size of the data records and the number of records affected in a single instance;

[0125] Rule determination unit 302 is specifically used for:

[0126] Based on the data record size and single response time of each access behavior information in multiple access behavior information, determine the first continuous trend of change of data record size and single response time;

[0127] When the first continuous trend of change is continuous synchronous growth, the preset adjustment rules are determined based on the single impact record of each access behavior information in multiple access behavior information.

[0128] Optionally, the adjustment unit 303 is specifically used for:

[0129] Based on the single impact record volume and single response time of each access information in multiple access behavior information, determine the second continuous trend of change of the single impact record volume and single response time;

[0130] When the second continuous trend is continuous synchronous growth, the preset adjustment rule is determined as the preprocessing rule;

[0131] According to preset adjustment rules, adjusting the database's data index information and / or preprocessing the data in the database includes:

[0132] The data in the database is preprocessed according to the preprocessing rules.

[0133] Optionally, when the preprocessing rule is a data frequency reduction rule, the data in the database is processed by frequency reduction; and / or when the preprocessing rule is a hot / cold separation rule, the data in the database is separated into hot and cold data; hot / cold separation means storing the data in the database in different locations according to the frequency of use and the frequency of modification.

[0134] Optionally, a first ratio is determined between the number of single impact records and the single response time for each of the multiple access behavior information;

[0135] Determine the second sustained rate of change for multiple first ratios;

[0136] When the second continuous rate of change is within the first preset range, the second continuous trend of change in the single impact record amount and single response time is determined to be a continuous synchronous increase.

[0137] Optionally, a third continuous rate of change of the single impact record volume can be determined based on the single impact record volume of each access behavior information in multiple access behavior information;

[0138] When the third continuous change rate is within the second preset change range, and the access data field information of each access behavior information in multiple access behavior information does not match the data index information, the preset adjustment rule is determined to be the index creation rule;

[0139] According to preset adjustment rules, adjusting the database's data index information and / or preprocessing the data in the database includes:

[0140] Adjust the database's data index information according to the index creation rules.

[0141] Optionally, a second ratio of the data record size to the single response time for each of the multiple access behavior information is determined;

[0142] Determine the first sustained rate of change for multiple second ratios;

[0143] When the first continuous rate of change is within the third preset range, the first continuous trend of change in the data recording scale and single response time is determined to be continuous synchronous growth.

[0144] This application provides an apparatus for adjusting a database. An identification unit 301, in response to multiple data usage request commands continuously initiated by an application, identifies multiple access behavior information corresponding to the multiple data usage request commands. A rule determination unit 302 is used to determine a preset adjustment rule based on the multiple access behavior information when multiple single response times in the multiple access behavior information continuously increase. An adjustment unit 303 adjusts the database's data index information and preprocessed data according to the determined preset adjustment rule. Thus, when the application scenario changes, the continuous increase in multiple single response times in the multiple access behavior information indicates a decrease in database data processing efficiency. When the database data processing efficiency decreases, the preset adjustment rule is determined through the multiple access behavior information, and the database's data index information and preprocessing are automatically adjusted according to the preset adjustment rule. That is, without manual intervention, and the adjustment process is not dependent on application scenario limitations, the database's data processing efficiency can be improved in terms of retrieval efficiency or reducing the final number of records used.

[0145] For specific implementation details of the units of the aforementioned device 300, please refer to the method embodiments of this application, which will not be repeated here.

[0146] This application also provides an electronic device. The device includes a memory and a processor.

[0147] The memory is used to store program code and transfer program code to the processor.

[0148] Processor: Used to execute the steps of one of the above-described methods for adjusting the database according to the instructions in the program code.

[0149] This application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a method for adjusting a database according to an embodiment of this application.

[0150] In practical applications, the computer-readable storage medium can be any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. For example, a computer-readable storage medium can be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0151] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.

[0152] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0153] Computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0154] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0155] The above description is merely an exemplary implementation of this application and is not intended to limit the scope of protection of this application.

Claims

1. A method of adjusting a database, characterized by, The method comprises: in response to a plurality of data use request instructions continuously initiated by an application end, identifying a plurality of access behavior information corresponding to the plurality of data use requests; when a plurality of single response time in a plurality of the access behavior information continuously increases, determining a preset adjustment rule according to a plurality of the access behavior information; the preset adjustment rule comprises at least one of an index creation rule for adjusting data index information and a preprocessing rule for preprocessing data in the database; adjusting the database according to the preset adjustment rule to improve the operation efficiency of the database; the determination of the preset adjustment rule according to a plurality of the access behavior information comprises: determining a first continuous change trend of the data record size and the single response time in a plurality of the access behavior information according to the data record size and the single response time of each access behavior information in a plurality of the access behavior information; when the first continuous change trend is continuously and synchronously increased, determining a second continuous change trend of the single impact record amount and the single response time in a plurality of the access behavior information according to the single impact record amount and the single response time of each access information in a plurality of the access behavior information; when the second continuous change trend is continuously and synchronously increased, determining that the preset adjustment rule is the preprocessing rule; the adjustment of the database according to the preset adjustment rule comprises: when the preprocessing rule is a data frequency reduction rule, frequency reduction processing the data in the database; and / or when the preprocessing rule is a cold and hot separation rule, separating the data in the database into cold and hot; the cold and hot separation is to store the data in the database in different positions according to the use frequency and the modification frequency.

2. The method of claim 1, wherein, the determination of the second continuous change trend of the single impact record amount and the single response time in a plurality of the access behavior information according to the single impact record amount and the single response time of each access information in a plurality of the access behavior information comprises: determining a first ratio of the single impact record amount and the single response time of each access behavior information in a plurality of the access behavior information; determining a second continuous change rate of a plurality of the first ratio in a plurality of the access behavior information; when the second continuous change rate is in a first preset change range, determining that the second continuous change trend of the single impact record amount and the single response time in a plurality of the access behavior information is continuously and synchronously increased.

3. The method of claim 1, wherein, the access behavior information further comprises access data field information, and the method further comprises: determining a third continuous change rate of the single impact record amount according to the single impact record amount of each access behavior information in a plurality of the access behavior information; when the third continuous change rate is in a second preset change range, and the access data field information of each access behavior information in a plurality of the access behavior information does not match the data index information, determining that the preset adjustment rule is the index creation rule; the adjustment of the database according to the preset adjustment rule comprises: adjusting the data index information of the database according to the index creation rule.

4. The method of claim 1, wherein, The first continuous change trend of the data record size and the single response time in the plurality of access behavior information is determined according to the data record size and the single response time of each access behavior information in the plurality of access behavior information, including: A second ratio of the data record size and the single response time of each access behavior information in the plurality of access behavior information is determined; A first continuous change rate of the plurality of second ratios in the plurality of access behavior information is determined; When the first continuous change rate is in a third preset change range, the first continuous change trend of the data record size and the single response time in the plurality of access behavior information is determined as a continuous and synchronous growth.

5. An apparatus for tuning a database, the apparatus comprising: The device comprises: An identification unit is configured to identify a plurality of access behavior information corresponding to a plurality of data usage request instructions continuously initiated by an application end in response to the plurality of data usage request instructions; A rule determination unit is configured to determine a preset adjustment rule according to the plurality of access behavior information when a plurality of single response times in the plurality of access behavior information continuously grow; the preset adjustment rule comprises at least one of an index creation rule for adjusting an index of data and a preprocessing rule for preprocessing data in the database; An adjustment unit is configured to adjust the database according to the preset adjustment rule to improve the operation efficiency of the database; The determination of the preset adjustment rule according to the plurality of access behavior information comprises: The first continuous change trend of the data record size and the single response time in the plurality of access behavior information is determined according to the data record size and the single response time of each access behavior information in the plurality of access behavior information; When the first continuous change trend is a continuous and synchronous growth, a second continuous change trend of the single impact record amount and the single response time in the plurality of access behavior information is determined according to the single impact record amount and the single response time of each access information in the plurality of access behavior information; When the second continuous change trend is a continuous and synchronous growth, the preset adjustment rule is determined as the preprocessing rule; The adjustment of the database according to the preset adjustment rule comprises: When the preprocessing rule is a data frequency reduction rule, the data in the database is frequency-reduced; and / or when the preprocessing rule is a cold and hot separation rule, the data in the database is cold and hot separated; the cold and hot separation is to store the data in the database in different positions according to the usage frequency and the modification frequency.

6. An electronic device, the device comprising: A memory and a processor; The memory is configured to store program code and transmit the program code to the processor; The processor is configured to execute the method steps of adjusting the database according to the instructions in the program code.

7. A computer-readable storage medium, characterized in that, The computer readable storage medium stores code, and the code is executed by the processor to implement the method steps of adjusting the database according to any one of claims 1-4. The computer readable storage medium stores code, and the code is executed by the processor to implement the method steps of adjusting the database according to any one of claims 1-4.

Citation Information

Patent Citations

  • Method and equipment for managing database information

    CN102053982A

  • Data acquisition method and device, medium and electronic equipment

    CN110879818A