Data processing method and apparatus, and storage medium and electronic device

By generating structured query statements based on custom function templates and general programming languages, and calling custom functions directly from the target database interface for data processing, the problem of low processing efficiency of custom function in the existing technology is solved, and efficient data processing and simplified function maintenance are achieved.

WO2025141471A1PCT designated stage expired Publication Date: 2025-07-03CLOUD INTELLIGENCE ASSETS HOLDING (SINGAPORE) PTE LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/IB2024/063144
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-25
Filing Date
2024-12-24
Publication Date
2025-07-03

AI Technical Summary

Technical Problem

In the prior art, custom functions require users to compile, package, add resources, and create functions, resulting in inefficient data processing.

Method used

By generating structured query statements based on custom function templates and common programming languages, custom functions are called directly from the target database interface for data processing, avoiding user compilation and packaging operations, and supporting creation and multiple uses at once.

Benefits of technology

It improves the efficiency of data processing, reduces the complexity of writing and maintaining custom functions, and realizes efficient writing and multiple use of custom functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure IB2024063144_03072025_PF_FP_ABST
    Figure IB2024063144_03072025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present application are a data processing method and apparatus, and a storage medium and an electronic device. The method comprises: receiving a data processing request, wherein the data processing request at least comprises target data to be processed and a target processing mode for the target data; on the basis of the target processing mode in the data processing request, generating a structured query statement for calling a first user defined function; and calling the first user defined function from a target interface of a target database on the basis of the structured query statement, and processing the target data on the basis of the first user defined function, so as to obtain a processing result. The present application solves the technical problem in the prior art of the processing efficiency of data being relatively low due to the fact that the data can be processed by means of a user defined function only after a user performs operations such as compilation and packaging, resource addition and function creation.
Need to check novelty before this filing date? Find Prior Art

Description

[0001]This application claims priority to Chinese patent application number 202311813069.1, filed with the China Patent Office on December 25, 2023, entitled "Data Processing Method and Apparatus, Storage Medium and Electronic Device," the entire contents of which are incorporated herein by reference. Technical Field This application relates to the field of data processing technology, and more specifically, to a data processing method and apparatus, a storage medium, and an electronic device. Background: User-defined functions (UDFs) are a core capability of relational databases, especially distributed big data database products, and are the most widely used sub-functions in big data products. Custom functions effectively extend the limited capabilities of the database's general built-in functions, supporting customized extensions to meet various user-specific task logic and requirements, implementing various complex task logic. Built-in built-in functions and custom functions in SQL (Structured Query Language) statements are among the most commonly used tools in SQL and are the most widely used sub-functions in various big data database products on the cloud. From Oracle's pipeline table functions, MS-SQL's table-valued functions and related stored procedures, to MaxCompute, HoI Ogres, and various open-source distributed big data platforms using UDFs, SQL engines can implement complex task logic and meet complex user needs. There are various syntax definitions, designs, and architectural implementations for custom UDFs. Most databases, especially traditional ones, support writing custom functions in SQL, also known as PL / SQL (Procedure Language / SQL). However, currently, custom UDFs require users to compile (in Java), package them, add resources, and create functions before they can be used. This process is cumbersome and requires local project creation, compilation, packaging, release, and creation of custom functions based on the package. Updates to task logic require repetition of these steps. Furthermore, the packaged program is a black box, making it difficult to view and modify. SQL programs containing UDFs cannot directly view their implementation logic, and some JAR packages even lack the source code, making code maintenance inconvenient. Currently, no effective solution has been proposed to the above problems.SUMMARY OF THE INVENTION Embodiments of the present application provide a data processing method and apparatus, a storage medium, and an electronic device to at least address the technical problem in the prior art that, in order to process data using a custom function, users must compile and package data, add resources, and create functions, resulting in relatively low data processing efficiency. According to one aspect of an embodiment of the present application, a data processing method is provided, comprising: receiving a data processing request, wherein the data processing request includes at least target data to be processed and a target processing method for the target data; generating, based on the target processing method in the data processing request, a structured query statement for invoking a first custom function, wherein the first custom function is derived from a custom function template and a general programming language, the custom function template being used to provide execution conditions for target code; invoking the first custom function from a target interface of a target database based on the structured query statement, and processing the target data according to the first custom function to obtain a processing result. Furthermore, before generating a structured query statement for calling the first custom function based on the target processing method in the data processing request, the method further includes: generating target code based on the general programming language and the target processing method; and generating the first custom function based on the custom function template and the target code. Furthermore, generating the first custom function based on the custom function template and the target code includes: adding the target code to a target location in the custom function template to obtain an initial custom function; setting target keywords in the initial custom function to obtain a processed initial custom function, wherein the target keywords include at least storage-class keywords and update-class keywords; and analyzing the processed initial custom function to obtain the first custom function. Furthermore, analyzing the processed initial user-defined function to obtain the first user-defined function includes: generating an abstract syntax tree based on the processed initial user-defined function; performing error analysis on code in the first user-defined function based on the abstract syntax tree to obtain a first analysis result; performing compilation analysis on the processed initial user-defined function to obtain a second analysis result; and modifying the processed initial user-defined function based on the first and second analysis results to obtain the first user-defined function. Furthermore, generating an abstract syntax tree based on the processed initial user-defined function includes: splitting the processed initial user-defined function to obtain multiple strings; filtering the multiple strings to obtain processed strings; and generating the abstract syntax tree based on the processed strings.Furthermore, performing error analysis on the code in the first user-defined function based on the abstract syntax tree to obtain a first analysis result includes: analyzing the data processing process of the code in the first user-defined function based on the abstract syntax tree, outside of a real execution environment, to obtain a first analysis sub-result; performing physical analysis on the data processing process of the code in the first user-defined function based on the abstract syntax tree, to obtain a second analysis sub-result; and obtaining the first analysis result based on the first analysis sub-result and the second analysis sub-result. Furthermore, performing compilation analysis on the processed initial user-defined function to obtain a second analysis result includes: obtaining the target code based on the processed initial user-defined function; compiling the target code in a real execution environment to obtain an execution result, wherein the real execution environment is the real execution environment of the first user-defined function; and performing error analysis based on the execution result to obtain the second analysis result. Furthermore, after obtaining the first custom function based on the custom function template and the target code, the method further includes: persistently storing the first custom function in the target database; and extending a target interface of the target database to call the first custom function through the extended target interface. According to another aspect of an embodiment of the present application, a data processing method is provided, comprising: obtaining a data processing request uploaded by a client, wherein the data processing request includes at least target data to be processed and a target processing method for the target data; generating, on a cloud server, a structured query statement for calling the first custom function based on the target processing method in the data processing request, wherein the first custom function is obtained based on a custom function template and a general programming language, the custom function template being used to provide execution conditions for the target code; calling the first custom function from the target interface of the target database based on the structured query statement, processing the target data based on the first custom function to obtain a processing result; and returning the processing result to the client.According to another aspect of an embodiment of the present application, a data processing device is provided, comprising: a receiving unit configured to receive a data processing request, wherein the data processing request includes at least target data to be processed and a target processing method for the target data; a first generating unit configured to generate, based on the target processing method in the data processing request, a structured query statement for invoking a first custom function, wherein the first custom function is derived from a custom function template and a general programming language, wherein the custom function template provides execution conditions for a target code; a calling unit configured to call the first custom function from a target interface of a target database based on the structured query statement, and process the target data based on the first custom function to obtain a processing result. Furthermore, the device further comprises: a second generating unit configured to generate a target code based on the general programming language and the target processing method before generating the structured query statement for invoking the first custom function based on the target processing method in the data processing request; and a third generating unit configured to generate the first custom function based on the custom function template and the target code. Furthermore, the third generation unit includes: an adding subunit configured to add the target code to a target location in the custom function template to obtain an initial custom function; a setting subunit configured to set target keywords in the initial custom function to obtain a processed initial custom function, wherein the target keywords include at least storage-class keywords and update-class keywords; an analysis subunit configured to analyze the processed initial custom function to obtain the first custom function. Furthermore, the analysis subunit includes: a generation module configured to generate an abstract syntax tree based on the processed initial custom function; a first analysis module configured to perform error analysis on the code in the first custom function based on the abstract syntax tree to obtain a first analysis result; a second analysis module configured to perform compilation analysis on the processed initial custom function to obtain a second analysis result; and a correction module configured to correct the processed initial custom function based on the first and second analysis results to obtain the first custom function. Furthermore, the generation module includes: a splitting submodule, configured to split the processed initial custom function to obtain multiple character strings; a filtering submodule, configured to filter the multiple character strings to obtain processed character strings; and a generation submodule, configured to generate the abstract syntax tree based on the processed character strings.Furthermore, the first analysis module includes: a first analysis submodule configured to analyze the data processing process of the code in the first user-defined function based on the abstract syntax tree, outside of a real execution environment, to obtain a first analysis sub-result; a second analysis submodule configured to perform physical analysis of the data processing process of the code in the first user-defined function based on the abstract syntax tree, to obtain a second analysis sub-result; and a determination submodule configured to obtain the first analysis result based on the first analysis sub-result and the second analysis sub-result. Furthermore, the second analysis module includes: an acquisition submodule configured to acquire the target code based on the processed initial user-defined function; a compilation submodule configured to compile the target code in a real execution environment to obtain an execution result, wherein the real execution environment is the real execution environment of the first user-defined function; and a third analysis submodule configured to perform error analysis based on the execution result to obtain the second analysis result. Furthermore, the apparatus further includes: a storage unit configured to persistently store the first custom function in the target database after obtaining the first custom function based on the custom function template and the target code; and an extension unit configured to perform extension processing on a target interface of the target database to call the first custom function through the extended target interface. According to another embodiment of the present application, a computer-readable storage medium is provided, wherein the storage medium stores a program, wherein when the program is executed, the device containing the storage medium is controlled to execute any one of the aforementioned data processing methods. According to another embodiment of the present application, an electronic device is provided, comprising a memory storing an executable program; and a processor configured to execute the program, wherein when the program is executed, the device executes any one of the aforementioned data processing methods.In an embodiment of the present application, a data processing request is received, wherein the data processing request includes at least target data to be processed and a target processing method for the target data; a structured query statement is generated based on the target processing method in the data processing request to call a first custom function, wherein the first custom function is obtained based on a custom function template and a general programming language, and the custom function template is used to provide execution conditions for the target code; the first custom function is called from a target interface of a target database based on the structured query statement, and the target data is processed based on the first custom function to obtain a processing result. This solves the technical problem in existing technologies that require users to perform operations such as compiling, packaging, adding resources, and creating functions before processing data through custom functions, resulting in relatively low data processing efficiency. In the present application, when data processing is required on the target data, a structured query statement for calling the first custom function can be directly generated based on the current target processing method. Finally, the structured query statement is used to call the first custom function from the target interface of the target database to complete the processing of the target data, avoiding the need for users to perform operations such as compiling, packaging, adding resources, and creating functions before processing data through custom functions. Furthermore, the custom functions in this application are based on a general programming language, which improves writing efficiency compared to the prior art method of writing encapsulated custom functions in SQL. Furthermore, the custom functions in this application support single-use creation and multiple uses, eliminating the need for users to locally create projects, compile, package, and publish online, thereby improving data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS The accompanying drawings described herein are provided to provide a further understanding of this application and constitute a part of this application. The exemplary embodiments of this application and their descriptions are intended to explain this application and do not constitute undue limitations of this application. In the accompanying drawings: FIG1 is a schematic diagram of a computer terminal according to the first embodiment of this application; FIG2 is a flow chart of a data processing method according to the first embodiment of this application; FIG3 is a schematic diagram of a custom function according to the first embodiment of this application; FIG4 is a flow chart of writing a custom function in the prior art; FIG5 is a flow chart of writing a custom function according to the first embodiment of this application; FIG6 is a flow chart of the data processing method according to the second embodiment of this application; FIG7 is a schematic diagram of a data processing device according to the third embodiment of this application; and FIG8 is a schematic diagram of a computer terminal according to the fourth embodiment of this application.DETAILED DESCRIPTION To help those skilled in the art better understand the present invention, the following will provide a clear and complete description of the technical solutions in the embodiments of the present invention, in conjunction with the accompanying drawings. It should be noted that the described embodiments represent only a portion of the present invention, and are not exhaustive. All other embodiments devised by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort should fall within the scope of protection of the present invention. It should be noted that the terms "first," "second," and so on, in the specification and claims of the present invention, and in the accompanying drawings, are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that such terms are interchangeable where appropriate, such that the embodiments of the present invention described herein can be implemented in an order other than that illustrated or described herein. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not necessarily limited to the steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, product, or apparatus. First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations: Distributed SQL: Structured Query Language, a standard language for database queries; the SQL language corresponds to a relational data computing model. Distributed SQL refers to a distributed system that supports scheduling, converting, and executing relational data computing jobs submitted in SQL in a distributed parallel environment. The distributed SQL job execution process first parses the SQL into an abstract syntax tree and converts it into a logical plan. The logical plan is a DAG (directed acyclic graph) composed of relational operators. The logical plan is then converted into a physical execution plan and scheduled for distributed execution on a distributed computing platform.User Defined Function (UDF): In a narrow sense, UDF refers to User Defined Sea Iar Function. In a broad sense, UDF includes User Defined Sea Iar Function (UDF), User Defined Table Function (UDTF), and User Defined Aggregate Function (UDAF). oIn this application, the term "UDF" refers to a broad category of custom functions, encompassing a variety of custom functions. User-defined functions (UDFs) in databases can support custom extensions to meet various user-defined task logic and requirements. A UDF (User-Defined Sealar Function) is a custom scalar function, commonly referred to as a UDF. Its input and output have a one-to-one relationship: it reads a row of data and writes a single output value. A UDTF (User-Defined Table-Valued Function) is a custom table-valued function used to output multiple rows of data in a single function call. It is the only custom function that can return multiple fields. A UDAF (User-Defined Aggregation Function) is a custom aggregate function. Its input and output have a many-to-one relationship: it aggregates multiple input records into a single output value. It can be used in conjunction with a Group By statement in SQL. General-purpose programming languages: A programming language is a formal language used to define the execution flow of computer instructions. Each programming language includes a set of vocabulary and grammatical specifications. These specifications typically include data types and structures, instruction types and instruction control, calling mechanisms and library functions, as well as unwritten conventions (such as progressive writing and variable naming). There are various ways to categorize programming languages. Most programming languages ​​are algorithm-description languages, such as C / C++ and Java, while some are data-description languages, such as markup languages ​​like HTML. Based on the difficulty of programming techniques, they can be divided into low-level languages ​​(machine language, assembly language) and high-level languages. Based on the design style, programming languages ​​can be divided into imperative languages ​​(procedural languages), structured languages, object-oriented languages, functional languages, and scripting languages. Based on the application domain, programming languages ​​can be divided into general-purpose and special-purpose programming languages. Based on the execution method, programming languages ​​can be divided into interpreted languages ​​(such as JavaScript, Python, Perl, and R), compiled languages ​​(such as C / C++), and compiled-interpreted languages ​​(such as Java and PHP). In this application, general-purpose programming languages ​​are categorized by their widespread use, including the most widely used and powerful languages, such as Java and Python. User-free compilation: Compilation is the process of using a compiler to generate a target program from a source program written in a source language.For example, compilation of programming languages ​​is the process of translating source code written in high-level computer languages ​​such as C++, Java, and C# into machine language that can be executed on a computer. This process converts high-level languages ​​into binary language recognizable by computers. Computers only recognize 1s and 0s; the compiler converts familiar human languages ​​into binary. In the prior art, custom UDFs (User Defined Functions) require the source code and packaged execution code into a JAR package before being submitted and published to a computing platform for compilation. However, the custom UDFs in this application do not require user compilation, meaning they are user-free. It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, storage, and display, etc.) involved in this application are all authorized by the user or fully authorized by all parties. The collection, use, and processing of these data must comply with relevant laws, regulations, and standards in the relevant region, and corresponding entry points are provided for users to choose to authorize or deny. Embodiment 1 According to an embodiment of the present application, a data processing method is also provided. It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system, such as a set of computer-executable instructions. Furthermore, although the flowcharts illustrate a logical order, in some cases, the steps shown or described may be executed in a different order than that shown. The method embodiment provided in Embodiment 1 of the present application can be executed in a mobile terminal, a computer terminal, or a similar computing device. Figure 1 shows a hardware block diagram of a computer terminal (or mobile device) for implementing the data processing method. As shown in Figure 1, the computer terminal (or mobile device) 10 may include a processor assembly 102 (the processor assembly 102 may include, but is not limited to, a processing device such as a microprocessor (MCU) or a programmable logic device (FPGA), and the processor assembly 102 may include a processor assembly, as shown in Figure 1 by 102a, 102b, ..., 102n), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, the electronic device may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS), a network interface, a power supply, and / or a camera. Those skilled in the art will appreciate that the structure shown in FIG. 1 is merely illustrative and does not limit the structure of the electronic device.For example, the computer terminal 10 may include more or fewer components than shown in FIG. 1 , or have a configuration different from that shown in FIG. It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry." This data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuitry may be a single, independent processing module, or may be fully or partially integrated into any of the other components of the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuitry functions as a processor control (e.g., selecting a variable resistor terminal path connected to an interface). Memory 104 may be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the data processing method in the embodiments of the present application. Processor 102 executes the software programs and modules stored in memory 104 to execute various functional applications and data processing, thereby implementing the aforementioned data processing method. Memory 104 may include high-speed random access memory (RAM) or non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memories remotely located relative to the processor 102. These remote memories may be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof. The transmission device 106 is used to receive or send data via a network. Specific examples of such networks may include a wireless network provided by the communications provider of the computer terminal 10. In one example, the transmission device 106 includes a network interface controller (NIC), which can connect to other network devices via a base station to enable communication with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module for wireless communication with the Internet. The display may be, for example, a touch-screen liquid crystal display (LCD), which enables a user to interact with the user interface of the computer terminal 10 (or mobile device). In the above operating environment, the present application provides a data processing method as shown in FIG2 . FIG2 is a flow chart of a data processing method according to a first embodiment of the present application, comprising: Step S201, receiving a data processing request, wherein the data processing request includes at least target data to be processed and a target processing method for the target data.Optionally, a data processing request is obtained. The data processing request must include at least the target data to be processed and the processing to be performed on the target data (i.e., the target processing method described above). For example, the target processing method may be filtering the data or performing a summation operation on the data. In step S202, a structured query statement for invoking a first custom function is generated based on the target processing method in the data processing request. The first custom function is derived based on a custom function template and a general programming language. The custom function template is used to provide execution conditions for the target code. Optionally, after obtaining the target processing method, the target custom function is determined based on the target processing method to implement the data processing. In other words, a structured query statement for invoking the first custom function is generated. It should be noted that the first custom function is derived based on the custom function template and a general programming language. The general programming language may be Java, Python, or other programming languages. It should be noted that the aforementioned custom function template is used to provide execution conditions for the target code, namely, enabling the target code to be executed through the custom function model. The aforementioned custom function template supports the use of general-purpose programming languages ​​such as Java and Python as function bodies for writing task logic, effectively improving custom function writing efficiency and reducing code maintenance costs. In step S203, a first custom function is called from a target interface of a target database based on a structured query statement, and target data is processed according to the first custom function to obtain a processing result. Optionally, after obtaining the aforementioned structured query statement, the structured query statement is executed, the first custom function is called from the target interface of the target database, and target data to be processed is obtained. Finally, the target data is processed according to the first custom function to obtain a processing result. In summary, when it is necessary to process the target data, a structured query statement that calls the first custom function can be directly generated according to the current target processing method. Finally, the structured query statement is used to call the first custom function from the target interface of the target database to complete the processing of the target data, thereby avoiding the need for users to compile, package, add resources, and create functions before processing the data through the custom function. In addition, the custom function in the present application is obtained based on a general programming language, which improves the writing efficiency compared to the prior art of writing and encapsulating custom functions in the SQL language. In addition, the custom function in the present application supports one-time creation and multiple uses, thereby avoiding the need for users to establish a project locally, compile, package, publish and release, and other operations, thereby achieving the effect of improving data processing efficiency.To directly call the first custom function to process the target data, the data processing method provided in the first embodiment of the present application, before generating a structured query statement for calling the first custom function based on the target processing method in the data processing request, further includes: generating target code based on a general programming language and the target processing method; and generating the first custom function based on the custom function template and the target code. Optionally, the data processing method provided in the present application utilizes the following steps to obtain the first custom function: writing task logic using a programming language based on the target processing method for the target data, i.e., generating the target code; then obtaining a custom function template; and generating the first custom function using the custom function template and the target code. It should be noted that the custom function template supports writing task logic using general programming languages ​​such as Java and Python as the function body, effectively improving custom function writing efficiency and reducing code maintenance costs. The custom function template also includes a target keyword, such as the embedded storage class keyword. Setting this keyword enables persistent storage of the custom function obtained based on the custom function template. To ensure the implementability of the first custom function, in the data processing method provided in the first embodiment of the present application, generating the first custom function based on the custom function template and target code includes: adding the target code to the target location in the custom function template to obtain an initial custom function; setting target keywords in the initial custom function to obtain a processed initial custom function, wherein the target keywords include at least a storage-class keyword and an update-class keyword; and analyzing the processed initial custom function to obtain the first custom function. Optionally, the target code obtained based on the task processing logic is added between the #code and #endcode characters included in the custom function template, i.e., adding the target code to the target location in the custom function template as described above. After obtaining the initial custom function, the target keyword is set. For example, the keyword "embedded function" is a required keyword (i.e., the storage-class keyword), indicating that the task code written in the programming language needs to be persistently stored and reused multiple times after successful creation. The keyword "replicate" (i.e., the update-class keyword) indicates that the save of an existing function will take effect immediately.In an optional embodiment, the first custom function derived from the custom function template described above is shown in FIG3 . "embedded function" is a required keyword, indicating that the task code written in a programming language needs to be persistently stored and reused multiple times after successful creation. The "replicate" keyword is optional. "create" or "replicate function" indicates support for updating the task processing code content of an already created function. For an existing function, "replicate" indicates that saving will take effect. Task processing can be written in general programming languages ​​such as Java and Python within the "#code" and "#endcode" fields following the "keyword." The language type is configured after "lang." For example, "lang" = "JAVA" in FIG3 indicates that the programming language is Java. oAfter obtaining the processed initial custom function, the processed initial custom function is analyzed and processed, for example, through lexical analysis, syntax analysis, semantic analysis, type checking, constant folding, and other processes, to obtain the first custom function. Through these steps, users no longer need to manage software resource packages or handle complex processes such as compilation, packaging, and uploading, thereby improving data processing efficiency. To improve the accuracy and reusability of the first custom function, the data processing method provided in the first embodiment of the present application analyzes and processes the processed initial custom function to obtain the first custom function, including: generating an abstract syntax tree based on the processed initial custom function; performing error analysis on the code in the first custom function based on the abstract syntax tree to obtain a first analysis result; performing compilation analysis based on the processed initial custom function to obtain a second analysis result; and modifying the processed initial custom function based on the first and second analysis results to obtain the first custom function. Optionally, after obtaining the processed initial custom function, the processed initial custom function is parsed to obtain the abstract syntax tree. An abstract syntax tree (AST) represents the user input statement in a tree-like structure. Each node in the tree represents a word, and the tree structure embodies the syntax. The AST is constructed during the parsing process. Once the parsing is complete, the parser outputs an AST with a one-to-one correspondence between the user input and the structure of the AST. After obtaining the AST, the code in the first custom function is analyzed for errors, for example, to determine the code's feasibility and rationality, to obtain the first analysis result. Following the error analysis, the processed initial custom function is then compiled and analyzed. This reduces various incompatibility issues that may occur in real production environments after local compilation, as is common in existing technologies. Furthermore, compiling and analyzing custom functions allows for early detection of type mismatches, eliminating the need to wait until execution to discover these issues. This proactive detection reduces operational costs. Finally, the processed initial user-defined function is corrected based on the first analysis result and the second analysis result to obtain a final first user-defined function. For example, if the first analysis result indicates that there is a mismatch between the actual type and the declared type of a variable or parameter, or if the second analysis result indicates a compilation error, the code in the processed initial user-defined function is corrected based on these issues to obtain the above-mentioned first user-defined function.The above-mentioned error analysis and compilation analysis can effectively avoid various subsequent incompatibility issues in real production environments. It also automates the time-consuming and manual operations of traditional user-defined functions (UDFs) within the database engine. Users no longer need to manage software resource packages or handle complex processes such as compilation, packaging, and uploading, thereby improving the efficiency of writing user-defined functions. In an optional embodiment, in the data processing method provided in Example 1 of the present application, generating an abstract syntax tree based on the processed initial user-defined function includes: splitting the processed initial user-defined function to obtain multiple strings; filtering the multiple strings to obtain processed strings; and generating an abstract syntax tree based on the processed strings. Optionally, splitting the processed initial user-defined function into tokens containing keyword recognition characters, thereby obtaining the multiple strings described above. To improve the simplicity of subsequent construction of the abstract syntax tree, the multiple strings can be filtered to obtain the processed strings. After obtaining the processed strings, the token stream can be parsed into an abstract syntax tree using a top-down or bottom-up algorithm. To improve the accuracy of code error analysis, in the data processing method provided in Example 1 of the present application, error analysis of the code in a first user-defined function based on an abstract syntax tree is performed to obtain a first analysis result, including: analyzing the data processing process of the code in the first user-defined function based on the abstract syntax tree, detached from a real execution environment, to obtain a first analysis sub-result; performing physical analysis of the data processing process of the code in the first user-defined function based on the abstract syntax tree, to obtain a second analysis sub-result; and obtaining the first analysis result based on the first analysis sub-result and the second analysis sub-result. Optionally, logical analysis of the data processing process of the code in the first user-defined function is performed based on the abstract syntax tree. It should be noted that logical analysis is performed on the data processing process of the code in the first user-defined function, detached from a real execution environment. Logical analysis is essentially a purely algebraic analysis process and is unrelated to the underlying distributed environment. The overall logical analysis process is to analyze the SQL statement input, complete flow, and operations, during which the task processing code that calls the user-defined function executes and processes data. After the logical analysis is completed, a physical analysis is performed on the data processing process of the code in the first custom function. The physical analysis is closely related to the underlying execution environment. For example, the physical analysis needs to determine how to partition and sort the data during shuffling, the amount of data to read, the number of processes to start to execute the task, and so on.It should be noted that during the logical and physical analysis processes, type checking can also be performed, such as determining whether the actual type of a variable or parameter matches the declared type, to avoid problems when the custom function is subsequently used. The above steps ensure the accuracy of the code for the first custom function. To improve the accuracy of the compilation analysis of the processed initial custom function, in the data processing method provided in Example 1 of the present application, compiling and analyzing the processed initial custom function to obtain a second analysis result includes: obtaining target code based on the processed initial custom function; compiling the target code in a real execution environment to obtain an execution result, where the real execution environment is the real execution environment of the first custom function; and performing error analysis based on the execution result to obtain a second analysis result. Optionally, when compiling and analyzing the processed initial custom function, the target code is obtained based on the processed initial custom function, and then compilation checking of the persistent Embedded Function is performed and the code is compiled and executed in the real execution environment to obtain the above-mentioned second analysis result. It should be noted that during the compilation process, Janino can automatically compile, package, and type-check Java target code, which accounts for the vast majority of Java code. Janino is an ultra-small, ultra-fast open-source Java compiler that dynamically compiles Java source code into Java bytecode at runtime and then executes this bytecode. Janino's key features include runtime dynamic compilation, lightweight and easy integration, and support for dynamic class loading. Janino can dynamically generate and load classes without pre-compiling Java source code, making Java programs more flexible and scalable. Similar to javac, Janino can not only compile a set of Java source files into a set of bytecode c .ass files, but can also compile Java expressions, code blocks, classes, and .java files in memory, load the bytecode, and execute it directly in the JVM. By compiling custom functions in a real execution environment, various incompatibility issues that occur in existing technologies after local compilation in real production environments can be effectively avoided. In an optional embodiment, in the data processing method provided in the first embodiment of the present application, after obtaining the first custom function based on the custom function template and the target code, the method further includes: persistently storing the first custom function in a target database; and extending a target interface of the target database to call the first custom function through the extended target interface.Optionally, after obtaining the first user-defined function, the first user-defined function and its related description information are persistently stored in a target database. In an optional embodiment, the target database may be a Meta framework module of a database platform. Meta information supports persistent embedded Java / Python user-defined functions (UDFs), requiring the definition of a corresponding storage structure. It also supports the creation of DDL Pian for embedded functions. , The DDL pIan is defined by SQL, similar to the common CreateFunct ion interface, while extending the meta's sdk interface (i.e., the target interface described above) so that sql can obtain the embedded function information persisted in meta and support the display of related information when describing a function. In an optional embodiment, after the persistent embedded function is created, a list of all created functions can be viewed through list functions, such as is functions -p my_project, and an established EmbedFunc function can be deleted through drop Func ion, such as drop Func ion myEmbedfuncName. Calling an EmbedFunc is the same as calling a normal function, directly in sql, such as select myEmbed func Name (co 1 1 ). , co 12 , co 13) from t ?When modifying and maintaining a UDF, users can simply execute the desc command on the platform to obtain the latest program source code and make modifications directly, improving the maintenance efficiency of the UDF. This application designs and builds a database-persistent embedded function that supports general programming languages ​​and requires no compilation, allowing users to simply write and save the program to the platform for immediate use. This eliminates the need for offline environment setup, program writing, compilation and packaging, upload and update, resource definition, and function definition based on these resources, as is currently the case with user-defined functions. The UDF designed in this application is instantly editable and effective, offering what you see is what you get, making it efficient and easy to write, use, and maintain. When modifying and maintaining a UDF, users can simply execute the desc command on the platform to obtain the latest program source code and make modifications directly, improving the maintainability of the UDF. This addresses the current industry practice of requiring separate offline storage of source code and compilation packages for UDFs, resulting in separate management of source code and execution packages, which can be difficult to maintain and can lead to source code loss or version mismatches for historical function modifications. The prior art process for creating a user-defined function, as shown in Figure 4, requires distributed management of resources and functions, offline environment establishment, program writing, compilation and packaging, upload and update, resource definition, and function definition based on these resources. The UDF process designed in this application, as shown in Figure 5, eliminates the need for users to set up offline projects, store and maintain task logic in a repository, or import various underlying and application-layer libraries to create custom functions. Users directly write functions containing task logic, register them, and then upload them to the database platform for storage, compilation and packaging, and resource upload. When users need to process data, they call the UDF function using SQL, and the data processing is completed on the database platform. The custom functions provided in this application perform compilation verification during function creation and update, identifying issues early and reducing usage costs. EmbedFunc is persistently stored after creation, enabling single-use creation and multiple uses. Supports advance inspection and persistent storage for efficient execution. During creation, program problems are checked and compiled in the production environment for verification and resolution. User-defined functions are created with only registration and operation separation, resulting in abnormal failure of formal environment checks and verification during execution, causing production task failures and online issues.In the data processing method provided in the first embodiment of the present application, a data processing request is received, wherein the data processing request includes at least target data to be processed and a target processing method for the target data; a structured query statement is generated based on the target processing method in the data processing request for calling a first custom function, wherein the first custom function is obtained based on a custom function template and a general programming language, and the custom function template is used to provide execution conditions for the target code; the first custom function is called from a target interface of a target database based on the structured query statement, and the target data is processed based on the first custom function to obtain a processing result. This solves the technical problem in existing technologies that require users to perform operations such as compiling, packaging, adding resources, and creating functions before processing data through custom functions, resulting in relatively low data processing efficiency. In the present application, when data processing is required on the target data, a structured query statement for calling the first custom function can be directly generated based on the current target processing method. Finally, the structured query statement is used to call the first custom function from the target interface of the target database to complete the processing of the target data, avoiding the need for users to perform operations such as compiling, packaging, adding resources, and creating functions before processing data through custom functions. Furthermore, the custom functions in this application are derived from general-purpose programming languages, which improves writing efficiency compared to the prior art method of writing encapsulated custom functions in SQL. Furthermore, the custom functions in this application support single-use creation and multiple uses, eliminating the need for users to locally create projects, compile, package, and publish online, thereby improving data processing efficiency. It should be noted that, for simplicity, the aforementioned method embodiments are presented as a series of actions. However, those skilled in the art should be aware that this application is not limited by the order of the actions described, as certain steps may be performed in a different order or simultaneously. Furthermore, those skilled in the art should also be aware that the embodiments described in this specification are preferred embodiments, and the actions and modules involved are not necessarily required for this application. Through the above description of the embodiments, those skilled in the art will clearly understand that the methods according to the above embodiments can be implemented using software and a necessary general-purpose hardware platform. Hardware implementation is also possible, but in many cases, the former is the preferred implementation.Based on this understanding, the technical solution of this application, or the portion that contributes to the prior art, can essentially be embodied in the form of a software product. This computer software product is stored in a storage medium (e.g., ROM / RAM, a magnetic disk, or an optical disk) and includes instructions for enabling a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in various embodiments of this application. Example 2 According to an embodiment of this application, a data processing method is also provided. As shown in FIG6 , the method includes: Step S601: Receiving a data processing request uploaded by a client, wherein the data processing request includes at least target data to be processed and a target processing method for the target data; Step S602: Generating, on a cloud server, a structured query statement for invoking a first custom function based on the target processing method in the data processing request, wherein the first custom function is derived based on a custom function template and a general programming language, and the custom function template is used to provide execution conditions for the target code. The first custom function is invoked from a target interface of a target database based on the structured query statement, and the target data is processed according to the first custom function to obtain a processing result. In step S603, the processing result is returned to the client. The specific method for processing the target data in the cloud server is the same as that in Example 1 and will not be further described here. It should be noted that, for simplicity of description, the aforementioned method embodiments are presented as a series of combined actions. However, those skilled in the art should be aware that this application is not limited to the order of the actions described, as certain steps may be performed in a different order or simultaneously. Furthermore, those skilled in the art should also be aware that the embodiments described in this specification are preferred embodiments, and the actions and modules involved are not necessarily required for this application. Through the above description of the embodiments, those skilled in the art will clearly understand that the methods according to the above embodiments can be implemented using software and a necessary general-purpose hardware platform. Hardware can also be used, but in many cases the former is the preferred implementation. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can essentially be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of the various embodiments of the present application.Example 3 According to an embodiment of the present application, a data processing device for implementing the above-mentioned data processing method is further provided. As shown in FIG7 , the device includes: a receiving unit 701, a first generating unit 702, and a calling unit 703. Receiving unit 701 is configured to receive a data processing request, wherein the data processing request includes at least target data to be processed and a target processing method for the target data; first generating unit 702 is configured to generate a structured query statement for calling a first custom function based on the target processing method in the data processing request, wherein the first custom function is obtained based on a custom function template and a general programming language, and the custom function template is used to provide execution conditions for the target code; calling unit 703 is configured to call the first custom function from a target interface of a target database based on the structured query statement, and process the target data according to the first custom function to obtain a processing result. In the data processing device provided in the third embodiment of the present application, a data processing request is received by a receiving unit 701, wherein the data processing request includes at least: target data to be processed and a target processing method for the target data; a first generating unit 702 generates a structured query statement for calling a first custom function based on the target processing method in the data processing request, wherein the first custom function is obtained based on a custom function template and a general programming language, and the custom function template is used to provide execution conditions for the target code; a calling unit 703 calls the first custom function from a target interface of a target database based on the structured query statement, and processes the target data based on the first custom function to obtain a processing result, thereby solving the technical problem in the prior art that the user needs to compile, package, add resources, and create functions before processing data through a custom function, resulting in a relatively low data processing efficiency. In the present application, when data processing is required on the target data, a structured query statement for calling the first custom function can be directly generated based on the current target processing method, and finally the structured query statement is used to call the first custom function from the target interface of the target database to complete the processing of the target data, thereby avoiding the need for the user to compile, package, add resources, and create functions. Data can only be processed through custom functions after operations such as adding resources and creating functions. In addition, the custom functions in this application are obtained based on a general programming language. Compared with the existing technology of using SQL language to write encapsulated custom functions, the writing efficiency is improved. In addition, the custom functions in this application support one-time creation and multiple uses, avoiding the need for users to set up projects, compile, package, and publish online locally, thereby achieving the effect of improving data processing efficiency.In the data processing device provided in the third embodiment of the present application, the device further includes: a second generation unit configured to generate target code based on a general programming language and the target processing method before generating a structured query statement for calling the first custom function based on the target processing method in the data processing request; and a third generation unit configured to generate the first custom function based on the custom function template and the target code. In the data processing device provided in the third embodiment of the present application, the third generation unit includes: an adding subunit configured to add the target code to a target location in the custom function template to obtain an initial custom function; a setting subunit configured to set target keywords in the initial custom function to obtain a processed initial custom function, wherein the target keywords include at least storage-class keywords and update-class keywords; and an analyzing subunit configured to analyze the processed initial custom function to obtain the first custom function. In the data processing device provided in the third embodiment of the present application, the analysis subunit includes: a generation module configured to generate an abstract syntax tree based on the processed initial user-defined function; a first analysis module configured to perform error analysis on the code in the first user-defined function based on the abstract syntax tree to obtain a first analysis result; a second analysis module configured to perform compilation analysis on the processed initial user-defined function to obtain a second analysis result; and a correction module configured to correct the processed initial user-defined function based on the first and second analysis results to obtain the first user-defined function. In the data processing device provided in the third embodiment of the present application, the generation module includes: a splitting submodule configured to split the processed initial user-defined function to obtain multiple strings; a filtering submodule configured to filter the multiple strings to obtain processed strings; and a generation submodule configured to generate an abstract syntax tree based on the processed strings. In the data processing device provided in Example 3 of the present application, the first analysis module includes: a first analysis sub-module, configured to analyze the data processing process of the code in the first custom function based on the abstract syntax tree, outside the actual execution environment, to obtain a first analysis sub-result; a second analysis sub-module, configured to perform physical analysis of the data processing process of the code in the first custom function based on the abstract syntax tree, to obtain a second analysis sub-result; and a determination sub-module, configured to obtain the first analysis result based on the first analysis sub-result and the second analysis sub-result.In the data processing device provided in the third embodiment of the present application, the second analysis module includes: an acquisition submodule configured to acquire target code based on the processed initial custom function; a compilation submodule configured to compile the target code in a real execution environment to obtain an execution result, where the real execution environment is the real execution environment of the first custom function; and a third analysis submodule configured to perform error analysis based on the execution result to obtain a second analysis result. The data processing device provided in the third embodiment of the present application also includes: a storage unit configured to persistently store the first custom function in a target database after obtaining the first custom function based on the custom function template and the target code; and an extension unit configured to extend the target interface of the target database to call the first custom function through the extended target interface. It should be noted that the aforementioned receiving unit 701, first generating unit 702, and calling unit 703 correspond to steps S201 to S203 in the first embodiment. The examples and application scenarios implemented by these three units and the corresponding steps are the same, but are not limited to the contents disclosed in the first embodiment. It should be noted that the above-mentioned module, as part of the device, can run in the computer terminal 10 provided in Example 1. It should be noted that the preferred implementation schemes involved in the above-mentioned embodiments of this application are the same as the solution, application scenarios, and implementation processes provided in Example 1, but are not limited to the solution provided in Example 1. Example 4: The embodiments of this application can provide a computer terminal, which can be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the above-mentioned computer terminal can be replaced with a terminal device such as a mobile terminal. Optionally, in this embodiment, the above-mentioned computer terminal can be located in at least one network device among multiple network devices in a computer network. In this embodiment, the computer terminal may execute program code for the following steps in the data processing method: receiving a data processing request, wherein the data processing request includes at least target data to be processed and a target processing method for the target data; generating a structured query statement for calling a first custom function based on the target processing method in the data processing request, wherein the first custom function is obtained based on a custom function template and a general programming language, and the custom function template is used to provide execution conditions for the target code; calling the first custom function from a target interface of a target database based on the structured query statement, and processing the target data based on the first custom function to obtain a processing result.The computer terminal can execute program code for the following steps in the data processing method: Before generating a structured query statement for calling a first custom function based on a target processing method in a data processing request, the method further includes: generating target code based on a general programming language and the target processing method; and generating the first custom function based on a custom function template and the target code. The computer terminal can execute program code for the following steps in the data processing method: Generating the first custom function based on the custom function template and the target code includes: adding the target code to a target location in the custom function template to obtain an initial custom function; setting target keywords in the initial custom function to obtain a processed initial custom function, wherein the target keywords include at least storage-class keywords and update-class keywords; and analyzing the processed initial custom function to obtain the first custom function. The computer terminal can execute program code for the following steps in the data processing method: analyzing the processed initial custom function to obtain a first custom function includes: generating an abstract syntax tree based on the processed initial custom function; performing error analysis on code in the first custom function based on the abstract syntax tree to obtain a first analysis result; performing compilation analysis on the processed initial custom function to obtain a second analysis result; and modifying the processed initial custom function based on the first and second analysis results to obtain the first custom function. The computer terminal can execute program code for the following steps in the data processing method: generating an abstract syntax tree based on the processed initial custom function includes: splitting the processed initial custom function to obtain multiple strings; filtering the multiple strings to obtain a processed string; and generating an abstract syntax tree based on the processed string. The computer terminal can execute program code of the following steps in the data processing method: performing error analysis on the code in the first user-defined function based on the abstract syntax tree to obtain a first analysis result, which includes: analyzing the data processing process of the code in the first user-defined function in a state separated from a real execution environment based on the abstract syntax tree to obtain a first analysis sub-result; performing physical analysis on the data processing process of the code in the first user-defined function based on the abstract syntax tree to obtain a second analysis sub-result; and obtaining the first analysis result based on the first analysis sub-result and the second analysis sub-result.The computer terminal can execute program code for the following steps in the data processing method: compiling and analyzing the processed initial custom function to obtain a second analysis result includes: obtaining target code based on the processed initial custom function; compiling the target code in a real execution environment to obtain an execution result, where the real execution environment is the real execution environment of the first custom function; and performing error analysis based on the execution result to obtain a second analysis result. The computer terminal can also execute program code for the following steps in the data processing method: after obtaining the first custom function based on the custom function template and the target code, the method further includes: persistently storing the first custom function in a target database; and extending a target interface of the target database to call the first custom function through the extended target interface. Optionally, FIG8 is a block diagram of the structure of a computer terminal according to an embodiment of the present application. As shown in FIG8 , the computer terminal 10 may include one or more (only one is shown in FIG8 ) processors 102 and a memory 104. oThe computing terminal 10 may also include a storage controller to control and manage the memory 104. The computing terminal 10 may also include a peripheral interface to connect to a radio frequency module, an audio module, a display screen, and the like. The memory may be used to store software programs and modules, such as the program instructions / modules corresponding to the data processing methods and apparatuses described in the embodiments of the present application. The processor executes the software programs and modules stored in the memory to perform various functional applications and data processing, thereby implementing the aforementioned data processing methods. The memory may include high-speed random access memory (RAM) and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory located remotely from the processor, which may be connected to the terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof. The processor can access information and applications stored in the memory through a transmission device to perform the following steps: receiving a data processing request, wherein the data processing request includes at least: target data to be processed and a target processing method for the target data; generating a structured query statement for calling a first custom function based on the target processing method in the data processing request, wherein the first custom function is derived based on a custom function template and a general programming language, and the custom function template is used to provide execution conditions for the target code; calling the first custom function from a target interface of a target database based on the structured query statement, and processing the target data based on the first custom function to obtain a processing result. Optionally, the processor can further execute program code for the following steps: before generating the structured query statement for calling the first custom function based on the target processing method in the data processing request, the method further includes: generating target code based on the general programming language and the target processing method; and generating the first custom function based on the custom function template and the target code. Optionally, the processor may further execute program code of the following steps: generating a first custom function based on the custom function template and the target code includes: adding the target code to a target position in the custom function template to obtain an initial custom function; setting and processing a target keyword in the initial custom function to obtain a processed initial custom function, wherein the target keyword includes at least a storage class keyword and an update class keyword; and analyzing and processing the processed initial custom function to obtain a first custom function.Optionally, the processor may further execute program code for the following steps: analyzing the processed initial user-defined function to obtain the first user-defined function includes: generating an abstract syntax tree based on the processed initial user-defined function; performing error analysis on code in the first user-defined function based on the abstract syntax tree to obtain a first analysis result; performing compilation analysis on the processed initial user-defined function to obtain a second analysis result; and modifying the processed initial user-defined function based on the first analysis result and the second analysis result to obtain the first user-defined function. Optionally, the processor may further execute program code for the following steps: generating an abstract syntax tree based on the processed initial user-defined function includes: splitting the processed initial user-defined function to obtain multiple strings; filtering the multiple strings to obtain processed strings; and generating an abstract syntax tree based on the processed strings. Optionally, the processor may further execute program code for the following steps: performing error analysis on the code in the first user-defined function based on the abstract syntax tree to obtain a first analysis result includes: analyzing the data processing process of the code in the first user-defined function based on the abstract syntax tree, outside of a real execution environment, to obtain a first analysis sub-result; performing physical analysis on the data processing process of the code in the first user-defined function based on the abstract syntax tree to obtain a second analysis sub-result; and obtaining the first analysis result based on the first analysis sub-result and the second analysis sub-result. Optionally, the processor may further execute program code for the following steps: performing compilation analysis on the processed initial user-defined function to obtain a second analysis result includes: obtaining target code based on the processed initial user-defined function; compiling the target code in a real execution environment to obtain an execution result, where the real execution environment is the real execution environment of the first user-defined function; and performing error analysis based on the execution result to obtain a second analysis result. Optionally, the processor may further execute program code for the following steps: after obtaining the first custom function based on the custom function template and the target code, the method may further include: persistently storing the first custom function in a target database; and extending a target interface of the target database to call the first custom function through the extended target interface. Those skilled in the art will appreciate that the structure shown in FIG8 is merely illustrative, and the computer terminal may also be a smartphone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile internet device (MID), a PAD, or other terminal device. FIG8 does not limit the structure of the electronic device.For example, the computer terminal 10 may include more or fewer components (such as a network interface, a display device, etc.) than those shown in FIG8 , or may have a configuration different from that shown in FIG8 . Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware associated with the terminal device through a program. The program can be stored in a computer-readable storage medium, which may include a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. Example 5 The embodiments of the present application also provide a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the data processing method provided in Example 1 above. Optionally, in this embodiment, the storage medium can be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group. Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: receiving a data processing request, wherein the data processing request includes at least target data to be processed and a target processing method for the target data; generating a structured query statement for invoking a first custom function based on the target processing method in the data processing request, wherein the first custom function is derived based on a custom function template and a general programming language, and the custom function template is used to provide execution conditions for the target code; invoking the first custom function from a target interface of a target database based on the structured query statement, and processing the target data based on the first custom function to obtain a processing result. The storage medium is configured to store program code for performing the following steps: before generating the structured query statement for invoking the first custom function based on the target processing method in the data processing request, the method further includes: generating target code based on the general programming language and the target processing method; and generating the first custom function based on the custom function template and the target code. The storage medium is configured to store program code for executing the following steps: generating a first custom function based on a custom function template and a target code includes: adding the target code to a target location in the custom function template to obtain an initial custom function; setting and processing target keywords in the initial custom function to obtain a processed initial custom function, wherein the target keywords include at least storage-class keywords and update-class keywords; and analyzing and processing the processed initial custom function to obtain a first custom function.The storage medium is configured to store program code for performing the following steps: analyzing the processed initial custom function to obtain a first custom function includes: generating an abstract syntax tree based on the processed initial custom function; performing error analysis on code in the first custom function based on the abstract syntax tree to obtain a first analysis result; performing compilation analysis on the processed initial custom function to obtain a second analysis result; and modifying the processed initial custom function based on the first and second analysis results to obtain the first custom function. The storage medium is configured to store program code for performing the following steps: generating an abstract syntax tree based on the processed initial custom function includes: splitting the processed initial custom function to obtain multiple strings; filtering the multiple strings to obtain processed strings; and generating an abstract syntax tree based on the processed strings. The storage medium is configured to store program code for executing the following steps: performing error analysis on the code in the first user-defined function based on an abstract syntax tree to obtain a first analysis result, including: analyzing the data processing process of the code in the first user-defined function based on the abstract syntax tree, outside of a real execution environment, to obtain a first analysis sub-result; performing physical analysis on the data processing process of the code in the first user-defined function based on the abstract syntax tree to obtain a second analysis sub-result; and obtaining the first analysis result based on the first analysis sub-result and the second analysis sub-result. The storage medium is configured to store program code for executing the following steps: performing compilation analysis on the processed initial user-defined function to obtain a second analysis result, including: obtaining target code based on the processed initial user-defined function; compiling the target code in a real execution environment to obtain an execution result, wherein the real execution environment is the real execution environment of the first user-defined function; and performing error analysis based on the execution result to obtain a second analysis result. The storage medium is configured to store program code for executing the following steps: After obtaining a first custom function based on a custom function template and target code, the method further includes: persistently storing the first custom function in a target database; and extending a target interface of the target database to call the first custom function through the extended target interface. The serial numbers of the embodiments of this application are for descriptive purposes only and do not represent the merits of each embodiment. In the above embodiments of this application, the description of each embodiment has its own emphasis. For portions not detailed in a particular embodiment, reference should be made to the relevant descriptions of other embodiments. In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways.The device embodiments described above are merely illustrative. For example, the division of units is merely a logical functional division. In actual implementation, other divisions may be employed. For example, multiple units or components may be combined or integrated into another system, or some features may be omitted or not implemented. Furthermore, the couplings or direct couplings or communication connections shown or discussed may be through interfaces, or indirect couplings or communication connections between units or modules, and may be electrical or other forms. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of these units may be selected to achieve the objectives of the present embodiments as needed. Furthermore, the functional units in the various embodiments of the present application may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. These integrated units may be implemented in either hardware or software functional units. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product, stored in a storage medium, includes instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memories (ROMs), random access memories (RAMs), removable hard drives, magnetic disks, or optical disks. The above description is merely a preferred embodiment of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and such improvements and modifications should also be considered within the scope of protection of this application.Industrial Applicability The data processing method provided in the embodiments of the present application can directly generate a structured query statement that calls the first custom function based on the current target processing method when data processing is required on target data. Finally, the structured query statement is used to call the first custom function from the target interface of the target database to complete the processing of the target data. This avoids the need for users to compile, package, add resources, and create functions before processing data through the custom function. In addition, the custom function in the present application is obtained based on a general programming language, which improves the writing efficiency compared to the prior art of writing and encapsulating custom functions in the SQL language. In addition, the custom function in the present application supports one-time creation and multiple uses, avoiding the need for users to locally establish a project, compile, package, and publish online, thereby achieving the effect of improving data processing efficiency.

Claims

Claims 1. A data processing method, comprising: Receive a data processing request, where the data processing request at least includes: target data to be processed and a target processing method for the target data; generate a structured query statement for calling a first custom function according to the target processing method in the data processing request, where the first custom function is obtained based on a custom function template and a general programming language, and the custom function template is used to provide execution conditions for target code; call the first custom function from a target interface of a target database according to the structured query statement, and process the target data according to the first custom function to obtain a processing result.

2. The method according to claim 1, wherein Before generating a structured query statement for calling a first custom function according to the target processing method in the data processing request, the method further includes: generating target code according to the general programming language and the target processing method; generating the first custom function according to the custom function template and the target code.

3. The method according to claim 2, wherein Generating the first custom function according to the custom function template and the target code includes: adding the target code to a target position in the custom function template to obtain an initial custom function; performing setting processing on target keywords in the initial custom function to obtain a processed initial custom function, where the target keywords at least include storage class keywords and update class keywords; performing analysis processing on the processed initial custom function to obtain the first custom function.

4. The method according to claim 3, wherein, Performing analysis processing on the processed initial custom function to obtain the first custom function includes: generating an abstract syntax tree according to the processed initial custom function; performing error analysis on the code in the first custom function according to the abstract syntax tree to obtain a first analysis result; performing compilation analysis according to the processed initial custom function to obtain a second analysis result; 23 Correcting the processed initial custom function according to the first analysis result and the second analysis result to obtain the first custom function.

5. The method according to claim 4, wherein Generating an abstract syntax tree according to the processed initial custom function includes: performing splitting processing on the processed initial custom function to obtain a plurality of strings; performing filtering processing on the plurality of strings to obtain processed strings; generating the abstract syntax tree according to the processed strings.

6. The method according to claim 4, wherein Error analysis is performed on the code in the first custom function according to the abstract syntax tree, and the first analysis result is obtained, including: according to the abstract syntax tree, analyzing the data processing process of the code in the first custom function in a real execution environment-free state to obtain a first analysis sub-result; according to the abstract syntax tree, performing a physical analysis on the data processing process of the code in the first custom function to obtain a second analysis sub-result; and obtaining the first analysis result according to the first analysis sub-result and the second analysis sub-result.

7. The method according to claim 4, wherein Compilation analysis is performed according to the processed initial custom function, and the second analysis result is obtained, including: according to the processed initial custom function, obtaining the target code; in a real execution environment, performing compilation on the target code to obtain an execution result, where the real execution environment is the real execution environment of the first custom function; and performing error analysis according to the execution result to obtain the second analysis result.

8. The method according to claim 4, wherein After obtaining the first custom function according to the custom function template and the target code, the method further includes: persistently storing the first custom function in the target database; and performing an extension process on the target interface of the target database to call the first custom function through the extended target interface.

9. A data processing method, comprising: Obtain a data processing request uploaded by a client, where the data processing request at least includes: target data to be processed and a target processing method for the target data; generating a structured query statement for calling a first custom function in a cloud server according to the target processing method in the data processing request, where the first custom function is obtained based on a custom function template and a general programming language, and the custom function template is used to provide execution conditions for the target code; calling the first custom function from the target interface of the target database according to the structured query statement, and processing the target data according to the first custom function to obtain a processing result; and returning the processing result to the client.

10. A data processing device, comprising: A receiving unit, configured to receive a data processing request, where the data processing request at least includes: target data to be processed and a target processing method for the target data; a first generating unit, configured to generate a structured query statement for calling a first custom function according to the target processing method in the data processing request, where the first custom function is obtained based on a custom function template and a general programming language, and the custom function template is used to provide execution conditions for the target code; and a calling unit, configured to call the first custom function from the target interface of the target database according to the structured query statement, and process the target data according to the first custom function to obtain a processing result.

11. A computer-readable storage medium, the computer-readable storage medium including a stored program, wherein, When the program runs, control the device where the storage medium is located to execute the data processing method described in any one of claims 1 to 9.

12. An electronic device, comprising: A memory storing an executable program; A processor for running the program, wherein when the program runs, it executes the data processing method described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Data processing method and device based on Flink SQL and storage medium

    CN111026779A

  • Method and system decoding user defined functions

    US20050160100A1

  • User defined functions for data loading

    US20120239612A1