摘要 |
A data processing method and apparatus, which relate to the computer field and are capable of effectively improving scalability of a database system. The data processing method includes: receiving source code of an external routine, where the source code of the external routine is compiled by using an advanced programming language; compiling the source code to obtain intermediate code, where the intermediate code is a byte stream identifiable to a virtual machine on any operating platform; converting, according to an instruction set on the operating platform, the intermediate code into machine code capable of running on the operating platform; and storing the machine code to a database. The data processing method and apparatus provided by the embodiments of the present invention are used to process data. |
主权项 |
1. A data processing method, comprising:
receiving, by a receiver, source code of an external routine, wherein the source code of the external routine is compiled using an advanced programming language; compiling, by a processor coupled to the receiver, the source code to obtain intermediate code, wherein the intermediate code is a byte stream identifiable to a plurality of virtual machines on a plurality of different operating platforms; converting, by the processor and according to an instruction set on one of the operating platforms, the intermediate code into machine code capable of running on the one of the operating platforms; storing, in a memory coupled to the processor, the machine code to a database; receiving, by the receiver and from a second piece of user equipment, a request for invoking the external routine; determining, by the processor and according to the request for invoking the external routine, whether the second piece of user equipment has permission to invoke the external routine; invoking, according to a target name and a target address, the intermediate code of the external routine when the intermediate code of the external routine is invoked; and running, by the processor, the machine code so as to invoke the external routine from the database when the second piece of user equipment has the permission to invoke the external routine. |