CN110399384A - UDF adaptation method, data processing method, equipment and storage medium - Google Patents

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

Info

Publication number
CN110399384A
CN110399384A CN201810367417.XA CN201810367417A CN110399384A CN 110399384 A CN110399384 A CN 110399384A CN 201810367417 A CN201810367417 A CN 201810367417A CN 110399384 A CN110399384 A CN 110399384A
Authority
CN
China
Prior art keywords
udf
computer
language
programming language
computer program
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.)
Granted
Application number
CN201810367417.XA
Other languages
Chinese (zh)
Other versions
CN110399384B (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 present application provides a kind of UDF adaptation method, data processing method, equipment and storage medium.In the embodiment of the present application, in conjunction with the information for the UDF second development interface that computing platform to be adapted to is supported, platform adaptation is done to the UDF write using the first computer programming language, the UDF write using the first computer programming language is converted into the class file that computing platform to be adapted to is supported, and then the syntax format of the second computer program language used according to computing platform to be adapted to, which is compiled and is packaged into the resource bundle that computing platform to be adapted to can be called.It can be seen that, the embodiment of the present application is by carrying out adaptation processing to UDF, so that UDF cross-platform can be used, reach and is developed at one, the effect that many places use, this is conducive to break through the existing using flexible write platform identity possessed by UDF based on certain language, be conducive to improve UDF, and then reduces 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
Structured Query Language (SQL) itself provides rich built-in functions for programmers to use, but the actual business scenario may be complex, and the built-in functions may not meet the programming requirements of the business scenario. For this reason, SQL also provides a User Defined Function (UDF) to meet the programming requirements of complex business scenarios.
Python, as an object-oriented interpreted computer programming language, has a very rich and powerful library, can easily join code modules written in other languages together, and has the advantages of simplicity, flexibility, easy learning, and the like, so that it is increasingly popular to write UDF based on Python language in large data-related computing platforms.
However, the existing UDF written based on the Python language has platform characteristics, so that the use of writing the UDF 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 using a UDF written in a 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 by adopting a first computer programming language;
converting the UDF written by adopting the first computer programming language into a class file of the first computer programming language according to the information of the UDF secondary development interface supported by the computing platform to be adapted;
compiling the class file of the first computer program language into the class file of a second computer program language based on the syntactic 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 a resource file package which can be directly called and executed by the computing platform to be adapted.
An embodiment of the present application further provides a computer device, including: a memory and a processor;
the memory stores a computer program;
the processor, coupled with the memory, to execute the computer program to:
responding to the UDF adaptation instruction, and acquiring the UDF written by adopting a first computer programming language;
converting the UDF written by adopting the first computer programming language into a class file of the first computer programming language according to the information of the 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 a second computer program language based on the syntactic 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 a resource file package which can be directly called and executed by the computing platform to be adapted.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium; the computer program, when executed by a processor, causes the processor to perform acts comprising:
responding to the UDF adaptation instruction, and acquiring the UDF written by adopting a first computer programming language;
converting the UDF written by adopting the first computer programming language into a class file of the first computer programming language according to the information of the 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 a second computer program language based on the syntactic 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 a resource file package which can be directly called and executed by the computing platform to be adapted.
An embodiment of the present application further provides a data processing method, including:
acquiring a user defined function UDF and development interface information written by adopting a first computer programming language;
converting the UDF into a class file of the first computer programming language according to the development interface information;
compiling the class file of the first computer program language into the class file of the second computer program language according to the syntactic format of the second computer program language.
In the embodiment of the application, platform adaptation is performed on the UDF written by adopting the first computer programming language by combining information of the UDF secondary development interface supported by the computing platform to be adapted, the UDF written by adopting the first computer programming language is converted into the class file supported by the computing platform to be adapted, and then the class file is compiled and packaged into the resource file packet which can be called by the computing platform to be adapted according to the syntax format of the second computer programming language used by the computing platform to be adapted. Therefore, the UDF can be used in a cross-platform mode by performing adaptation processing on the UDF, the effects of one-site development and multiple-site use are achieved, the existing platform characteristic of writing the UDF based on a certain language is favorably broken through, the use flexibility of the UDF is favorably improved, and the development cost is further reduced.
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 application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic flowchart of a UDF adaptation method according to an exemplary embodiment of the present application;
FIG. 2 is a flowchart illustrating a method for converting a UDF written in a first computer programming language into a class file in the first computer programming language according to an exemplary embodiment of the present application;
FIG. 3 is a flowchart illustrating an exemplary method for compiling class files in a first computer programming language into class files in a second computer programming language according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating packaging of class files in a second computer programming 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 diagram of a software framework for platform adaptation for UDF according to an exemplary embodiment of the present application;
fig. 6a is a schematic structural diagram of a UDF adaptation apparatus 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 another exemplary embodiment of the present application;
fig. 7b is a schematic structural diagram of another computer device according to 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 described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In some embodiments of the present application, platform adaptation may be performed on a UDF written in a first computer programming language in combination with information of a secondary development interface of the UDF supported by a computing platform to be adapted, the UDF written in the first computer programming language may be converted into a class file supported by the computing platform to be adapted, and the class file may be compiled and packaged according to a syntax format of a second computer programming language used by the computing platform to be adapted, so as to form a resource file package that can be called by the computing platform to be adapted. According to the embodiment of the application, adaptation processing is carried out on the UDF, so that the UDF can be used in a cross-platform mode, the effects of one-place development and multiple-place use are achieved, the existing platform characteristic of writing the UDF based on a certain language is favorably broken through, the use flexibility of the UDF is favorably improved, and the development cost is further reduced.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart 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 programming language.
102. And converting the UDF written by adopting the first computer programming language into a class file of the first computer programming 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 a second computer program language based on a syntactic format of the second computer program language used by the computing platform to be adapted.
104. And packaging the class files 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.
SQL is a database query and programming language and is widely applied to various computing platforms with data storage and processing functions. SQL provides rich built-in functions and UDFs at the same time, and in some complex service scenes, service programmers can customize needed functions, namely the UDFs, according to service requirements to meet the programming requirements of the complex service scenes.
After one UDF is developed successfully, 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 generally cannot be seamlessly migrated to another computing platform, that is, another computing platform cannot call the UDF, which not only limits the use of the UDF, but also causes waste of development resources.
To solve the above technical problem, this embodiment provides a scheme that can perform platform adaptation on the UDF, so that the UDF can be used across platforms, and achieves the effects of one-site development and multiple-site use, thereby providing flexibility in use of the UDF and reducing development cost.
Before platform adaptation is done to a UDF, the UDF needs to be written. Generally, a UDF may be written in some computer programming language according to the UDF specification. For example, the UDF may be written in, but not limited to, the Python language. In this embodiment, the computer program language used for writing the UDF is written as the first computer program language.
When a certain computing platform needs to use the UDF written by the first computer programming language but cannot directly call the UDF, platform adaptation can be performed on the UDF written by the first computer programming language aiming at the computing platform.
For example, when the computing platform does not support the first computer programming language, the UDF written in the first computer programming language cannot be directly called, and platform adaptation may be performed on the UDF written in the first computer programming language 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 programming language, the UDF written in the first computer programming language cannot be directly called, and platform adaptation can be performed on the UDF written in the first computer programming language for the computing platform.
For ease of distinction and description, a computing platform that requires platform adaptation for a UDF written in a first computer programming language will be 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 UDF written by the first computer programming language needs to be subjected to platform adaptation aiming at the computing platform to be adapted, the related user can send a UDF adaptation instruction to the computer equipment, and the UDF adaptation instruction indicates that the UDF written by the first computer programming language needs to be subjected to platform adaptation, so that the computer equipment can conveniently perform the platform adaptation on the UDF written by the first computer programming language. The computer device is an execution subject of the method of this embodiment, and optionally, the computer device may be a computer device where a computing platform to be adapted is located, but is not limited thereto. The computer equipment performs a platform adaptation process on the UDF written by the first computer programming language as follows:
firstly, a UDF written by a first computer program is obtained according to a UDF adaptation instruction. Secondly, according to the information of a UDF secondary development interface supported by a computing platform to be adapted, performing platform adaptation on the UDF written by the first computer programming language, and converting the UDF written by the first computer programming language into a class file of the first computer programming language. The class file of the first computer program language comprises information of a UDF secondary development interface supported by the computing platform to be adapted, can be recognized by the computing platform to be adapted, and provides a basic condition for the computing platform to be adapted to call the UDF written by the first computer program.
Then, considering that different computer program languages are used by different computing platforms, the syntax formats of the different computer program languages are different. For example, the Python programming language uses indentation to indicate the beginning and exit of a statement block (Off-side rule), with increasing indentation indicating the beginning of a statement block and decreasing indentation indicating the exit of a statement block. However, the programming languages such as C language and C + + use parentheses or some kind of keywords to indicate the beginning or end of a statement block. Therefore, the class file of the first computer program language can be compiled according to the syntactic format of the second computer program language used by the computing platform to be adapted, so as to form the class file of the second computer program language. Wherein the second computer programming language is different from the first computer programming language. For example, the first computer programming language may be Python and the second computer programming language may be java, C + +, or the like. After obtaining the class files in the second computer programming language, the class files in the second computer programming language may be packaged into a corresponding resource file package. By this, 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 by the first computer programming language, the resource file package formed by packaging is directly called and executed.
In this embodiment, platform adaptation is performed on the UDF written in the first computer programming language in combination with information of the UDF secondary development interface supported by the computing platform to be adapted, the UDF written in the first computer programming language is converted into a class file supported by the computing platform to be adapted, and then the class file is compiled and packaged into a resource file package which can be directly called and executed by the computing platform to be adapted according to a syntax format of the second computer programming language used by the computing platform to be adapted. The method and the device enable the UDF written by the first computer programming language to be seamlessly migrated to different computing platforms, so that the UDF can be used in a cross-platform mode, and the effects of one-site development and multiple-site use are achieved.
When the UDF is written by adopting the Python language, the method provided by the embodiment can break through the platform characteristics of the UDF written by adopting the Python language, and can seamlessly migrate the UDF written by adopting the Python language to different computing platforms, so that the UDF can be used across platforms, the use flexibility of the UDF written by adopting the Python language is improved, and the development cost of the UDF can be further reduced.
In some exemplary embodiments, the UDF adaptation instructions include, but are not limited to: UDF compile commands and UDF package commands. Wherein the UDF compile command is for instructing to compile a class file of the second computer program language. The UDF packaging command is used for indicating that a resource file package which can be directly called and executed by a computing platform to be adapted is packaged.
In an alternative embodiment, the user may input a UDF compile command to the computer device, the UDF compile command being operable as a UDF adaptation instruction for triggering the computer device to obtain a UDF written in a first computer programming language and compile it into a class file in a second computer programming language. For example, the computer device may provide a human-machine interface to the user to facilitate the user's input of UDF compilation commands. Alternatively, the human-machine interface may be implemented as a web page, an in-application interface or a command line window, etc. Taking the example of the human-computer interaction interface being implemented as a command line window, the computer device may display the command line window to the user in response to an operation of opening the command line window by the user, and further obtain the UDF compilation command input by the user in response to an input operation of the user in the command line window. Based on this, an alternative implementation of step 101 is: and responding to a UDF compiling command input by a user, and acquiring the UDF written in the first computer program language.
Further, under the trigger of the UDF compiling command, the computer device may convert the UDF written in the first computer programming language into a class file in the first computer programming language according to information of a UDF secondary development interface supported by the computing platform to be adapted, and may compile the class file in the first computer programming language into a class file in the second computer programming language according to a syntax format of the second computer programming language used by the computing platform to be adapted.
After compiling the class files of the first computer program language into the class files of the second computer program language, the user can continue inputting the UDF packaging instruction through the command line window to indicate that the class files of the second computer program language are packaged into the resource file package which can be directly called and executed by the computing platform to be adapted. Based on this, an alternative implementation of step 104 is: and in response to a UDF packaging instruction input by a user, packaging the class files 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.
In another optional embodiment, the user may input a UDF packaging instruction to the computer device, where the UDF packaging instruction may be used as a UDF adaptation instruction to trigger the computer device to acquire the UDF written in the first computer programming language and finally package the UDF into a resource file package that can be directly called and executed by the computing platform to be adapted. Similarly, the computer device may provide a human-computer interaction interface to the user to facilitate the user's entry of UDF packaged commands. Alternatively, the human-machine interface may be implemented as a web page, an in-application interface or a command line window, etc. Taking the example of the human-computer interaction interface being implemented as a command line window, the computer device may display the command line window to the user in response to an operation of opening the command line window by the user, and further obtain the UDF packaging instruction input by the user in response to an input operation of the user in the command line window. Based on this, another alternative implementation of step 101 is: and responding to a UDF packaging instruction input by a user, and acquiring the UDF written in the first computer programming language.
Further, under the trigger of the UDF packing command, the computer device may convert the UDF written in the first computer programming language into a class file of the first computer programming language according to the information of the UDF secondary development interface supported by the computing platform to be adapted, and may compile the class file of the first computer programming language into a class file of the second computer programming language according to the syntax format of the second computer programming language used by the computing platform to be adapted; and then, packaging the class files 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.
Optionally, in the foregoing or the following embodiments, the UDF adaptation instruction may carry UDF identification information for identifying a UDF written in a first computer language, for example, a storage path of the UDF. If a plurality of UDFs are written in the first computer language, the UDFs may be packaged into resource file packages that can be directly called and executed by the computing platform to be adapted by using the method provided in the embodiment of the present application. Furthermore, 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 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 and an ID of the computing platform to be adapted. This information can be used to identify which computing platform the UDF adaptation process needs to be done for and the information needed for adaptation. Wherein, the information required for 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 different computing platforms to be adapted, the information of the UDF secondary development interface supported by the computing platform to be adapted is 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) implement com.aliyun.odps.udf.udf.interface; 2) the evaluate method was performed. The code is described as follows:
taking the computing platform to be adapted as the HIVE as an example, the information of the UDF secondary development interface supported by the HIVE includes but is not limited to: 1) implementing org.apache.hadoop.hive.ql.udf.genetic.genericudf interface; 2) the evaluate method was performed. The code is described as follows:
taking the computing platform to be adapted as SPARK as an example, the information of the UDF secondary development interface supported by SPARK includes but is not limited to: 1) the method comprises the steps of realizing org, apache, spark, sql, api, java, UDF1-UDF 22 interfaces, wherein UDF1 represents one input parameter, UDF2 represents two input parameters, and the like; 2) and (4) 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) realize org, approach, table, functions, scalarfunction interface; 2) implement eval method. The code is described as follows:
it should be noted that, the information carried by the UDF adaptation instruction in the foregoing embodiment is only an exemplary illustration, and besides the information, the UDF adaptation instruction may also carry some other information.
In the above or below embodiments, the UDF written in the first computer programming language may be converted into a class file in the first computer programming language according to information of the UDF secondary development interface supported by the computing platform to be adapted. The class file of the first computer program language meets the requirement of the computing platform to be adapted on the class file and can be recognized by the computing platform to be adapted. In an exemplary embodiment, the class files required by the computing platform to be adapted may include, but are not limited to, a class header and a body function. The class header is used for identifying whether the class file is a class file which can be accepted by a computing platform to be adapted; the main function is the main content of the class file, i.e. the function part corresponding to the function that 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 programming language into a class file in the first computer programming language, as shown in fig. 2, includes the following steps:
201. and copying the UDF written by adopting the first computer programming language into the class file of the first computer programming language as a main function in the class file of the first computer programming 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 programming language, the code logic and data should be the same as those in the class files of the first computer programming language, so that the function of implementing the UDF written in the first computer programming language can be ensured, but the syntax format is different.
Based on the above, 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, includes the following steps:
301. and according to the syntactic format of the second computer program language, implementing the code logic in the class file of the first computer program language in the class file of the second computer program language.
302. And copying the 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 the class files of the second computer program language into a resource file package that can be directly called and executed by the computing platform to be adapted. An alternative embodiment of packing class files in the second computer programming language into resource files that can be directly called and executed by the computing platform to be adapted is shown in fig. 4, and includes the following steps:
401. and packaging the UDF written by adopting the first computer programming language and the class file of the first computer programming language into a file package corresponding to the first computer programming language, and storing the file package in a first file directory.
402. And packaging the file package corresponding to the first computer programming language and the class file of the second computer programming 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 into a second file directory.
Optionally, in step 401, packaging may be performed using a packaging tool associated with the first computer programming language; in step 402, packaging may be performed using a packaging tool associated with the second computer programming language to facilitate faster packaging.
In this optional embodiment, the file related to the first computer programming language is first packaged into the file package corresponding to the first computer programming language, and then the file related to the second computer programming language and the file package corresponding to the first computer programming language are packaged together to form the resource file package that can be directly called by the computing platform to be adapted. The resource file package contains various files, such as source codes of the UDF written by adopting the first computer programming language, and the like, so that a user can edit and modify the files such as the source codes and the like according to actual requirements so as to be matched with the actual requirements.
Through the embodiment, the computing platform to be adapted can call the UDF written in the first computer programming 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 foregoing or the following embodiments, the first computer programming language may be an object-oriented Python language, and correspondingly, the second computer programming 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 logic of the method provided by the above embodiments can be implemented as a computer software, and the framework of the computer software is shown in fig. 5, and includes: an adaptation class (PyUDFAdapter), a proxy class (PyUDFProxy), a creation class (PyUDFBuild), and a command class (PyUDFCommand). PyUDFCommand may support UDF compile commands and UDF packed commands.
In order to more clearly explain the technical solution of the embodiment of the present application, a UDF adaptation flow in the OPDS-oriented platform written in Python language is migrated to a HIVE platform supporting Java language by taking as an example the software framework diagram shown in fig. 5. In the process, the Python language is a first computer program language, the Java language is a second computer program language, and the HIVE platform is a computing platform to be adapted. The UDF adaptation flow is as follows:
first, PyUDFCommand provides a command line window to the user. The user issues a UDF compile command or a UDF packed command to PyUDFCommand through a command line window.
And the UDF compiling command or the UDF packaging command carries information of a UDF secondary development interface supported by the HIVE platform. For information of the UDF secondary development interface supported by the HIVE platform, reference may be made to the examples given in the foregoing embodiments.
Then, the PyUDFCommand responds to a UDF compiling command or a UDF packaging command sent by a user to acquire a UDF' uer-biz-UDF. Py is the filename of UDF. And then, the PyUDFAdapter acquires the UDF 'uer-biz-udf.py', and converts the UDF 'uer-biz-udf.py' written in the Python language into a class file of the Python language according to the information of a UDF secondary development interface supported by the HIVE platform carried in the UDF compiling command or the UDF packaging command.
Next, PyUDFProxy compiles the class file of Python language into a class file of Java language based on the syntax format of Java language used by the HIVE platform.
Alternatively, PyUDFProxy may employ a Python compiler, such as Jython, to compile the Python language class files into Java language class files.
And finally, if the user sends a UDF packaging command, the PyadFBuild 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 PyadF. Thus, the HIVE platform can directly call PyUDF.JAR to realize the function of UDF 'uer-biz-udf.py'.
Optionally, the PyUDFBuild may adopt a packaging tool suitable for Python language, for example, setupools, and package the UDF "uer-biz-udf.py" written by Python and the class file of Python language into a Python package, and store the Python package in the first file directory; furthermore, a packaging tool suitable for Java language, for example, deploy, may be used to package the Python package and the class file in Java language into a JAR package, that is, pyudf.
In an alternative embodiment, the user may first issue a UDF compile command, so as to compile Java classes first; then, when needed, the UDF package command is issued again to package Java into a JAR package, i.e., pyudf.
Besides the above method embodiments, the present application embodiment also provides a UDF adaptation apparatus. As shown in fig. 6a, the UDF adaptation apparatus includes: a command module 61, an adaptation module 62, a compilation module 63 and a packaging module 64.
A command module 61, configured to, in response to the UDF adaptation instruction, obtain a UDF written in a first computer programming language;
the adaptation module 62 is configured to convert a UDF written in a first computer programming language into a class file in the first computer programming language according to information of a UDF secondary development interface supported by the computing platform to be adapted;
a compiling module 63, configured to compile 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;
and the packaging module 64 is used for packaging the class files 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.
In an optional embodiment, the command module 61 is specifically configured to: and responding to a UDF compiling command input by a user, and acquiring the UDF written in the first computer program language. Accordingly, the packing module 64 is specifically configured to: and in response to a UDF packaging instruction input by a user, packaging the class files 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.
In an optional embodiment, the command module 61 is specifically configured to: a UDF written in a first computer programming language is obtained in response to a UDF-packed command input by a user.
In an alternative embodiment, the adaptation module 62 is specifically configured to: copying a UDF written by adopting a first computer programming language into a class file of the first computer programming language as a main function in the class file of the first computer programming 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 syntactic format of a second computer program language, realizing code logic in the class file of the first computer program language in the class file of the second computer program language; and copying the 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 packing module 64 is specifically configured to: packing UDF written by a first computer programming language and class files of the first computer programming language into a file package corresponding to the first computer programming language, and storing the file package in a first file directory; and packaging the file package corresponding to the first computer programming language and the class file of the second computer programming 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 into a second file directory.
In an alternative embodiment, the first computer programming language is an object oriented python language and the second computer programming language is a 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 apparatus includes: a memory 60a and a processor 60 b. Wherein,
the memory 60a is used to store computer programs and may be configured to store other various data to support operations on the computer device. Examples of such data include instructions for any other application or method operating on the computer device, contact data, phonebook data, messages, pictures, videos, and so forth.
The memory 60a may be implemented by any type or combination of volatile or non-volatile 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 disks.
A processor 60b, coupled to the memory 60a, for executing the computer program stored in the memory 60a for:
responding to the UDF adaptation instruction, and acquiring the UDF written by adopting a first computer programming language;
converting the UDF written by adopting a first computer programming language into a class file of the first computer programming language according to the information of the UDF secondary development interface supported by the platform to be calculated;
compiling the class file of the first computer program language into a class file of a second computer program language based on a syntactic 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 a resource file package which can be directly called and executed by the computing platform to be adapted.
In an alternative embodiment, the functionality of the computing platform to be adapted may be implemented by a processor executing another computer program, which may be installed for implementation on the computer device provided in the present embodiment. I.e. the computer device may also implement the functionality of the computing platform to be adapted in addition to the UDF adaptation functionality.
In an alternative embodiment, the processor 60b, when obtaining a UDF written in the first computer programming language, is specifically configured to: and responding to a UDF compiling command input by a user, and acquiring the UDF written in the first computer program language.
Accordingly, when packaging the resource file package, the processor 60b is specifically configured to: and in response to a UDF packaging instruction input by a user, packaging the class files 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.
In another alternative embodiment, the processor 60b, when obtaining a UDF written in the first computer programming language, is specifically configured to: a UDF written in a first computer programming language is obtained in response to a UDF-packed command input by a user.
Optionally, the processor 60b, when converting the UDF written in the first computer program language into a class file in the first computer program language, is specifically configured to: copying a UDF written by adopting a first computer programming language into a class file of the first computer programming language as a main function in the class file of the first computer programming 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, 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 syntactic format of a second computer program language, realizing code logic in the class file of the first computer program language in the class file of the second computer program language; and copying the data in the class file of the first computer program language into the class file of the second computer program language.
Based on the above, when the processor 60b packages the resource file package, it is specifically configured to: packing UDF written by a first computer programming language and class files of the first computer programming language into a file package corresponding to the first computer programming language, and storing the file package in a first file directory; and packaging the file package corresponding to the first computer programming language and the class file of the second computer programming 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 into a second file directory.
Further, as shown in fig. 6b, the computer apparatus further includes: communication component 60c, display 60d, power component 60e, audio component 60f, and the like. Only some of the components are schematically shown in fig. 6b and it is not meant that the electronic device comprises only the components shown in fig. 6 b.
The computer device provided in this embodiment performs platform adaptation on the UDF written in the first computer programming language in combination with information of the UDF secondary development interface supported by the computing platform to be adapted, converts the UDF written in the first computer programming language into class files supported by the computing platform to be adapted, and then compiles and packages the class files into a resource file package that can be called by the computing platform to be adapted according to a syntax format of the second computer programming language used by the computing platform to be adapted. The method and the device enable the UDF written by the first computer programming language to be seamlessly migrated to different computing platforms, enable the UDF to be used in a cross-platform mode, achieve the effects of one-site development and multiple-site use, improve the use flexibility of the UDF, and further reduce the development cost of the UDF.
Correspondingly, the embodiment of the application also provides a computer readable storage medium, and the computer readable storage medium stores a computer program. The computer program, when executed by the processor, causes the processor to perform the actions of: responding to the UDF adaptation instruction, and acquiring the UDF written by adopting a first computer programming language; converting the UDF compiled by adopting a first computer programming language into a class file of the first computer programming language according to the information of the UDF secondary development interface supported by the computing platform to be adapted; compiling the class file of the first computer program language into a class file of a second computer program language based on a syntactic 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 a resource file package which can be directly called and executed by the computing platform to be adapted.
Optionally, the 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 the command line class program instructions are executed by the processor, cause the processor to perform the acts of: and responding to a UDF compiling command or a 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 the acts of: and converting the UDF written by adopting the first computer programming language into a class file of the first computer programming language according to the information of the UDF secondary development interface supported by the platform to be calculated.
Accordingly, the agent class program instructions, when executed by the processor, cause the processor to perform the acts of: compiling the class files of the first computer program language into class files of a second computer program language based on a syntactic format of the second computer program language used by the computing platform to be adapted.
Further, the deployment class program instructions, when executed by the processor, cause the processor to perform the acts of: and packaging the class files 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.
Alternatively, the functions of the computing platform to be adapted may be implemented by a processor executing another computer program, which may be stored in a computer-readable storage medium provided in the present embodiment. Of course, other computer programs for implementing the functionality of the computing platform to be adapted may also be stored in other computer readable storage media. The other computer program is different from the computer program stored in the computer-readable storage medium provided in the present embodiment; accordingly, the other computer-readable storage media are different from the computer-readable storage media provided in the present embodiment.
Fig. 7a is a flowchart of a data processing method according to another exemplary embodiment of the present application. As shown in fig. 7a, the method comprises:
701. and acquiring the UDF and development interface information written by adopting a first computer programming language.
702. And converting the UDF into a class file of a first computer program language according to the development interface information.
703. And compiling the class file of the first computer program language into the class file of the second computer program language according to the syntactic format of the second computer program language.
The method provided by the embodiment can be executed by computer equipment. The computer equipment executes the method provided by the embodiment, and can convert the UDF written by adopting the first computer programming language into a class file of the first computer programming language according to the development interface information; the class files of the first computer programming language may be compiled into class files of a second computer programming language according to a syntactic format of the second computer programming language.
Alternatively, the development interface information may be interface information for secondary development for UDF. The object having the secondary development requirement for the UDF may be any computing platform or device, and is not limited thereto. In addition, objects having secondary development requirements for UDFs are different, and accordingly, development interface information is also different. Therefore, through different development interface information, the UDF can be converted into a class file of a first computer program language which can be recognized and supported by different platforms or equipment, and the 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 programming language and stored in a storage space accessible by the computer device, so that the computer device reads the UDF from the storage space. The UDF may be written in the first computer programming language on the computer device, or may be written in the first computer programming language on another device.
Alternatively, the development interface information may be written in advance according to the development requirements of a computing platform or device having secondary development requirements for UDF.
Further, after obtaining the class file of the second computer program language, the executable file may be further generated based on the class file of the second computer program language. Therefore, each device supporting the second computer programming language, such as various computing platforms, can directly call and execute the executable file, so that the function defined by the UDF is realized, the UDF can be used across platforms, the effects of one-place development and multiple-place use are achieved, the use flexibility of the UDF is provided, and the development cost is reduced.
Fig. 7b is a schematic structural diagram of another computer device according to another exemplary embodiment of the present application. As shown in fig. 7b, the computer apparatus includes: a memory 70a and a processor 70 b.
The memory 70a is used to store computer programs and may be configured to store other various data to support operations on the computer device. Examples of such data include instructions for any other application or method operating on the computer device, contact data, phonebook data, messages, pictures, videos, and so forth.
The memory 70a may be implemented by any type or combination of volatile or non-volatile 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 disks.
A processor 70b, coupled to the memory 70a, for executing the computer program stored in the memory 70a for:
acquiring UDF and development interface information written by adopting a first computer programming language;
converting the UDF into a class file of a 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 syntactic format of the second computer program language.
Further, the processor 70b may also generate an executable file based on the class file of the second computer program language after obtaining the class file of the second computer program language. Therefore, each device supporting the second computer programming language, such as various computing platforms, can directly call and execute the executable file, so that the function defined by the UDF is realized, the UDF can be used across platforms, the effects of one-place development and multiple-place use are achieved, the use flexibility of the UDF is provided, and the development cost is reduced.
Further, as shown in fig. 7b, the computer apparatus further includes: communication component 70c, display 70d, power component 70e, audio component 70f, and the like. Only some of the components are schematically shown in fig. 7b and it is not meant that the electronic device comprises only the components shown in fig. 7 b.
Further, embodiments of the present application also provide another computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program causes the processor to perform actions including:
acquiring a user defined function UDF and development interface information written by adopting a first computer programming language;
converting the UDF into a class file of a 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 syntactic format 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 of the second computer programming language.
The communication components in fig. 6b and 7b may be configured to facilitate communication between the device to which the communication component belongs and other devices 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 an 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 includes 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 displays 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 an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
The power supply components in fig. 6b and 7b provide power to the various components of the device to which the power supply component belongs. The power components may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the devices to which the power components belong.
The audio components in fig. 6b and 7b are configured to output and/or input audio signals. For example, the audio component includes a Microphone (MIC) configured to receive an external audio signal when the device to which the audio component belongs is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be 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 flows described in the above embodiments and the drawings, a plurality of operations are included in a specific order, but it should be clearly understood that the operations may be executed out of the order presented herein or in parallel, and the sequence numbers of the operations, such as 401, 402, etc., are merely used for distinguishing different operations, and the sequence numbers do not represent any execution order per se. Additionally, 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", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different.
As will be appreciated by one skilled in the art, 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 flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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 a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
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 computer storage media 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 that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
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 an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (17)

1. A method for adapting a custom function UDF is characterized by comprising the following steps:
responding to the UDF adaptation instruction, and acquiring the UDF written by adopting a first computer programming language;
converting the UDF written by adopting the first computer programming language into a class file of the first computer programming language according to the information of the UDF secondary development interface supported by the computing platform to be adapted;
compiling the class file of the first computer program language into the class file of a second computer program language based on the syntactic 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 a resource file package which can be directly called and executed by the computing platform to be adapted.
2. The method of claim 1, wherein obtaining the UDF written in the first computer programming language in response to the UDF adaptation instructions comprises:
responding to a UDF compiling command input by a user, and acquiring a UDF compiled by adopting a first computer programming language;
the packaging the class files 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 includes:
and in response to a UDF packaging instruction input by a user, packaging the class files 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.
3. The method of claim 1, wherein obtaining the UDF written in the first computer programming language in response to the UDF adaptation instructions comprises:
a UDF written in a first computer programming language is obtained in response to a UDF-packed command input by a user.
4. The method according to claim 1, wherein the converting the UDF written in the first computer programming language into a class file of the first computer programming language according to the information of the UDF secondary development interface supported by the computing platform to be adapted comprises:
copying the UDF written by adopting the first computer programming language as a main function in the class file of the first computer programming language into the class file of the first computer programming 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 programming language.
5. The method of claim 1, wherein compiling the class files of the first computer program language into class files 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 comprises:
according to the syntactic format of the second computer program language, implementing the code logic in the class file of the first computer program language in the class file of the second computer program language;
and copying the data in the class file of the first computer program language into the class file of the second computer program language.
6. The method of claim 1, wherein packaging the class files of the second computer program language into a resource file package that can be directly called and executed by the computing platform to be adapted comprises:
packaging the UDF written by adopting the first computer programming language and the class file of the first computer programming language into a file package corresponding to the first computer programming language, and storing the file package in a first file directory;
and packaging the file package corresponding to the first computer programming language and the class file of the second computer programming 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 into a second file directory.
7. A method according to any one of claims 1 to 6, wherein the first computer program language is an object oriented python language and the second computer program language is a java language.
8. A computer device, comprising: a memory and a processor;
the memory stores a computer program;
the processor, coupled with the memory, to execute the computer program to:
responding to the UDF adaptation instruction, and acquiring the UDF written by adopting a first computer programming language;
converting the UDF written by adopting the first computer programming language into a class file of the first computer programming language according to the information of the 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 a second computer program language based on the syntactic 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 a resource file package which can be directly called and executed by the computing platform to be adapted.
9. The computer device according to claim 8, wherein the processor, when obtaining the UDF written in the first computer programming language, is specifically configured to: responding to a UDF compiling command input by a user, and acquiring a UDF compiled by adopting a first computer programming language;
when the processor packages the resource file package, the processor is specifically configured to: and in response to a UDF packaging instruction input by a user, packaging the class files 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.
10. The computer device according to claim 8, wherein the processor, when obtaining the UDF written in the first computer programming language, is specifically configured to: a UDF written in a first computer programming language is obtained in response to a UDF-packed command input by a user.
11. The computer device according to claim 8, wherein the processor, when converting the UDF written in the first computer programming language into a class file of the first computer programming language, is specifically configured to:
copying the UDF written by adopting the first computer programming language as a main function in the class file of the first computer programming language into the class file of the first computer programming 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 programming language.
12. The computer device of claim 8, wherein the processor, when compiling the class files of the first computer programming language into the class files of the second computer programming language, is specifically configured to:
according to the syntactic format of the second computer program language, implementing the code logic in the class file of the first computer program language in the class file of the second computer program language;
and copying the data in the class file of the first computer program language into the class file of the second computer program language.
13. The computer device according to any of claims 8-12, wherein the processor, when packaging the resource file package, is specifically configured to:
packaging the UDF written by adopting the first computer programming language and the class file of the first computer programming language into a file package corresponding to the first computer programming language, and storing the file package in a first file directory;
and packaging the file package corresponding to the first computer programming language and the class file of the second computer programming 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 into a second file directory.
14. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program; the computer program, when executed by a processor, causes the processor to perform acts comprising:
responding to the UDF adaptation instruction, and acquiring the UDF written by adopting a first computer programming language;
converting the UDF written by adopting the first computer programming language into a class file of the first computer programming language according to the information of the 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 a second computer program language based on the syntactic 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 a resource file package which can be directly called and executed by the computing platform to be adapted.
15. The computer-readable storage medium of claim 14, wherein the first computer program comprises: the system comprises an adaptation program instruction, a proxy program instruction, a deployment program instruction and a command line program instruction;
the command line class program instructions, when executed by the processor, cause the processor to perform the acts of: responding to a UDF compiling command or a UDF packaging command input by a user, and acquiring a UDF compiled by adopting a first computer programming language;
the adaptation class program instructions, when executed by the processor, cause the processor to perform the acts of: converting the UDF written by adopting a first computer programming language into a class file of the first computer programming language according to the information of the UDF secondary development interface supported by the computing platform to be adapted;
the proxy class program instructions, when executed by the processor, cause the processor to perform the acts of: compiling the class file of the first computer program language into the class file of a second computer program language based on the syntactic 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 the acts of: and packaging the class files 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.
16. A data processing method, comprising:
acquiring a user defined function UDF and development interface information written by adopting a first computer programming language;
converting the UDF into a class file of the first computer programming language according to the development interface information;
compiling the class file of the first computer program language into the class file of the second computer program language according to the syntactic format of the second computer program language.
17. The method of claim 16, 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 true CN110399384A (en) 2019-11-01
CN110399384B 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)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111026779A (en) * 2019-12-19 2020-04-17 厦门安胜网络科技有限公司 Data processing method, device and storage medium based on Flink SQL
CN112162881A (en) * 2020-09-04 2021-01-01 郑州阿帕斯数云信息科技有限公司 Platform switching method and device
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 (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102073490A (en) * 2009-11-25 2011-05-25 阿里巴巴集团控股有限公司 Method and device for translating database language
US20130226555A1 (en) * 2012-02-23 2013-08-29 Microsoft Corporation Multilingual Build Integration for Compiled Applications
CN104572072A (en) * 2014-12-01 2015-04-29 北京百度网讯科技有限公司 MVC (model view controller) mode-based language transformation method and equipment for program
CN106843875A (en) * 2017-01-19 2017-06-13 杭州数梦工场科技有限公司 The method and apparatus of cross-platform transplanting Python programs

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102073490A (en) * 2009-11-25 2011-05-25 阿里巴巴集团控股有限公司 Method and device for translating database language
US20130226555A1 (en) * 2012-02-23 2013-08-29 Microsoft Corporation Multilingual Build Integration for Compiled Applications
CN104572072A (en) * 2014-12-01 2015-04-29 北京百度网讯科技有限公司 MVC (model view controller) mode-based language transformation method and equipment for program
CN106843875A (en) * 2017-01-19 2017-06-13 杭州数梦工场科技有限公司 The method and apparatus of cross-platform transplanting Python programs

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111026779A (en) * 2019-12-19 2020-04-17 厦门安胜网络科技有限公司 Data processing method, device and storage medium based on Flink SQL
CN111026779B (en) * 2019-12-19 2023-10-17 厦门安胜网络科技有限公司 Data processing method, device and storage medium based on Flink SQL
CN112162881A (en) * 2020-09-04 2021-01-01 郑州阿帕斯数云信息科技有限公司 Platform switching method and device
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

Also Published As

Publication number Publication date
CN110399384B (en) 2023-12-15

Similar Documents

Publication Publication Date Title
CN110399384B (en) UDF adaptation method, data processing method, device and storage medium
CN107402788B (en) Resource packaging management method and device
CN111240684B (en) Cutting method and device of JS codes, medium and electronic equipment
CN114168111B (en) Method, device, product and storage medium for realizing componentized route
CN107943485B (en) Patch compiling platform and patch compiling method
US20140298318A1 (en) Computer-executable application packaging method, computer-executable device and storage media performing the same
WO2022237610A1 (en) Program compiling method and program loading method
CN113419710B (en) Development method and device of applet, electronic equipment and medium
WO2023213263A1 (en) Program compiling method, program starting method, and device and storage medium
CN114489670A (en) Data processing method, device, equipment and storage medium
CN114996134A (en) Containerized deployment method, electronic equipment and storage medium
CN106610845B (en) Information management method, device, server and system
CN113448690B (en) Monitoring method and device
KR101112697B1 (en) Computer readable recording medium containing a program for converting SK-VM and WIPI-JAVA applications to Android applications
CN112346761B (en) Front-end resource online method, device, system and storage medium
CN106484375B (en) Instruction block loading method, soft switch equipment and system
CN112764796A (en) Installation package generation system
CN114385128A (en) Data processing method, device, apparatus, storage medium and program product
CN114168183A (en) Front-end resource information processing method, device, equipment and storage medium
WO2019157891A1 (en) Application installation method and application installer generating method
CN113296777A (en) Dependency analysis and program compilation method, apparatus, and storage medium
CN117472432A (en) Byte code file processing method, electronic equipment and storage medium
CN106598974B (en) Data file generation and calling method and device for android system application program
CN117056317B (en) Data processing method, device, equipment and computer readable storage medium
CN111414160A (en) Development method and device of software development platform

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