Statement execution method
By establishing a query parameter table and a parameter information record table in the database, extracting and processing query parameters, and generating subquery statements, the problem of inefficiency of multi-parameter query in traditional query methods is solved, and efficient data query is achieved.
Patent Information
- Application Number
- CN202411829063.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-12
AI Technical Summary
When traditional query methods process multiple query parameters, the statements are lengthy, the query efficiency is inefficient, and the number of IN parameter items is too large, the database query efficiency is seriously affected, and errors are prone to occur.
By pre-establishing the query parameter table and parameter information record table in the target database, extracting the query parameters and obtaining parameter identification according to the multiplexing conditions of the parameter information record table, updating the parameter information field, determining the sub-query statement, and replacing the original query statement to improve query efficiency.
It realizes that when multiple query parameters are included in the query statement, data query can still be completed efficiently, improving query efficiency and avoiding errors caused by excessive IN parameter items.
Smart Images

Figure CN119293085B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of database technology, and in particular to a statement execution method. Background Art
[0002] With the development of computer and Internet technology, databases are widely used in data management. With the continuous development of database applications, users often need to filter and query data based on multiple values. Most traditional query methods require users to add multiple conditions to the statement to complete the query, which not only makes the statement lengthy, but also makes the query inefficient. In order to meet this type of query needs, IN parameters came into being. IN parameters allow users to specify multiple values in the query statement, and then retrieve records matching multiple values from the database to complete the query operation. By using IN parameters, users can avoid writing complex query statements, thereby simplifying the query statement and improving the query efficiency. As the amount of data gradually increases, in order to meet the query requirements, the number of items containing IN parameters in the query statement also gradually increases, which seriously affects the execution efficiency of the query statement; and in order to avoid data query errors, most databases will configure IN parameter restriction strategies to achieve errors when the number of IN parameter items is too large. However, in actual application scenarios, it is inevitable that the number of IN parameter items will increase, so an effective solution is urgently needed to solve the above problems. Summary of the invention
[0003] In view of this, an embodiment of this specification provides a statement execution method. One or more embodiments of this specification also relate to a statement execution device, a computing device, a computer-readable storage medium and a computer program product to solve the technical defects existing in the prior art.
[0004] According to a first aspect of an embodiment of this specification, a statement execution method is provided, including:
[0005] Receiving a query statement submitted to a target database, and extracting query parameters from the query statement, wherein the target database includes a query parameter table and a parameter information record table;
[0006] When the query parameter satisfies the parameter reuse condition corresponding to the parameter information record table, obtaining a parameter identifier corresponding to the query parameter;
[0007] updating the parameter information field corresponding to the query parameter in the parameter information record table according to the parameter identifier, and determining the sub-query statement corresponding to the query parameter according to the update result and the query parameter table;
[0008] The query statement is updated to a target query statement by using the sub-query statement, and target data is searched in the target database by executing the target query statement.
[0009] According to a second aspect of an embodiment of this specification, a statement execution device is provided, including:
[0010] A receiving module is configured to receive a query statement submitted to a target database and extract query parameters from the query statement, wherein the target database includes a query parameter table and a parameter information record table;
[0011] An acquisition module is configured to acquire a parameter identifier corresponding to the query parameter if the query parameter satisfies a parameter reuse condition corresponding to the parameter information record table;
[0012] An updating module is configured to update the parameter information field corresponding to the query parameter in the parameter information record table according to the parameter identifier, and determine the sub-query statement corresponding to the query parameter according to the update result and the query parameter table;
[0013] The execution module is configured to update the query statement into a target query statement by using the sub-query statement, and query the target data in the target database by executing the target query statement.
[0014] According to a third aspect of an embodiment of this specification, a computing device is provided, including:
[0015] Memory and processor;
[0016] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the above statement execution method are implemented.
[0017] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the above-mentioned statement execution method are implemented.
[0018] According to a fifth aspect of the embodiments of this specification, a computer program product is provided, including a computer program or instructions, which implement the steps of the above statement execution method when executed by a processor.
[0019] The statement execution method provided in the present embodiment can support the query statement containing multiple query parameters to complete data query and further improve the data query efficiency. After receiving the query statement submitted to the target database, the query parameters can be first extracted from the query statement, and the target database will pre-establish a query parameter table for storing the query parameters and a parameter information recording table for storing parameter information related to the query parameters; thereby, when the query parameters meet the parameter reuse conditions corresponding to the parameter information recording table, the parameter identifier corresponding to the query parameter can be obtained, and based on this, the parameter information field corresponding to the query parameter in the parameter information recording table is updated according to the parameter identifier, and the sub-query statement corresponding to the query parameter is determined according to the update result and the query parameter table; the query parameter table and the parameter information recording table are coordinated to support the reuse of query parameters, and any number of query parameters can be cached through the query parameter table, thereby supporting the query statement containing any number of query parameters to still complete the access to the target database and ensure query efficiency. Finally, the subquery statement can be used to update the query statement to the target query statement, and the target data can be queried in the target database by executing the target query statement. When the query statement contains any number of query parameters, the query parameters can be replaced with subquery statements, so that the database can complete the execution of the query statement corresponding to any query parameters, thereby effectively improving the data query efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a schematic diagram of a statement execution method provided by an embodiment of this specification;
[0021] Figure 2 is a flow chart of a statement execution method provided by an embodiment of this specification;
[0022] Figure 3 is a flow chart of a processing process of a statement execution method provided by an embodiment of this specification;
[0023] Figure 4 It is a structural diagram of a statement execution device provided by an embodiment of this specification;
[0024] Figure 5 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION
[0025] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0026] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0027] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0028] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0029] First, the terms involved in one or more embodiments of this specification are explained.
[0030] IN parameter: is a condition used to specify multiple possible values. It allows users to test whether a field matches one of a given set of values in a query. This method is commonly used in SQL (Structured Query Language) because it can make queries more concise and easier to read, so it can be used to replace multiple OR conditions.
[0031] In this specification, a statement execution method is provided. This specification also relates to a statement execution device, a computing device, a computer-readable storage medium and a computer program product, which are described in detail one by one in the following embodiments.
[0032] In practical applications, if the number of IN parameters is large, the SQL statement will be very long and there will be hard parsing problems. The database will consume more computing resources when parsing the SQL statement. Therefore, an effective solution is urgently needed to solve the above problems.
[0033] See also Figure 1 As shown in the schematic diagram, in order to support the query statement containing multiple query parameters to complete data query and further improve the data query efficiency, after receiving the query statement submitted to the target database, the query parameters can be first extracted from the query statement, and the target database will pre-establish a query parameter table for storing the query parameters, and a parameter information recording table for storing parameter information related to the query parameters; thereby, when the query parameters meet the parameter reuse conditions corresponding to the parameter information recording table, the parameter identifier corresponding to the query parameter can be obtained, and based on this, the parameter information field corresponding to the query parameter in the parameter information recording table is updated according to the parameter identifier, and the sub-query statement corresponding to the query parameter is determined according to the update result and the query parameter table; by cooperating with the query parameter table and the parameter information recording table, the query parameters can be reused, and any number of query parameters can be cached through the query parameter table, thereby supporting the query statement containing any number of query parameters to complete the access to the target database and ensure query efficiency. Finally, the subquery statement can be used to update the query statement to the target query statement, and the target data can be queried in the target database by executing the target query statement. When the query statement contains any number of query parameters, the query parameters can be replaced with subquery statements, so that the database can complete the execution of the query statement corresponding to any query parameters, thereby effectively improving the data query efficiency.
[0034] See also Figure 2 , Figure 2 A flowchart of a statement execution method provided according to an embodiment of the present specification is shown, which specifically includes the following steps.
[0035] Step S202: receiving a query statement submitted to a target database, and extracting query parameters from the query statement, wherein the target database includes a query parameter table and a parameter information record table.
[0036] The statement execution method provided in this embodiment can be applied to any scenario where a statement contains an IN parameter to access a target database, and is used to implement a scenario where a query statement contains a query parameter, and no matter how many or few items the query parameter contains, data query can be quickly completed in the target database. This embodiment takes the target database as a database storing transaction data as an example to illustrate the statement execution method. For descriptions of other scenarios, please refer to the same or corresponding descriptions in this embodiment, and this embodiment does not make any limitation here.
[0037] Specifically, the query statement specifically refers to an SQL statement spliced with one or more IN parameters, which is used to query the target data in the target database. Correspondingly, the query parameter is the IN parameter spliced in the query statement; wherein, the query statement and the query parameter can be edited according to actual needs, and this embodiment does not make any limitation here.
[0038] Accordingly, the query parameter table specifically refers to a table in the target database for storing query parameters, and is used to store multiple query parameters in the query parameter table, so as to avoid the database reporting errors due to too many query parameter items. Accordingly, the parameter information recording table specifically refers to a data table for recording parameter information related to query parameters, and the parameter information recorded includes but is not limited to the summary information, identification, number of times used, number of citations, usage time and other information of the query parameters, and is used to associate with the query parameters in the query parameter table, so that when the query parameters in the newly received query statement exist in the query parameter table, the query parameters can be reused based on the parameter information recording table, and the query parameters stored in the query parameter table can also be managed, thereby effectively improving the efficiency of data query.
[0039] Based on this, in order to support the query statement containing multiple query parameters to complete data query and further improve the efficiency of data query, after receiving the query statement submitted to the target database, the query parameters can be first extracted from the query statement, and the target database will pre-establish a query parameter table for storing query parameters and a parameter information record table for storing parameter information related to the query parameters; and then, when the query parameter meets the parameter reuse condition corresponding to the parameter information record table, the parameter identifier corresponding to the query parameter can be obtained, and on this basis, the parameter information field corresponding to the query parameter in the parameter information record table is updated according to the parameter identifier, and the sub-query statement corresponding to the query parameter is determined according to the update result and the query parameter table; through the cooperation of the query parameter table and the parameter information record table, the query parameters can be reused, and any number of query parameters can be cached through the query parameter table, and then the query statement containing any number of query parameters can still complete the access to the target database and ensure the query efficiency. Finally, the sub-query statement can be used to update the query statement to the target query statement, and the target data can be queried in the target database by executing the target query statement.
[0040] In specific implementation, considering that the query statement submitted by the user may contain query parameters that do not exist in the query parameter table, and the newly added query parameters may be used again in subsequent data queries, the newly added query parameters can be updated to the query parameter table and the parameter information record table. In this embodiment, the specific implementation method is as follows:
[0041] In the case that the query parameter does not satisfy the parameter reuse condition corresponding to the parameter information recording table, construct new parameter information and a new parameter identifier for the query parameter; establish an association relationship between the query parameter and the new parameter information and the new parameter identifier; store the query parameter in the query parameter table based on the association relationship, and store the new parameter information in the parameter information recording table.
[0042] Specifically, the newly added parameter information specifically refers to the parameter information corresponding to the query parameter that does not meet the parameter reuse condition, including but not limited to summary information, identification, number of times used, number of times cited, usage time, etc. Correspondingly, the newly added parameter identification specifically refers to the unique identification of the corresponding query parameter, which is used to establish an association relationship between the parameter information stored in the parameter information record table and the query parameter stored in the query parameter table, so that when the parameter can be reused, the newly added parameter identification is used to complete the reading of the corresponding query parameter and the update of the parameter information.
[0043] Based on this, after receiving the query statement submitted to the target database and extracting the query parameters from the query statement, it is possible to detect whether the query parameters meet the parameter reuse conditions. If the query parameters do not meet the parameter reuse conditions corresponding to the parameter information record table, it means that there is no parameter information matching the query parameters in the parameter information record table, which further indicates that the currently obtained query parameters are newly added query parameters. In order to facilitate subsequent use, newly added parameter information and newly added parameter identifiers can be constructed for the query parameters; on this basis, an association relationship between the query parameters and the newly added parameter information and the newly added parameter identifier can be established; and the newly added parameter information and the query parameters can be bound through the association relationship. Then, based on the association relationship, the query parameters can be stored in the query parameter table, and the newly added parameter information can be stored in the parameter information record table, so that after a new query statement containing the query parameters is obtained later, the query parameters can be reused in combination with the query parameter table and the parameter information record table.
[0044] For example, the target database is used to store all transaction data involved in the trading platform. When it is necessary to read the transaction data corresponding to n users from the target database for compliance detection, an SQL statement for reading the transaction data of n users in the target database will be triggered. At this time, the SQL statement can be parsed, and the IN parameters contained in the SQL statement can be extracted from the SQL statement according to the parsing result. After obtaining the IN parameters, in order to improve the efficiency of data query and save more computing resources, the target database has a query parameter table TMP_VALUES for storing IN parameters and a record table TMP_VALUES_ASSIST for storing parameter information related to IN parameters. Therefore, it can be detected whether the currently extracted IN parameter exists in the query parameter table and the record table. If not, it means that the IN parameter is a newly added IN parameter. At this time, the parameter identifier batch_id=19 can be constructed for the IN parameter, and the parameter information corresponding to the IN parameter can be constructed. Then, based on the parameter identifier batch_id=19, the IN parameter can be stored in the query parameter table, and the parameter information can be stored in the record table, so that when the IN parameter is contained in the subsequent statement, the query parameter table and the record table can be combined to complete the reuse of the IN parameter, thereby improving the data query efficiency.
[0045] In summary, by dynamically updating the query parameter table and the parameter information record table, the query parameter table and the parameter information record table can save the query parameters that may be reused at any time, thereby effectively improving the execution efficiency of the query statements corresponding to such query parameters.
[0046] Step S204: when the query parameter satisfies the parameter reuse condition corresponding to the parameter information record table, obtain the parameter identifier corresponding to the query parameter.
[0047] Specifically, after the query parameters are extracted from the query statement, if the query parameters meet the parameter reuse conditions corresponding to the parameter information record table, it means that the currently extracted query parameters have been recorded in the query parameter table. In this case, no additional computing resources are needed to parse the query parameters, but the corresponding query parameters in the query parameter table can be directly used to participate in the execution of this query statement, thereby effectively improving the efficiency of data query and saving more computing resources. Prior to this, in order to ensure that the logic of the query parameter reuse mechanism can run well, it is also necessary to record the parameter information of each reusable query parameter through the parameter information record table. Therefore, the parameter identifier corresponding to the query parameter can be obtained first, so that the execution of the query statement can be driven according to the parameter identifier later.
[0048] The parameter reuse condition specifically refers to a condition for detecting whether a query parameter is a reusable query parameter. Correspondingly, the parameter identifier specifically refers to a unique identifier corresponding to the query parameter, which is used to access the query parameter table and the parameter information record table.
[0049] Furthermore, when detecting whether the query parameter meets the parameter reuse condition, in order to avoid the problem that the query parameter is an expired parameter and cannot be reused, the query parameter can be detected in combination with the parameter summary information and the modification time. In this embodiment, the specific implementation is as follows:
[0050] The query parameters are sorted, and parameter summary information corresponding to the sorted query parameters is calculated, and the parameter information record table is queried based on the parameter summary information; the query parameter information matching the parameter summary information is determined according to the query result, and when the sorting value of the query parameter information is the same as the sorting value of the sorted query parameters and the modification time difference of the query parameter information is less than a set time difference threshold, it is determined that the query parameters meet the parameter reuse conditions corresponding to the parameter information record table, and the step of obtaining the parameter identifier corresponding to the query parameter is performed.
[0051] Specifically, the ranking value of the sorted query parameter specifically refers to the sequence value obtained after sorting all the query parameters extracted from the query statement; the ranking value of the query parameter information specifically refers to the sequence value obtained after the query parameters corresponding to the query parameter information are sorted, which is recorded in the parameter information recording table and used to detect whether the parameters are reusable during the parameter reuse stage. The parameter summary information specifically refers to the summary information obtained after calculating the query parameters using the SM3 algorithm. Accordingly, the query parameter information specifically refers to the parameter information corresponding to the query parameter in the parameter information recording table, and accordingly, the modification time difference specifically refers to the time point recorded in the query parameter information when the query parameter was last used, and the time difference determined by subtracting the current time point. Setting the time difference threshold specifically refers to the threshold for comparing the time difference between the modification time and the current time. For example, the modification time corresponding to the query parameter information is 2024 / 11 / 22 / 15:15:02, the current time is 2024 / 11 / 22 / 16:17:18, and the set time difference threshold is 2 hours. By subtracting the modification time from the current time, it is determined that the modification time difference is 1 hour, 2 minutes and 16 seconds, which is less than the set time difference threshold. At this time, it is determined that the query parameter can be reused.
[0052] Based on this, in order to detect whether the query parameters are reusable query parameters, the query parameters can be sorted first, and the parameter summary information corresponding to the sorted query parameters can be calculated using the SM3 algorithm. At the same time, the parameter information record table can be queried based on the parameter summary information; the query parameter information matching the parameter summary information is determined according to the query result, and the sorting value of the query parameter information is the same as the sorting value of the query parameter after sorting, and the modification time difference of the query parameter information is less than the set time difference threshold, which indicates that the currently obtained query parameter is a reusable query parameter. Therefore, it can be determined that the query parameter meets the parameter reuse condition corresponding to the parameter information record table, and the step of obtaining the parameter identifier corresponding to the query parameter is executed.
[0053] In practical applications, considering that the parameter summary information calculated by different arrangement orders of query parameters may be different, and the parameter summary information contained in the query parameter information recorded in the parameter information record table is the result of calculating after sorting the parameters, after obtaining the query parameters in the query statement, in order to determine whether they are reusable, they also need to be sorted and then the summary information is calculated. Then, combining the parameter summary information, sorting results and modification time can accurately detect whether the query parameters are reusable parameters for subsequent processing.
[0054] Using the above example, after obtaining the IN parameters extracted from the SQL statement, the IN parameters can be sorted first, and then the SM3 algorithm can be used to calculate the corresponding SM3 summary information of the sorted IN parameters. Then, it can be detected whether there is data with the same SM3 summary information in the record table TMP_VALUES_ASSIST, and whether the sort value value of the data record is the same as the sort value value1 after the IN parameter is sorted, and whether the modification time difference is within 2 hours (determined by subtracting the current time point from the modification time point corresponding to the IN parameter). If so, it means that the IN parameter is a reusable IN parameter, so the parameter identifier batch_id=19 corresponding to the IN parameter can be obtained, so that the IN parameter can be read in the query parameter table TMP_VALUES according to the parameter identifier batch_id=19, and the parameter information corresponding to the IN parameter in the record table TMP_VALUES_ASSIST can be updated, thereby supporting the reuse of IN parameters and improving data query efficiency.
[0055] In summary, by combining parameter summary information, sorting value, and modification time to detect whether query parameters meet the parameter reuse conditions, it is possible to reuse query parameters with higher frequency, thereby improving efficiency. At the same time, it is possible to manage expired query parameters, thereby avoiding resource consumption caused by table expansion.
[0056] Step S206: updating the parameter information field corresponding to the query parameter in the parameter information record table according to the parameter identifier, and determining the sub-query statement corresponding to the query parameter according to the update result and the query parameter table.
[0057] Specifically, after obtaining the parameter identifier corresponding to the query parameter as described above, further, considering that the query parameter table stores a large number of reusable query parameters, if the parameter information corresponding to each query parameter is not recorded through the parameter information recording table, it will result in that when the query parameter is reused, it will be necessary to traverse the query parameter table to complete it, and it will be impossible to regularly maintain the query parameters with low activity in the query parameter table, which will cause the space occupied by the query parameter table to gradually increase. Therefore, in order to avoid the above problems, the parameter information corresponding to each query parameter in the query parameter table can be recorded in the parameter information recording table, so that when the corresponding query parameter is reused, the parameter information field of the corresponding query parameter in the parameter information recording table can be updated according to the parameter identifier. After the update is completed, the sub-query statement corresponding to the query parameter can be determined according to the update result and the query parameter table, so that the sub-query statement can be used to update the query statement later, thereby reducing the length of the query statement, saving the parsing time and memory of the statement (the time and memory consumed by parsing a long statement far exceeds the time and memory consumed by a short statement), and improving the efficiency of data query.
[0058] The parameter information field specifically refers to the field included in the parameter information of the corresponding query parameter in the parameter information record table, and different fields are used to record different attributes of the query parameter, including but not limited to the summary information field for recording summary information, the identification field for representing the uniqueness of the parameter, the number of times field for representing the number of times the parameter is used, the number of times field for representing the number of times the parameter is referenced, the time field for representing the time when the parameter is used, etc. Correspondingly, the sub-query statement specifically refers to the sub-statement of the query parameter in the replaceable query statement constructed in advance for the query parameter included in the query parameter table.
[0059] Furthermore, considering that the parameter information stored in the parameter information record table is information statistically collected during the query parameter reuse phase, if the current query parameter is a reusable parameter, the corresponding field can be updated. In this embodiment, the specific implementation is as follows:
[0060] Determine the target parameter information corresponding to the parameter identifier in the parameter information record table; obtain a parameter usage count field, a parameter reference count field, and a parameter operation time field by parsing the target parameter information; use the parameter usage count field, the parameter reference count field, and the parameter operation time field as parameter information fields corresponding to the query parameters; and multiplex and update the parameter information fields.
[0061] Specifically, the parameter usage count field refers to a field that records the number of times a query parameter is used, and the parameter reference count field refers to a field that records the number of times a query parameter is referenced. The parameter operation time field refers to a field that records the corresponding time information each time a parameter is used or referenced. Correspondingly, reuse update refers to an update operation on a field that updates the query parameter to be reused this time, such as adding 1 to the number of times.
[0062] Based on this, after obtaining the parameter identifier corresponding to the query parameter, the target parameter information corresponding to the parameter identifier can be determined in the parameter information recording table; thereafter, in order to be able to record the reuse of the query parameters this time, the parameter usage count field, the parameter reference count field and the parameter operation time field can be obtained by parsing the target parameter information; then the parameter usage count field, the parameter reference count field and the parameter operation time field can be reused and updated to complete the record of the query parameter reuse, and subsequently the sub-query statement can be used to replace the query parameters in the query statement to complete the execution of the query statement.
[0063] Using the above example, after determining the parameter identifier batch_id=19 corresponding to the IN parameter, considering that the record table TMP_VALUES_ASSIST records the sorted values of the IN parameters corresponding to each IN parameter in the query parameter table TMP_VALUES, the SM3 summary information of the IN parameter, the parameter identifier batch_id of the IN parameter, the number of times the IN parameter is used use_count, the number of times the IN parameter is referenced reference_count, and the operation time dtime_operate of the IN parameter. Therefore, according to the parameter identifier batch_id=19, the field corresponding to the parameter identifier can be determined in the record table TMP_VALUES_ASSIST. At this time, the number of times the parameter identifier is used field use_count can be increased by 1, the number of times the parameter identifier is referenced field reference_count can be increased by 1, and the operation time dtime_operate can be set to the current time 2024 / 11 / 22 / 16:17:18. On this basis, the IN parameters in the SQL statement can be replaced by the set subquery statement, and the data query operation can be completed quickly.
[0064] In summary, by updating the parameter information of the corresponding query parameter in the parameter information record table, the record table can be used for information maintenance in each query parameter reuse stage, thereby effectively maintaining the orderly operation of the query parameter reuse logic.
[0065] In addition, in order to quickly replace the query parameters in the query statement during the subsequent statement execution process, a sub-query statement corresponding to each query parameter can be pre-established. In this embodiment, the specific implementation method is as follows:
[0066] At least one candidate query parameter is obtained by traversing the query parameter table; and a candidate sub-query statement is constructed for each candidate query parameter, wherein the candidate sub-query statement is used to update the query statement in the query parameter reuse task.
[0067] Specifically, the candidate query parameters refer to the query parameters stored in the query parameter table, and the candidate sub-query statements refer to the sub-query statements constructed for each candidate query parameter. Based on this, in the sub-query statement construction phase, the query parameter table can be traversed to obtain all the candidate query parameters it contains; and then a candidate sub-query statement can be constructed for each candidate query parameter, which can support use in the query parameter reuse phase.
[0068] In summary, by pre-establishing sub-query statements corresponding to various query parameters, it is possible to support rapid use of query parameters in the reuse phase, thereby improving statement execution efficiency.
[0069] Step S208: using the sub-query statement to update the query statement into a target query statement, and querying target data in the target database by executing the target query statement.
[0070] Specifically, after obtaining the sub-query statement corresponding to the query parameter, in order to improve the execution efficiency of the query statement, the query statement can be updated to the target query statement using the sub-query statement, and the query parameters in the query statement can be replaced. Based on this, the target query statement can be executed to quickly query the target data in the target database for downstream business use. The target query statement specifically refers to the query statement obtained after adding the sub-query statement to the query statement.
[0071] Furthermore, when the query statement is updated by using the sub-query statement, the query parameter in the query statement may be replaced by using the sub-query statement. In this embodiment, the specific implementation is as follows:
[0072] The query parameter is determined in the query statement; the query parameter is replaced by the sub-query statement to obtain a target query statement, and the step of querying target data in the target database by executing the target query statement is performed.
[0073] That is to say, since the query statement may contain one or more query parameters, if the query statement containing complex query parameters is parsed and executed, it may consume a lot of computing resources and time. Therefore, in order to improve computing efficiency, the query parameters can be directly replaced by using the sub-query statement pre-constructed for the query parameters, so as to obtain the target query statement, and execute the step of querying the target data in the target database by executing the target query statement.
[0074] In summary, by using a subquery statement to directly replace the query parameters in the query statement, the parsing time and memory consumed by the query statement carrying the query parameters can be avoided, thereby improving data query efficiency.
[0075] Furthermore, when the target query statement is executed, in order to indicate that the current query parameter has been reused, the corresponding information field needs to be updated for reuse. In this embodiment, the specific implementation is as follows:
[0076] When the target query statement is executed, the parameter usage count field, the parameter reference count field and the parameter operation time field are multiplexed and updated according to the parameter identifier. The multiplexed update specifically refers to the operation of correcting the multiplexed result, such as reducing the reference count field by 1.
[0077] Using the above example, after completing the update of the field corresponding to the parameter identifier batch_id=19, you can use the subquery statement associated with the IN parameter (select value from tmp_values where batch_id = 19) to replace the IN parameter in the SQL statement, and you will get the target SQL statement. Then, you can complete the operation of reading n user transaction data in the target database by executing the target SQL statement, so that the downstream can perform compliance testing on the transaction data. Furthermore, when the target SQL statement is executed, you can update the field associated with the parameter identifier batch_id=19 in the record table TMP_VALUES_ASSIST, such as reducing the reference count field reference_count by 1, thereby indicating that the IN parameter reuse is complete.
[0078] In summary, by managing and controlling the reuse cycle related information of each query parameter through the parameter information record table, the orderliness of the query parameter reuse logic can be effectively maintained, thereby improving data query efficiency.
[0079] In addition, considering that the parameter information recorded in the parameter information record table represents the reuse of each query parameter, and the query parameter table is a query parameter table that records reusable query parameters, in order to avoid space occupation caused by table expansion, expired query parameters can be deleted regularly. In this embodiment, the specific implementation method is as follows:
[0080] Determine the operation time difference and the number of references corresponding to each parameter information in the parameter information record table; filter the parameter information whose operation time difference is greater than the operation time difference threshold and whose number of references is equal to the set number threshold as the parameter information to be deleted; determine the expired parameter identifier corresponding to the parameter information to be deleted; delete the parameter information to be deleted corresponding to the expired parameter identifier in the parameter information record table, and delete the expired query parameter corresponding to the expired parameter identifier in the query parameter table.
[0081] Specifically, the parameter information to be deleted specifically refers to the parameter information that meets the deletion conditions in the parameter information record table. Correspondingly, the expired parameter identifier specifically refers to the parameter identifier recorded in the parameter information to be deleted. Correspondingly, the expired query parameter specifically refers to the query parameter to be deleted in the query parameter record table. Correspondingly, the modification time difference specifically refers to the time difference between the time point when the corresponding query parameter recorded in each parameter information was last reused and the current time point, and the operation time difference threshold specifically refers to the threshold for comparing the time difference between the operation time and the current time. For example, the operation time is 2024 / 11 / 22 / 09:05:06, the current time is 2024 / 11 / 22 / 15:16:17, and the operation time difference threshold is 3 hours. At this time, if it is determined that the parameter was used 3 hours ago, it can be determined that the parameter can be deleted.
[0082] Based on this, in order to avoid the expansion of the table and occupy more space, the operation time difference and reference count corresponding to each parameter information in the parameter information record table can be determined after a set time interval; at this time, the operation time difference and reference count corresponding to each parameter information can be compared with the set conditions, and the parameter information with an operation time difference greater than the operation time difference threshold and a reference count equal to the set number threshold can be screened out according to the comparison result as the parameter information to be deleted. Further, the expired parameter identifier corresponding to the parameter information to be deleted can be determined; then the parameter information to be deleted corresponding to the expired parameter identifier can be deleted from the parameter information record table, and the expired query parameters corresponding to the expired parameter identifier can be deleted from the query parameter table, so as to achieve the purpose of regularly cleaning up expired query parameters.
[0083] Using the above example, when querying expired IN parameters, you can query the parameter information with an operation time of 3 hours ago (such as before 2024 / 11 / 22 / 13:17:18) and a reference count of 0 from the record table TMP_VALUES_ASSIST. If it exists, get the batch_id contained in the parameter information and determine that batch_id = 1. After that, you can delete the parameter information with batch_id = 1 in the record table TMP_VALUES_ASSIST, and delete the IN parameter with batch_id = 1 in the query parameter table TMP_VALUES.
[0084] The statement execution method provided in the present embodiment can support the query statement containing multiple query parameters to complete data query and further improve the data query efficiency. After receiving the query statement submitted to the target database, the query parameters can be first extracted from the query statement, and the target database will pre-establish a query parameter table for storing the query parameters and a parameter information recording table for storing parameter information related to the query parameters; thereby, when the query parameters meet the parameter reuse conditions corresponding to the parameter information recording table, the parameter identifier corresponding to the query parameter can be obtained, and based on this, the parameter information field corresponding to the query parameter in the parameter information recording table is updated according to the parameter identifier, and the sub-query statement corresponding to the query parameter is determined according to the update result and the query parameter table; the query parameter table and the parameter information recording table are coordinated to support the reuse of query parameters, and any number of query parameters can be cached through the query parameter table, thereby supporting the query statement containing any number of query parameters to still complete the access to the target database and ensure query efficiency. Finally, the subquery statement can be used to update the query statement to the target query statement, and the target data can be queried in the target database by executing the target query statement. When the query statement contains any number of query parameters, the query parameters can be replaced with subquery statements, so that the database can complete the execution of the query statement corresponding to any query parameters, thereby effectively improving the data query efficiency.
[0085] The following combination Figure 3 , taking the application of the statement execution method provided in this specification in a data query scenario as an example, the statement execution method is further described. Figure 3 A processing flow chart of a statement execution method provided in an embodiment of the present specification is shown, which specifically includes the following steps.
[0086] Step S302: receiving a query statement submitted to a target database, and extracting query parameters from the query statement, wherein the target database includes a query parameter table and a parameter information record table.
[0087] Step S304: sort the query parameters, calculate parameter summary information corresponding to the sorted query parameters, and query the parameter information record table based on the parameter summary information.
[0088] Step S306, when the query parameter information that matches the parameter summary information is determined based on the query results, and the ranking value of the query parameter information is the same as the ranking value of the query parameter after sorting, and the modification time difference of the query parameter information is less than the set time difference threshold, it is determined that the query parameter meets the parameter reuse condition corresponding to the parameter information record table, and the parameter identifier corresponding to the query parameter is obtained.
[0089] Step S308: Determine the target parameter information corresponding to the parameter identifier in the parameter information record table.
[0090] Step S310, by parsing the target parameter information, obtain the parameter usage count field, the parameter reference count field and the parameter operation time field.
[0091] Step S312: The parameter usage count field, the parameter reference count field, and the parameter operation time field are used as parameter information fields corresponding to the query parameters, and the parameter information fields are multiplexed and updated.
[0092] Step S314: determine the sub-query statement corresponding to the query parameter according to the update result and the query parameter table.
[0093] Step S316, determining query parameters in the query statement, and replacing the query parameters with sub-query statements to obtain a target query statement.
[0094] Step S318, querying the target data in the target database by executing the target query statement.
[0095] Step S320, when the target query statement is executed, the parameter usage count field, the parameter reference count field and the parameter operation time field are multiplexed and updated according to the parameter identifier.
[0096] Step S322: Determine the operation time difference and reference count corresponding to each piece of parameter information in the parameter information record table.
[0097] Step S324, filter the parameter information whose operation time difference is greater than the set operation time difference threshold and whose reference count is equal to the set reference count threshold as the parameter information to be deleted.
[0098] Step S326, determining the expired parameter identifier corresponding to the parameter information to be deleted.
[0099] Step S328: Delete the to-be-deleted parameter information corresponding to the expired parameter identifier in the parameter information record table, and delete the expired query parameter corresponding to the expired parameter identifier in the query parameter table.
[0100] In summary, in order to support the query statement containing multiple query parameters to complete data query and further improve the data query efficiency, after receiving the query statement submitted to the target database, the query parameters can be first extracted from the query statement, and the target database will pre-establish a query parameter table for storing the query parameters, and a parameter information recording table for storing parameter information related to the query parameters; thereby, when the query parameters meet the parameter reuse conditions corresponding to the parameter information recording table, the parameter identifier corresponding to the query parameter can be obtained, and based on this, the parameter information field of the corresponding query parameter in the parameter information recording table is updated according to the parameter identifier, and the sub-query statement corresponding to the query parameter is determined according to the update result and the query parameter table; by cooperating with the query parameter table and the parameter information recording table, the query parameters can be reused, and any number of query parameters can be cached through the query parameter table, thereby supporting the query statement containing any number of query parameters to complete the access to the target database and ensure query efficiency. Finally, the subquery statement can be used to update the query statement to the target query statement, and the target data can be queried in the target database by executing the target query statement. When the query statement contains any number of query parameters, the query parameters can be replaced with subquery statements, so that the database can complete the execution of the query statement corresponding to any query parameters, thereby effectively improving the data query efficiency.
[0101] Corresponding to the above method embodiment, this specification also provides a statement execution device embodiment, Figure 4 FIG. 1 shows a schematic diagram of the structure of a statement execution device provided by an embodiment of the present specification. Figure 4 As shown, the device comprises:
[0102] The receiving module 402 is configured to receive a query statement submitted to a target database and extract query parameters from the query statement, wherein the target database includes a query parameter table and a parameter information record table;
[0103] The acquisition module 404 is configured to acquire a parameter identifier corresponding to the query parameter if the query parameter satisfies a parameter reuse condition corresponding to the parameter information record table;
[0104] An updating module 406 is configured to update the parameter information field corresponding to the query parameter in the parameter information record table according to the parameter identifier, and determine the sub-query statement corresponding to the query parameter according to the update result and the query parameter table;
[0105] The execution module 408 is configured to update the query statement into a target query statement by using the sub-query statement, and query the target data in the target database by executing the target query statement.
[0106] In an optional embodiment, the acquisition module 404 is further configured to:
[0107] The query parameters are sorted, and parameter summary information corresponding to the sorted query parameters is calculated, and the parameter information record table is queried based on the parameter summary information; the query parameter information matching the parameter summary information is determined according to the query result, and when the sorting value of the query parameter information is the same as the sorting value of the sorted query parameters and the modification time difference of the query parameter information is less than a set time difference threshold, it is determined that the query parameters meet the parameter reuse conditions corresponding to the parameter information record table, and the step of obtaining the parameter identifier corresponding to the query parameter is performed.
[0108] In an optional embodiment, the updating module 406 is further configured to:
[0109] Determine the target parameter information corresponding to the parameter identifier in the parameter information record table; obtain a parameter usage count field, a parameter reference count field, and a parameter operation time field by parsing the target parameter information; use the parameter usage count field, the parameter reference count field, and the parameter operation time field as parameter information fields corresponding to the query parameters; and multiplex and update the parameter information fields.
[0110] In an optional embodiment, the execution module 408 is further configured to:
[0111] The query parameter is determined in the query statement; the query parameter is replaced by the sub-query statement to obtain a target query statement, and the step of querying target data in the target database by executing the target query statement is performed.
[0112] In an optional embodiment, the device further comprises:
[0113] The storage module is configured to construct new parameter information and a new parameter identifier for the query parameter when the query parameter does not meet the parameter reuse condition corresponding to the parameter information recording table; establish an association relationship between the query parameter and the new parameter information and the new parameter identifier; store the query parameter in the query parameter table based on the association relationship, and store the new parameter information in the parameter information recording table.
[0114] In an optional embodiment, the device further comprises:
[0115] The deletion module is configured to determine the operation time difference and the number of references corresponding to each parameter information in the parameter information record table; filter the parameter information whose operation time difference is greater than the operation time difference threshold and the number of references is equal to the set number threshold as the parameter information to be deleted; determine the expired parameter identifier corresponding to the parameter information to be deleted; delete the parameter information to be deleted corresponding to the expired parameter identifier in the parameter information record table, and delete the expired query parameter corresponding to the expired parameter identifier in the query parameter table.
[0116] In an optional embodiment, the device further comprises:
[0117] The construction module is configured to obtain at least one candidate query parameter by traversing the query parameter table; and construct a candidate sub-query statement for each candidate query parameter, wherein the candidate sub-query statement is used to update the query statement in the query parameter reuse task.
[0118] In an optional embodiment, the device further comprises:
[0119] The update field module is configured to multiplex and update the parameter usage count field, the parameter reference count field and the parameter operation time field according to the parameter identifier when the target query statement is executed.
[0120] The statement execution device provided in the present embodiment can, in order to support the query statement containing multiple query parameters and also complete the data query, and further improve the data query efficiency, after receiving the query statement submitted to the target database, first extract the query parameters from the query statement, and the target database will pre-establish a query parameter table for storing the query parameters, and a parameter information recording table for storing parameter information related to the query parameters; thereby, when the query parameter satisfies the parameter reuse condition corresponding to the parameter information recording table, the parameter identifier corresponding to the query parameter can be obtained, and based on this, the parameter information field corresponding to the query parameter in the parameter information recording table is updated according to the parameter identifier, and the sub-query statement corresponding to the query parameter is determined according to the update result and the query parameter table; the query parameter table and the parameter information recording table are coordinated to support the reuse of query parameters, and any number of query parameters can be cached through the query parameter table, thereby supporting the query statement containing any number of query parameters to still complete the access to the target database, and ensuring the query efficiency. Finally, the subquery statement can be used to update the query statement to the target query statement, and the target data can be queried in the target database by executing the target query statement. When the query statement contains any number of query parameters, the query parameters can be replaced with subquery statements, so that the database can complete the execution of the query statement corresponding to any query parameters, thereby effectively improving the data query efficiency.
[0121] The above is a schematic scheme of a statement execution device of this embodiment. It should be noted that the technical scheme of the statement execution device and the technical scheme of the above statement execution method belong to the same concept, and the details not described in detail in the technical scheme of the statement execution device can be referred to the description of the technical scheme of the above statement execution method.
[0122] Figure 5 The structure block diagram of a computing device 500 provided according to an embodiment of the present specification is shown. The components of the computing device 500 include but are not limited to a memory 510 and a processor 520. The processor 520 is connected to the memory 510 via a bus 530, and the database 550 is used to store data.
[0123] The computing device 500 also includes an access device 540 that enables the computing device 500 to communicate via one or more networks 560. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 540 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, and a near field communication (NFC).
[0124] In one embodiment of the present specification, the above components of the computing device 500 and Figure 5 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 5 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0125] The computing device 500 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 500 may also be a mobile or stationary server.
[0126] The processor 520 is used to execute the following computer executable instructions, which, when executed by the processor, implement the steps of the above statement execution method.
[0127] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above statement execution method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above statement execution method.
[0128] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which can implement the steps of the above statement execution method when executed by a processor.
[0129] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above statement execution method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above statement execution method.
[0130] An embodiment of the present specification also provides a computer program product, including a computer program or instructions, which implements the steps of the above statement execution method when executed by a processor.
[0131] The above is a schematic scheme of a computer program product of this embodiment. It should be noted that the technical scheme of the computer program product and the technical scheme of the above statement execution method belong to the same concept, and the details not described in detail in the technical scheme of the computer program product can be referred to the description of the technical scheme of the above statement execution method.
[0132] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0133] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0134] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0135] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0136] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can understand and use this specification well.
Claims
1. A statement execution method, characterized in that: include: Receiving a query statement submitted to a target database, and extracting a query parameter from the query statement, wherein the target database includes a query parameter table and a parameter information record table, the query statement is an SQL statement concatenated with at least one IN parameter, and the query parameter is an IN parameter; The parameter information recording table is queried based on the parameter summary information corresponding to the query parameter, and a ranking value of the query parameter information matched by the parameter summary information is determined according to the query result. If the ranking value of the query parameter after sorting is the same, and the modification time difference of the query parameter information is less than a set time threshold, the query parameter satisfies the parameter reuse condition corresponding to the parameter information recording table, and a parameter identifier corresponding to the query parameter is obtained; updating the parameter information field corresponding to the query parameter in the parameter information record table according to the parameter identifier, and determining the sub-query statement corresponding to the query parameter according to the update result and the query parameter table; The query statement is updated to a target query statement by using the sub-query statement, and target data is searched in the target database by executing the target query statement.
2. The statement execution method according to claim 1, characterized in that: The querying the parameter information record table based on the parameter summary information corresponding to the query parameter, determining the ranking value of the query parameter information matched by the parameter summary information according to the query result, which is the same as the ranking value of the query parameter after sorting, and the query parameter satisfies the parameter reuse condition corresponding to the parameter information record table when the modification time difference of the query parameter information is less than the set time threshold, and obtaining the parameter identifier corresponding to the query parameter includes: Sorting the query parameters, calculating parameter summary information corresponding to the sorted query parameters, and querying the parameter information record table based on the parameter summary information; Determine the query parameter information that matches the parameter summary information based on the query result, and when the ranking value of the query parameter information is the same as the ranking value of the sorted query parameter and the modification time difference of the query parameter information is less than the set time difference threshold, determine that the query parameter meets the parameter reuse condition corresponding to the parameter information record table, and execute the step of obtaining the parameter identifier corresponding to the query parameter.
3. The statement execution method according to claim 1, characterized in that: The updating of the parameter information field corresponding to the query parameter in the parameter information record table according to the parameter identifier includes: Determine the target parameter information corresponding to the parameter identifier in the parameter information record table; By parsing the target parameter information, a parameter usage count field, a parameter reference count field, and a parameter operation time field are obtained; The parameter usage count field, the parameter reference count field and the parameter operation time field are used as parameter information fields corresponding to the query parameter; A multiplexing update is performed on the parameter information field.
4. The statement execution method according to claim 1, characterized in that: The updating the query statement to a target query statement by using the sub-query statement, and searching for target data in the target database by executing the target query statement, includes: Determining the query parameter in the query statement; The query parameter is replaced by the sub-query statement to obtain a target query statement, and the step of querying target data in the target database by executing the target query statement is performed.
5. The statement execution method according to claim 1, characterized in that: After the step of extracting the query parameters from the query statement is executed, the method further includes: In the case where the query parameter does not satisfy the parameter reuse condition corresponding to the parameter information record table, constructing new parameter information and a new parameter identifier for the query parameter; Establishing an association relationship between the query parameter and the newly added parameter information and the newly added parameter identifier; The query parameters are stored in the query parameter table based on the association relationship, and the newly added parameter information is stored in the parameter information recording table.
6. The statement execution method according to any one of claims 1 to 5, characterized in that: After the step of querying the target data in the target database by executing the target query statement is performed, the method further includes: Determine the operation time difference and the number of references corresponding to each piece of parameter information in the parameter information record table; Filter parameter information whose operation time difference is greater than the operation time difference threshold and whose reference count is equal to the set reference count threshold as parameter information to be deleted; Determine an expired parameter identifier corresponding to the parameter information to be deleted; The to-be-deleted parameter information corresponding to the expired parameter identifier is deleted from the parameter information record table, and the expired query parameter corresponding to the expired parameter identifier is deleted from the query parameter table.
7. The statement execution method according to any one of claims 1 to 5, characterized in that: Before the step of updating the parameter information field corresponding to the query parameter in the parameter information record table according to the parameter identifier is executed, the method further includes: Obtain at least one candidate query parameter by traversing the query parameter table; A candidate sub-query statement is constructed for each candidate query parameter, wherein the candidate sub-query statement is used to update the query statement in the query parameter reuse task.
8. The statement execution method according to claim 3, characterized in that: After the step of querying the target data in the target database by executing the target query statement is performed, the method further includes: When the target query statement is executed, the parameter usage count field, the parameter reference count field and the parameter operation time field are multiplexed and updated according to the parameter identifier.
9. A computing device, characterized in that include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the method described in any one of claims 1 to 8 are implemented.
10. A computer-readable storage medium, characterized in that: It stores computer executable instructions, which, when executed by a processor, implement the steps of the method described in any one of claims 1 to 8.
11. A computer program product, characterized in that The method comprises a computer program or an instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Data inquiry method, correlation device and database system
CN109241093A
Data query method, middleware, electronic device and storage medium
CN113553339A