Data processing method and device and electronic equipment
By parsing data processing commands and generating programs that call the AI function, and using the AI function to process natural language prompt words, the problem of low efficiency in the development of complex data analysis in the existing technology is solved, and flexible and efficient data analysis and processing is achieved.
Patent Information
- Application Number
- CN202410800862.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-10-15
AI Technical Summary
When existing data analysis methods deal with complex data scenarios, they need to write complex analysis functions in a targeted manner, resulting in low development efficiency and difficulty in achieving in-depth analysis and processing of text information data.
By obtaining data processing commands, parsing and generating data processing programs that call the AI function, and using the AI function to process target data based on natural language prompts, the flexibility and efficiency of complex data analysis can be achieved.
It simplifies the development of data processing programs, improves the flexibility and efficiency of data analysis, enhances support for various data analysis functions, and avoids writing specialized analysis functions for each function.
Smart Images

Figure CN118779074A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to the technical fields of large models, big data, etc., and specifically to data processing methods, devices and electronic equipment. Background Art
[0002] Data analysis is a process of in-depth research and summary of data, aiming to extract valuable information and form conclusions. At present, mainstream data analysis methods are mainly applied to structured data and some simple data analysis scenarios, such as querying data, deleting data, etc. However, when a more in-depth analysis of the data is required, it is necessary to introduce functions with corresponding functions in a targeted manner, which makes the code implementation more complicated. Summary of the invention
[0003] The present disclosure provides a data processing method, device and electronic device.
[0004] According to one aspect of the present disclosure, there is provided a data processing method, comprising:
[0005] Obtaining a data processing command, wherein the data processing command includes a call command for an AI function;
[0006] Parse the data processing command to determine the data operation type, target field to be processed and prompt word corresponding to the data processing command;
[0007] Generate a first data processing program that calls the AI function based on the data operation type, the target field, and the prompt word;
[0008] The first data processing program is executed to call the AI function to process the target data corresponding to the target field based on the prompt word.
[0009] According to another aspect of the present disclosure, there is provided a data processing device, comprising:
[0010] An acquisition module, used to acquire a data processing command, wherein the data processing command includes a call command of an AI function;
[0011] A determination module is used to parse the data processing command and determine the data operation type, target field to be processed and prompt word corresponding to the data processing command;
[0012] A generation module, used to generate a first data processing program for calling the AI function based on the data operation type, the target field and the prompt word;
[0013] The calling module is used to execute the first data processing program to call the AI function to process the target data corresponding to the target field based on the prompt word.
[0014] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0015] at least one processor; and
[0016] a memory communicatively connected to at least one processor; wherein,
[0017] The memory stores instructions that can be executed by at least one processor. The instructions are executed by the at least one processor so that the at least one processor can execute the method of the above embodiment.
[0018] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to execute the method according to the above embodiment.
[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0021] Figure 1 A flowchart of a data processing method provided by an embodiment of the present disclosure;
[0022] Figure 2 A flowchart of another data processing method provided by an embodiment of the present disclosure;
[0023] Figure 3 A flowchart of another data processing method provided by an embodiment of the present disclosure;
[0024] Figure 4 A flowchart of another data processing method provided by an embodiment of the present disclosure;
[0025] Figure 5 A flowchart of another data processing method provided by an embodiment of the present disclosure;
[0026] Figure 6 A schematic diagram of the structure of another data processing device provided by an embodiment of the present disclosure;
[0027] Figure 7 It is a block diagram of an electronic device used to implement data processing according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0028] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0029] Artificial intelligence is a discipline that studies the use of computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level technical fields and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies include computer vision technology, speech recognition technology, natural language processing technology, as well as deep learning, big data processing technology, knowledge graph technology, and other major directions.
[0030] In data analysis scenarios, it may be necessary to perform deeper analysis and processing on text information data, such as extracting text information summaries, or translating, or masking data processing operations. Currently, for each data processing operation, it is necessary to write a corresponding analysis function, which makes program code development more complicated and inefficient.
[0031] The data processing method, device, electronic device, and storage medium of the embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0032] It should be noted that the data processing method implemented in the present disclosure is configured in a data processing device (hereinafter referred to as the processing device) for illustration, and the processing device can be applied to any electronic device so that the electronic device can perform the function of data processing.
[0033] Among them, the electronic device can be any device with computing capabilities, such as a personal computer (PC), a mobile terminal, etc. The mobile terminal can be, for example, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, and other hardware devices with various operating systems, touch screens and / or display screens.
[0034] Figure 1 A flowchart of a data processing method provided in an embodiment of the present disclosure.
[0035] like Figure 1 As shown, the method includes:
[0036] Step 101, obtaining a data processing command, wherein the data processing command includes a call command for an AI function.
[0037] Among them, AI functions can be large models, etc., which are used to achieve in-depth analysis and processing of data.
[0038] In this application, the data processing command can be pre-written in the script, and when the script is executed, the processing device can obtain the data processing command. The data processing command is used to complete the analysis and processing operation of the data in the database. The data processing command includes the data operation type, the target field to be operated, the prompt word, etc., and this application does not limit this.
[0039] The call command of the AI function can be implemented by calling a function. The syntax specification of the call command of the AI function can be: ai_function(${prompt}, ....${args}), where ${prompt} is a prompt word, such as desensitizing the numbers in the copy, extracting the summary of the copy, and calculating the square difference of the data. ${args} is the target field to be processed, and the target field is the field corresponding to the data stored in the database.
[0040] In addition, the target field can be one or more. In the case of multiple target fields, the prompt word includes the description of the processing operation and the description of each target field, etc., to adapt to the complex scenario of data processing of multiple target fields. For example, ai_function('The first field is time, the second field is sales; calculate the total annual sales', 'date, income'), the first single quote "The first field is time, the second field is the sales field; I need to calculate the total annual sales" is the prompt word, the "first field is time, the second field is the sales field" before the semicolon is the description of each target field, which is used to indicate the physical meaning corresponding to each target field, and the "calculate the total annual sales" after the semicolon is the processing operation description, which is used to indicate how to process the data. In the case of one target field, the prompt word can only include the processing operation description. For example, ai_function('Desensitize the numbers in the copy', info), the prompt word only includes the processing operation description "Desensitize the numbers in the copy".
[0041] In addition, data processing commands can be written based on database languages. For example, select ai_function('Numbers in desensitized copy', info) from dept means to process the data corresponding to the info field queried from the dept table with 'Numbers in desensitized copy'. INSERT INTO Customers(info)VALUES(ai_function('Numbers in desensitized copy', 'bob's annual salary of 1 million')) means to process 'Numbers in desensitized copy' with 'bob's annual salary of 1 million' and then insert it into Customers(info).
[0042] As a result, AI functions can be integrated into data analysis. In complex data analysis scenarios, only prompt words expressed in natural language can be used with the help of AI functions to achieve complex data analysis, avoiding the need to write complex data processing programs, thereby improving the flexibility of data analysis. In addition, various data analysis functions can be implemented with the help of AI functions, avoiding the need to write corresponding analysis functions for each data analysis function, thereby improving the development efficiency of data processing programs.
[0043] Step 102: parse the data processing command to determine the data operation type, the target field to be processed, and the prompt word corresponding to the data processing command.
[0044] Among them, data operation types include query operation type, insert operation type, delete operation type, etc., and this application does not impose any restrictions on this.
[0045] In the present application, the data processing command is generated according to the preset grammar rules, so the data processing command can be parsed based on the preset grammar rules to determine the data operation type, target field, and prompt word corresponding to the data processing command.
[0046] For example, the data processing commands generated based on the database language are: select ai_function('Numbers in the desensitized copy', info) from dept; INSERT INTO Customers(info) VALUES(ai_function('Numbers in the desensitized copy', 'bob's annual salary is 1 million')); DELETE FROM Employees WHERE ai_function('The first field is the department, the second field is the age, and the third field is the date of employment; delete the data whose department is Department 1, Department 2, or Department 3, whose age is greater than 60 years old, and whose employment date is after 2020', 'DepartmentID, Age, HireDate'). The first word in the data processing command indicates the data operation type. Select corresponds to the query operation type, INSERT corresponds to the insert operation type, and DELETE corresponds to the delete operation type. Determine the first parameter in the ai_function function as the prompt word (for example, 'numbers in the desensitized text', 'the first field is the department, the second field is the age, and the third field is the time of employment; delete the data whose department is Department 1, Department 2, or Department 3, whose age is greater than 60 years old, and whose time of employment is after 2020'). In the data processing commands corresponding to the query operation type and the delete operation type, determine the field contained in the second parameter of the ai_function function as the target field (for example, info, 'DepartmentID, Age, HireDate'). In the data processing commands corresponding to the insert operation type, determine the insert field in the SQL statement as the target field (for example, info).
[0047] Step 103, based on the data operation type, the target field and the prompt word, generate a first data processing program for calling the AI function.
[0048] In this application, different data operation types correspond to different data processing flows. For example, for the query operation type, the corresponding data processing flow is to obtain data from the database and then call the AI function for processing. For the insert operation type, the corresponding data processing flow is to first call the AI function to process the data and then insert it into the database. For the delete operation type, the corresponding data processing flow is to obtain data from the database, then call the AI function to judge the data, determine the data to be deleted, and then delete the data to be deleted from the database.
[0049] Therefore, when the data operation type is a query operation type, the first data processing program generated is: generate a data query statement based on the target field, and execute the data query statement in the database to obtain the target data, and then call the AI function to process the target data based on the prompt word to obtain the processed output data.
[0050] When the data operation type is an insert operation type, the first data processing program generated is: determine the content to be inserted in the data processing command, then call the AI function to process the target data corresponding to the target field in the content to be inserted based on the prompt word, obtain the target insert content, and then generate a data insert statement based on the target insert content, and execute the data insert statement in the database to insert the target insert content into the database.
[0051] When the data operation type is a deletion operation type, the first data processing program generated is: generating a data query statement based on the target field, and executing the data query statement in the database to obtain the target data, after which the AI function is called to process the target data based on the prompt word, and determine the data to be deleted in the target data, and then, generating a data deletion statement based on the data to be deleted, and executing the data deletion statement in the database to delete the data to be deleted from the database.
[0052] Step 104 , executing a first data processing program to call the AI function to process the target data corresponding to the target field based on the prompt word.
[0053] In this application, executing the first data processing program can realize calling the AI function to process the target data corresponding to the target field based on the prompt word. Thus, the flexibility and convenience of data processing are improved, the data processing function is enriched, and the data processing capability is enhanced.
[0054] Optionally, the data processing command is verified to determine whether the data processing command conforms to the preset grammatical rules, and if the data processing command does not conform to the preset grammatical rules, a call grammar error message is generated, thereby improving the reliability of data processing.
[0055] In the present application, a data processing command is obtained, wherein the data processing command includes a call instruction of an AI function, and then the data processing command is parsed to determine the data operation type, the target field to be processed, and the prompt word corresponding to the data processing command, and based on the data operation type, the target field, and the prompt word, a first data processing program for calling the AI function is generated, and then the first data processing program is executed to call the AI function to process the target data corresponding to the target field based on the prompt word. Thus, different data processing programs are generated based on the data operation type, the target field to be processed, and the prompt word, so that different data processing is performed by calling the AI function. Thereby, the flexibility of data processing is enhanced and the development efficiency of data processing programs is improved.
[0056] Figure 2 A flowchart of a data processing method provided in an embodiment of the present disclosure.
[0057] like Figure 2 As shown, the method includes:
[0058] Step 201, obtaining a data processing command, wherein the data processing command includes a call command for an AI function.
[0059] Step 202: parse the data processing command to determine the data operation type, target field to be processed, and prompt word corresponding to the data processing command.
[0060] Step 203: Generate a first data processing program for calling the AI function based on the data operation type, the target field and the prompt word.
[0061] In the present application, the specific implementation process of steps 201 to 203 can be found in the detailed description of any embodiment of the present application and will not be repeated here.
[0062] Step 204: when the data operation type is a query operation type, a data query statement is generated based on the target field, and the data query statement is executed in the database to obtain the target data.
[0063] In the present application, data processing commands can be rewritten based on database grammar rules to generate data query statements.
[0064] For example, if the data processing instruction is: select ai_function('Numbers in desensitized text', info)fromdept, the target field is info. The corresponding data query statement is Select info from dept.
[0065] Afterwards, the data query statement is executed in the database to obtain the target data.
[0066] Step 205: Call the AI function to process the target data based on the prompt word to obtain processed output data.
[0067] In the present application, prompt words and target data are input into the AI function, and the target data is used as the processing data of the AI function. The prompt words are used to instruct the AI function on what specific processing to do with the target data. After the AI function processes the target data based on the prompt words, the result of the processing of the target data is output, thereby obtaining the processed output data.
[0068] For example, the data processing instruction is: select ai_function('Numbers in desensitized text', info)fromdept, and the target data is "bob's annual salary is 1 million; alice's annual salary is 900,000". Then the output data is "bob's annual salary is XX million; alice's annual salary is XX million".
[0069] In this application, when the data operation type is a query operation type, a data query statement is generated based on the target field, and the data query statement is executed in the database to obtain the target data, and then the AI function is called to process the target data based on the prompt word to obtain the processed output data. This enhances the processing capability and flexibility of the data query operation.
[0070] Figure 3 A flowchart of a data processing method provided in an embodiment of the present disclosure.
[0071] like Figure 3 As shown, the method includes:
[0072] Step 301, obtaining a data processing command, wherein the data processing command includes a call command for an AI function.
[0073] Step 302: parse the data processing command to determine the data operation type, target field to be processed, and prompt word corresponding to the data processing command.
[0074] Step 303: Generate a first data processing program for calling the AI function based on the data operation type, the target field and the prompt word.
[0075] In the present application, the specific implementation process of steps 301 to 303 can be found in the detailed description of any embodiment of the present application and will not be repeated here.
[0076] Step 304: When the data operation type is an insert operation type, determine the content to be inserted in the data processing command.
[0077] In the present application, when inserting data into a database, the content to be inserted can be configured in a data processing command. Afterwards, the data processing command can be parsed to extract the content to be inserted.
[0078] For example, the data processing command is: INSERT INTO Customers(info)VALUES(ai_function('Numbers in the desensitized copy','bob's annual salary is 1 million')). The second parameter in the ai_function function is the content to be inserted. Therefore, the second parameter of the ai_function function, 'bob's annual salary is 1 million', is extracted to determine the content to be inserted.
[0079] Step 305: Call the AI function to process the target data corresponding to the target field in the content to be inserted based on the prompt word to obtain the target insertion content.
[0080] In the present application, prompt words and content to be inserted are input into the AI function, and the content to be inserted is used as processing data for the AI function. The prompt words are used to instruct the AI function on what specific processing to do with the inserted content. After the AI function processes the target data corresponding to the target field in the content to be inserted based on the prompt words, the AI function outputs the result of the processing of the target data, thereby obtaining the target inserted content.
[0081] It should be noted that, when the content to be inserted corresponds to one field, the field is the target field, and the content to be inserted is the target data. When the content to be inserted corresponds to multiple fields, the target field may be one or more of the multiple fields, so the target data is part or all of the content to be inserted.
[0082] For example, if the data processing command is INSERT INTO Customers(UserID, Address, Total_Sales) VALUES ai_function('The first field is the user ID UserID, the second field is the home address Address, the third field is the sales quantity Quantity, and the home address Address is masked', '152, Tianfuyuan Community, Chaoyang District, Beijing, 50'), the content to be inserted is '152, Tianfuyuan Community, Chaoyang District, Beijing, 50', the target field is Address, and the target data is "Tianfuyuan Community, Chaoyang District, Beijing". The target inserted content obtained is "152, ×× District, ×× Community, ×× City, 50".
[0083] Step 306: Generate a data insert statement based on the target insert content, and execute the data insert statement in the database to insert the target insert content into the database.
[0084] In this application, based on the database syntax rules, the target insertion content is used to rewrite the data processing command to generate a data insertion statement. For example, the data processing command is INSERT INTO Customers (UserID, Address, Total_Sales) VALUES ai_function ('The first field is the user ID UserID, the second field is the home address Address, the third field is the sales quantity Quantity, and the home address Address is masked', '152, Tianfuyuan Community, Chaoyang District, Beijing, 50'), and its corresponding data insertion statement is INSERT INTO Customers (UserID, Address, Total_Sales) VALUES (152, ×× District ×× Community, ×× City, 50).
[0085] After that, the data insertion statement is executed in the database to complete the function of inserting the target insert content into the database.
[0086] In this application, when the data operation type is an insert operation type, the content to be inserted in the data processing command is determined, and then the AI function is called to process the target data corresponding to the target field in the content to be inserted based on the prompt word, and the target insertion content is obtained. Then, a data insertion statement is generated based on the target insertion content, and the data insertion statement is executed in the database to insert the target insertion content into the database. This enhances the processing capability and flexibility of the data insertion operation.
[0087] Figure 4 A flowchart of a data processing method provided in an embodiment of the present disclosure.
[0088] like Figure 4 As shown, the method includes:
[0089] Step 401, obtaining a data processing command, wherein the data processing command includes a call command for an AI function.
[0090] Step 402, parse the data processing command to determine the data operation type, target field to be processed, and prompt word corresponding to the data processing command.
[0091] Step 403, based on the data operation type, the target field and the prompt word, generate a first data processing program for calling the AI function.
[0092] In the present application, the specific implementation process of steps 401 to 403 can be found in the detailed description of any embodiment of the present application and will not be repeated here.
[0093] Step 404: when the data operation type is a delete operation type, a data query statement is generated based on the target field, and the data query statement is executed in the database to obtain the target data.
[0094] In the scenario of deleting data from a database, you may need to perform complex judgments on the data to determine whether to delete the data from the database. For example, when the data corresponding to multiple fields simultaneously meet certain conditions, delete the data from the database. When using SQL statements for judgment, the program logic is relatively complex and inconvenient to implement.
[0095] In this application, a data query statement can be generated based on the target field, and the data query statement can be executed in the database to obtain the target data, so as to facilitate the subsequent call of the AI function to determine whether the target data meets specific conditions, thereby determining whether the target data is data to be deleted.
[0096] Step 405: Call the AI function to process the target data based on the prompt word to determine the data to be deleted in the target data.
[0097] The target data may include one row of data or multiple rows of data, and the prompt word may include specific conditions.
[0098] In the present application, prompt words and target data can be input into the AI function, and the target data can be used as the processing data of the AI function. The prompt words can be used to instruct the AI function on what specific judgments to make on the target data. After the AI function makes a judgment on each row of data in the target data based on the prompt words, it outputs all rows of data that meet the specific conditions contained in the prompt words. In this way, the data to be deleted can be obtained.
[0099] For example, the data processing command is: DELETE FROM Employees WHERE ai_function('The first field is department, the second field is age, and the third field is employment date; delete the data whose department is department 1, department 2, or department 3, whose age is greater than 60 years old, and whose employment date is after 2020', 'DepartmentID, Age, HireDate'). The prompt word (i.e., specific condition) is "The first field is department, the second field is age, and the third field is employment date; delete the data whose department is department 1, department 2, or department 3, whose age is greater than 60 years old, and whose employment date is after 2020", and call the AI function to determine whether the DepartmentID, Age, and HireDate in each row of data obtained meet the above specific conditions. If a row of data meets the specific condition, the row of data is determined as data to be deleted.
[0100] As a result, the flexibility and convenience of data processing are improved, the data processing functions are enriched, and the processing capabilities of data deletion operations are enhanced.
[0101] Step 406: Generate a data deletion statement based on the data to be deleted, and execute the data deletion statement in the database to delete the data to be deleted from the database.
[0102] In this application, based on the database syntax rules, the data processing command is rewritten using the data to be deleted to generate a data deletion statement. For example, the data processing command is: DELETE FROM Employees WHERE ai_function('The first field is the department, the second field is the age, and the third field is the time of employment; delete the data whose department is Department 1, or Department 2, or Department 3, whose age is greater than 60 years old, and whose employment time is after 2020', 'DepartmentID, Age, HireDate'), and the corresponding data to be deleted is (Department 1, 61, 202101). Then the corresponding data deletion statement is: DELETE FROM Employees WHERE DepartmentID='Department 1'AND Age=61AND HireDate='202101'.
[0103] After that, the data deletion statement is executed in the database to delete the data to be deleted from the database.
[0104] In this application, when the data operation type is a delete operation type, a data query statement is generated based on the target field, and the data query statement is executed in the database to obtain the target data. After that, the AI function is called to process the target data based on the prompt word to determine the data to be deleted in the target data. Then, a data deletion statement is generated based on the data to be deleted, and the data deletion statement is executed in the database to delete the data to be deleted from the database. This enhances the processing capability and flexibility of the data deletion operation.
[0105] Figure 5 A flowchart of a data processing method provided in an embodiment of the present disclosure.
[0106] like Figure 5 As shown, the method includes:
[0107] Step 501: Obtain a data processing command, wherein the data processing command includes a call command for an AI function.
[0108] Step 502: parse the data processing command to determine the data operation type, target field to be processed, and prompt word corresponding to the data processing command.
[0109] Step 503: Generate a first data processing program for calling the AI function based on the data operation type, the target field and the prompt word.
[0110] In the present application, the specific implementation process of steps 501 to 503 can be found in the detailed description of any embodiment of the present application and will not be repeated here.
[0111] Step 504: transform the first data processing program based on the grammatical rules of the target data analysis engine to generate a second data processing program.
[0112] In order to improve data processing capabilities, data analysis engines (such as Hive, Flink, Spark, and Trino) are usually used to access databases. Each data analysis engine has different grammatical rules.
[0113] In the present application, in order to improve the compatibility of data processing, the first data processing program can be transformed based on the grammatical rules of the target data analysis engine to generate a second data processing program suitable for the target data analysis engine.
[0114] Step 505, executing a second data processing program in the target data analysis engine to call the AI function to process the target data corresponding to the target field based on the prompt word.
[0115] In the present application, the second data processing program is sent to the target data analysis engine, and the second data processing program is executed in the target data analysis engine to call the AI function to process the target data corresponding to the target field based on the prompt word.
[0116] In this application, a data processing command is obtained, wherein the data processing command includes the call of an AI function, and then the data processing command is parsed to determine the data operation type, the target field to be processed, and the prompt word corresponding to the data processing command, so as to generate a first data processing program that calls the AI function based on the data operation type, the target field, and the prompt word, and then, the first data processing program is transformed based on the grammatical rules of the target data analysis engine to generate a second data processing program, and the second data processing program is executed in the target data analysis engine to call the AI function to process the target data corresponding to the target field based on the prompt word. Thus, based on the data processing strategy associated with the data operation type, different first data processing programs are generated, and the first data processing program is converted to execute the second data processing program in the target data analysis engine, so as to realize calling the AI function in different data analysis engines to process the data differently. Thereby, the flexibility and compatibility of data processing are enhanced, and the development efficiency of data processing programs is improved.
[0117] The disclosed embodiment provides another data processing method: the processing device can also be integrated into each data analysis engine (for example, Hive, Flink, Spark, Trino). It can be understood that since the grammatical rules of each data analysis engine are different, the integrated grammar of the processing device in each data analysis engine is different, and the grammatical rules for calling the processing device integrated in each data analysis engine are also different. Therefore, after obtaining the data processing command, the data processing command can be converted based on the interface call grammatical rules of the processing device in the target data analysis engine to realize the call of the processing device in the target data analysis engine to perform data processing.
[0118] In order to implement the above embodiment, the embodiment of the present disclosure also proposes a data processing device.
[0119] Figure 6 A schematic diagram of the structure of a data processing device provided in an embodiment of the present disclosure.
[0120] like Figure 6 As shown, the data processing device 600 includes: an acquisition module 610, a determination module 620, a generation module 630, and a calling module 640.
[0121] An acquisition module 610 is used to acquire a data processing command, wherein the data processing command includes a call command of an AI function;
[0122] A determination module 620 is used to parse the data processing command and determine the data operation type, the target field to be processed and the prompt word corresponding to the data processing command;
[0123] A generating module 630, for generating a first data processing program for calling an AI function based on a data operation type, a target field, and a prompt word;
[0124] The calling module 640 is used to execute the first data processing program to call the AI function to process the target data corresponding to the target field based on the prompt word.
[0125] In a possible implementation of the embodiment of the present disclosure, the first data processing program includes:
[0126] When the data operation type is a query operation type, a data query statement is generated based on the target field, and the data query statement is executed in the database to obtain the target data;
[0127] The AI function is called to process the target data based on the prompt word to obtain the processed output data.
[0128] In a possible implementation of the embodiment of the present disclosure, the first data processing program includes:
[0129] In the case where the data operation type is an insert operation type, determining the content to be inserted in the data processing command;
[0130] Call the AI function to process the target data corresponding to the target field in the content to be inserted based on the prompt word, and obtain the target inserted content;
[0131] A data insert statement is generated based on the target insert content, and the data insert statement is executed in a database to insert the target insert content into the database.
[0132] In a possible implementation of the embodiment of the present disclosure, the first data processing program includes:
[0133] When the data operation type is a delete operation type, a data query statement is generated based on the target field, and the data query statement is executed in the database to obtain the target data;
[0134] Call the AI function to process the target data based on the prompt word and determine the data to be deleted in the target data;
[0135] A data deletion statement is generated based on the data to be deleted, and the data deletion statement is executed in the database to delete the data to be deleted from the database.
[0136] In a possible implementation of the embodiment of the present disclosure, the calling module 640 is used to:
[0137] Transforming the first data processing program based on the grammatical rules of the target data analysis engine to generate a second data processing program;
[0138] A second data processing program is executed in the target data analysis engine to call the AI function to process the target data corresponding to the target field based on the prompt word.
[0139] In a possible implementation of the embodiment of the present disclosure, a verification module is further included, which is used to:
[0140] Verify the data processing command to determine whether the data processing command complies with the preset grammatical rules;
[0141] When the data processing command does not conform to the preset grammatical rules, a call syntax error message is generated.
[0142] In a possible implementation manner of the embodiment of the present disclosure, when there are multiple target fields, the prompt word includes a description of each target field.
[0143] It should be noted that the explanation of the aforementioned data processing method embodiment is also applicable to the device of this embodiment, so it will not be repeated here.
[0144] In the present application, a data processing command is obtained, wherein the data processing command includes a call instruction of an AI function, and then the data processing command is parsed to determine the data operation type, the target field to be processed, and the prompt word corresponding to the data processing command, and based on the data operation type, the target field, and the prompt word, a first data processing program for calling the AI function is generated, and then the first data processing program is executed to call the AI function to process the target data corresponding to the target field based on the prompt word. Thus, different data processing programs are generated based on the data operation type, the target field to be processed, and the prompt word, so that different data processing is performed by calling the AI function. Thereby, the flexibility of data processing is enhanced and the development efficiency of data processing programs is improved.
[0145] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.
[0146] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0147] like Figure 7 As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 702 or a computer program loaded from a storage unit 708 to a RAM (Random Access Memory) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An I / O (Input / Output) interface 705 is also connected to the bus 704.
[0148] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0149] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Units), various dedicated AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, a DSP (Digital Signal Processor), and any appropriate processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as a data processing method. For example, in some embodiments, the data processing method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the data processing method described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to execute the data processing method in any other appropriate manner (eg, by means of firmware).
[0150] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application Specific Standard Products), SOCs (System On Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor that may be a dedicated or general-purpose programmable processor that may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0151] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0152] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0153] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0154] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.
[0155] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business s scalability in traditional physical hosts and VPS services (Virtual Private Server). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0156] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0157] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A data processing method, include: Obtaining a data processing command, wherein the data processing command includes a call command for an AI function; Parsing the data processing command to determine the data operation type, the target field to be processed and the prompt word corresponding to the data processing command; Based on the data operation type, the target field and the prompt word, generating a first data processing program that calls the AI function; The first data processing program is executed to call the AI function to process the target data corresponding to the target field based on the prompt word.
2. The method according to claim 1, in, The first data processing program includes: In the case where the data operation type is a query operation type, generating a data query statement based on the target field, and executing the data query statement in a database to obtain the target data; The AI function is called to process the target data based on the prompt word to obtain processed output data.
3. The method according to claim 1, in, The first data processing program includes: In the case where the data operation type is an insert operation type, determining content to be inserted in the data processing command; Calling the AI function to process the target data corresponding to the target field in the content to be inserted based on the prompt word to obtain the target insertion content; A data insert statement is generated based on the target insert content, and the data insert statement is executed in a database to insert the target insert content into the database.
4. The method according to claim 1, in, The first data processing program includes: In the case where the data operation type is a delete operation type, generating a data query statement based on the target field, and executing the data query statement in a database to obtain the target data; Calling the AI function to process the target data based on the prompt word, and determining the data to be deleted in the target data; A data deletion statement is generated based on the data to be deleted, and the data deletion statement is executed in a database to delete the data to be deleted from the database.
5. The method according to claim 1, in, The executing the first data processing program to call the AI function to process the target data corresponding to the target field based on the prompt word includes: Transforming the first data processing program based on the grammatical rules of the target data analysis engine to generate a second data processing program; The second data processing program is executed in the target data analysis engine to call the AI function to process the target data corresponding to the target field based on the prompt word.
6. The method according to claim 1, in, Also includes: Verifying the data processing command to determine whether the data processing command complies with preset grammatical rules; When the data processing command does not conform to the preset grammatical rules, a call syntax error message is generated.
7. The method according to any one of claims 1 to 6, in, In the case that there are multiple target fields, the prompt word includes a description of each target field.
8. A data processing device, include: An acquisition module, used to acquire a data processing command, wherein the data processing command includes a call command of an AI function; A determination module, used to parse the data processing command, and determine the data operation type, the target field to be processed and the prompt word corresponding to the data processing command; A generating module, used for generating a first data processing program for calling the AI function based on the data operation type, the target field and the prompt word; A calling module is used to execute the first data processing program to call the AI function to process the target data corresponding to the target field based on the prompt word.
9. The device as claimed in claim 8, in, The first data processing program includes: In the case where the data operation type is a query operation type, generating a data query statement based on the target field, and executing the data query statement in a database to obtain the target data; The AI function is called to process the target data based on the prompt word to obtain processed output data.
10. The device according to claim 8, in, The first data processing program includes: In the case where the data operation type is an insert operation type, determining content to be inserted in the data processing command; Calling the AI function to process the target data corresponding to the target field in the content to be inserted based on the prompt word to obtain the target insertion content; A data insert statement is generated based on the target insert content, and the data insert statement is executed in a database to insert the target insert content into the database.
11. The device according to claim 8, in, The first data processing program includes: In the case where the data operation type is a delete operation type, generating a data query statement based on the target field, and executing the data query statement in a database to obtain the target data; Calling the AI function to process the target data based on the prompt word, and determining the data to be deleted in the target data; A data deletion statement is generated based on the data to be deleted, and the data deletion statement is executed in a database to delete the data to be deleted from the database.
12. The device according to claim 8, in, The calling module is used to: Transforming the first data processing program based on the grammatical rules of the target data analysis engine to generate a second data processing program; The second data processing program is executed in the target data analysis engine to call the AI function to process the target data corresponding to the target field based on the prompt word.
13. The device according to claim 8, in, Also includes a verification module for: Verifying the data processing command to determine whether the data processing command complies with preset grammatical rules; When the data processing command does not conform to the preset grammatical rules, a call syntax error message is generated.
14. The device according to any one of claims 8 to 13, in, In the case that there are multiple target fields, the prompt word includes a description of each target field.
15. An electronic device, include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.
16. A non-transitory computer-readable storage medium storing computer instructions, in, The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.
17. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.
