Method for executing database operation instruction, apparatus, device and storage medium
By receiving table operation instructions in the database system and determining the sub-operation set, a series of complex operations including AI operations and data processing operations are automatically executed, which solves the problem of high complexity of AI-related processing instructions in the database system and improves the user's operation efficiency.
Patent Information
- Application Number
- PCT/CN2024/085276
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-19
- Filing Date
- 2024-04-01
- Publication Date
- 2025-03-06
AI Technical Summary
In the database system, the instructions of AI-related processing are complex, resulting in low user operation efficiency.
By receiving table operation instructions, the corresponding sub-operation set is determined, including data processing operations and AI operations, the data in the data table is provided to the AI server and the model creation request is sent to automatically perform a series of complex operations including AI operations and data processing operations.
Users only need to enter simple table operation instructions to trigger automatic execution of complex operations, which improves operation efficiency.
Smart Images

Figure CN2024085276_06032025_PF_FP_ABST
Abstract
Description
Method, device, equipment and storage medium for executing database operation instructions
[0001] This disclosure claims priority to Chinese patent application No. 202311117702.3 filed on August 31, 2023, entitled “A database system and AI model training method”, and Chinese patent application No. 202311211296.7 filed on September 19, 2023, entitled “Method, device, equipment and storage medium for executing database operation instructions”, the entire contents of which are incorporated by reference into this disclosure. Technical Field
[0002] The present disclosure relates to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for executing database operation instructions. Background Art
[0003] Artificial intelligence (AI) technology has been applied to various fields. Database systems often involve AI-related processing, such as creating and deleting AI models. In database systems, AI-related processing is not simply a simple data calculation process, but a complex process that combines database-related and AI-related operations. This complex process often requires the user to enter a series of commands to complete the execution, resulting in high command complexity and low operational efficiency.
[0004] Summary of the Invention
[0005] The present disclosure provides a method, apparatus, device, and storage medium for executing database operation instructions, which can improve user operation efficiency.
[0006] In a first aspect, a method for executing database operation instructions is provided. The method is applied to a database system and includes: first, receiving a first table operation instruction, wherein the first table operation instruction is for adding a column in a data table; then, based on the first table operation instruction, determining a corresponding sub-operation set, wherein the sub-operation set includes at least one data processing operation and at least one artificial intelligence (AI) operation, wherein the at least one artificial intelligence (AI) operation includes training an AI model based on data in the data table; then, providing the data in the data table to an AI server and sending a model creation request to the AI server, wherein the model creation request is for instructing the AI server to train an AI model based on the data in the data table; and finally, obtaining the AI model.
[0007] The first table of operation instructions adds instructions to the column of the extended syntax. Based on the first table of operation instructions, the AI model is created and trained, ultimately obtaining a series of operations for the AI model. The obtained AI model includes the model algorithm type and model mathematical parameters (these are the values obtained after training).
[0008] In this way, table operation instructions can trigger the automatic execution of a series of complex operations including at least one AI operation and at least one data processing operation. Users only need to enter simple table operation instructions instead of a series of complex operation instructions, which can improve operational efficiency.
[0009] In one possible implementation, the first table operation instruction may include a first key field, which is used to define a column as a prediction column, where the prediction column is defined to record the inference result of the AI model. Based on the first key field, the first table operation instruction can be determined, and then the corresponding sub-operation set can be determined.
[0010] The first key field can be set to any field not used by the database operation instruction, and the first key field can be added to a specified position of the first table operation instruction.
[0011] In this way, triggering the relevant processing logic of the above sub-operation set by identifying the first key field has simpler logic than other triggering methods and can improve processing efficiency.
[0012] In one possible implementation, after obtaining the trained AI model, an execution function of the AI model is further generated, and the execution function is used to call the AI model.
[0013] In this way, by calling the execution function to call the AI model, it is possible to make it easier for the database server to perform AI operations.
[0014] In one possible implementation, a mapping relationship between columns of a data table and an AI model is recorded.
[0015] The database server maintains a table name-column name-function name mapping table, which is used to record the correspondence between the execution function created by the column addition instruction of the extended syntax and the data table and column.
[0016] In this way, the mapping table can quickly determine the AI model corresponding to the table operation instruction, improving the efficiency of operations related to the AI model. Moreover, a simple column addition instruction can trigger the execution of more complex sub-operation sets, which can also improve operational efficiency.
[0017] In a possible implementation manner, a column is added to the data table based on the first table operation instruction.
[0018] Based on the column adding instruction of the extended syntax, a corresponding column adding instruction of the general syntax is generated, and then a column is added to the data table.
[0019] In this way, a simple column addition instruction can trigger the execution of a more complex set of sub-operations, thereby improving operation efficiency.
[0020] In one possible implementation, when a call instruction to an execution function of an AI model is received, the corresponding processing may include: inputting the inference condition parameters in the call instruction into the AI model to obtain a first inference result, and feeding back the first inference result as a response to the call instruction.
[0021] In this way, directly calling functions can simplify the instruction processing logic and improve the efficiency of the AI model reasoning process.
[0022] In one possible implementation, when a first field query instruction for a data table is received, the corresponding processing may include: based on the mapping relationship between the above-mentioned columns and the AI model, determining that the AI model needs to be used, and then inputting the query condition parameters in the first field query instruction into the AI model to obtain a second inference result, and feeding back the second inference result as a response to the first field query instruction.
[0023] If a row of data in the data table includes the query condition parameter, the field corresponding to the above column name in the row can be further determined. This field can be considered as the query target field of the above field query instruction, and the inference result can be added to the query target field.
[0024] If the query parameter isn't included in any row of data in the data table, you can create a new row and add the query parameter there. Each query parameter consists of a column name and a value. In that row, you can identify the field corresponding to the column name and add the corresponding value to that field. Additionally, you can identify the field in that row that corresponds to the predicted column name. This field can be considered the target field for the aforementioned field query instruction, and the inference result can be added to the target field.
[0025] In this way, a field query instruction can trigger the automatic execution of a series of complex operations including at least one AI operation and at least one data processing operation. Users only need to enter a simple field query instruction instead of a series of complex operation instructions, which can improve operational efficiency.
[0026] In one possible implementation, after obtaining the inference result of the AI model, the inference result of the AI model is recorded in the above-mentioned prediction column.
[0027] In this way, a simple field query instruction can trigger the execution of a more complex set of sub-operations, thereby improving operational efficiency.
[0028] In one possible implementation, when a second field query instruction for a column of a data table is received, the corresponding processing may include: determining the target inference result from the column based on the query condition parameters in the second field query instruction, and then feeding back the target inference result as the query result of the second field query instruction.
[0029] In this way, if AI model inference has been performed based on the first field query instruction and the inference results have been filled in the data table, then when the second field query instruction with the same query condition parameters as the first field query instruction is executed subsequently, there is no need to perform AI model inference again, and data query can be simply performed, which can improve processing efficiency.
[0030] In one possible implementation, when a second table operation instruction is received, the AI model and / or the execution function of the AI model is deleted based on the mapping relationship between the column and the AI model. The second table operation instruction is used to delete a column in the data table.
[0031] The second table operation instruction may be a column deletion instruction of an extended syntax, which may include the first key field.
[0032] In this way, users only need to enter simple column deletion instructions to perform more complex query and deletion operations, which can improve operational efficiency.
[0033] In one possible implementation, the model creation request is further used to instruct the AI server to obtain data from a third-party storage service. Providing the data in the data table to the AI server may include storing the data in the third-party storage service.
[0034] The third-party storage service may be an object storage service (OBS) or a dataset.
[0035] In addition, in addition to transmitting data through a third-party storage server, the corresponding data can also be transmitted directly.
[0036] In this way, the reliability of data transmission can be improved.
[0037] In one possible implementation, before receiving the first table operation instruction, table creation processing may be performed, including: receiving a table creation instruction for creating a data table, wherein the table creation instruction adds a second key field corresponding to the target column; creating the data table, and determining indication information based on the second key field, wherein the indication information indicates that the target column in the data table is used to store training calibration data; and providing the indication information to the AI server after determining the corresponding sub-operation set.
[0038] In this way, the training calibration data can be specified more flexibly.
[0039] In a second aspect, a device for executing database operation instructions is provided, the device comprising at least one module, and the at least one module is used to implement the method provided by the above-mentioned first aspect and its possible implementation manner.
[0040] In a third aspect, a computing device cluster is provided, comprising at least one computing device, each computing device comprising a processor and a memory; the processor of at least one computing device is used to execute instructions stored in the memory of at least one computing device, so that the computing device cluster executes the method provided by the above-mentioned first aspect and its possible implementation methods.
[0041] In a fourth aspect, a computer-readable storage medium is provided, which includes computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method provided by the above-mentioned first aspect and its possible implementation manner.
[0042] In a fifth aspect, a computer program product comprising instructions is provided. When the instructions are executed by a computing device cluster, the computing device cluster executes the method provided by the first aspect and possible implementations thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] FIG1 is a schematic structural diagram of a data system provided by an embodiment of the present disclosure;
[0044] FIG2 is a flow chart of a method for executing a database operation instruction provided by an embodiment of the present disclosure;
[0045] FIG3 is a flow chart of a method for executing a column add instruction provided by an embodiment of the present disclosure;
[0046] FIG4 is a flow chart of a method for executing a column delete instruction provided by an embodiment of the present disclosure;
[0047] FIG5 is a flow chart of a method for executing a field query instruction provided by an embodiment of the present disclosure;
[0048] FIG6 is a flow chart of a method for executing a function call instruction provided by an embodiment of the present disclosure;
[0049] FIG7 is a flow chart of a method for executing a table creation instruction provided by an embodiment of the present disclosure;
[0050] FIG8 is a schematic structural diagram of a device for executing database operation instructions provided by an embodiment of the present disclosure;
[0051] FIG9 is a schematic diagram of a computing device provided by an embodiment of the present disclosure;
[0052] FIG10 is a schematic diagram of a computing device cluster provided by an embodiment of the present disclosure;
[0053] FIG11 is a schematic diagram of a computing device cluster provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0054] In order to make the objectives, technical solutions and advantages of the present disclosure more clear, the embodiments of the present disclosure will be further described in detail below with reference to the accompanying drawings.
[0055] The concepts involved in this disclosure are explained below:
[0056] database
[0057] A database is a collection of data with a specified data structure. The data in a database is generally stored in a two-dimensional table.
[0058] Table operation instructions
[0059] A table operation instruction is an instruction for performing table operations in a database. Table operations can include creating a table, adding columns, deleting columns, adding data, deleting data, querying data, and so on. A Structured Query Language (SQL) statement is a database query and programming language used to access data and query, update, and manage databases.
[0060] AI Operation
[0061] AI operations are machine learning-related operations, such as creating AI models (obtaining AI models that can be used for reasoning through training), reasoning, deleting AI models, and so on.
[0062] Training calibration data
[0063] Training calibration data is the data used as a reference value (or true value) for the output data during AI model training. It is generally calibrated manually or automatically by an algorithm. For example, for an AI model that identifies object types in images, if a sample image contains a car, the corresponding training calibration data may be a number representing the "car type."
[0064] Metadata of AI models
[0065] Metadata is data that describes data and can be considered as data attribute information. AI model metadata is the attribute information of the AI model, such as the model algorithm type.
[0066] Asynchronous mode and synchronous mode
[0067] Asynchronous mode refers to running multiple clients on a user terminal. Multiple clients can send operation instructions to the database server separately. The database server can process each operation instruction in parallel. For example, it can execute the creation process of multiple AI models in parallel. The processing process of each operation instruction can refer to the processing flow of the method for executing database operation instructions provided in the embodiments of this disclosure. The user terminal can display the execution status of each operation instruction, for example, AI model training in progress, AI model creation completed, etc.
[0068] Synchronous mode involves running a client on a user terminal. This client can be used to send one or more operation instructions to the database server. When multiple operation instructions are sent, the database server processes them sequentially and serially. The processing of each operation instruction can be found in the process flow of the method for executing database operation instructions provided in the embodiments of this disclosure. For executed operation instructions, the user terminal may display a completed status; for incomplete operation instructions, the user terminal may display a blocked status.
[0069] The present disclosure provides a method for executing database operation instructions. This method can be applied to a data system composed of a database server (or database system) 110 and an AI server (or AI system) 120. The structure of the data system is shown in Figure 1. The data system may also include an OBS device 130, a metadata service device 140, a dataset device 150, and the like. The following describes each component of the data system:
[0070] The database server 110 can be a server cluster or a single device. The database server is generally used to store massive amounts of data and to process database operation instructions sent by user devices. In the case of a server cluster, the database server can further include a scheduling server 111 and a storage engine server 112.
[0071] The scheduling server 111 can be responsible for instruction parsing, task allocation, task monitoring, execution control, etc. At the same time, the scheduling server can conveniently implement operations such as task execution, rerunning, and termination, and can conveniently view execution logs and timely monitor and manage task execution.
[0072] The storage engine server is the underlying component of the database and the core of the database. The main processing of the storage engine server can include creating, querying, updating, and deleting data tables.
[0073] AI server 120, also known as an AI engine server, is a framework that supports user development of machine learning and deep learning model training tasks, such as TensorFlow and MXNet. The AI engine server can be used for various AI operations, such as creating AI models.
[0074] The OBS device 130 is a third-party storage device that can provide large-capacity, secure, highly reliable, and low-cost data storage. It does not need to consider capacity limitations during use and provides a variety of storage types to meet user demands for various business scenarios.
[0075] The meta service device 140 is mainly used to store metadata, and in the embodiment of the present disclosure can be used to store metadata of an AI model.
[0076] The dataset device 150 is also a third-party storage device, generally used to build a small database.
[0077] In database applications, users hope to use simple database operation instructions to trigger the execution of some more complex combined operations, especially combined operations including AI operations, to improve operational efficiency and lower the threshold for using AI functions. To this end, the embodiment of the present disclosure provides a method for executing database operation instructions, as shown in Figure 2, including the following steps:
[0078] 201, receiving a table operation instruction.
[0079] The table operation instruction may be a table operation instruction that conforms to general SQL syntax rules. Alternatively, the table operation instruction may be a table operation instruction with extended syntax, in the following ways: Method 1: the table operation instruction may be a table operation instruction obtained by adding a first key field to a table operation instruction that conforms to general SQL syntax rules, and the first key field may be added to a specified position in the table operation instruction; Method 2: the table operation instruction may be a table operation instruction obtained by replacing a specified field in a table operation instruction that conforms to general SQL syntax rules with the first key field.
[0080] The table operation instructions of the embodiment of the present disclosure mainly take column adding instructions, column deleting instructions, and field query instructions as examples. Other situations are handled similarly and will not be described in detail. The following are examples of several table operation instructions, among which the column adding instruction is a column adding instruction of extended syntax, which is in the form of a table operation instruction obtained by adding the first key field to the specified position of the column adding instruction of general syntax, the column deleting instruction is a column deleting instruction of extended syntax, which is in the form of a table operation instruction obtained by adding the first key field to the specified position of the column deleting instruction of general syntax, and the field query instruction is a field query instruction of general syntax. The first key field can be set to any field that is not used by any database operation instruction. The embodiment of the present disclosure takes the first key field as PREDICT as an example to explain the solution in detail. Other situations are similar and will not be described in detail. The specific form is as follows:
[0081] Column addition instruction: ALTER TABLE table_name ADD PREDICT column_name datatype
[0082] ALTER TABLE table_name ADD column_name datatype is a table operation instruction in general syntax. Adding the first key field PREDICT to this instruction and placing it after ADD creates a column addition instruction in extended syntax. table_name is the name of the table to which the column is to be added, column_name is the name of the newly added column, and datatype is the format requirement for the data in the newly added column. For example, if datatype is char(20), it means that every data point in the column is in character format, and the maximum length of the data string is 20.
[0083] Column deletion instruction: ALTER TABLE table_name DROP PREDICT COLUMN column_name
[0084] ALTER TABLE table_name DROP COLUMN column_name is a table operation instruction with standard syntax. Adding the first key field PREDICT to this instruction and placing the first key field after DROP creates a column deletion instruction with extended syntax. table_name is the name of the table to be deleted, and column_name is the name of the column to be deleted.
[0085] Field query instruction: SELECT column_name FROM table_name AS SELECT……
[0086] Field query instructions use the standard syntax for table operations. table_name is the name of the table being queried, and column_name is the column name corresponding to the queried field. The fields following AS SELECT are query condition parameters, which can include one or more query condition parameters. Each query condition parameter consists of a column name and a condition value.
[0087] 202. Determine a corresponding sub-operation set based on the received table operation instruction.
[0088] The sub-operation set may include at least one AI operation, and in addition to the AI operation, may also include at least one data processing operation, such as adding or deleting a column in a table, updating a mapping table, and the like.
[0089] In the database server, a correspondence between table operation instructions and sub-operation sets may be stored. In this correspondence, different table operation instructions may correspond to different sub-operation sets. The sub-operation sets corresponding to various table operation instructions will be described in detail in the following content.
[0090] After receiving a table operation instruction using extended syntax, the database server can identify the first key field in the instruction to trigger the retrieval of the corresponding sub-operation set. This will be explained in detail later in conjunction with the execution process of column add and column delete instructions. For table operation instructions using standard syntax, a judgment can be made based on certain parameter information in the instruction to trigger the retrieval of the corresponding sub-operation set. This will be explained in detail later in conjunction with the execution process of field query instructions.
[0091] 203, execute the sub-operation set.
[0092] Different sub-operations may be executed by different entities: some are executed on the database server, while others are executed on the AI server. The dispatch server within the database server can assign different sub-operations to corresponding execution devices. The corresponding devices then execute the assigned sub-operations. If an error occurs during the execution of a sub-operation set, the sub-operation set or the sub-operation itself can be re-executed based on the settings.
[0093] Using this method, table operation instructions can trigger the automatic execution of a series of complex operations, including at least one AI operation and at least one data processing operation. Users only need to enter simple table operation instructions instead of a series of complex operation instructions, which can improve operational efficiency.
[0094] There are many possible situations for the above table operation instructions, and the corresponding sub-operation sets are also different, and the AI operations in the sub-operation sets are also different. The following is a detailed introduction to several of these situations:
[0095] (1) In case 1, the table operation instruction is a column addition instruction, and the AI operation includes creating an AI model.
[0096] When the scheduling server receives the table operation instruction, the parsing process of the table operation instruction can be as follows:
[0097] When the scheduling server parses the instruction, it first reads the instruction name in the table operation instruction. When it reads the ALTER TABLE and ADD fields, it can determine that the instruction is a column operation instruction. It then further determines whether there is PREDICT after the ADD field. If so, it determines that the instruction is a column addition instruction with extended syntax.
[0098] In the scheduling server, different sub-operation sets are set for table operation instructions with different extended syntaxes. The sub-operation set corresponding to the column addition instruction with extended syntax may include sub-operations such as creating an AI model, updating a mapping table, and adding a column. The execution process of this sub-operation set can be shown in Figure 3, including the following steps:
[0099] 301, create AI model.
[0100] The scheduling server can add instructions based on the columns of the extended syntax above to generate instructions for creating an AI model. The instructions for creating an AI model can be in the following form:
[0101] CREAT MODEL model_name WITH()AS SELECT*FROM table_name
[0102] In this instruction, CREAT MODEL is the instruction name, WITH() is used to extract the relevant attribute parameters of the AI model, and AS SELECT*FROM is used to extract the data source for training the AI model. The characters of these three fields are fixed and can be called fixed fields.
[0103] model_name, the fields in the brackets after WITH, and table_name are parameter fields. The contents of the parameter fields can be obtained from the column operation instructions or set in advance.
[0104] model_name is the name of the AI model to be created. There are multiple ways to set this name. For example, you can use a sequence number, a string plus a sequence number, or a combination of the table name and column name in a column operation instruction.
[0105] The fields in the brackets after WITH are the attribute parameters of the AI model, such as the training mode and the model algorithm type. Attribute parameters can be pre-set, for example, pre-setting the training mode to asynchronous mode or synchronous mode. Attribute parameters can also be obtained in the column addition instruction. For example, the column addition instruction has a parameter field, which carries the model algorithm type as a convolutional neural network. Attribute parameters can also be determined by some automated machine learning technologies. For example, the model algorithm type is automatically determined based on the data type in the data table. The automated machine learning technology used can be automated machine learning (AutoML) or smart machine learning (SmartML).
[0106] table_name is the name of the data table where the data for training the AI model is located. This table_name can be obtained from the table_name in the column add instruction.
[0107] After generating the instruction to create an AI model, it can be further parsed to obtain a series of sub-operations. The specific execution process of the sub-operations can be as follows:
[0108] 3011, providing the data in the data table to the AI server.
[0109] The data table is in the form of a two-dimensional table. The embodiment of the present disclosure takes the following data table as an example to provide a detailed description of the solution.
[0110] The data table is named "iris" and has five columns: sepal length (sepal_length), sepal width (sepal_width), petal length (petal_length), petal width (petal_width), and type (output_label). The data corresponding to output_label is the training calibration data.
[0111] The form of the data table is shown in Table 1:
[0112] Table 1
[0113] The scheduling server can notify the storage engine server to send the data in the data table directly to the AI server. For example, this processing method can be used when the amount of data in the data table is small. Alternatively, the scheduling server can first store the data in the data table to a third-party storage device, and then notify the AI server to obtain the corresponding data from the third-party storage device. For example, this processing method can be used when the amount of data in the data table is large. The following describes the processing method using a third-party storage device:
[0114] The scheduling server can instruct the storage engine server to create a foreign table on a third-party storage device and add the data from the data table to the foreign table. The third-party storage device can be an OBS device or a dataset device. The foreign table name can be set by adding the "external" field after the table name in the column addition instruction, or other setting methods can be used. The data structure of the foreign table can be the same as the data structure of the data table in the column addition instruction. The storage engine server can add all the data in the data table to the foreign table, or it can select data from some columns based on automated machine learning technology and add them to the foreign table.
[0115] You can pre-set an indication for a data table to indicate the target column as training calibration data. This indication can be set via the table creation instructions when creating the data table (described in detail later), or it can be preset (for example, setting the first column as training calibration data). This indication is also set for the table when creating it.
[0116] The command to create a foreign table can be: CREAT EXTERNAL TEMP TABLE external_table_name
[0117] external_table_name is the name of the external table to be created. For example, the external table name is iris_external.
[0118] The instruction to fill the data in the data table into the external table is: INSERT INTO external_table_name SELECT * FROM table_name table_name is the name of the data table, for example, the table name can be iris.
[0119] 3012, send a model creation request to the AI server.
[0120] The scheduling server sends a model creation request to the AI server. The model creation request may carry the attribute parameters of the AI model (which can be obtained from the above-mentioned CREAT MODEL instruction), and may also carry the storage location information of the above-mentioned appearance, such as the address of the third-party storage device, storage path, name of the appearance, etc.
[0121] Based on the storage location information of the appearance, the AI server can obtain the data in the appearance from a third-party storage device, and at the same time obtain the above-mentioned indication information. Based on the indication information, it can be determined which column of data in the appearance is the training calibration data, and then the data in the appearance other than the training calibration data can be determined as the sample input data. Furthermore, the AI server can create an initial AI model that conforms to the above-mentioned attribute information (i.e., an AI model that has not been trained and adjusted, in which the mathematical parameters of the model are all initial values), and then train the initial AI model based on the sample input data and the training calibration data. During the training process, the storage engine server can periodically send status query requests to the AI server, and the AI server can feedback the training status to the storage engine server, such as training in progress, training completed, etc.
[0122] After the AI server completes training, it can send the model file of the trained AI model to a third-party storage device. The model file may include the model algorithm type, model mathematical parameters (these are the values taken after training), and feature data (such as the accuracy of the AI model, etc.). The third-party storage device can be pre-specified by the storage engine server, and can be an OBS device or a dataset device. This third-party storage device can be the same as or different from the third-party storage device that stores the table.
[0123] After the storage engine server finds that the current training status is training completed, it can obtain the storage location information of the model file from the AI server, such as the address, storage path, and file name of the third-party storage device.
[0124] 3013, obtain the AI model.
[0125] The storage engine server obtains the model file of the AI model from the third-party storage device based on the storage location information. Alternatively, the AI server can also send the model file directly to the storage engine server.
[0126] The storage engine server then stores the model file on a third-party storage device bound to the storage engine server (the previous third-party storage device temporarily stores the model file, while the third-party storage device here stores the model file long-term until the AI model is deleted), and generates metadata for the AI model based on the current storage location information. The metadata can also include other attribute information of the AI model, such as name, accuracy, etc. The storage engine server can store the metadata, or the storage engine server can send the metadata to the scheduling server, which then sends the metadata to the meta service device for storage.
[0127] In the above processing, the storage engine server queries the training status, obtains the model file, stores the model file, generates metadata, stores metadata, etc. Some or all of these processes can also be performed by the scheduling server.
[0128] 3014, generate the execution function of the AI model.
[0129] The scheduling server can generate an execution function of the AI model based on the model algorithm type and model mathematical parameters, and store the execution function in the storage engine server.
[0130] 302. Update the table name-column name-function name mapping table.
[0131] The scheduling server can maintain a mapping table of table name, column name, and function name to record the correspondence between the execution function created by the column addition instruction of the extended syntax and the data table and column. After generating the execution function of the AI model, the table name, column name, and function name of the execution function in the column addition instruction can be added to the mapping table accordingly. When the execution function is subsequently called to perform inference on the AI model or when the AI model is deleted, the mapping table can be used for related queries.
[0132] 303, add columns to the data table.
[0133] The scheduling server can generate a corresponding general syntax column adding instruction based on the above extended syntax column adding instruction. For example, the corresponding processing can be to remove the first key field in the extended syntax column adding instruction. The generated instruction can be as follows:
[0134] ALTER TABLE table_name ADD column_name datatype
[0135] Furthermore, a column adding instruction of this general syntax can be executed to add a column to the corresponding data table.
[0136] For example, if we add a prediction column predict1 to the data table shown in Table 1 above, the resulting data table will be as shown in Table 2. The corresponding instructions are as follows:
[0137] ALTER TABLE iris ADD predict1 char(20)
[0138] Table 2
[0139] In some application scenarios, the above-mentioned steps 302 and / or 303 may not be performed. For example, the function name generation rule is set to combine the table name and column name corresponding to the column addition instruction, and similar function name generation rules are also used in the reasoning and deletion of the AI model. In this case, step 302 may not be performed. For another example, if it is not necessary to record the reasoning results in the data table when reasoning based on the AI model in a certain application scenario, the processing of step 303 may not be performed. In addition, there is no necessary temporal sequence relationship between step 303 and steps 301-302. Step 303 can be executed first or later, and can also be interspersed at any time during the process of steps 301-302.
[0140] In the embodiment of the present disclosure, the AI model can also be retrained by a similar processing method as described above. When the data in the data table changes to a certain extent (for example, a large amount of data is added), the user can enter a similar extended syntax column addition instruction again to trigger the AI model retraining. The retraining process is similar to the above process, and please refer to the above related content. Here, the column addition instruction of the currently input extended syntax is referred to as the first column addition instruction, and the column addition instruction of the extended syntax input in the above process is referred to as the second column addition instruction.
[0141] The first table name in the first column add instruction and the second table name in the second column add instruction are the same. The first column name in the first column add instruction and the second column name in the second column add instruction can be the same or different. When the first column name and the second column name are different, the process of executing the first column add instruction and the second column add instruction will create a first AI model and a second AI model respectively. They can be considered as different versions of the same AI model, which correspond to different columns in the same data table. When the first column name and the second column name are the same, after executing the second column add instruction to generate the second AI model, the first AI model can be replaced by the second AI model.
[0142] The retraining of the AI model can be triggered by a manual user input instruction or automatically. The database server can monitor the data in the above data table. When it detects that the data in the data table meets the specified change conditions, it retrains the AI model based on the current data in the data table. The change condition can be that the data that has changed (added or modified) exceeds a specified number or a specified ratio, or the change value of the distribution information of one or more columns of data exceeds a specified threshold. The distribution information can be the existence ratio of various values.
[0143] (2) Case 2: The table operation instruction is a column deletion instruction, and the AI operation includes determining the AI model based on the table name and column name in the column deletion instruction.
[0144] When the scheduling server receives the table operation instruction, the parsing process of the table operation instruction can be as follows:
[0145] When the scheduling server parses the instruction, it first reads the instruction name in the table operation instruction. When it reads the ALTER TABLE, DROP, COLUMN field, it can determine that the instruction is a column deletion instruction. It then further determines whether there is PREDICT after the DROP field. If so, it determines that the instruction is a column deletion instruction with extended syntax.
[0146] In the scheduling server, different sub-operation sets are set for table operation instructions with different extended syntaxes. The sub-operation set corresponding to the column deletion instruction with extended syntax may include sub-operations such as determining an AI model and deleting an AI model. The execution process of this sub-operation set can be shown in Figure 4, including the following steps:
[0147] 401. Determine the AI model to be deleted based on the table name and column name of the data table in the column deletion instruction.
[0148] Method 1: The scheduling server stores a table name-column name-function name mapping table. The scheduling server can obtain the table name and column name of the data table in the column deletion instruction, and then search the mapping table for the function name corresponding to the table name and column name. This is the function name of the AI model's execution function, which can also be considered the name of the AI model.
[0149] Method 2: When the name of the AI model is a combination of the table name and column name of the data table when creating the AI model, the name of the AI model can be directly combined according to the table name and column name of the data table in the column deletion instruction.
[0150] 402: Delete the metadata of the AI model and delete the execution function of the AI model.
[0151] The scheduling server can send a metadata deletion message with the AI model name to the meta service device, which will delete the metadata corresponding to the AI model name. The scheduling server can send an execution function message with the AI model name to the storage engine server, which will delete the execution function corresponding to the AI model name.
[0152] 403. In the mapping table, delete the mapping relationship between the table name, column name, and function name in the column delete instruction.
[0153] The scheduling server may delete the corresponding items of the table name, column name, and function name found in step 401 in the above mapping table.
[0154] 404. Delete the corresponding column in the corresponding table based on the table name and column name in the column deletion instruction.
[0155] The scheduling server can generate a corresponding column deletion instruction in general syntax based on the column deletion instruction in the extended syntax. For example, the corresponding processing can be to remove the first key field in the column deletion instruction in the extended syntax. The generated instruction can be as follows:
[0156] ALTER TABLE table_name DROP COLUMN column_name
[0157] Furthermore, a column deletion instruction of this general syntax can be executed to delete a column in a corresponding data table.
[0158] For example, if we delete the prediction column predict1 from the data table shown in Table 2, the resulting data table will be as shown in Table 1. The corresponding instructions are as follows:
[0159] ALTER TABLE iris DROP COLUMN predict1
[0160] In certain application scenarios, steps 403 and / or 404 may not be performed. For example, in the second approach, the data system does not have the mapping table, in which case step 403 may not be performed. Another example is that when creating an AI model, no columns were added to the data table, in which case step 404 may not be performed. Furthermore, there is no necessary temporal sequence between steps 402, 403, and 404; any step may be performed first or later.
[0161] (3) Case three: the table operation instruction is a field query instruction, and the AI operation includes AI model reasoning.
[0162] When the scheduling server receives the table operation instruction, the parsing process of the table operation instruction can be as follows:
[0163] When the scheduling server parses the instruction, it first reads the instruction name in the table operation instruction. When it reads the SELECT, FROM, and AS SELECT fields, it can be determined that the instruction is a field query instruction. The field query instruction is an instruction for querying data in a data table, and the form can be: SELECT predict1 FROM iris AS SELECT... Then, the scheduling server further determines whether the table name-column name-function name mapping table stored in itself contains a mapping relationship between a function name and the table name and column name in the instruction. If so, the scheduling server determines the sub-operation set corresponding to the field query instruction, and then executes the sub-operation set. The execution process of the sub-operation set can be shown in Figure 5, including the following steps:
[0164] 501. Determine the execution function of the AI model based on the table name and column name in the field query instruction.
[0165] Method 1: The scheduling server stores a table name-column name-function name mapping table. The scheduling server can obtain the table name and column name of the data table in the field query instruction, and then search the mapping table for the function name corresponding to the table name and column name. This is the function name of the AI model's execution function.
[0166] Method 2: When the name of the AI model is a combination of the table name and column name of the data table when creating the AI model, the name of the AI model can be directly combined according to the table name and column name of the data table in the field query instruction, which is the function name of the execution function of the AI model.
[0167] 502. Input the query condition parameters in the field query instruction into the execution function of the AI model to obtain the inference result.
[0168] The scheduling server can obtain the query condition parameters from the field query instruction. It then sets the query condition parameters as the function input data. Furthermore, it sends an inference notification to the storage engine server. The inference notification carries the function name and input data of the AI model's execution function. The inference notification can also carry the aforementioned table and column names.
[0169] The storage engine server calls the AI model's execution function based on the function name and feeds the function's input data into the execution function to obtain the inference result. The function input data is the query condition parameters, which include the condition column name and condition value. The condition column name is the parameter name of the execution function, and the condition value is the corresponding parameter value.
[0170] The storage engine server can determine the corresponding data table based on the table name, query function input data (i.e., query condition parameters) in the data table, and perform different processing based on different query results:
[0171] In case 1, if a row of data in the data table includes the function input data, the field corresponding to the above column name in the row can be further determined. This field can be considered as the query target field of the above field query instruction, and then the inference result can be added to the query target field.
[0172] For example, if the query condition parameters are sepal_length 4.5, sepal_width 3.1, petal_length 1.1, and petal_width 0.20, there is a row of data in the data table corresponding to Table 2. The field value corresponding to the sepal_length column is 4.5, the field value corresponding to the sepal_width column is 3.1, the field value corresponding to the petal_length column is 1.1, and the field value corresponding to the petal_width column is 0.20. The output_label column and the predict1 column are empty. Executing the field query instruction will fill in the inference result 2 (category number) in the field corresponding to the predict1 column in this row (that is, the query result field), as shown in Table 3.
[0173] Table 3
[0174] In the second scenario, if the function input data is not included in any row of data in the data table, you can create a new row and add the function input data (i.e., query condition parameters) to it. As previously explained, each query condition parameter consists of a condition column name and a condition value. You can identify the field corresponding to the condition column name in this row and add the corresponding condition value to that field. Additionally, you can identify the field corresponding to the aforementioned column name in this row. This field can be considered the query target field for the aforementioned field query instruction, and the inference result can then be added to the query target field.
[0175] For example, if the query parameters are sepal_length 4.5, sepal_width 3.1, petal_length 1.1, and petal_width 0.20, none of the rows in the data table corresponding to Table 2 contain these query parameters. You can create a new row to enter these query parameters and enter inference result 2 (category number) in the field corresponding to the predict1 column (i.e., the query result field), as shown in Table 4.
[0176] Table 4
[0177] 503. Feedback the inference result as the query result of the field query instruction.
[0178] The storage engine server feeds back the inference results to the user.
[0179] In the embodiment of the present disclosure, considering that executing a field query instruction will fill in the inference results in the data table, and may also fill in the query condition parameters, optionally, when receiving a field query instruction, after determining that there is a table entry in the table name-column name-function name mapping table that includes the table name and column name in the instruction, it can be determined whether there is a row in the data table of the table name that meets the query condition parameters. If so, it is further determined whether the field corresponding to the column name in the row (i.e., the query result field) is empty. If it is empty, it can be processed according to the above process. If it is not empty, the data of the field can be directly read and fed back as the query result. According to this processing method, if the field query instruction is executed according to the above process, and the same field query instruction is executed again, the AI model reasoning will not be triggered, and only a simple data query will be performed.
[0180] In addition to triggering AI model inference through field query instructions as mentioned above, AI model inference can also be triggered directly by executing function call instructions.
[0181] The calling instruction is in the form of: SELECT func_name inference condition parameter
[0182] func_name is the name of the AI model's execution function. The inference condition parameters are similar to the query condition parameters described above. For example, if the execution function is named iris_predice1, the inference condition parameters are sepal_length 4.5, sepal_width 3.1, petal_length 1.1, and petal_width 0.20.
[0183] Because the AI model can be retrained in the embodiments of the present disclosure, there may be multiple different versions of the same AI model. If different versions of the same AI model have different function names, the corresponding execution function can be directly called using the function name, and the execution function can be used for inference processing. If different versions of the same AI model use the same function name and are equipped with different version numbers, the processing flow shown in Figure 6 can be used, including the following steps:
[0184] 601. Receive a call instruction for the execution function of the AI model.
[0185] The calling instruction may carry the function name and function input data of the executed function.
[0186] 602. Determine the version number corresponding to the function name carried in the call instruction based on a mapping table of function name-version number.
[0187] The scheduling server stores a mapping table of function names and version numbers, which is used to store the version number of the latest execution function of the AI model. After receiving the call instruction, the scheduling server queries the latest version number of the AI model through the mapping table of function names and version numbers.
[0188] 603. Call the execution function of the AI model based on the function name and version number, input the function input data in the call instruction into the execution function, and obtain the inference result.
[0189] 604 , feeding back the inference result as a response to the call instruction.
[0190] Each time the AI model is retrained, the version number of the retrained execution function can be obtained. In the function name-version number mapping table, the version number corresponding to the function name of the execution function is replaced with the currently obtained version number.
[0191] The present disclosure also provides a method for creating a data table, in which a target column is set as training calibration data for use in the AI model training process. The processing flow of the method is shown in FIG7 and may include the following steps:
[0192] 701, receiving a table creation instruction.
[0193] The statement corresponding to the target column in the table creation instruction may include a second key field, which is used to indicate that the data in the target column is training calibration data. The character content of this field can be pre-set arbitrarily. The form of the table creation instruction can be:
[0194] CREATE TABLE table_name
[0195] (
[0196] column_name1 datatype,
[0197] column_name2 datatype,
[0198] column_name3 datatype,
[0199] column_name4 datatype,
[0200] column_name5 datatype PREDICT KEY
[0201] )
[0202] ...;
[0203] Only a portion of the instruction is shown; the "..." portion is not explained here. CREATE TABLE is the instruction name. table_name is the table name, column_name1, column_name2, column_name3, column_name4, and column_name5 are the five column names, and datatype is the data format corresponding to the column. PREDICT KEY is the second key field. Since PREDICT KEY is in column 5, column 5 is set to training calibration data.
[0204] Taking the creation of the data table corresponding to Table 1 as an example, the table creation instruction can be:
[0205] CREATE TABLE iris
[0206] (
[0207] sepal_length float4,
[0208] sepal_width float4,
[0209] petal_length float4,
[0210] petal_width float4,
[0211] output_label char(20)PREDICT KEY
[0212] )
[0213] ...;
[0214] PREDICT KEY is used to indicate that the data corresponding to the output_label column is training calibration data.
[0215] 702. Create the table and record the instruction information corresponding to the table.
[0216] The indication information is used to indicate that the data in the target column is training calibration data, and the indication information will be used in the subsequent training process.
[0217] Based on the same technical concept, an embodiment of the present disclosure provides a device for executing database operation instructions. The device can be applied to the above-mentioned database system. As shown in FIG8 , the device includes:
[0218] The receiving module 810 is configured to receive a first table operation instruction, wherein the first table operation instruction is configured to add a column in a data table.
[0219] Determination module 820 is used to determine the corresponding sub-operation set based on the first table operation instruction, wherein the sub-operation set includes at least one data processing operation and at least one artificial intelligence (AI) operation, and at least one AI operation includes an AI model obtained by training based on data in the data table.
[0220] Processing module 830 is used to: provide the data in the data table to the AI server; send a model creation request to the AI server, wherein the model creation request is used to instruct the AI server to train an AI model based on the data in the data table; and obtain the AI model.
[0221] In one possible implementation, the first table operation instruction includes a first key field, the first key field being used to define a column as a prediction column, the prediction column being used to record an inference result of the AI model. A determination module is configured to determine a corresponding sub-operation set based on the first key field.
[0222] In a possible implementation, the processing module 830 is further configured to generate an execution function of the AI model, and the execution function is configured to call the AI model.
[0223] In a possible implementation, the processing module 830 is further configured to record a mapping relationship between columns of the data table and the AI model.
[0224] In a possible implementation, the processing module 830 is further configured to add a column to the data table based on the first table operation instruction.
[0225] In one possible implementation, the receiving module 810 is further configured to receive a call instruction for an execution function of the AI model. The processing module 830 is further configured to input the inference condition parameters in the call instruction into the AI model to obtain a first inference result, and to provide the first inference result as a response to the call instruction.
[0226] In one possible implementation, the receiving module 810 is further configured to receive a first field query instruction for a column of a data table. The determining module 820 is further configured to determine, based on a mapping relationship between the column and the AI model, whether the AI model should be used. The processing module 830 is further configured to input the query condition parameters in the first field query instruction into the AI model to obtain a second inference result, and to provide the second inference result as a response to the first field query instruction.
[0227] In one possible implementation, the processing module 830 is further configured to record the inference results of the AI model into columns.
[0228] In one possible implementation, receiving module 810 is further configured to receive a second field query instruction for a column of a data table. Determining module 820 is further configured to determine a target inference result from the column based on query condition parameters in the second field query instruction. Processing module 830 is further configured to feed back the target inference result as a query result for the second field query instruction.
[0229] In one possible implementation, the receiving module 810 is further configured to receive a second table operation instruction for deleting a column in the data table. The processing module 830 is further configured to delete the AI model and / or its execution function based on the mapping relationship between the column and the AI model.
[0230] In one possible implementation, the model creation request is further used to instruct the AI server to obtain data from a third-party storage service. Processing module 830 is used to store the data in the third-party storage service.
[0231] In one possible implementation, receiving module 810 is further configured to receive a table creation instruction, wherein the table creation instruction is configured to create a data table, and a second key field corresponding to a target column is added to the table creation instruction. Processing module 830 is further configured to create the data table and determine indication information based on the second key field, wherein the indication information is configured to indicate that the target column in the data table is used to store training calibration data. After determining a corresponding sub-operation set, the indication information is provided to the AI server.
[0232] The receiving module 810, the determining module 820, and the processing module 830 can all be implemented in software or hardware. For example, the implementation of the receiving module 810 will be described below using the receiving module 810 as an example. Similarly, the implementation of the determining module 820 and the processing module 830 can refer to the implementation of the receiving module 810.
[0233] As an example of a software functional unit, the receiving module 810 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the receiving module 810 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.
[0234] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.
[0235] As an example of a hardware functional unit, the receiving module 810 may include at least one computing device, such as a server. Alternatively, the receiving module 810 may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0236] The multiple computing devices included in the receiving module 810 can be distributed in the same region or in different regions. The multiple computing devices included in the receiving module 810 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the receiving module 810 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0237] It should be noted that, in other embodiments, the receiving module 810, the determining module 820 and the processing module 830 can be used to execute any step in the method for executing database operation instructions. The steps that the receiving module 810, the determining module 820 and the processing module 830 are responsible for implementing can be specified as needed. The full functions of the device for executing database operation instructions are realized by respectively implementing different steps in the method for executing database operation instructions through the receiving module 810, the determining module 820 and the processing module 830.
[0238] The present disclosure also provides a computing device 100. As shown in FIG9 , computing device 100 includes a bus 102, a processor 104, a memory 106, and a communication interface 108. Processor 104, memory 106, and communication interface 108 communicate with each other via bus 102. Computing device 100 may be a server or a terminal device. It should be understood that the present disclosure does not limit the number of processors and memories in computing device 100.
[0239] Bus 102 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG3 illustrates a single bus line, but this does not imply a single bus or type of bus. Bus 102 may include a path for transmitting information between various components of computing device 100 (e.g., memory 106, processor 104, and communication interface 108).
[0240] The processor 104 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0241] The memory 106 may include volatile memory, such as random access memory (RAM). The memory 106 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0242] Memory 106 stores executable program code, which processor 104 executes to implement the functions of receiving module 810, determining module 820, and processing module 830, respectively, thereby implementing the method for executing database operation instructions. That is, memory 106 stores instructions for executing the method for executing database operation instructions.
[0243] Alternatively, the memory 106 stores executable code, and the processor 104 executes the executable code to implement the functions of the aforementioned receiving module 810, determining module 820, and processing module 830, thereby implementing the method for executing the database operation instruction. In other words, the memory 106 stores instructions for executing the method for executing the database operation instruction.
[0244] The communication interface 108 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 100 and other devices or a communication network.
[0245] The present disclosure also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.
[0246] As shown in Figure 10, the computing device cluster includes at least one computing device 100. The memory 106 of one or more computing devices 100 in the computing device cluster may store the same instructions for executing the method of database operation instructions.
[0247] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store partial instructions for executing the method for database operation instructions. In other words, the combination of one or more computing devices 100 can jointly execute the instructions for executing the method for database operation instructions.
[0248] It should be noted that the memory 106 in different computing devices 100 in the computing device cluster may store different instructions, each for performing a portion of the functions of the apparatus for executing database operation instructions. In other words, the instructions stored in the memory 106 in different computing devices 100 may implement the functions of one or more of the receiving module 810, the determining module 820, and the processing module 830.
[0249] In some possible implementations, one or more computing devices in a computing device cluster may be connected via a network. The network may be a wide area network or a local area network, etc. FIG11 shows a possible implementation. As shown in FIG11 , two computing devices 100A and 100B are connected via a network. Specifically, the connection to the network is made via a communication interface in each computing device. In this type of possible implementation, the memory 106 in the computing device 100A stores instructions for executing the functions of the processing module 830. At the same time, the memory 106 in the computing device 100B stores instructions for executing the functions of the receiving module 810 and the determining module 820.
[0250] The connection method between the computing device clusters shown in Figure 11 can be that considering that the method for executing database operation instructions provided by the present disclosure requires a large amount of data storage, it is considered to entrust the functions implemented by the receiving module 510 and the determining module 520 to the computing device 100B for execution.
[0251] It should be understood that the functions of the computing device 100A shown in FIG11 may also be completed by multiple computing devices 100. Similarly, the functions of the computing device 100B may also be completed by multiple computing devices 100.
[0252] The present disclosure also provides another computing device cluster. The connection relationship between the computing devices in this computing device cluster can be similar to the connection relationship between the computing device clusters described in Figures 10 and 11. However, the memory 106 of one or more computing devices 100 in this computing device cluster can store the same instructions for executing database operation instructions.
[0253] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store partial instructions for executing the method for database operation instructions. In other words, the combination of one or more computing devices 100 can jointly execute the instructions for executing the method for database operation instructions.
[0254] The present disclosure also provides a computer program product containing instructions. The computer program product may be software or a program product containing instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the method causes the at least one computing device to execute the database operation instructions.
[0255] The embodiments of the present disclosure also provide a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a digital video disk (DVD)), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct a computing device to execute a method for performing a database operation instruction, or instruct a computing device to execute a method for performing a database operation instruction.
[0256] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the protection scope of the technical solutions of the various embodiments of the present disclosure.
Claims
1. A method for executing a database operation instruction, characterized in that: The method is applied to a database system, and the method comprises: Receive a first table operation instruction, wherein the first table operation instruction is used to add a column in a data table; Based on the first table operation instruction, determine a corresponding sub-operation set, wherein the sub-operation set includes at least one data processing operation and at least one artificial intelligence (AI) operation, and the at least one AI operation includes an AI model obtained by training based on the data in the data table; Providing the data in the data table to the AI server; Sending a model creation request to the AI server, wherein the model creation request is used to instruct the AI server to obtain the AI model through training based on the data in the data table; Obtain the AI model.
2. The method according to claim 1, characterized in that: The first table operation instruction includes a first key field, the first key field is used to define the column as a prediction column, and the prediction column is used to record the inference result of the AI model; The determining the corresponding sub-operation set based on the first table operation instruction includes: determining the corresponding sub-operation set based on the first key field.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: An execution function of the AI model is generated, where the execution function is used to call the AI model.
4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: Record the mapping relationship between the columns of the data table and the AI model.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Based on the first table operation instruction, the column is added to the data table.
6. The method according to any one of claims 3 to 5, characterized in that: The method further comprises: Receiving a call instruction to the execution function of the AI model; The inference condition parameters in the calling instruction are input into the AI model to obtain a first inference result, and the first inference result is fed back as a response to the calling instruction.
7. The method according to any one of claims 4 to 5, characterized in that: The method further comprises: receiving a first field query instruction for the column of the data table; Based on the mapping relationship between the column and the AI model, determining that the AI model needs to be used; The query condition parameters in the first field query instruction are input into the AI model to obtain a second inference result, and the second inference result is fed back as a response to the first field query instruction.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: The inference result of the AI model is recorded in the column.
9. The method according to claim 8, characterized in that The method further comprises: receiving a second field query instruction for the column of the data table; Determining a target inference result from the column based on a query condition parameter in the second field query instruction; The target inference result is fed back as a query result of the second field query instruction.
10. The method according to any one of claims 4 to 9, characterized in that: The method further comprises: receiving a second table operation instruction, where the second table operation instruction is used to delete the column in the data table; Based on the mapping relationship between the column and the AI model, the AI model and / or the execution function of the AI model is deleted.
11. The method according to any one of claims 1 to 10, characterized in that: The model creation request is also used to instruct the AI server to obtain the data from a third-party storage service; Providing the data in the data table to the AI server includes: storing the data in the third-party storage service.
12. The method according to any one of claims 1 to 11, characterized in that: Before receiving the first table operation instruction, the method further includes: receiving a table creation instruction, wherein the table creation instruction is used to create the data table, and a second key field corresponding to the target column is added to the table creation instruction; Creating the data table, and determining indication information based on the second key field, wherein the indication information is used to indicate that the target column in the data table is used to store training calibration data; After determining the corresponding sub-operation set, the method further includes: The instruction information is provided to the AI server.
13. A device for executing a database operation instruction, characterized in that: The device is applied to a database system, and comprises: A receiving module, configured to receive a first table operation instruction, wherein the first table operation instruction is used to add a column in a data table; A determination module, configured to determine a corresponding sub-operation set based on the first table operation instruction, wherein the sub-operation set includes at least one data processing operation and at least one artificial intelligence (AI) operation, and the at least one AI operation includes an AI model obtained by training based on the data in the data table; A processing module is used to provide the data in the data table to the AI server; send a model creation request to the AI server, wherein the model creation request is used to instruct the AI server to obtain the AI model through training based on the data in the data table; and obtain the AI model.
14. The device according to claim 13, characterized in that The first table operation instruction includes a first key field, the first key field is used to define the column as a prediction column, and the prediction column is used to record the inference result of the AI model; The determination module is used to determine the corresponding sub-operation set based on the first key field.
15. The device according to claim 13 or 14, characterized in that The processing module is also used to generate an execution function of the AI model, and the execution function is used to call the AI model.
16. The device according to any one of claims 13 to 15, characterized in that The processing module is also used to record the mapping relationship between the columns of the data table and the AI model.
17. The device according to any one of claims 13 to 16, characterized in that: The processing module is further configured to add the column to the data table based on the first table operation instruction.
18. The device according to any one of claims 15 to 17, characterized in that: The receiving module is further used to receive a call instruction for the execution function of the AI model; The processing module is also used to input the reasoning condition parameters in the calling instruction into the AI model to obtain a first reasoning result, and to feed back the first reasoning result as a response to the calling instruction.
19. The device according to any one of claims 16-17, characterized in that The receiving module is further used to receive a first field query instruction for the column of the data table; The determination module is further used to determine the need to use the AI model based on the mapping relationship between the column and the AI model; The processing module is also used to input the query condition parameters in the first field query instruction into the AI model to obtain a second reasoning result, and to feed back the second reasoning result as a response to the first field query instruction.
20. The device according to any one of claims 13 to 19, characterized in that The processing module is also used to record the inference results of the AI model into the column.
21. The device according to claim 20, characterized in that The receiving module is further used to receive a second field query instruction for the column of the data table; The determination module is further used to determine a target inference result from the column based on a query condition parameter in the second field query instruction; The processing module is further configured to feed back the target inference result as a query result of the second field query instruction.
22. The device according to any one of claims 16 to 21, characterized in that The receiving module is further used to receive a second table operation instruction, where the second table operation instruction is used to delete the column in the data table; The processing module is further used to delete the AI model and / or the execution function of the AI model based on the mapping relationship between the column and the AI model.
23. The device according to any one of claims 13 to 22, characterized in that: The model creation request is also used to instruct the AI server to obtain the data from a third-party storage service; The processing module is used to store the data in the third-party storage service.
24. The device according to any one of claims 13 to 23, characterized in that The receiving module is further used to receive a table creation instruction, wherein the table creation instruction is used to create the data table, and a second key field corresponding to the target column is added to the table creation instruction; The processing module is further used to create the data table and determine indication information based on the second key field, wherein the indication information is used to indicate that the target column in the data table is used to store training calibration data; after determining the corresponding sub-operation set, the indication information is provided to the AI server.
25. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 12.
26. A computer-readable storage medium, characterized in that: The method comprises computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster performs the method according to any one of claims 1 to 12.
27. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Method and device for executing database operation instruction, equipment and storage medium
CN119537386A
Method and device for realizing automatic model construction, electronic equipment and storage medium
CN112149838A
Model processing method and device, electronic equipment and storage medium
CN113065843A
Machine learning model automatic production line construction method and system
CN114115857A
AI model production method and system based on meta universe data marking
CN115169578A