A Python interpreter, terminal and medium based on DolphinDB
By integrating the Python interpreter into the DolphinDB server, the bottleneck of data interaction between the Python client and the DolphinDB server is resolved, multi-threaded parallel and distributed computing is implemented, data computing efficiency is improved, and efficient interaction and data storage of DolphinDB are supported.
Patent Information
- Application Number
- CN202310536154.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-12
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2043-05-12
AI Technical Summary
In the existing technology, data interaction between the Python client and the DolphinDB server requires serialization and network transmission, which causes the network speed to become a bottleneck for data calculation, and the original Python does not support distributed computing and multi-threaded parallelism.
Provides a Python interpreter based on DolphinDB, adopts DolphinDB data model and object model, seamlessly integrates with DolphinDB, supports multi-threaded parallel and distributed computing, runs directly in the DolphinDB server, provides Python interface, supports SQL query and DolphinDB scripting language functions, and reduces data conversion and transmission process.
It achieves seamless integration of the Python interpreter in the DolphinDB server, supports multi-threaded parallel and distributed computing, reduces the data conversion and transmission process, improves data computing efficiency, and provides efficient interaction with DolphinDB.
Abstract
Description
Technical Field
[0001] The present invention relates to the field of system interaction, and in particular to a DolphinDB-based Python interpreter, terminal equipment, and storage medium. Background Art
[0002] DolphinDB is a high-performance distributed time-series database that integrates a powerful programming language and a high-capacity, high-speed streaming data analysis system. It provides a one-stop solution for the rapid storage, retrieval, analysis, and computation of massive structured data, and is suitable for fields such as quantitative finance and the Industrial Internet of Things.
[0003] Python is a data analysis language.
[0004] Some users use the DolphinDB Python API client to establish a session with the DolphinDB server over the network for interaction. Because the Python client and the DolphinDB server are two different systems with completely different data models, a data conversion and transmission process is required to enable interaction between the two systems.
[0005] Data conversion and transmission steps include serialization, network I / O, and deserialization. For example, for tabular data, Python typically uses the DataFrame type in the pandas module. Its counterpart in DolphinDB is the TABLE type. To transmit a DataFrame from a Python client to a DolphinDB server, the table must first be serialized into a byte stream, which is then sent to the DolphinDB server over the network. The byte stream is then deserialized on the DolphinDB server to produce a DolphinDB TABLE type.
[0006] In our test environment, for example, the Python client (version 1.30.17.1) and the DolphinDB server (version 2.00.6) were both running Intel Xeon Silver 4214 @ 2.2GHz CPUs, 512GB of memory, CentOS 7 64-bit, and a 10 Gigabit Ethernet network. Uploading a 10 million-row pandas DataFrame of type int32 from the Python client to the DolphinDB server took 225 milliseconds, indicating that the network speed between the Python client and the DolphinDB server limited the data computation during the interaction.
[0007] For the above reasons, in the prior art, the interaction between the Python client and the DolphinDB server requires the Python client to connect to the DolphinDB server, which causes a large amount of data conversion and transmission between the Python client and the DolphinDB server, and the network speed becomes the bottleneck of data calculation during the interaction process. Summary of the Invention
[0008] In order to solve the above problems, the present application provides a Python interpreter, terminal device and storage medium based on DolphinDB.
[0009] In the first aspect, the present application provides a DolphinDB-based Python interpreter that adopts the following technical solutions:
[0010] A DolphinDB-based Python interpreter includes a model module, which is provided with a DolphinDB data model, a DolphinDB object model, and a DolphinDB evaluation model. The interpreter and DolphinDB share the same object model, namely the DolphinDB object model. The interpreter is seamlessly integrated with DolphinDB, providing a Python interface, utilizing the DolphinDB data model, and running on the DolphinDB server to support interaction with the DolphinDB database using Python syntax. The Python interpreter supports multi-threaded parallelism in data analysis, utilizes the DolphinDB computing engine, storage engine, and distributed computing capabilities, is fully integrated with the DolphinDB database, and directly supports SQL query statements in Python.
[0011] By adopting the above technical solution,
[0012] 1. This solves Python's GIL and supports multi-threaded parallelism in data analysis. Compared with the original Python interpreter, this application does not have a GIL lock, while the original Python has a GIL lock. Therefore, in the DolphinDB Python of this application, multiple users can use multiple sessions at the same time without affecting each other, and a single user can start multiple tasks without affecting each other.
[0013] 2. Support distributed computing. The original Python does not support distributed computing, but this application DolphinDBPython inherits the functions of DolphinDB. DolphinDB supports distributed computing, so this application DolphinDBPython can support distributed computing.
[0014] 3. Fully integrated with the database, it provides the ability to execute Python scripts in the DolphinDB runtime environment, sharing a set of object systems and runtime environments with DolphinDB Script. The calculations of this application are based on DolphinDB's superior storage and calculation functions, and can directly call DolphinDB's thousands of built-in functions, increasing programming flexibility.
[0015] This application expands the syntax of Python and supports the unique features of the DolphinDB scripting language, including SQL statements, timer statements, and metaprogramming. Users familiar with Python can use Python directly in DolphinDB without having to connect to the DolphinDB server through a Python client. The Python interpreter based on DolphinDB in this application can provide the same interface as the original Python, and the underlying data structure is consistent with DolphinDB. Data can be saved directly in the DolphinDB server. After the client connects to the DolphinDB server, it only needs to interact with the server by sending commands, without requiring a large amount of data conversion and transmission, and is less affected by network speed.
[0016] Preferably, the method further includes: a session unit, which uses a GUI client or a VSCode client to connect to the server and create a session before DolphinDB Python runs.
[0017] By adopting the above technical solution, DolphinDB Python runs on the DolphinDB server. Therefore, before each run, you need to use a client such as GUI or VS Code to connect to the server and create a session, rather than starting a new independent process like CPython. The client uses the session to execute scripts and functions on the DolphinDB server and transfer data between the client and the DolphinDB server.
[0018] Preferably, the session is a Python Session.
[0019] By adopting the above technical solution, DolphinDB has two types of sessions: DolphinDB Sessions and Python Sessions. Each type of session uses a different parser to parse the user's scripts. To use DolphinDB Python, you need to create a Python Session connection. The DolphinDB GUI client or DolphinDB VS Code provides configuration to quickly switch between DolphinDB Sessions and Python Sessions. Users interact with the DolphinDB server by entering scripts in the interactive interface.
[0020] Preferably, the evaluation model includes: based on the DolphinDB class, adding PyClass and PyInstance to introduce a class mechanism, the PyClass represents the meta-information of the class, and the PyClass stores a mapping from name to value to represent the attributes and methods of the class; the PyInstance is used to represent the class instance, and each of the PyInstances stores the class pointer of the instance and a mapping from name to value to represent the members of the class instance.
[0021] By adopting the above technical solutions, the most commonly used data structures in Python include list, tuple, dict, and set. In order to have the same data structures in DolphinDB Python, based on the introduction of class mechanisms such as PyClass and PyInstance, built-in classes such as PyList, PyListIterator, PyTuple, PyTupleIterator, PyDict, PyDictKeyIterator, PyDictValueIterator, PyDictItemIterator, PySet, and PySetIterator are implemented to represent the corresponding basic data structures in Python.
[0022] Preferably, the token is provided with a token type, and the token type of the token includes variable name, number, string, indentation, and all constant types supported in DolphinDB.
[0023] By adopting the above technical solution, the lexical analysis module divides the input into several tokens. The token types are divided into variable names, numbers, strings, indentations, and all constant types supported by DolphinDB, such as dates and times. The result of the lexical analysis module is an array of tokens for subsequent syntax parsing units to call.
[0024] Preferably, the nodes in the syntax tree include statement nodes and expression nodes, the statement nodes include module nodes, function definition nodes, class definition nodes, if nodes, while nodes and SQL nodes; the expression nodes include constant nodes, unary operation nodes, binary operation nodes, logical operation nodes, list nodes, tuple nodes and dictionary nodes.
[0025] Preferably, the variable types include global variables, local variables and non-local variables, which are used for looking up variables when the program is running.
[0026] Preferably, the syntax analysis unit is also used to find all nested functions, collect external variables required by internal functions, add the external variables to the parameters of the internal functions, and then promote the internal functions to the global space, thereby supporting the definition of nested functions.
[0027] By adopting the above technical solution, since DolphinDB does not support nested functions, that is, it does not support defining functions within functions. In order to support this feature, the syntax analysis unit finds all nested functions, collects the external variables required by the inner functions, adds these external variables to the parameters of the inner functions, and then promotes the inner functions to the global space, thereby supporting the definition of nested functions.
[0028] In a second aspect, the present application discloses a terminal device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor loads and executes the computer program, the processor adopts the above-mentioned DolphinDB-based Python interpreter.
[0029] By adopting the above technical solution, a computer program is generated by the above-mentioned DolphinDB-based Python interpreter and stored in the memory to be loaded and executed by the processor. Therefore, a terminal device is manufactured based on the memory and the processor to facilitate user use.
[0030] In a third aspect, the present application discloses a computer-readable storage medium, which adopts the following technical solution: a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the above-mentioned DolphinDB-based Python interpreter is adopted.
[0031] By adopting the above technical solution, a computer program is generated by the above-mentioned DolphinDB-based Python interpreter and stored in a computer-readable storage medium to be loaded and executed by a processor. The computer-readable storage medium facilitates the readability and storage of the computer program. DETAILED DESCRIPTION
[0032] This embodiment of the present application discloses a DolphinDB-based Python interpreter, comprising a parsing module and a model module. The model module includes a DolphinDB data model, a DolphinDB object model, and a DolphinDB evaluation model. The parsing module is used to parse input data and convert it into statements that can be executed using the DolphinDB scripting engine. The parsing module includes a session unit, a lexical parsing unit, a grammatical parsing unit, a syntax analysis unit, and an interpretation and execution unit.
[0033] The session unit is used to connect to the server and create a session using a GUI client or VS Code client before running DolphinDB Python. The lexical parsing unit is used to divide the input data into several tokens and data types supported by DolphinDB, and organize the tokens into arrays. The syntax parsing unit is used to interpret the array syntax to obtain the nodes of the syntax tree. The syntax analysis unit is used to distinguish the variable types of variables in the array and mark the variable types on the syntax tree. The interpretation and execution unit is used to translate the syntax tree into statements that can be executed using the DolphinDB script engine.
[0034] The implemented Python interpreter expands upon the original Python syntax and supports features specific to the DolphinDB scripting language, including SQL statements, timer statements, and metaprogramming. Users familiar with Python can use Python directly within DolphinDB without having to connect to the DolphinDB server through a Python client.
[0035] Specifically, the purpose of implementing a Python interpreter directly in DolphinDB is to enable this data to be stored directly in the DolphinDB server. When using a Python client to interact with the DolphinDB server, the Python client and the DolphinDB server are two different systems with completely different data models.
[0036] For example, Python typically uses the DataFrame type in the pandas module for tabular data, while DolphinDB's corresponding type is the TABLE type. Interaction between the two systems requires a translation and transmission process. For example, to transfer a DataFrame from a Python client to a DolphinDB server, the table must first be serialized into a byte stream, which is then sent over the network to the DolphinDB server. The byte stream is then deserialized on the DolphinDB server to create a DolphinDB TABLE type.
[0037] The DolphinDB Python interpreter provides the same interface as the original Python version, but directly utilizes the DolphinDB data model at the bottom layer and runs on the DolphinDB server. Therefore, there is no data conversion and transmission process, and no need to send data over the network, so it is less affected by network speed.
[0038] Regarding the DolphinDB Python object model and the DolphinDB Python evaluation model,
[0039] The most fundamental difference between DolphinDB Python and CPython lies in their object models, while their evaluation models are the same. DolphinDB Python and DolphinDB share the same object model, allowing for seamless integration. For example, the implementation of integers corresponds to `int` in C++, as shown in the Int interface exposed in the DolphinDB C++ API (Application Programming Interface). For the implementation of integer objects in Python, see struct_longobject. This shows that integer objects in Python not only have data but also type information.
[0040] DolphinDB has several important classes: Object, Constant, Heap, and Statement. These classes play a crucial role in implementing DolphinDB Python. Constant inherits from Object. There's also the Statement class, which represents an executable object, such as a loop statement.
[0041] A constant represents a value with two important properties: type and form. Types include INT (32-bit integers) and LONG (64-bit integers), and forms include scalars, vectors, pairs, matrices, sets, dictionaries, and tables. For example, if a constant has an INT type and a vector form, it represents a vector of arbitrary length, with each element of the vector being of type INT.
[0042] Object is used to represent a constant that can be evaluated in a Heap. A Heap represents an environment, a mapping from names to values (constants). For example, the value of the expression `x+1` depends on the value of x in its environment. For a constant, the result of evaluating it in any Heap is itself.
[0043] In DolphinDB, constants, variables, functions, arithmetic expressions, column references, SQL queries, and metacode inherit from Object. The Statement class represents executable statements, including assignment statements and if statements.
[0044] Each Object, Constant, and Statement needs to implement serialization and deserialization methods to support remote procedure calls and distributed computing.
[0045] The original Python does not support distributed computing, but the DolphinDB Python of this application inherits the functions of DolphinDB, which supports distributed computing, so the DolphinDB Python of this application can support distributed computing.
[0046] DolphinDB Python builds on these classes, introducing a class mechanism by adding PyClass and PyInstance. PyClass represents class metadata, storing a name-to-value mapping for class attributes and methods. PyInstance represents class instances. Each PyInstance stores a pointer to the instance's class and a name-to-value mapping for the class instance's members.
[0047] The most commonly used data structures in Python include list, tuple, dict, and set. In order to have the same data structures in DolphinDBPython, based on the class mechanism, built-in classes such as PyList, PyListIterator, PyTuple, PyTupleIterator, PyDict, PyDictKeyIterator, PyDictValueIterator, PyDictItemIterator, PySet, and PySetIterator are implemented to represent the corresponding basic data structures in Python.
[0048] DolphinDB Python is fully integrated with the DolphinDB database. Specifically, this application provides the ability to execute Python scripts within the DolphinDB runtime environment, sharing the same object system and runtime environment as DolphinDB Script. Operations in this application are based on DolphinDB's superior storage and compute engines, allowing direct access to thousands of DolphinDB built-in functions, increasing programming flexibility. The syntax of this application can be based on Python 3, allowing DolphinDB Python to incorporate DolphinDB's unique syntax. For example, DolphinDB Python directly supports SQL queries, eliminating the need to use SQL through an API.
[0049] Unlike CPython, DolphinDB Python runs on the DolphinDB server. Therefore, before each run, you need to use a client such as the GUI or VS Code to connect to the server and create a session, rather than starting a new, independent process like CPython. Each session maintains connection information, user information, global variables, and so on. The client uses the session to execute scripts and functions on the DolphinDB server and to transfer data between the client and the server.
[0050] This application solves Python's GIL (Global Interpreter Lock) and supports multi-threaded parallelism in data analysis. Specifically, compared with the original Python interpreter, this application does not have a GIL lock, while the original Python has a GIL lock. Therefore, in DolphinDB Python, multiple users can use multiple sessions simultaneously without affecting each other, and a single user can start multiple tasks without affecting each other.
[0051] Before DolphinDB 2.10.0, there was only one type of Session by default. DolphinDB 2.10.0 added a new Session type, so there are currently two types of Session in DolphinDB: DolphinDB Session and Python Session.
[0052] Different types of sessions use different parsers to parse user scripts. To use DolphinDB Python, you need to create a Python session connection. The DolphinDB GUI client or DolphinDB VS Code provides configuration to quickly switch between DolphinDB sessions and Python sessions. Users interact with the DolphinDB server by entering scripts in the interactive interface.
[0053] Compared with DolphinDB's Python API, this application runs directly in the DolphinDB Server, while the Python API requires establishing a connection with the DolphinDB server in the Python environment and then interacting with DolphinDB by executing DolphinDB scripts.
[0054] In the lexical analysis module, the user inputs source code as a string, which is then divided into tokens. Token types include variable names, numbers, strings, indents, and DolphinDB constant types, such as BOOL, CHAR, SHORT, INT, dates, and times. The lexical analysis module produces an array of tokens, which is then used by the parsing unit.
[0055] In the grammar parsing unit, the grammar parsing unit takes the token array as input and uses the recursive descent method to parse. Each grammar rule corresponds to a function, and the result returned by the function is a node in the grammar tree.
[0056] Nodes in a syntax tree are broadly categorized as statement nodes and expression nodes. Statement nodes include module nodes, function definition nodes, class definition nodes, if nodes, while nodes, and SQL nodes. Expression nodes include constant nodes, unary operation nodes, binary operation nodes, logical operation nodes, list nodes, tuple nodes, and dictionary nodes. The system in this application uses Python 3.10 syntax as a model, adding support for SQL and DolphinDB metaprogramming. After parsing the input token array, a module node is generated.
[0057] In the syntax analysis unit, each variable name is analyzed to distinguish the type of each variable and mark it in the syntax tree. Variable types include global variables, local variables, and nonlocal variables, which are used to look up variables during program runtime.
[0058] In addition, DolphinDB does not support nested functions, that is, it does not support defining functions within functions. To support this feature, the syntax analysis unit will find all nested functions, collect the external variables required by the inner functions, add these external variables to the parameters of the inner functions, and then promote the inner functions to the global space, thereby supporting the definition of nested functions.
[0059] Within the interpreted execution unit, the DolphinDB database system provides an internal execution mechanism that includes expression objects, constant objects, statement objects, and an evaluation environment. An expression object or statement object can be evaluated within an evaluation environment to a constant object. Constant objects include integers, floating-point numbers, vectors, matrices, and tables.
[0060] The input of the interpreter execution unit is a syntax tree, and the output is a statement object that can be executed by the DolphinDB system. The interpreter module translates the syntax tree into statements that can be executed by the DolphinDB scripting engine. For statements that are not supported by the existing execution mechanism of the DolphinDB system, such as if expressions and while statements, new expression objects or statement objects are added to the DolphinDB system to implement them.
[0061] DolphinDB Python implements function definition, class definition, return, assignment, in-place assignment, for loop, while loop, if, with, try, raise, pass, continue, break, assert, and import. DolphinDB-related extended statements include share and timer, and SQL statements include select, exec, update, alter, delete, and insert.
[0062] DolphinDB Python supports parsing constants in Python, including strings and numbers, and also adds support for DolphinDB-specific constants including DATETIME, TIMESTAMP, NANOTIME, etc.
[0063] The implementation principle of a DolphinDB-based Python interpreter in this embodiment is as follows: the interpreter provides a Python interface and utilizes the DolphinDB data model, running on a DolphinDB server. Specifically, the implemented Python interpreter expands upon the native Python syntax and supports features unique to the DolphinDB scripting language, including SQL statements, timer statements, and metaprogramming. Users familiar with Python can use Python directly within DolphinDB without having to connect to the DolphinDB server through a Python client, allowing data to be stored directly on the DolphinDB server.
[0064] The Python interpreter based on DolphinDB can provide the same interface as the original Python, but the underlying data structure is consistent with DolphinDB, so data can be saved directly in the DolphinDB server. After the client connects to the DolphinDB server, it only needs to interact with the server by sending commands, without the need for a large amount of data conversion and transmission, and is less affected by network speed.
[0065] This application can natively execute Python code in the DolphinDB database, and the underlying data structure is consistent with DolphinDB, and can directly use DolphinDB's computing engine, storage engine and distributed computing capabilities.
[0066] An embodiment of the present application further discloses a terminal device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor uses the DolphinDB-based Python interpreter of the above embodiment when executing the computer program.
[0067] Among them, the terminal device can be a computer device such as a desktop computer, a laptop computer or a cloud server, and the terminal device includes but is not limited to a processor and a memory. For example, the terminal device can also include input and output devices, network access devices and buses, etc.
[0068] Among them, the processor can adopt a central processing unit (CPU). Of course, according to actual usage, other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. can also be adopted. The general-purpose processor can adopt a microprocessor or any conventional processor, etc., and this application does not impose any restrictions on this.
[0069] Among them, the memory can be an internal storage unit of the terminal device, such as the hard disk or memory of the terminal device, or it can be an external storage device of the terminal device, such as a plug-in hard disk, smart memory card (SMC), secure digital card (SD) or flash memory card (FC) equipped on the terminal device, etc., and the memory can also be a combination of the internal storage unit and the external storage device of the terminal device. The memory is used to store computer programs and other programs and data required by the terminal device. The memory can also be used to temporarily store data that has been output or is to be output. This application does not impose any restrictions on this.
[0070] Among them, through this terminal device, the DolphinDB-based Python interpreter of the above embodiment is stored in the memory of the terminal device, and is loaded and executed on the processor of the terminal device to facilitate user use.
[0071] An embodiment of the present application further discloses a computer-readable storage medium, and the computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the DolphinDB-based Python interpreter of the above embodiment is adopted.
[0072] Among them, the computer program can be stored in a computer-readable medium, the computer program includes computer program code, the computer program code can be in the form of source code, object code, executable file or certain middleware, etc. The computer-readable medium includes any entity or device that can carry computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that computer-readable medium includes but is not limited to the above-mentioned components.
[0073] Among them, through this computer-readable storage medium, the Python interpreter based on DolphinDB in the above embodiment is stored in the computer-readable storage medium, and is loaded and executed on the processor to facilitate the storage and application of the above-mentioned Python interpreter based on DolphinDB.
[0074] The above are all preferred embodiments of the present application and are not intended to limit the scope of protection of this application. Unless otherwise stated, any feature disclosed in this specification (including the abstract) may be replaced by other equivalent or similar features. In other words, unless otherwise stated, each feature is merely an example of a series of equivalent or similar features.
Claims
1. A Python interpreter based on DolphinDB, characterized in that include: The model module includes the DolphinDB data model, the DolphinDB object model, and the DolphinDB evaluation model; The interpreter and DolphinDB share the same object model, which is the DolphinDB object model. The interpreter is seamlessly integrated with DolphinDB, provides a Python interface, utilizes the DolphinDB data model, runs in the DolphinDB server, and supports the use of Python syntax to interact with the DolphinDB database. The Python interpreter supports multi-threaded parallelism in data analysis, uses the computing engine, storage engine and distributed computing capabilities of the DolphinDB, is fully integrated with the DolphinDB database, and directly supports SQL query statements in Python.
2. The DolphinDB-based Python interpreter according to claim 1, wherein: It also includes a parsing module for parsing input data and converting it into statements that can be executed using the DolphinDB script engine.
3. The DolphinDB-based Python interpreter according to claim 2, wherein: The parsing module includes: A lexical parsing unit that divides input data into a number of tokens and organizes the tokens into an array; A syntax parsing unit, performing syntax interpretation on the array to obtain nodes of a syntax tree; a syntax analysis unit, configured to distinguish variable types of variables in the array, and mark the variable types on the syntax tree; The interpretation and execution unit translates the syntax tree into statements that can be executed using the DolphinDB script engine.
4. The DolphinDB-based Python interpreter according to claim 2 or 3, characterized in that: Also includes: Session unit, before DolphinDB Python runs, use the GUI client or VS Code client to connect to the server to create a session.
5. The DolphinDB-based Python interpreter according to claim 1, wherein: The DolphinDB evaluation model includes: adding PyClass and PyInstance to introduce class mechanisms based on the DolphinDB class, The PyClass represents the meta-information of the class. The PyClass stores a mapping from name to value to represent the attributes and methods of the class. The PyInstance is used to represent a class instance. Each of the PyInstances stores a class pointer of the instance and a mapping from name to value to represent the members of the class instance.
6. The DolphinDB-based Python interpreter according to claim 3, wherein: The token types of the token include variable names, numbers, strings, indents, and all constant types supported in DolphinDB.
7. The DolphinDB-based Python interpreter according to claim 3, wherein: The nodes in the syntax tree include statement nodes and expression nodes. The statement nodes include module nodes, function definition nodes, class definition nodes, if nodes, while nodes and SQL nodes; The expression nodes include constant nodes, unary operation nodes, binary operation nodes, logical operation nodes, list nodes, tuple nodes and dictionary nodes.
8. The DolphinDB-based Python interpreter according to any one of claim 3, characterized in that: The syntax analysis unit is further used to find all nested functions, collect external variables required by internal functions, add the external variables to the parameters of the internal functions, and then promote the internal functions to the global space, thereby supporting the definition of nested functions.
9. A terminal device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that: When the processor loads and executes the computer program, the DolphinDB-based Python interpreter according to any one of claims 1 to 7 is adopted.
10. A computer-readable storage medium storing a computer program, wherein: When the computer program is loaded and executed by the processor, the DolphinDB-based Python interpreter according to any one of claims 1 to 7 is adopted.
Citation Information
Patent Citations
AISQL parser in decision-making distributed database system and implementation method thereof
CN109241104A
SQL interpreter of HBase and optimization method
CN111309757A