Database operation execution method and device, computer equipment and storage medium

By obtaining and analyzing the characteristic information of database operation instructions, selecting and applying appropriate instruction execution templates for data conversion, the problem of poor compatibility of database operation instructions in different data source environments is solved, and higher compatibility and flexibility is achieved.

CN119537431APending Publication Date: 2025-02-28CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411634597.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

In different data source environments, the compatibility flexibility of database operation instructions is poor, and compatibility issues cannot be effectively solved by updating the data source plug-in.

Method used

By obtaining the instruction characteristic information of the initial operation instructions, selecting the instruction execution template, performing data conversion to generate target operation instructions, and using the target parser to execute target operation instructions, improving the compatibility of database operation instructions.

Benefits of technology

Improves the compatibility and flexibility of database operation instructions in different data sources, and can more effectively deal with various compatibility issues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537431A_ABST
    Figure CN119537431A_ABST
Patent Text Reader

Abstract

The invention relates to a database operation execution method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the steps of obtaining at least one kind of instruction feature information of an initial operation instruction in response to the initial operation instruction; selecting an instruction execution template according to the instruction feature information; according to the instruction execution template, performing data conversion on instruction data of the initial operation instruction to obtain target instruction data, and generating a target operation instruction according to the target instruction data; and calling a target analyzer according to the instruction execution template and the target operation instruction, and executing the target operation instruction by using the target analyzer. By adopting the method, the compatibility flexibility of database operation instructions in different data sources can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data technology, and in particular to a database operation execution method, apparatus, computer equipment, storage medium and computer program product. Background Art

[0002] In big data technology, data source management is particularly important. The data source management function plays the most important role in the entire big data platform. Its primary solution is the data management and crawling of various heterogeneous data sources.

[0003] For different usage environments, the compatibility of database operation instructions is particularly important. In related technologies, different data source plug-ins are used to distinguish database operation instructions to achieve compatibility. However, in actual business scenarios, due to problems such as environmental deployment, confidentiality, deployment upgrade reviews, etc., it is often impossible to address various compatibility issues by updating the data source plug-in, resulting in poor compatibility and flexibility of database operation instructions executed in different data source plug-ins. Summary of the invention

[0004] Based on this, it is necessary to provide a database operation execution method, apparatus, computer equipment, computer-readable storage medium and computer program product that can improve the compatibility flexibility of database operation instructions in different data sources in response to the above technical problems.

[0005] In a first aspect, the present application provides a method for executing a database operation, comprising:

[0006] In response to an initial operation instruction, acquiring at least one instruction feature information of the initial operation instruction;

[0007] Selecting an instruction execution template according to the instruction feature information;

[0008] According to the instruction execution template, data conversion is performed on the instruction data of the initial operation instruction to obtain target instruction data, and a target operation instruction is generated according to the target instruction data;

[0009] The target parser is called according to the instruction execution template and the target operation instruction, and the target parser is used to execute the target operation instruction.

[0010] In one embodiment, selecting an instruction execution template according to the instruction feature information includes:

[0011] Determine the priorities of a plurality of preset execution templates according to the instruction characteristic information to obtain a priority sequence;

[0012] According to the priority sequence, an instruction execution template is selected.

[0013] In one embodiment, selecting an instruction execution template according to the priority sequence includes:

[0014] Select the preset execution template with the highest priority in the current priority sequence as the instruction execution template;

[0015] Correspondingly, after executing the target operation instruction using the target parser, the method further includes:

[0016] In the case where the target operation instruction is not successfully executed, the instruction execution template is removed from the current priority sequence, and the step of selecting the preset execution template with the highest priority in the current priority sequence as the instruction execution template is re-executed.

[0017] In one embodiment, the instruction characteristic information includes a field type, a field length, and a field specific value; and determining the priorities of multiple preset execution templates according to the instruction characteristic information to obtain a priority sequence includes:

[0018] Extracting multiple candidate preset execution templates according to the field type;

[0019] Calculate the matching degree data of each candidate preset execution template according to the field length and the field specific value;

[0020] The matching degree data is sorted to obtain a priority sequence.

[0021] In one embodiment, calling a target parser according to the instruction execution template and the target operation instruction includes:

[0022] Selecting a target parser according to the sub-instruction statement in the target operation instruction;

[0023] The calling order of each of the target parsers is determined according to the instruction execution template.

[0024] In one embodiment, the sub-instruction statement in the target operation instruction includes at least one of a loop statement, a non-empty judgment statement, a specific value judgment statement, an associated query statement, and a parameter placeholder; and executing the target operation instruction using the target parser includes:

[0025] In the case where the target operation instruction includes a parameter placeholder, a parameter parser is used to replace the parameter placeholder with the acquired real parameter value.

[0026] In a second aspect, the present application further provides a database operation execution device, comprising:

[0027] An instruction receiving module, configured to obtain at least one instruction characteristic information of the initial operation instruction in response to the initial operation instruction;

[0028] A template selection module, used to select an instruction execution template according to the instruction feature information;

[0029] A data conversion module, used to perform data conversion on the instruction data of the initial operation instruction according to the instruction execution template to obtain target instruction data, and generate a target operation instruction according to the target instruction data;

[0030] An instruction execution module is used to call a target parser according to the instruction execution template and the target operation instruction, and use the target parser to execute the target operation instruction.

[0031] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0032] In response to an initial operation instruction, acquiring at least one instruction feature information of the initial operation instruction;

[0033] Selecting an instruction execution template according to the instruction feature information;

[0034] According to the instruction execution template, data conversion is performed on the instruction data of the initial operation instruction to obtain target instruction data, and a target operation instruction is generated according to the target instruction data;

[0035] The target parser is called according to the instruction execution template and the target operation instruction, and the target parser is used to execute the target operation instruction.

[0036] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0037] In response to an initial operation instruction, acquiring at least one instruction feature information of the initial operation instruction;

[0038] Selecting an instruction execution template according to the instruction feature information;

[0039] According to the instruction execution template, data conversion is performed on the instruction data of the initial operation instruction to obtain target instruction data, and a target operation instruction is generated according to the target instruction data;

[0040] The target parser is called according to the instruction execution template and the target operation instruction, and the target parser is used to execute the target operation instruction.

[0041] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0042] In response to an initial operation instruction, acquiring at least one instruction feature information of the initial operation instruction;

[0043] Selecting an instruction execution template according to the instruction feature information;

[0044] According to the instruction execution template, data conversion is performed on the instruction data of the initial operation instruction to obtain target instruction data, and a target operation instruction is generated according to the target instruction data;

[0045] The target parser is called according to the instruction execution template and the target operation instruction, and the target parser is used to execute the target operation instruction.

[0046] The above-mentioned database operation execution method, device, computer equipment, storage medium and computer program product respond to the initial operation instruction by obtaining at least one instruction feature information of the initial operation instruction, and then selecting an instruction execution template based on the instruction feature information. The instruction execution template can reassemble the data corresponding to the initial operation instruction according to the requirements of the target data source plug-in. Therefore, according to the instruction execution template, the instruction data of the initial operation instruction is converted to obtain the target instruction data compatible with the target data source plug-in, and then the target operation instruction is generated according to the target instruction data, and the target parser is called according to the instruction execution template and the target operation instruction. The target operation instruction is executed using the target parser, which can improve the compatibility and flexibility of database operation instructions in different data sources. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0048] FIG1 is an application environment diagram of a method for executing database operations in one embodiment;

[0049] FIG2 is a schematic diagram of a flow chart of a method for executing database operations in one embodiment;

[0050] FIG3 is a schematic diagram of a flow chart of a method for executing database operations in another embodiment;

[0051] FIG4 is a structural block diagram of a database operation execution device in one embodiment;

[0052] FIG5 is a diagram showing the internal structure of a computer device in one embodiment;

[0053] FIG. 6 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0055] The database operation execution method provided in the embodiment of the present application can be applied in the application environment shown in Figure 1. Among them, the terminal 102 communicates with the server 104 through the network, and the terminal 102 can be used to receive the user's operation command and send the initial operation instruction to the server 104 according to the operation command. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The data storage system can be used to store instruction feature information and a variety of instruction execution templates. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.

[0056] In an exemplary embodiment, taking the selected instruction execution template as an SQL (Structured Query Language) execution template as an example, as shown in FIG2 , a database operation execution method is provided, and the method is applied to the server 104 in FIG1 as an example for description, including the following steps S202 to S208. Among them:

[0057] Step S202: in response to the initial operation instruction, obtaining at least one instruction characteristic information of the initial operation instruction.

[0058] The instruction characteristic information may include data such as field type, field length, and field specific value, and may also include information such as specified plug-in identity information, driver module identity information, and execution method name. Exemplarily, the initial operation instruction may be an SQL statement, and the server 104 may receive the SQL statement sent by the terminal 102, and simultaneously parse out one or more instruction characteristic information of the SQL statement.

[0059] Step S204: selecting an instruction execution template according to instruction feature information.

[0060] Exemplarily, the server 104 may determine the priorities of multiple preset execution templates according to the instruction feature information, obtain a priority sequence, and then select an instruction execution template according to the priority sequence. For example, the server 104 may select the preset execution template with the highest priority in the current priority sequence as the instruction execution template. The server 104 may also execute the instruction execution templates in order according to their priorities. If the SQL template of the current priority fails to execute, the next priority is executed until a SQL template of a certain priority is successfully executed or all SQL templates fail to execute. If all fail to execute, the SQL execution exception information of the first priority is returned.

[0061] Step S206, performing data conversion on the instruction data of the initial operation instruction according to the instruction execution template to obtain target instruction data, and generating a target operation instruction according to the target instruction data.

[0062] Exemplarily, taking format conversion as an example, the server 104 can perform data conversion on the instruction data of the initial operation instruction according to the instruction execution template to obtain the target instruction data. The instruction execution template for format conversion can be the following table structure:

[0063]

[0064] Among them, params is set with el expression, and multiple values ​​are separated by commas, which are consistent with the order of placeholders. For example, ${database} means to get the placeholder '?' corresponding to the value of `table_schema` in all tables, and use el expression to get the corresponding value from the passed parameter.

[0065] Among them, convert contains two attributes, before and after, which represent the rules of the incoming parameters and the rules of the execution results respectively. They are mainly for the conversion of SQL type and JDBC type values. The conversion rules depend on the format conversion template. Before and after mainly contain column field name, type field type, length field length, and value field value. They are used to correspond to the parameter name in the incoming parameters or the column name in the execution result and extract the corresponding value, and then convert it into the corresponding value through the value and format conversion template.

[0066] Among them, result_set mainly includes three attributes: mapping, merge, and single, which respectively indicate whether to rename the column name of the execution result, whether to return a single row result, and whether to return a single column result.

[0067] Among them, group_by_union mainly includes two properties: union Foreach and group By Key, which respectively represent the value name of the corresponding input parameter concatenated in the union loop when SQL is generated and the column name of the grouping and merging when the result is returned.

[0068] Among them, with_where mainly includes two attributes: index and with, which respectively indicate the order of the placeholders in the where condition corresponding to the placeholders in the entire SQL statement, starting with 0; and whether the where keyword is included when generating the SQL of the where condition.

[0069] Step S208, calling the target parser according to the instruction execution template and the target operation instruction, and using the target parser to execute the target operation instruction.

[0070] For example, when the target operation instruction is not successfully executed, the server 104 may remove the instruction execution template from the current priority sequence, and re-execute the step of selecting the preset execution template with the highest priority in the current priority sequence as the instruction execution template.

[0071] Exemplarily, the server 104 may select a target parser according to the sub-instruction statements in the target operation instruction, and determine the calling order of each target parser according to the instruction execution template. The sub-instruction statements in the target operation instruction include at least one of a loop statement, a non-empty judgment statement, a specific value judgment statement, an associated query statement, and a parameter placeholder;

[0072] Furthermore, the target parser can be used to process the condition parameter and generate the where condition SQL to execute the target operation instruction. The system will first generate the WHERE part of the SQL statement according to the query condition (for example: age > 30) passed in; used to parse the forEach structure and generate multiple SQL conditions according to the given loop data; used to parse the notNull structure to check whether a field is not empty; used to parse the equal structure to generate a query condition equal to a certain value; used to parse the join structure to process the connection query between multiple tables; used to parse the empty structure to check whether a field is empty or an empty string; used to parse the params parameter structure to process the dynamic parameters in the SQL statement; used to process the union logic and generate the union splicing SQL; and can also be used to process the corresponding el parameter in the SQL. Exemplarily, when the target operation instruction includes a parameter placeholder, the server 104 can use the parameter parser to replace the parameter placeholder with the obtained real parameter value.

[0073] After calling the target parser, the server 104 can extract the SQL statement parameters from the incoming parameters according to the SQL template, encapsulate them into the original data source plug-in call data object, set the corresponding SQL execution method for the data object according to the execution type of the SQL template, and remap the column names in the SQL execution result according to the Mapping mapping rules. Among them, the mapped column names support fuzzy regular matching to be compatible with the return list of the show databases statement. Next, the server 104 can convert the values ​​in the execution result according to the SQL template, and merge the query results if the current SQL execution requires the results to be merged.

[0074] Furthermore, there are several scenarios for merging: first, a single-column return result without the display of the column name, for example, [{a:1},{a:2}] is converted to [1,2]; second, a single-row return result only returns the data of the first row, for example, [{a:1,b:1}] is converted to {a:1,b:1}, and the above two scenarios can be implemented together.

[0075] In the above-mentioned database operation execution method, by obtaining at least one instruction feature information of the initial operation instruction, and then selecting an instruction execution template based on the instruction feature information, the instruction execution template can reassemble the data corresponding to the initial operation instruction according to the requirements of the target data source plug-in. Therefore, according to the instruction execution template, the instruction data of the initial operation instruction is converted to obtain the target instruction data compatible with the target data source plug-in, and then the target operation instruction is generated based on the target instruction data, and the target parser is called according to the instruction execution template and the target operation instruction. The target operation instruction is executed using the target parser, which can improve the compatibility and flexibility of database operation instructions in different data sources.

[0076] In an exemplary embodiment, taking the selected instruction execution template as an SQL conversion template as an example, as shown in FIG3 , the priority of multiple preset execution templates is determined according to the instruction feature information, and the step of obtaining the priority sequence may include steps S302 to S306. Among them:

[0077] Step S302: extract multiple candidate preset execution templates according to the field type.

[0078] The format conversion template can be used for conversion of SQL type and JDBC (Java Database Connection) type.

[0079] Exemplarily, the server 104 may use the field type corresponding value as a query condition to obtain all format conversion templates as candidate preset execution templates.

[0080] Step S304: Calculate the matching data of each candidate preset execution template according to the field length and the field specific value.

[0081] Exemplarily, the server 104 may determine the min_length, max_length, min_value, and max_value in each format conversion template, find a conversion template that meets all the conditions, and calculate the matching data.

[0082] Step S306: sort the matching degree data to obtain a priority sequence.

[0083] For example, the server 104 may select one of the format conversion templates according to the matching degree data of the matching conversion templates, thereby replacing the value corresponding to the field type. If no match is found, the default format conversion template is used for replacement.

[0084] For example, the corresponding value of the type (field type) passed in is a JDBC type, such as INTEGER, length is 10, and value is 100. In the format conversion template, there are int, intunsigned, mediumint, and mediumint unsigned that meet the conditions and are sorted in order of priority. Since int meets the requirements, the replacement value is int. If value>2147483647, it exceeds the maximum value of the int type. In this case, int unsigned meets the requirements, so the replacement value is int unsigned.

[0085] Furthermore, the above format conversion template may have the following table structure:

[0086]

[0087] In another exemplary embodiment, the server 104 obtains at least one instruction feature information of the initial operation instruction in response to the initial operation instruction, extracts multiple candidate preset execution templates according to the field type, calculates the matching data of each candidate preset execution template according to the field length and the field specific value, sorts the matching data, and obtains a priority sequence.

[0088] Next, the server 104 selects the preset execution template with the highest priority in the current priority sequence as the instruction execution template, performs data conversion on the instruction data of the initial operation instruction according to the instruction execution template, obtains target instruction data, and generates a target operation instruction according to the target instruction data.

[0089] Subsequently, the server 104 selects a target parser according to the sub-instruction statements in the target operation instruction, determines the calling order of each target parser according to the instruction execution template, and uses the target parser to execute the target operation instruction. If the target operation instruction is not successfully executed, the instruction execution template is removed from the current priority sequence, and the step of selecting the preset execution template with the highest priority in the current priority sequence as the instruction execution template is re-executed.

[0090] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0091] Based on the same inventive concept, the embodiment of the present application also provides a database operation execution device for implementing the above-mentioned database operation execution method. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above-mentioned method, so the specific limitations in the one or more database operation execution device embodiments provided below can refer to the limitations of the database operation execution method above, and will not be repeated here.

[0092] In an exemplary embodiment, as shown in FIG. 4 , a database operation execution device is provided, comprising: an instruction receiving module 402, a template selecting module 404, a data conversion module 406 and an instruction execution module 408, wherein:

[0093] The instruction receiving module 402 is used to obtain at least one instruction characteristic information of the initial operation instruction in response to the initial operation instruction;

[0094] The template selection module 404 is used to select an instruction execution template according to instruction feature information;

[0095] The data conversion module 406 is used to perform data conversion on the instruction data of the initial operation instruction according to the instruction execution template to obtain target instruction data, and generate a target operation instruction according to the target instruction data;

[0096] The instruction execution module 408 is used to call the target parser according to the instruction execution template and the target operation instruction, and use the target parser to execute the target operation instruction.

[0097] In one embodiment, the template selection module 404 includes:

[0098] A priority determination unit, used to determine the priorities of a plurality of preset execution templates according to the instruction characteristic information to obtain a priority sequence;

[0099] The template selection unit is used to select an instruction execution template according to a priority sequence.

[0100] In one of the embodiments, the template selection unit is specifically used to: select a preset execution template with the highest priority in the current priority sequence as the instruction execution template;

[0101] Correspondingly, the instruction execution module 408 is also used to: when the target operation instruction is not executed successfully, remove the instruction execution template from the current priority sequence, and re-execute the step of selecting the preset execution template with the highest priority in the current priority sequence as the instruction execution template.

[0102] In one of the embodiments, the instruction feature information includes a field type, a field length, and a field specific value; the priority determination unit is specifically used to: extract multiple candidate preset execution templates according to the field type; calculate the matching data of each candidate preset execution template according to the field length and the field specific value; sort the matching data to obtain a priority sequence.

[0103] In one embodiment, the instruction execution module 408 is specifically used to: select a target parser according to a sub-instruction statement in the target operation instruction; and determine a calling order of each target parser according to an instruction execution template.

[0104] In one of the embodiments, the sub-instruction statement in the target operation instruction includes at least one of a loop statement, a non-empty judgment statement, a specific value judgment statement, an associated query statement, and a parameter placeholder; the instruction execution module 408 is also used to: when the target operation instruction includes a parameter placeholder, use a parameter parser to replace the parameter placeholder with the obtained actual parameter value.

[0105] Each module in the above-mentioned database operation execution device can be implemented in whole or in part by software, hardware or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0106] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG5. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store information such as instruction feature information and multiple instruction execution templates. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a database operation execution method is implemented.

[0107] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG6. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a database operation execution method is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0108] Those skilled in the art will understand that the structure shown in FIG. 6 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0109] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: in response to an initial operation instruction, obtaining at least one instruction feature information of the initial operation instruction; selecting an instruction execution template based on the instruction feature information; performing data conversion on the instruction data of the initial operation instruction based on the instruction execution template to obtain target instruction data, and generating a target operation instruction based on the target instruction data; calling a target parser based on the instruction execution template and the target operation instruction, and using the target parser to execute the target operation instruction.

[0110] In one embodiment, when executing a computer program, the processor further implements the following steps: determining priorities of a plurality of preset execution templates according to instruction feature information to obtain a priority sequence; and selecting an instruction execution template according to the priority sequence.

[0111] In one embodiment, when the processor executes the computer program, the following steps are also implemented: selecting the preset execution template with the highest priority in the current priority sequence as the instruction execution template; if the target operation instruction is not executed successfully, removing the instruction execution template from the current priority sequence, and re-executing the step of selecting the preset execution template with the highest priority in the current priority sequence as the instruction execution template.

[0112] In one embodiment, when the processor executes the computer program, the following steps are also implemented: extracting multiple candidate preset execution templates according to the field type; calculating the matching data of each candidate preset execution template according to the field length and the field specific value; sorting the matching data to obtain a priority sequence.

[0113] In one embodiment, when the processor executes the computer program, the following steps are also implemented: selecting a target parser according to a sub-instruction statement in the target operation instruction; and determining a calling order of each target parser according to an instruction execution template.

[0114] In one embodiment, when the processor executes the computer program, the following steps are further implemented: when the target operation instruction includes a parameter placeholder, the parameter placeholder is replaced with the acquired real parameter value using a parameter parser.

[0115] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: in response to an initial operation instruction, at least one instruction feature information of the initial operation instruction is obtained; based on the instruction feature information, an instruction execution template is selected; based on the instruction execution template, instruction data of the initial operation instruction is converted to obtain target instruction data, and a target operation instruction is generated based on the target instruction data; a target parser is called based on the instruction execution template and the target operation instruction, and the target parser is used to execute the target operation instruction.

[0116] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining the priorities of multiple preset execution templates according to the instruction feature information to obtain a priority sequence; and selecting the instruction execution template according to the priority sequence.

[0117] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: selecting the preset execution template with the highest priority in the current priority sequence as the instruction execution template; if the target operation instruction is not executed successfully, removing the instruction execution template from the current priority sequence, and re-executing the step of selecting the preset execution template with the highest priority in the current priority sequence as the instruction execution template.

[0118] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: extracting multiple candidate preset execution templates according to the field type; calculating the matching data of each candidate preset execution template according to the field length and the field specific value; sorting the matching data to obtain a priority sequence.

[0119] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: selecting a target parser according to a sub-instruction statement in the target operation instruction; and determining a calling order of each target parser according to an instruction execution template.

[0120] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: when the target operation instruction includes a parameter placeholder, the parameter placeholder is replaced with the acquired real parameter value using a parameter parser.

[0121] In one embodiment, a computer program product is provided, including a computer program, which implements the following steps when executed by a processor: in response to an initial operation instruction, obtaining at least one instruction feature information of the initial operation instruction; selecting an instruction execution template based on the instruction feature information; performing data conversion on the instruction data of the initial operation instruction based on the instruction execution template to obtain target instruction data, and generating a target operation instruction based on the target instruction data; calling a target parser based on the instruction execution template and the target operation instruction, and using the target parser to execute the target operation instruction.

[0122] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining the priorities of multiple preset execution templates according to the instruction feature information to obtain a priority sequence; and selecting the instruction execution template according to the priority sequence.

[0123] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: selecting the preset execution template with the highest priority in the current priority sequence as the instruction execution template; if the target operation instruction is not executed successfully, removing the instruction execution template from the current priority sequence, and re-executing the step of selecting the preset execution template with the highest priority in the current priority sequence as the instruction execution template.

[0124] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: extracting multiple candidate preset execution templates according to the field type; calculating the matching data of each candidate preset execution template according to the field length and the field specific value; sorting the matching data to obtain a priority sequence.

[0125] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: selecting a target parser according to a sub-instruction statement in the target operation instruction; and determining a calling order of each target parser according to an instruction execution template.

[0126] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: when the target operation instruction includes a parameter placeholder, the parameter placeholder is replaced with the acquired real parameter value using a parameter parser.

[0127] 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 this application 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 relevant regulations.

[0128] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0129] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0130] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for executing database operations, characterized in that: The method comprises: In response to an initial operation instruction, acquiring at least one instruction feature information of the initial operation instruction; Selecting an instruction execution template according to the instruction feature information; According to the instruction execution template, data conversion is performed on the instruction data of the initial operation instruction to obtain target instruction data, and a target operation instruction is generated according to the target instruction data; The target parser is called according to the instruction execution template and the target operation instruction, and the target parser is used to execute the target operation instruction.

2. The method according to claim 1, characterized in that The selecting the instruction execution template according to the instruction feature information includes: Determine the priorities of a plurality of preset execution templates according to the instruction characteristic information to obtain a priority sequence; According to the priority sequence, an instruction execution template is selected.

3. The method according to claim 2, characterized in that The step of selecting an instruction execution template according to the priority sequence includes: Select the preset execution template with the highest priority in the current priority sequence as the instruction execution template; Correspondingly, after executing the target operation instruction using the target parser, the method further includes: In the case where the target operation instruction is not executed successfully, the instruction execution template is removed from the current priority sequence, and the step of selecting the preset execution template with the highest priority in the current priority sequence as the instruction execution template is re-executed.

4. The method according to claim 2, characterized in that: The instruction characteristic information includes a field type, a field length, and a field specific value; the priority of multiple preset execution templates is determined according to the instruction characteristic information to obtain a priority sequence, including: Extracting multiple candidate preset execution templates according to the field type; Calculate the matching degree data of each candidate preset execution template according to the field length and the field specific value; The matching degree data is sorted to obtain a priority sequence.

5. The method according to claim 4, characterized in that The calling of the target parser according to the instruction execution template and the target operation instruction comprises: Selecting a target parser according to the sub-instruction statement in the target operation instruction; The calling order of each of the target parsers is determined according to the instruction execution template.

6. The method according to claim 5, characterized in that The sub-instruction statement in the target operation instruction includes at least one of a loop statement, a non-empty judgment statement, a specific value judgment statement, an associated query statement, and a parameter placeholder; The using the target parser to execute the target operation instruction includes: In the case where the target operation instruction includes a parameter placeholder, a parameter parser is used to replace the parameter placeholder with the acquired real parameter value.

7. A database operation execution device, characterized in that: The device comprises: An instruction receiving module, configured to obtain at least one instruction characteristic information of the initial operation instruction in response to the initial operation instruction; A template selection module, used to select an instruction execution template according to the instruction feature information; A data conversion module, used to perform data conversion on the instruction data of the initial operation instruction according to the instruction execution template to obtain target instruction data, and generate a target operation instruction according to the target instruction data; An instruction execution module is used to call a target parser according to the instruction execution template and the target operation instruction, and use the target parser to execute the target operation instruction.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.