CN110399384B - UDF adaptation method, data processing method, device and storage medium - Google Patents

UDF adaptation method, data processing method, device and storage medium Download PDF

Info

Publication number
CN110399384B
CN110399384B CN201810367417.XA CN201810367417A CN110399384B CN 110399384 B CN110399384 B CN 110399384B CN 201810367417 A CN201810367417 A CN 201810367417A CN 110399384 B CN110399384 B CN 110399384B
Authority
CN
China
Prior art keywords
computer program
program language
udf
class
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810367417.XA
Other languages
Chinese (zh)
Other versions
CN110399384A (en
Inventor
苏晓明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201810367417.XA priority Critical patent/CN110399384B/en
Publication of CN110399384A publication Critical patent/CN110399384A/en
Application granted granted Critical
Publication of CN110399384B publication Critical patent/CN110399384B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

The embodiment of the application provides a UDF adaptation method, a data processing method, data processing equipment and a storage medium. In the embodiment of the application, the UDF written in the first computer program language is subjected to platform adaptation by combining the information of the UDF secondary development interface supported by the computing platform to be adapted, class files supported by the computing platform to be adapted are converted by the UDF written in the first computer program language, and then the class files are compiled and packaged into resource file packages which can be called by the computing platform to be adapted according to the grammar format of the second computer program language used by the computing platform to be adapted. Therefore, the embodiment of the application enables the UDF to be used across platforms by carrying out the adaptation treatment on the UDF, achieves the effects of one development and multiple uses, is beneficial to breaking through the platform characteristics of the prior writing of the UDF based on a certain language, is beneficial to improving the use flexibility of the UDF, and further reduces the development cost.

Description

UDF adaptation method, data processing method, device and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a UDF adaptation method, a data processing method, a device, and a storage medium.
Background
The structured query language (Structured Query Language, SQL) itself provides rich built-in functions for programmers to use, but actual business scenarios may be complex and built-in functions may not meet the programming requirements of the business scenario. To this end, SQL also provides user-defined functions (User Defined Function, UDF) to meet the programming requirements of complex business scenarios.
Python is used as an object-oriented interpreted computer programming language, has a very rich and powerful library, can easily link code modules written in other languages together, and has the advantages of simplicity, flexibility, easy learning and the like, so that the writing of UDF based on Python language in a big data-related computing platform is becoming popular.
However, the existing UDF written based on the Python language has the platform characteristic, so that the use of the UDF written based on the Python language is limited, the flexibility is poor, and the development cost is high.
Disclosure of Invention
Aspects of the present application provide a UDF adaptation method, a data processing method, a device, and a storage medium, so as to improve flexibility of use of UDFs written in Python language, thereby reducing development cost.
The embodiment of the application provides a UDF adaptation method, which comprises the following steps:
responding to the UDF adaptation instruction, and acquiring the UDF written in the first computer program language;
converting the UDF written by the first computer program language into a class file of the first computer program language according to the information of a UDF secondary development interface supported by a computing platform to be adapted;
compiling the class file of the first computer program language into the class file of the second computer program language based on the grammar format of the second computer program language used by the computing platform to be adapted;
and packaging the class files of the second computer program language into resource file packages which can be directly called and executed by the computing platform to be adapted.
The embodiment of the application also provides a computer device, which comprises: a memory and a processor;
the memory stores a computer program;
the processor, coupled to the memory, is configured to execute the computer program for:
responding to the UDF adaptation instruction, and acquiring the UDF written in the first computer program language;
converting the UDF written by the first computer program language into a class file of the first computer program language according to the information of a UDF secondary development interface supported by a platform to be calculated;
Compiling the class file of the first computer program language into the class file of the second computer program language based on the grammar format of the second computer program language used by the computing platform to be adapted;
and packaging the class files of the second computer program language into resource file packages which can be directly called and executed by the computing platform to be adapted.
Embodiments of the present application also provide a computer-readable storage medium storing a computer program; the computer program, when executed by a processor, causes the processor to perform actions comprising:
responding to the UDF adaptation instruction, and acquiring the UDF written in the first computer program language;
converting the UDF written by the first computer program language into a class file of the first computer program language according to the information of a UDF secondary development interface supported by a platform to be calculated;
compiling the class file of the first computer program language into the class file of the second computer program language based on the grammar format of the second computer program language used by the computing platform to be adapted;
and packaging the class files of the second computer program language into resource file packages which can be directly called and executed by the computing platform to be adapted.
The embodiment of the application also provides a data processing method, which comprises the following steps:
acquiring user-defined function UDF and development interface information written in a first computer program language;
converting the UDF into a class file of the first computer program language according to the development interface information;
and compiling the class file of the first computer program language into the class file of the second computer program language according to the grammar format of the second computer program language.
In the embodiment of the application, the UDF written in the first computer program language is subjected to platform adaptation by combining the information of the UDF secondary development interface supported by the computing platform to be adapted, class files supported by the computing platform to be adapted are converted by the UDF written in the first computer program language, and then the class files are compiled and packaged into resource file packages which can be called by the computing platform to be adapted according to the grammar format of the second computer program language used by the computing platform to be adapted. Therefore, the embodiment of the application enables the UDF to be used across platforms by carrying out the adaptation treatment on the UDF, achieves the effects of one development and multiple uses, is beneficial to breaking through the platform characteristics of the prior writing of the UDF based on a certain language, is beneficial to improving the use flexibility of the UDF, and further reduces the development cost.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
fig. 1 is a schematic flow chart of a UDF adaptation method according to an exemplary embodiment of the present application;
FIG. 2 is a flow chart of a method for converting a UDF written in a first computer program language into a class file in the first computer program language according to an exemplary embodiment of the present application;
FIG. 3 is a flowchart illustrating compiling a class file in a first computer program language into a class file in a second computer program language according to an exemplary embodiment of the present application;
FIG. 4 is a flow chart of a method for packaging class files of a second computer program language into resource files that can be directly invoked and executed by a computing platform to be adapted according to an exemplary embodiment of the present application;
FIG. 5 is a schematic diagram of a software framework for platform adaptation of a UDF, according to an exemplary embodiment of the present application;
fig. 6a is a schematic structural diagram of a UDF adapter device according to another exemplary embodiment of the present application;
FIG. 6b is a schematic diagram of a computer device according to another exemplary embodiment of the present application;
FIG. 7a is a flowchart of a data processing method according to yet another exemplary embodiment of the present application;
fig. 7b is a schematic structural diagram of another computer device according to still another exemplary embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be clearly and completely described below with reference to specific embodiments of the present application and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Aiming at the technical problem that the prior UDF written based on Python language has platform characteristics, so that the use flexibility of the UDF written by the prior UDF is poor, in some embodiments of the application, the method can combine the information of a UDF secondary development interface supported by a computing platform to be adapted, adapt the UDF written by a first computer program language to the platform, convert the UDF written by the first computer program language into a class file supported by the computing platform to be adapted, and compile and package the class file according to the grammar format of a second computer program language used by the computing platform to be adapted, so as to form a resource file package which can be called by the computing platform to be adapted. According to the embodiment of the application, through carrying out the adaptation processing on the UDF, the UDF can be used across platforms, and the effects of one development and multiple uses are achieved, so that the method is beneficial to breaking through the platform characteristics of the existing UDF written based on a certain language, improving the use flexibility of the UDF and further reducing the development cost.
The following describes in detail the technical solutions provided by the embodiments of the present application with reference to the accompanying drawings.
Fig. 1 is a schematic flow chart of a UDF adaptation method according to an exemplary embodiment of the present application. As shown in fig. 1, the method includes:
101. and responding to the UDF adaptation instruction, and acquiring the UDF written in the first computer program language.
102. And converting the UDF written in the first computer program language into a class file in the first computer program language according to the information of the UDF secondary development interface supported by the computing platform to be adapted.
103. Compiling the class files of the first computer program language into class files of the second computer program language based on a grammar format of the second computer program language to be used by the computing platform.
104. And packaging the class files of the second computer program language into resource file packages which can be directly called and executed by the computing platform to be adapted.
SQL is widely used as a database query and programming language in a variety of computing platforms having data storage and processing capabilities. SQL provides abundant built-in functions and UDF at the same time, in some complex business scenes, business programmers can customize the required functions, namely UDF, according to business requirements to meet the programming requirements of the complex business scenes.
After one UDF is successfully developed, if the UDF can be used by different computing platforms without repeated development, development resources can be saved, and the data processing efficiency of the computing platforms can be improved. However, in the prior art, a UDF developed for one computing platform cannot be migrated to another computing platform seamlessly, that is, the other computing platform cannot call the UDF, which not only limits the use of the UDF, but also causes waste of development resources.
Aiming at the technical problems, the embodiment provides a scheme capable of carrying out platform adaptation on the UDF, so that the UDF can be used across platforms, the effects of one development and multiple uses are achieved, the use flexibility of the UDF is provided, and the development cost is reduced.
Before adapting the UDF to the platform, the UDF needs to be written. Generally, UDFs can be written in some computer programming language in accordance with the UDF specification. For example, the UDF may be written in, but is not limited to, the Python language. In the present embodiment, a computer program language used for writing the UDF is referred to as a first computer program language.
When a certain computing platform needs to use the UDF written in the first computer program language but cannot directly call the UDF, the platform adaptation can be performed on the UDF written in the first computer program language aiming at the computing platform.
For example, when the computing platform does not support the first computer program language, the UDF written in the first computer program language cannot be directly invoked, and then the UDF written in the first computer program language may be platform-adapted for the computing platform.
For another example, when the information of the UDF secondary development interface supported by the computing platform is different from the information of the UDF secondary development interface used when the UDF is written in the first computer program language, the UDF written in the first computer program language cannot be directly called, and then the computing platform can be adapted to the UDF written in the first computer program language.
For ease of distinction and description, a computing platform that requires a platform adaptation of a UDF written in a first computer program language is referred to as a computing platform to be adapted. The computing platform to be adapted may be any SQL enabled data processing engine, for example HIVE, ODPS, SPARK, FLINK, etc.
When the platform adaptation is required for the to-be-adapted computing platform to the UDF written in the first computer program language, the related user can send a UDF adaptation instruction to the computer device, and the UDF adaptation instruction indicates that the platform adaptation is required for the UDF written in the first computer program language, so that the computer device can adapt to the platform of the UDF written in the first computer program language. The computer device is an execution subject of the method of the embodiment, and optionally, the computer device may be a computer device where the computing platform to be adapted is located, but is not limited thereto. The process of performing platform adaptation on the UDF written in the first computer program language by the computer equipment is as follows:
First, a UDF written in a first computer program is obtained according to a UDF adaptation instruction. Secondly, according to the information of the UDF secondary development interface supported by the computing platform to be adapted, performing platform adaptation on the UDF written in the first computer program language, and converting the UDF written in the first computer program language into a class file in the first computer program language. The class file of the first computer program language contains information of the UDF secondary development interface supported by the computing platform to be adapted, and the information can be identified by the computing platform to be adapted, so that a basic condition is provided for the computing platform to be adapted to call the UDF written by the first computer program.
Then, the grammar formats of the different computer program languages will be different in consideration of the different computer program languages used by the different computing platforms. For example, python programming languages utilize the indentation to represent the start and exit of a statement block (Off-side rule), with increasing the indentation to represent the start of the statement block and decreasing the indentation to represent the exit of the statement block. However, the programming languages such as C language and c++ use curly brackets or some kind of keywords to indicate the start or end of the sentence block. Therefore, the class file of the first computer program language can be compiled according to the grammar format of the second computer program language used by the computing platform to be adapted to form the class file of the second computer program language. Wherein the second computer program language is different from the first computer program language. For example, the first computer program language may be Python and the second computer program language may be java language, C language, c++ language, or the like. After obtaining the class files of the second computer program language, the class files of the second computer program language may be packaged into corresponding resource file packages. Thus, the platform adaptation to the UDF is completed, and the resource file package formed by packaging can be directly called and executed by the computing platform to be adapted.
When the computing platform to be adapted needs to use the UDF written in the first computer program language, directly calling and executing the resource file package formed by packaging.
In this embodiment, in combination with information of a secondary development interface of the UDF supported by the computing platform to be adapted, platform adaptation is performed on the UDF written in the first computer program language, the class file supported by the computing platform to be adapted is converted by the UDF written in the first computer program language, and then the class file is compiled and packaged into a resource file package that can be directly called and executed by the computing platform to be adapted according to a syntax format of the second computer program language used by the computing platform to be adapted. The method ensures that the UDF written by the first computer programming language can be seamlessly migrated to different computing platforms, so that the UDF can be used across the platforms, and the effects of one development and multiple uses are achieved.
When the UDF is written in the Python language, the method provided by the embodiment can break through the platform characteristics of the UDF written in the Python language, and can seamlessly migrate the UDF written in the Python language to different computing platforms, so that the UDF can be used in a cross-platform manner, the use flexibility of the UDF written in the Python language is improved, and further the development cost of the UDF can be reduced.
In some exemplary embodiments, the UDF adaptation instructions include, but are not limited to: UDF compile commands and UDF pack commands. Wherein the UDF compilation command is for instructing the compiling of class files of the second computer program language. The UDF package command is used to instruct to package resource file packages that can be directly invoked and executed by the computing platform to be adapted.
In an alternative embodiment, the user may input a UDF compiling command to the computer device, where the UDF compiling command may be used as a UDF adaptation instruction for triggering the computer device to obtain a UDF written in the first computer program language and compile the UDF into a class file in the second computer program language. For example, the computer device may provide a human-machine interaction interface to the user to facilitate user input of UDF compilation commands. Alternatively, the human-machine interaction interface may be implemented as a web page, an in-application interface or a command line window, or the like. Taking the man-machine interaction interface as an example, the computer equipment can respond to the operation of opening the command line window by a user to display the command line window to the user, and further respond to the input operation of the user in the command line window to acquire the UDF compiling command input by the user. Based on this, an alternative embodiment of step 101 is: and responding to the UDF compiling command input by the user, and acquiring the UDF written in the first computer program language.
Further, under the triggering of the UDF compiling command, the computer equipment can convert the UDF written by the first computer program language into a class file of the first computer program language according to the information of the UDF secondary development interface supported by the computing platform to be adapted, and can compile the class file of the first computer program language into the class file of the second computer program language according to the grammar format of the second computer program language used by the computing platform to be adapted.
After compiling the class files of the first computer program language into class files of the second computer program language, the user may continue to input UDF package instructions through the command line window to instruct packaging of the class files of the second computer program language into resource file packages that may be directly invoked and executed by the computing platform to be adapted. Based on this, an alternative embodiment of step 104 is: and responding to the UDF packaging instruction input by the user, packaging the class files of the second computer program language into resource file packages which can be directly called and executed by the computing platform to be adapted.
In another alternative embodiment, the user may input a UDF package instruction to the computer device, where the UDF package instruction may be used as a UDF adaptation instruction, to trigger the computer device to obtain a UDF written in the first computer program language and finally package the UDF into a resource file package that may be directly invoked and executed by the computing platform to be adapted. Similarly, the computer device may provide a human-machine interaction interface to the user to facilitate user input of the UDF packaging command. Alternatively, the human-machine interaction interface may be implemented as a web page, an in-application interface or a command line window, or the like. Taking the man-machine interaction interface as an example, the computer equipment can respond to the operation of opening the command line window by a user to display the command line window to the user, and further respond to the input operation of the user in the command line window to acquire the UDF packaging instruction input by the user. Based on this, another alternative embodiment of step 101 is: and responding to the UDF packaging instruction input by the user, and acquiring the UDF written in the first computer program language.
Further, under the triggering of the UDF packaging command, the computer equipment can convert the UDF written by the first computer program language into a class file of the first computer program language according to the information of the UDF secondary development interface supported by the computing platform to be adapted, and can compile the class file of the first computer program language into the class file of the second computer program language according to the grammar format of the second computer program language used by the computing platform to be adapted; then, the class files of the second computer program language are packaged into resource file packages which can be directly called and executed by the computing platform to be adapted.
Alternatively, in the above or below embodiments, the UDF adaptation instructions may carry UDF identification information for identifying the UDF written in the first computer language, for example, a storage path of the UDF. If a plurality of UDFs are written in the first computer language, the method provided by the embodiment of the application can be used for respectively packaging the UDFs into resource file packages which can be directly called and executed by the computing platform to be adapted. Further, each packaged resource file can be packaged in a function library of the computing platform to be adapted so that the computing platform to be adapted can be directly called and executed when needed. Optionally, in the above or the following embodiments, the UDF adaptation instruction may further carry information related to the computing platform to be adapted, for example, information of a UDF secondary development interface supported by the computing platform to be adapted, and information of a name, an ID, and the like of the computing platform to be adapted. This information can be used to identify for which computing platform UDF adaptation processing is required and the information required for the adaptation. Among which, the information required for the adaptation includes, but is not limited to: information of a UDF secondary development interface supported by the computing platform to be adapted, information of a second computer program language used by the computing platform to be adapted and the like.
According to the different computing platforms to be adapted, the information of the UDF secondary development interface supported by the computing platform to be adapted is also different. Several examples are given below:
taking the computing platform to be adapted as an ODPS as an example, the information of the UDF secondary development interface supported by the ODPS includes, but is not limited to: 1) Realizing com.aliyun.odps.udf.UDF interface; 2) The evaluation method is implemented. The code is described as follows:
taking HIVE as an example of a computing platform to be adapted, information of the UDF secondary development interface supported by the HIVE includes, but is not limited to: 1) The org.apache.hadoop.hive.ql.udf.geneeric.genericudf interface is realized; 2) The evaluation method is implemented. The code is described as follows:
taking the example that the computing platform to be adapted is a SPARK, the information of the UDF secondary development interface supported by the SPARK includes but is not limited to: 1) An org.apache.spark.sql.api.java.UDF1-UDF 22 interface is realized, wherein UDF1 represents one input parameter, UDF2 represents two input parameters, and the like; 2) And realizing a call method. The code is described as follows:
taking the computing platform to be adapted as the FLINK as an example, the information of the UDF secondary development interface supported by the FLINK includes but is not limited to: 1) An org.apache.flexible.table.functions.scalarfunction interface is realized; 2) The eval method is implemented. The code is described as follows:
It should be noted that, the information carried by the UDF adaptation instruction in the above embodiment is only exemplary, and the UDF adaptation instruction may also carry some other information besides the information.
In the above or the following embodiments, according to the information of the UDF secondary development interface supported by the computing platform to be adapted, the UDF written in the first computer program language may be converted into a class file in the first computer program language. The class files of the first computer program language meet the requirements of the computing platform to be adapted on the class files, and can be identified by the computing platform to be adapted. In an exemplary embodiment, class files to be adapted to computing platform requirements may include, but are not limited to, class headers and body functions. The class header is used for identifying whether the class file is a class file which can be accepted by the computing platform to be adapted; the main function is the main content of the class file, namely the function part corresponding to the function which can be realized by the class file. In an embodiment of the present application, the body function of the class file in the first computer program language is a UDF written in the first computer program language.
Based on the above, an embodiment of converting a UDF written in a first computer program language into a class file in the first computer program language, as shown in fig. 2, includes the steps of:
201. And copying the UDF written in the first computer program language into the class file of the first computer program language as a main body function in the class file of the first computer program language.
202. And adding the information of the UDF secondary development interface supported by the computing platform to be adapted to the class header of the class file of the first computer program language.
In the above or the following embodiments, the class file of the first computer program language needs to be compiled into the class file of the second computer program language according to the syntax format of the second computer program language used by the computing platform to be adapted. For the class files of the second computer program language, the code logic and data should be the same as those in the class files of the first computer program language, so that the function of realizing the UDF written in the first computer program language can be ensured, but the grammar format is different.
Based on the foregoing, an alternative embodiment of compiling a class file in a first computer program language into a class file in a second computer program language, as shown in fig. 3, comprises the steps of:
301. code logic in the class file of the first computer program language is implemented in the class file of the second computer program language in accordance with the syntax format of the second computer program language.
302. Copying data in the class file of the first computer program language into the class file of the second computer program language.
In the above or the following embodiments, it is necessary to package class files of the second computer program language into resource file packages that can be directly called and executed by the computing platform to be adapted. An alternative embodiment for packaging class files of a second computer program language into resource files that can be directly invoked and executed by a computing platform to be adapted is shown in fig. 4, comprising the steps of:
401. and packaging the UDF written in the first computer program language and the class files in the first computer program language into file packages corresponding to the first computer program language, and storing the file packages under a first file directory.
402. And packaging the file package corresponding to the first computer program language and the class file of the second computer program language into a resource file package which can be directly called and executed by the computing platform to be adapted, and storing the resource file package under the second file directory.
Optionally, in step 401, packaging may be performed using a packaging tool associated with the first computer program language; in step 402, packaging may be performed using a packaging tool associated with the second computer program language in order to speed up packaging.
In the alternative embodiment, the files related to the first computer program language are packaged into the file package corresponding to the first computer program language, and then the files related to the second computer program language and the file package corresponding to the first computer program language are packaged together to form the resource file package which can be directly called by the computing platform to be adapted. The resource file package contains various files, such as source codes of UDF written in a first computer program language, so that a user can edit and modify the files, such as the source codes, according to actual requirements to meet the actual requirements.
Through the embodiment, the computing platform to be adapted can realize the call of the UDF written in the first computer program language and realize the function corresponding to the UDF only by calling and executing the resource file package stored in the second file directory.
It should be noted that in the above or the following embodiments, the first computer program language may be an object-oriented Python language, and correspondingly, the second computer program language may be a C language, a c++ language, a Java language, or the like; the computing platform to be adapted may be an ODPS platform, a SPARK platform, a BLINK platform, a HIVE platform, a FLINK platform, but is not limited thereto.
It should be noted that, the method logic provided in the foregoing embodiments may be implemented as a computer software, and the framework of the computer software is shown in fig. 5, including: an adaptation class (PyUDFAdapter), a proxy class (PyUDFProxy), a creation class (PyUDFBuild), and a command class (PyUDFCommand). PyUDFCommand can support UDF compilation commands and UDF packaging commands.
In order to more clearly illustrate the technical solution of the embodiment of the present application, in conjunction with the software framework diagram shown in fig. 5, an example is taken in which UDF written in Python language for the OPDS platform is migrated to HIVE platform supporting Java language, and the UDF adaptation flow is described. In this flow, the Python language is the first computer program language, the Java language is the second computer program language, and the HIVE platform is the computing platform to be adapted. The UDF adaptation flow is as follows:
first, pyUDFCommand provides a command line window to a user. The user issues a UDF compiling command or a UDF packaging command to the PyUDFCommand through a command line window.
The UDF compiling command or the UDF packaging command carries information of a UDF secondary development interface supported by the HIVE platform. Among them, the information of the UDF secondary development interface supported by the HIVE platform can be seen from the examples given in the foregoing embodiments.
Then, pyUDFComand responds to a UDF compiling command or a UDF packaging command sent by a user to obtain UDF 'uer-biz-UDF. Py' written in Python language for the ODPS platform. uer-biz-UDF. Py is the file name of UDF. Then, the PyUDFAdapter obtains UDF 'uer-biz-udf.py', and converts UDF 'uer-biz-udf.py' written in Python language into a class file in Python language according to the information of the UDF secondary development interface supported by the HIVE platform carried in the UDF compiling command or the UDF packaging command.
Next, pyUDFProxy compiles class files in Python language into class files in Java language based on the syntax format of Java language used by HIVE platform.
Alternatively, pyUDFProxy may compile class files in the Python language into class files in the Java language using a Python compiler, e.g. Jython.
Finally, if the user sends a UDF packaging command, the PyUDFBuild can package the class files of the Java language into a resource file package which can be directly called and executed by the HIVE platform, namely PyUDF. JAR. Thus, the HIVE platform directly calls PyUDF.JAR to realize the function of UDF uer-biz-udf.py.
Alternatively, pyUDFBuild may use a packaging tool applicable to Python language, for example setupeols, to package class files written in Python in a Python package, and store under the first file directory, where the class files are written in Python in UDF "uer-biz-udf.py"; furthermore, a packaging tool applicable to the Java language, such as depoy, may be used to package the Python package and the class file of the Java language into a JAR package, i.e., pyudf.
In an alternative embodiment, the user may issue a UDF compile command first to compile Java classes first; then, when needed, the UDF packing command is issued again to pack Java into JAR package, namely PyUDF. JAR.
In addition to the method embodiment, the embodiment of the application also provides a UDF adapting device. As shown in fig. 6a, the UDF adaptation device comprises: a command module 61, an adaptation module 62, a compiling module 63 and a packaging module 64.
A command module 61, configured to obtain a UDF written in a first computer program language in response to a UDF adaptation instruction;
the adapting module 62 is configured to convert, according to information of the UDF secondary development interface supported by the computing platform to be adapted, a UDF written in the first computer program language into a class file in the first computer program language;
a compiling module 63, configured to compile the class file of the first computer program language into a class file of a second computer program language based on a syntax format of the second computer program language used by the computing platform to be adapted;
the packaging module 64 is configured to package the class files in the second computer program language into resource file packages that can be directly called and executed by the computing platform to be adapted.
In an alternative embodiment, the command module 61 is specifically configured to: and responding to the UDF compiling command input by the user, and acquiring the UDF written in the first computer program language. Accordingly, the packaging module 64 is specifically configured to: and responding to the UDF packaging instruction input by the user, packaging the class files of the second computer program language into resource file packages which can be directly called and executed by the computing platform to be adapted.
In an alternative embodiment, the command module 61 is specifically configured to: and responding to the UDF packaging command input by the user, and acquiring the UDF written in the first computer program language.
In an alternative embodiment, the adaptation module 62 is specifically configured to: copying UDF written in a first computer program language into a class file of the first computer program language as a main body function in the class file of the first computer program language; and adding the information of the UDF secondary development interface supported by the computing platform to be adapted to the class header of the class file of the first computer program language.
In an alternative embodiment, the compiling module 63 is specifically configured to: according to the grammar format of the second computer program language, code logic in the class file of the first computer program language is realized in the class file of the second computer program language; copying data in the class file of the first computer program language into the class file of the second computer program language.
In an alternative embodiment, the packaging module 64 is specifically configured to: packaging UDF written by a first computer program language and class files of the first computer program language into file packages corresponding to the first computer program language, and storing the file packages under a first file directory; and packaging the file package corresponding to the first computer program language and the class file of the second computer program language into a resource file package which can be directly called and executed by the computing platform to be adapted, and storing the resource file package under the second file directory.
In an alternative embodiment, the first computer program language is the object oriented python language and the second computer program language is the java language.
Fig. 6b is a schematic structural diagram of a computer device according to another embodiment of the present application. As shown in fig. 6b, the computer device includes: a memory 60a and a processor 60b. Wherein,
memory 60a is used to store computer programs and may be configured to store various other data to support operations on the computer device. Examples of such data include instructions for any other application or method operating on a computer device, contact data, phonebook data, messages, pictures, video, and the like.
The memory 60a may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
A processor 60b coupled to the memory 60a for executing a computer program stored in the memory 60a for:
responding to the UDF adaptation instruction, and acquiring the UDF written in the first computer program language;
converting UDF written by a first computer program language into a class file of the first computer program language according to the information of a UDF secondary development interface supported by a platform to be calculated;
compiling the class file of the first computer program language into a class file of the second computer program language based on a grammar format of the second computer program language used by the computing platform to be adapted;
and packaging the class files of the second computer program language into resource file packages which can be directly called and executed by the computing platform to be adapted.
In an alternative embodiment, the functions of the computing platform to be adapted may be implemented by the processor executing other computer programs, which may be installed on the computer device provided in this embodiment. That is, the computer device may also implement the functions of the computing platform to be adapted, in addition to the UDF adaptation function.
In an alternative embodiment, the processor 60b, when retrieving a UDF written in the first computer program language, is specifically configured to: and responding to the UDF compiling command input by the user, and acquiring the UDF written in the first computer program language.
Accordingly, the processor 60b is specifically configured to, when packaging the resource file package described above: and responding to the UDF packaging instruction input by the user, packaging the class files of the second computer program language into resource file packages which can be directly called and executed by the computing platform to be adapted.
In another alternative embodiment, the processor 60b, when retrieving a UDF written in the first computer program language, is specifically configured to: and responding to the UDF packaging command input by the user, and acquiring the UDF written in the first computer program language.
Optionally, the processor 60b is specifically configured to, when converting a UDF written in the first computer program language into a class file in the first computer program language: copying UDF written in a first computer program language into a class file of the first computer program language as a main body function in the class file of the first computer program language; and adding the information of the UDF secondary development interface supported by the computing platform to be adapted to the class header of the class file of the first computer program language.
Further, the processor 60b is specifically configured to, when compiling the class file of the first computer program language into the class file of the second computer program language: according to the grammar format of the second computer program language, code logic in the class file of the first computer program language is realized in the class file of the second computer program language; copying data in the class file of the first computer program language into the class file of the second computer program language.
Based on the foregoing, the processor 60b is specifically configured to, when packaging the resource file package: packaging UDF written by a first computer program language and class files of the first computer program language into file packages corresponding to the first computer program language, and storing the file packages under a first file directory; and packaging the file package corresponding to the first computer program language and the class file of the second computer program language into a resource file package which can be directly called and executed by the computing platform to be adapted, and storing the resource file package under the second file directory.
Further, as shown in fig. 6b, the computer device further includes: communication component 60c, display 60d, power component 60e, audio component 60f, and other components. Only part of the components are schematically shown in fig. 6b, which does not mean that the electronic device only comprises the components shown in fig. 6 b.
According to the computer equipment provided by the embodiment, the UDF written in the first computer program language is subjected to platform adaptation by combining the information of the UDF secondary development interface supported by the computing platform to be adapted, class files supported by the computing platform to be adapted are converted by the UDF written in the first computer program language, and then the class files are compiled and packaged into resource file packages which can be called by the computing platform to be adapted according to the grammar format of the second computer program language used by the computing platform to be adapted. The method ensures that the UDF written by the first computer programming language can be seamlessly migrated to different computing platforms, so that the UDF can be used across the platforms, the effect of one development and multiple uses is achieved, the use flexibility of the UDF is improved, and the development cost of the UDF can be further reduced.
Accordingly, the embodiment of the present application also provides a computer-readable storage medium storing a computer program. The computer program, when executed by a processor, causes the processor to perform the acts of: responding to the UDF adaptation instruction, and acquiring the UDF written in the first computer program language; according to the information of the UDF secondary development interface supported by the computing platform to be adapted, converting the UDF written by the first computer program language into a class file of the first computer program language; compiling the class file of the first computer program language into a class file of the second computer program language based on a grammar format of the second computer program language used by the computing platform to be adapted; and packaging the class files of the second computer program language into resource file packages which can be directly called and executed by the computing platform to be adapted.
Optionally, the above computer program comprises: adaptation class program instructions, proxy class program instructions, deployment class program instructions, and command line class program instructions. The software framework of the computer program can be seen in fig. 5.
When executed by a processor, the command line class program instructions cause the processor to perform acts of: and responding to the UDF compiling command or the UDF packaging command input by a user, and acquiring the UDF written in the first computer program language.
Further, the adaptation class program instructions, when executed by the processor, cause the processor to perform acts of: and converting the UDF written in the first computer program language into a class file in the first computer program language according to the information of the UDF secondary development interface supported by the platform to be calculated.
Accordingly, when the proxy class program instructions are executed by the processor, cause the processor to perform acts of: compiling the class files of the first computer program language into class files of the second computer program language based on a grammar format of the second computer program language to be used by the computing platform.
Further, the deployment class program instructions, when executed by the processor, cause the processor to perform acts of: and packaging the class files of the second computer program language into resource file packages which can be directly called and executed by the computing platform to be adapted.
Alternatively, the functions of the computing platform to be adapted may be implemented by the processor executing other computer programs, which may be stored in the computer-readable storage medium provided in the present embodiment. Of course, other computer programs for implementing the functions of the computing platform to be adapted may also be stored in other computer readable storage media. Other computer programs are different from the computer programs stored in the computer-readable storage medium provided by the present embodiment; accordingly, other computer-readable storage media are different from those provided by the present embodiment.
Fig. 7a is a flowchart of a data processing method according to still another exemplary embodiment of the present application. As shown in fig. 7a, the method comprises:
701. and obtaining UDF and development interface information written in the first computer program language.
702. According to the development interface information, the UDF is converted into a class file of a first computer program language.
703. According to the grammar format of the second computer program language, compiling the class file of the first computer program language into the class file of the second computer program language.
The method provided by the present embodiment may be performed by a computer device. The computer equipment executes the method provided by the embodiment, and can convert the UDF written in the first computer program language into a class file in the first computer program language according to the development interface information; and compiling the class file of the first computer program language into the class file of the second computer program language according to the grammar format of the second computer program language.
Alternatively, the development interface information may be interface information secondarily developed for the UDF. The object having a requirement for secondary development of the UDF may be any computing platform or device, which is not limited thereto. In addition, objects having secondary development requirements for UDF are different, and accordingly, development interface information is also different. Therefore, through different development interface information, the UDF can be converted into class files of a first computer program language which can be identified and supported by different platforms or equipment, and personalized requirements of the different platforms or equipment on the UDF can be met.
Alternatively, the UDF may be written in advance in the first computer program language and stored in a storage space accessible to the computer device so that the computer device reads the UDF from the storage space. Wherein the UDF may be written in a first computer program language on the computer device, or alternatively, may be written in a first computer program language on other devices.
Alternatively, the development interface information may be written in advance according to development requirements of a computing platform or device having secondary development requirements for the UDF.
Further, after obtaining the class file of the second computer program language, an executable file may also be generated based on the class file of the second computer program language. Thus, each device supporting the second computer program language, such as various computing platforms, can directly call and execute the executable file, thereby realizing the functions defined by the UDF, enabling the UDF to be used across platforms, achieving the effects of one development and multiple uses, providing the flexibility of using the UDF, and reducing the development cost.
Fig. 7b is a schematic structural diagram of another computer device according to still another exemplary embodiment of the present application. As shown in fig. 7b, the computer device includes: a memory 70a and a processor 70b.
Memory 70a is used to store a computer program and may be configured to store various other data to support operations on a computer device. Examples of such data include instructions for any other application or method operating on a computer device, contact data, phonebook data, messages, pictures, video, and the like.
The memory 70a may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
A processor 70b, coupled to the memory 70a, for executing the computer program stored in the memory 70a for:
obtaining UDF and development interface information written by a first computer program language;
converting the UDF into a class file of a first computer program language according to the development interface information;
According to the grammar format of the second computer program language, compiling the class file of the first computer program language into the class file of the second computer program language.
Further, the processor 70b may also generate the executable file based on the class file of the second computer program language after obtaining the class file of the second computer program language. Thus, each device supporting the second computer program language, such as various computing platforms, can directly call and execute the executable file, thereby realizing the functions defined by the UDF, enabling the UDF to be used across platforms, achieving the effects of one development and multiple uses, providing the flexibility of using the UDF, and reducing the development cost.
Further, as shown in fig. 7b, the computer device further includes: communication component 70c, display 70d, power component 70e, audio component 70f, and other components. Only part of the components are schematically shown in fig. 7b, which does not mean that the electronic device only comprises the components shown in fig. 7 b.
Further, embodiments of the present application also provide another computer-readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform actions comprising:
Acquiring user-defined function UDF and development interface information written in a first computer program language;
converting the UDF into a class file of a first computer program language according to the development interface information;
according to the grammar format of the second computer program language, compiling the class file of the first computer program language into the class file of the second computer program language.
Further, the processor may also perform the following actions: an executable file is generated based on the class file in the second computer program language.
The communication component in fig. 6b and 7b may be configured to facilitate communication between the device to which the communication component belongs and other devices, either in a wired or wireless manner. The device to which the communication component belongs may access a wireless network based on a communication standard, such as WiFi,2G or 3G, or a combination thereof. In one exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component further comprises a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
The display in fig. 6b and 7b may include a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation.
The power supply assembly in fig. 6b and 7b provides power to the various components of the device to which the power supply assembly belongs. The power components may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the devices to which the power components pertain.
The audio component in fig. 6b and 7b is configured to output and/or input an audio signal. For example, the audio component includes a Microphone (MIC) configured to receive external audio signals when the device to which the audio component belongs is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may be further stored in a memory or transmitted via a communication component. In some embodiments, the audio assembly further comprises a speaker for outputting audio signals.
It should be noted that, in some of the above embodiments and the flows described in the drawings, a plurality of operations appearing in a specific order are included, but it should be clearly understood that the operations may be performed out of the order in which they appear herein or performed in parallel, the sequence numbers of the operations, such as 401, 402, etc., are merely used to distinguish between the various operations, and the sequence numbers themselves do not represent any order of execution. In addition, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first" and "second" herein are used to distinguish different messages, devices, modules, etc., and do not represent a sequence, and are not limited to the "first" and the "second" being different types.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.

Claims (15)

1. A custom function UDF adaptation method, comprising:
responding to the UDF adaptation instruction, and acquiring the UDF written in the first computer program language;
according to the information of the UDF secondary development interface supported by the computing platform to be adapted, converting the UDF written by a first computer program language into a class file of the first computer program language, wherein the class file of the first computer program language meets the requirements of the computing platform to be adapted, comprises class heads and main body functions, and can be identified by the computing platform to be adapted;
Compiling the class file of the first computer program language into the class file of the second computer program language based on the grammar format of the second computer program language used by the computing platform to be adapted;
packaging the class files of the second computer program language into resource file packages which can be directly called and executed by the computing platform to be adapted;
the converting the UDF written in the first computer program language into a class file in the first computer program language according to the information of the UDF secondary development interface supported by the computing platform to be adapted, including:
copying the UDF written in the first computer program language into the class file of the first computer program language as a main body function in the class file of the first computer program language;
and adding the information of the UDF secondary development interface supported by the computing platform to be adapted to the class header of the class file of the first computer program language.
2. The method of claim 1, wherein the obtaining the UDF written in the first computer program language in response to the UDF adaptation instruction comprises:
responding to a UDF compiling command input by a user, and acquiring the UDF written in a first computer program language;
The packaging the class files of the second computer program language into resource file packages which can be directly called and executed by the computing platform to be adapted, comprising:
and responding to a UDF packaging instruction input by a user, packaging the class files of the second computer program language into resource file packages which can be directly called and executed by the computing platform to be adapted.
3. The method of claim 1, wherein the obtaining the UDF written in the first computer program language in response to the UDF adaptation instruction comprises:
and responding to the UDF packaging command input by the user, and acquiring the UDF written in the first computer program language.
4. The method of claim 1, wherein compiling the class file of the first computer program language into the class file of the second computer program language based on a syntax format of the second computer program language used by the computing platform to be adapted comprises:
according to the grammar format of the second computer program language, code logic in the class file of the first computer program language is realized in the class file of the second computer program language;
copying the data in the class file of the first computer program language into the class file of the second computer program language.
5. The method of claim 1, wherein packaging the class files of the second computer program language into resource file packages that can be directly invoked and executed by the computing platform to be adapted comprises:
packaging the UDF written in the first computer program language and the class files in the first computer program language into file packages corresponding to the first computer program language, and storing the file packages under a first file directory;
and packaging the file package corresponding to the first computer program language and the class file of the second computer program language into a resource file package which can be directly called and executed by the computing platform to be adapted, and storing the resource file package under a second file directory.
6. The method of any one of claims 1-5, wherein the first computer program language is object-oriented python language and the second computer program language is java language.
7. A computer device, comprising: a memory and a processor;
the memory stores a computer program;
the processor, coupled to the memory, is configured to execute the computer program for:
Responding to the UDF adaptation instruction, and acquiring the UDF written in the first computer program language;
according to the information of the UDF secondary development interface supported by the computing platform to be adapted, converting the UDF written by a first computer program language into a class file of the first computer program language, wherein the class file of the first computer program language meets the requirements of the computing platform to be adapted, comprises class heads and main body functions, and can be identified by the computing platform to be adapted;
compiling the class file of the first computer program language into the class file of the second computer program language based on the grammar format of the second computer program language used by the computing platform to be adapted;
packaging the class files of the second computer program language into resource file packages which can be directly called and executed by the computing platform to be adapted;
the processor is specifically configured to, when converting the UDF written in the first computer program language into a class file in the first computer program language:
copying the UDF written in the first computer program language into the class file of the first computer program language as a main body function in the class file of the first computer program language;
And adding the information of the UDF secondary development interface supported by the computing platform to be adapted to the class header of the class file of the first computer program language.
8. The computer device according to claim 7, wherein the processor, when obtaining the UDF written in the first computer program language, is specifically configured to: responding to a UDF compiling command input by a user, and acquiring the UDF written in a first computer program language;
the processor is specifically configured to, when packaging the resource file package: and responding to a UDF packaging instruction input by a user, packaging the class files of the second computer program language into resource file packages which can be directly called and executed by the computing platform to be adapted.
9. The computer device according to claim 7, wherein the processor, when obtaining the UDF written in the first computer program language, is specifically configured to: and responding to the UDF packaging command input by the user, and acquiring the UDF written in the first computer program language.
10. The computer device of claim 7, wherein the processor, when compiling the class file of the first computer program language into the class file of the second computer program language, is specifically configured to:
According to the grammar format of the second computer program language, code logic in the class file of the first computer program language is realized in the class file of the second computer program language;
copying the data in the class file of the first computer program language into the class file of the second computer program language.
11. The computer device according to any of the claims 7-10, wherein the processor, when packaging the resource file package, is specifically configured to:
packaging the UDF written in the first computer program language and the class files in the first computer program language into file packages corresponding to the first computer program language, and storing the file packages under a first file directory;
and packaging the file package corresponding to the first computer program language and the class file of the second computer program language into a resource file package which can be directly called and executed by the computing platform to be adapted, and storing the resource file package under a second file directory.
12. A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program; the computer program, when executed by a processor, causes the processor to perform actions comprising:
Responding to the UDF adaptation instruction, and acquiring the UDF written in the first computer program language;
according to the information of the UDF secondary development interface supported by the computing platform to be adapted, converting the UDF written by a first computer program language into a class file of the first computer program language, wherein the class file of the first computer program language meets the requirements of the computing platform to be adapted, comprises class heads and main body functions, and can be identified by the computing platform to be adapted;
compiling the class file of the first computer program language into the class file of the second computer program language based on the grammar format of the second computer program language used by the computing platform to be adapted;
packaging the class files of the second computer program language into resource file packages which can be directly called and executed by the computing platform to be adapted;
the processor is specifically configured to, when converting the UDF written in the first computer program language into a class file in the first computer program language:
copying the UDF written in the first computer program language into the class file of the first computer program language as a main body function in the class file of the first computer program language;
And adding the information of the UDF secondary development interface supported by the computing platform to be adapted to the class header of the class file of the first computer program language.
13. The computer readable storage medium of claim 12, wherein the first computer program comprises: adaptation class program instructions, proxy class program instructions, deployment class program instructions, and command line class program instructions;
the command line class program instructions, when executed by the processor, cause the processor to perform acts of: responding to a UDF compiling command or a UDF packaging command input by a user, and acquiring the UDF written in a first computer program language;
the adaptation class program instructions, when executed by the processor, cause the processor to perform actions of: converting the UDF written by the first computer program language into a class file of the first computer program language according to the information of the UDF secondary development interface supported by the computing platform to be adapted;
the agent class program instructions, when executed by the processor, cause the processor to perform acts of: compiling the class file of the first computer program language into the class file of the second computer program language based on the grammar format of the second computer program language used by the computing platform to be adapted;
The deployment class program instructions, when executed by the processor, cause the processor to perform acts of: packaging the class files of the second computer program language into resource file packages which can be directly called and executed by the computing platform to be adapted;
the adaptation class program instructions, when executed by the processor, cause the processor to perform specific actions:
copying the UDF written in the first computer program language into the class file of the first computer program language as a main body function in the class file of the first computer program language;
and adding the information of the UDF secondary development interface supported by the computing platform to be adapted to the class header of the class file of the first computer program language.
14. A method of data processing, comprising:
acquiring a user-defined function (UDF) written in a first computer program language and development interface information, wherein the development interface information corresponds to a computing platform or equipment with secondary development requirements for the UDF;
according to the development interface information, converting the UDF into a class file of the first computer program language, wherein the class file of the first computer program language meets the requirements of the computing platform or the equipment, comprises class heads and main body functions, and can be identified by the computing platform or the equipment;
Compiling the class file of the first computer program language into the class file of the second computer program language according to the grammar format of the second computer program language;
converting the UDF into a class file of the first computer program language according to the development interface information, comprising:
copying the UDF written in the first computer program language into the class file of the first computer program language as a main body function in the class file of the first computer program language;
and adding the development interface information to a class header of a class file of the first computer program language.
15. The method as recited in claim 14, further comprising:
and generating an executable file based on the class file of the second computer program language.
CN201810367417.XA 2018-04-23 2018-04-23 UDF adaptation method, data processing method, device and storage medium Active CN110399384B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810367417.XA CN110399384B (en) 2018-04-23 2018-04-23 UDF adaptation method, data processing method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810367417.XA CN110399384B (en) 2018-04-23 2018-04-23 UDF adaptation method, data processing method, device and storage medium

Publications (2)

Publication Number Publication Date
CN110399384A CN110399384A (en) 2019-11-01
CN110399384B true CN110399384B (en) 2023-12-15

Family

ID=68319748

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810367417.XA Active CN110399384B (en) 2018-04-23 2018-04-23 UDF adaptation method, data processing method, device and storage medium

Country Status (1)

Country Link
CN (1) CN110399384B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111026779B (en) * 2019-12-19 2023-10-17 厦门安胜网络科技有限公司 Data processing method, device and storage medium based on Flink SQL
CN113448619A (en) * 2021-06-29 2021-09-28 上海达梦数据库有限公司 Cross-platform program implementation method and device, computer equipment and storage medium
CN113504904A (en) * 2021-07-26 2021-10-15 中国平安人寿保险股份有限公司 User-defined function implementation method and device, computer equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106843875A (en) * 2017-01-19 2017-06-13 杭州数梦工场科技有限公司 The method and apparatus of cross-platform transplanting Python programs

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102073490B (en) * 2009-11-25 2013-09-11 阿里巴巴集团控股有限公司 Method and device for translating database language
US9442744B2 (en) * 2012-02-23 2016-09-13 Microsoft Technology Licensing, Llc Multilingual build integration for compiled applications
CN104572072B (en) * 2014-12-01 2017-09-29 北京百度网讯科技有限公司 A kind of language transfer method and equipment to the program based on MVC pattern

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106843875A (en) * 2017-01-19 2017-06-13 杭州数梦工场科技有限公司 The method and apparatus of cross-platform transplanting Python programs

Also Published As

Publication number Publication date
CN110399384A (en) 2019-11-01

Similar Documents

Publication Publication Date Title
CN110399384B (en) UDF adaptation method, data processing method, device and storage medium
CN114168111B (en) Method, device, product and storage medium for realizing componentized route
WO2022237610A1 (en) Program compiling method and program loading method
CN110727482B (en) Interface updating method and device
WO2019022827A1 (en) Systems and methods for providing patchable rom firmware
CN114489670A (en) Data processing method, device, equipment and storage medium
CN112685030A (en) Method, device, storage medium and electronic equipment for generating service code
WO2023213263A1 (en) Program compiling method, program starting method, and device and storage medium
CN113722394A (en) Data synchronization method, device and storage medium
CN106610845B (en) Information management method, device, server and system
CN114996134A (en) Containerized deployment method, electronic equipment and storage medium
CN113448690B (en) Monitoring method and device
KR20110114754A (en) Media containing a program convert sk-vm and wipi-java application to android application
CN106484375B (en) Instruction block loading method, soft switch equipment and system
CN105786465A (en) Scripting language execution method and device
CN112764796A (en) Installation package generation system
CN114385128A (en) Data processing method, device, apparatus, storage medium and program product
CN112346761B (en) Front-end resource online method, device, system and storage medium
CN114546359A (en) DSL description file generation method, device, equipment and storage medium
CN114416101A (en) Front-end project debugging method and system
CN117472432A (en) Byte code file processing method, electronic equipment and storage medium
WO2019157891A1 (en) Application installation method and application installer generating method
CN106598974B (en) Data file generation and calling method and device for android system application program
CN112925527B (en) Calling method, calling device, storage medium and electronic equipment
CN114661296B (en) Program code compiling method, program code compiling device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40015688

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant