Database system, data transmission method, computing device, and readable storage medium
By decoupling the network services of the control link and the data link, the hosted code module processes the control link to multiplex the original protocol stack, and the native code module processes the data link to transmit at zero copy, solving the performance bottlenecks and compatibility problems of traditional database systems and achieving efficient and stable data transmission.
Patent Information
- Application Number
- CN202510561836.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2045-04-30
AI Technical Summary
Traditional database systems based on managed code modules have significant overhead when performing complex calculations, especially the surge in resource demand and increased transmission delay in network transmission links, resulting in limited throughput and stability, and process-level replacement solutions have problems such as repeated development of data transmission protocol stacks and interfaces and compatibility guarantees.
Using the decoupling deployment mechanism between the control link and the data link, the hosted network service module processes the control link to multiplex the original protocol stack to ensure compatibility, while the native network service module independently processes the data link to achieve zero copy transmission, bypassing redundant copy operations across module interfaces.
It significantly reduces memory footprint and transmission delay, improves data transmission performance and stability, while reducing development costs and compatibility risks, and achieves low-cost and high-compatibility zero-copy transmission of data links.
Smart Images

Figure CN120086207B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the technical field of databases and big data, and in particular to a database system, a data transmission method, a computing device, and a readable storage medium. Background Art
[0002] With the rapid growth in demand for big data applications, database systems are facing performance bottlenecks. Traditional database systems based on managed code modules (such as the Java Virtual Machine (JVM)) incur significant overhead when executing complex computations. This is particularly true during network transmission, where data transfer between managed code modules and native code modules (such as native C / C++ modules) requires copying via cross-module interfaces (such as the Java Native Interface (JNI)). This leads to a surge in resource demands and increased transmission latency, severely limiting the throughput and stability of database systems.
[0003] Currently, the process-level replacement solution starts a native process of a native code module, which is responsible for all contents including calculation, control and network transmission. It can avoid copy transmission across module interfaces and achieve zero copy on the network transmission link.
[0004] However, while process-level replacement solutions achieve zero-copy data links through independent native processes, they require redeveloping the data transmission protocol stack and interfaces of complex native code modules. This leads to duplicate development of data transmission protocol stacks and interfaces, and difficulty ensuring cross-module compatibility. Therefore, a database system with low development costs, balanced data transmission compatibility, and support for zero-copy data links is urgently needed. Summary of the Invention
[0005] In view of this, embodiments of this specification provide a database system. One or more embodiments of this specification also relate to a data transmission method, a computing device, a computer-readable storage medium, and a computer program product to address technical deficiencies in the prior art.
[0006] According to a first aspect of an embodiment of this specification, a database system is provided. The server of the database system includes:
[0007] A managed code module, including a managed network service module, which is used to transmit control information to and from the client, wherein the control information is metadata that guides the database system to execute the request instruction logic;
[0008] A native code module, including a native network service module and a computing unit. The native network service module is used to transmit data information to and from the client, and to access the computing unit to obtain data information. The data information is a data set generated by the database system in response to a client request.
[0009] Cross-module interface, used to transfer control information between managed code modules and native code modules.
[0010] According to a second aspect of the embodiments of this specification, a data transmission method is provided, which is applied to the above-mentioned database system, and the method includes:
[0011] Calling the managed network service module to receive control information sent by the client, wherein the control information is metadata that guides the database system to execute the request instruction logic;
[0012] Call the managed network service module and transfer the control information to the native code module through the cross-module interface.
[0013] The managed network service module is called, and the running status of the native code module is updated based on the control information through the computing unit.
[0014] According to a third aspect of the embodiments of this specification, a data transmission method is provided, which is applied to the above-mentioned database system, and the method includes:
[0015] Calling the managed network service module to receive a pull request for control information sent by the client, where the control information is metadata that guides the database system to execute the requested instruction logic;
[0016] Call the managed network service module to obtain control information corresponding to the pull request from the computing unit through the cross-module interface;
[0017] Calls the managed network service module and returns control information to the client.
[0018] According to a fourth aspect of the embodiments of this specification, a data transmission method is provided, which is applied to the above-mentioned database system, and the method includes:
[0019] Calling the native network service module to receive a pull request for data information sent by the client, wherein the data information is a data set generated by the database system in response to the client request;
[0020] Call the native network service module to access the computing unit to obtain the data information corresponding to the pull request;
[0021] Call the native network service module and return data information to the client.
[0022] According to a fifth aspect of the embodiments of this specification, a database system configuration method is provided, including:
[0023] Use the optimizer to divide the current process into multiple calculation stages and determine the upstream and downstream relationships of multiple calculation stages;
[0024] performing a compatibility check on the plurality of computation stages to determine whether each computation stage is executed as a managed code module or a native code module in a server of a database system, wherein the database system is the aforementioned database system;
[0025] Register data service port information for multiple computing stages according to the execution mode;
[0026] The data service port information of the upstream computing stage of each computing stage is registered in the current computing stage, so that when the current computing stage is executed in the computing stage, it is connected to the corresponding hosted network service module port or native network service module port according to the data service port information of the registered upstream computing stage to complete data access control.
[0027] According to a sixth aspect of the embodiments of this specification, there is provided a computing device, including:
[0028] memory and processor;
[0029] The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the above-mentioned data transmission method are implemented.
[0030] According to a seventh aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores a computer program / instruction, and when the computer program / instruction is executed by a processor, the steps of the above-mentioned data transmission method are implemented.
[0031] According to an eighth aspect of the embodiments of this specification, a computer program product is provided, comprising a computer program / instruction, which implements the steps of the above-mentioned data transmission method when executed by a processor.
[0032] In one embodiment of the present specification, a database system is provided, wherein a server of the database system includes a managed code module, a native code module, and a cross-module interface;
[0033] The managed code module includes a managed network service module, the native code module includes a native network service module and a computing unit, and the cross-module interface is used to transmit control information between the managed code module and the native code module;
[0034] The managed network service module is used to transmit control information to and from the client;
[0035] The native network service module is used to transmit data information with the client;
[0036] The native network service module is used to access the computing unit to obtain data information.
[0037] In the embodiments of this specification, the network services of the control link and the data link are decoupled and deployed, realizing a differentiated processing mechanism for cross-module transmission. The managed network service module processes the control link based on the protocol stack of the original managed code module to ensure protocol compatibility with the client, while the native network service module independently takes over the data link transmission and directly accesses the data information generated by the native computing unit, bypassing the redundant copy operations of the cross-module interface. The architecture of this database system enables the data link to be directly transmitted to the client in a zero-copy manner in the native code module, significantly reducing memory usage and transmission delay. At the same time, the control link still reuses the mature protocol stack of the managed code module, avoiding the repeated development of the complex protocol stack and interface of the native code module, thereby achieving a balance between development cost, compatibility guarantee and transmission performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 This is a schematic diagram of the structure of a database system provided by one embodiment of this specification;
[0039] Figure 2 This is a schematic diagram of the structure of a database system of an analytical database provided in one embodiment of this specification;
[0040] Figure 3 This is one of the flowcharts of a database system of an analytical database provided by one embodiment of this specification;
[0041] Figure 4 This is the second flow chart of a database system of an analytical database provided by one embodiment of this specification;
[0042] Figure 5 This is the third flow chart of a database system of an analytical database provided by one embodiment of this specification;
[0043] Figure 6 This is one of the flow charts of a data transmission method provided by one embodiment of this specification;
[0044] Figure 7 This is the second flowchart of a data transmission method provided by an embodiment of this specification;
[0045] Figure 8 This is the third flowchart of a data transmission method provided by an embodiment of this specification;
[0046] Figure 9This is the fourth flowchart of a data transmission method provided by an embodiment of this specification;
[0047] Figure 10 This is a structural block diagram of a computing device provided by one embodiment of this specification. DETAILED DESCRIPTION
[0048] The following description sets forth many specific details to facilitate a thorough understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the scope of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0049] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a," "the," and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0050] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0051] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0052] First, the terms involved in one or more embodiments of this specification are explained.
[0053] Database system: A software system used to efficiently store, organize, manage, and retrieve structured data. It supports data definition, operation, control, and transaction processing functions, and provides reliable data services for applications.
[0054] Online Analytical Processing (OLAP): A database type designed for complex data analysis. It uses a multidimensional data model to support rapid aggregation, slicing, and drilling operations on large-scale historical data, serving decision support and project intelligence scenarios.
[0055] Online Transaction Processing (OLTP) databases are designed for high-concurrency transaction processing. They are optimized for short, atomic operations (such as add, delete, modify, and query) and are suitable for project scenarios such as order processing and real-time transactions.
[0056] Java Virtual Machine (JVM): A managed code module that interprets and executes Java bytecodes, provides memory management, garbage collection, and cross-platform compatibility, but may introduce runtime performance overhead.
[0057] Native C / C++ module: A native code module that runs directly on the operating system and generates machine code by compiling to achieve high-performance computing. It is often used for the development of low-latency, high-throughput system core modules.
[0058] Java Native Interface: A cross-language interactive interface provided by the Java platform that allows Java code to call native (such as C / C++) functions and vice versa. However, this requires copying data between managed code modules and native code modules, resulting in additional memory and performance loss.
[0059] Zero-copy transmission: During cross-module data transmission, redundant data replication between memories is avoided to achieve efficient transmission, reduce latency and resource consumption.
[0060] Service routing: Based on preset strategies or dynamic states (such as computing unit code modules), target service endpoints (such as Java or native network services) are selected in the network to establish connections, ensuring that data and control links are correctly distributed to the corresponding processing modules.
[0061] Relational database (Structured Query Language, SQL for short): A data management system based on the relational model that organizes data in a table structure, supports ACID transactions and the standardized SQL query language, and ensures data consistency and integrity.
[0062] MySQL: An open-source relational database management system that supports multi-threading, multiple storage engines, and a high-availability architecture. It is widely used in web applications and online transaction processing scenarios.
[0063] Process: The basic unit of operating system resource allocation, with independent memory space and execution context. Data between different processes is isolated and they need to interact through the inter-process communication (IPC) mechanism.
[0064] Thread: An execution unit within a process that shares process memory resources and enables concurrent processing through lightweight scheduling. It is suitable for task scenarios that require frequent switching or collaboration.
[0065] Java network transport protocol interface: The communication protocol stack (such as HTTP / RPC) implemented in the Java code module reuses the serialization and handshake logic of the existing Java ecosystem to ensure seamless compatibility between the control link and the client protocol.
[0066] Storage connector: An adapter module in a database system used to connect to external storage components (such as distributed file systems and object storage), encapsulating storage protocols and access logic to achieve efficient data reading, writing, and persistence management.
[0067] A directed acyclic graph (DAG) is a graph data structure consisting of vertices and directed edges. Edges connect vertices in a single direction and do not contain any closed loops. In database systems, DAGs represent the logical topology of task execution. Vertices correspond to data processing stages (such as scanning, aggregation, and sorting), while directed edges define the data dependencies and execution order between stages, ensuring that tasks flow efficiently according to conflict-free dependencies.
[0068] Currently, database systems, such as online analytical databases, face performance bottlenecks in traditional managed code modules in scenarios involving intensive computing and large data transfers. Native replacement is a major trend in technological evolution and can significantly improve database system performance. There are two technical approaches to native replacement:
[0069] The first is a thread-level replacement solution, in which multiple native threads are started within the managed process of the managed code module to perform calculations, while external managed threads are responsible for external network interaction and transmission. The advantage of this solution is that the original network communication protocols, storage connectors, etc. of the managed code module can be reused, avoiding the need to redevelop compatibility and significantly reducing the workload. This allows for a high level of compatibility to be achieved quickly with a small, controllable workload, and reduces the risk of going online. The disadvantage of this solution is that all network interaction and transmission must be handled by the managed code module, and data must be copied between the managed code module and the native code module through a cross-module interface, which brings additional performance overhead, memory overhead, and stability risks.
[0070] The second approach is a process-level replacement solution, which launches a native process in the native code module to handle all aspects of computing, control, and network transmission. The advantage of this solution is that it avoids copying and transmitting cross-module interfaces, enabling zero-copy network transmission links, thereby improving performance and stability. However, the disadvantage is that it requires redeveloping nearly all execution content, including the native code module's data transmission protocol stack and interfaces. This is a significant workload, carries a high risk of going online, and involves duplicate development of the data transmission protocol stack and interfaces, making cross-module compatibility difficult to ensure.
[0071] The content of data transmission in the database system can be divided into control links and data links. Among them, the control link has many communication types and complex protocols, but the data volume is small and the impact on performance is small. The communication protocol of the data link is relatively simple, but the data volume is large and the impact on performance and stability is obvious.
[0072] Based on the above content, this specification provides a database system that decouples and deploys network services for control links and data links, and realizes a differentiated processing mechanism for cross-module transmission. The managed network service module processes the control link based on the protocol stack of the original managed code module to ensure protocol compatibility with the client, while the native network service module independently takes over the data link transmission, directly accesses the data information generated by the native computing unit, and bypasses the redundant copy operations of the cross-module interface, combining the advantages of thread-level replacement solutions and process-level replacement methods: on the one hand, due to the low complexity of the data link, the complexity of the native code module developing a separate set of network service modules for the data link is controllable, so the workload of the thread-level replacement solution can be kept low and the risk of going online can be reduced; on the other hand, due to the large impact of the data link on performance and stability, switching the data link of the native code module can obtain the high performance and stability of the process-level replacement solution.
[0073] This specification also relates to a data transmission method, a computing device, a computer-readable storage medium, and a computer program product, which are described in detail one by one in the following embodiments.
[0074] See also Figure 1 , Figure 1 FIG. 1 is a schematic diagram showing the structure of a database system provided by an embodiment of the present specification. The server 110 of the database system 10 includes:
[0075] The managed code module 1110 includes a managed network service module 11110 , which is used to transmit control information to and from the client 120 , wherein the control information is metadata that directs the database system to execute the request instruction logic;
[0076] The native code module 1120 includes a native network service module 11210 and a computing unit. The native network service module 11210 is used to transmit data information with the client 120 and access the computing unit 11220 to obtain data information, wherein the data information is a data set generated by the database system in response to a request from the client 120;
[0077] The cross-module interface 1130 is used to transmit control information between the managed code module 1110 and the native code module 1120 .
[0078] Database system 10 is a database system that supports hybrid code modules. An instance of database system 110 is deployed on server 110, and client 120 accesses database system 10 deployed on server 110 via a control link and / or a data link. Database system 10 can be an online analytical database or an online transactional database. For example, database system 10 is an online analytical database designed to support complex aggregate query processing in multidimensional data analysis scenarios.
[0079] Server 110 is a physical or virtual computing node running database system 10. It includes hardware resources such as processors, memory, storage devices, and network interface cards, as well as software modules consisting of operating systems and database kernel components. For example, server 110 can be deployed in a cloud server cluster and receive distributed data requests from clients 120 through a load balancer.
[0080] Client 120 is the service requester for database system 10, communicating and interacting with the managed network service module 11110 and native network service module 11210 of server 110 via a control link and a data link, respectively. Client 120 submits data operation requests to server 110 and receives control responses and data results from the server. Client 120 supports protocol compatibility with server 110, adapting to the control protocol defined by managed code module 1110 and the data transmission protocol of native code module 1120 to ensure cross-code module request distribution and result reception. For example, client 120 submits query requests via the MySQL protocol control link and receives query result sets via the data link.
[0081] Managed code module 1110 is a managed language-based code module that performs network communication and protocol processing for the control link. It reuses its native protocol stack to handle connection management, authentication, and transaction control instructions for client 120. It also transmits control information with native code module 1120 via cross-module interface 1130. For example, a Java code module can run the MySQL Java driver to handle client-side SQL parsing and execution plan generation.
[0082] Native code module 1120 is a native language-based code module that performs data computation and network transmission of data links. For example, a C++ code module is deployed as a separate process and includes a C++ network service module and a Task computing unit. The C++ network service module directly calls the operating system kernel's zero-copy interface (e.g., sendfile) to transfer the data results generated by the Task computing unit from shared memory to client 120, avoiding cross-module data duplication.
[0083] Cross-module interface 1130 is the communication interface between managed code module 1110 and native code module 1120. It transmits control information (such as query plans and transaction status) but not data. Cross-module interface 1130 is implemented based on a cross-language calling mechanism (such as the Java native interface) and uses a lightweight serialization protocol (such as Protobuf) to transmit control instructions. For example, the Java code module serializes HTTP control information (such as GET, POST, and DELETE) into binary instructions through the Java native interface, triggering task scheduling in the C++ code module. However, it does not participate in data link copy operations.
[0084] The managed network service module 11110 is the network component within the managed code module 1110 that handles the control link. It reuses the managed language's protocol stack to achieve protocol compatibility with the client 120. Managed network service module 11110 is responsible for parsing client 120 requests, generating a logical execution plan, and triggering the data computation process in the native code module 1120 via the cross-module interface 1130. For example, the HTTP protocol service of the network service module (NetworkServer (For ControlMsg)) within the Java code module parses the SQL request from the client 120, generates a query execution plan, and passes it to the C++ code module via the Java native interface. The HTTP protocol service of the network service module within the Java code module also returns the transaction status (e.g., a successful submission response).
[0085] Native network service module 11210 is the network component within native code module 1120 that handles data links. It directly accesses the shared memory area of compute unit 11220 and transmits data to client 120 using zero-copy transmission technology. Native network service module 11210 is independent of the protocol stack of managed code module 1110, eliminating data copying and cross-module call overhead. For example, the HTTP protocol service of the network service module (NetworkServer (For DataMsg)) within the C++ code module directly reads data blocks from the shared memory of compute unit 11220 and transmits them to client 120 via HTTP, bypassing the Java Virtual Machine memory copy process and achieving zero copy.
[0086] Computation unit 11220 is the data processing engine within native code module 1120, performing query optimization, data scanning, and aggregation operations. Computation unit 11220 writes computation results to a shared memory area for direct access by native network service module 11210 and connects to external storage systems (such as distributed file systems) using storage connectors. For example, Task computation unit 11220 in the C++ module receives a query plan from the Java native interface, performs parallel data scanning and aggregation calculations, and writes the results to a memory-mapped file, which is then directly accessed by the network service module (NetworkServer (ForDataMsg)) in the C++ code module via a pointer.
[0087] Control information is metadata that guides the database system 10 in executing the request instruction logic, including but not limited to query plan instructions, transaction status identifiers, authentication credentials, connection management parameters, lock management signals, execution progress feedback, and resource scheduling strategies. Control information is typically generated by client 120 request parsing or triggered by changes in the system's internal state. It is used to drive the computational flow of computing units 11220 and maintain consistency across modules. For example, in a distributed query scenario, control information may include shard execution plans, node load weights, and fault-tolerant retry strategies, scheduling computing units 11220 to execute parallel tasks via cross-module interfaces.
[0088] Data information is a collection of data generated by the database system 10 in response to requests from the client 120. It can be persistent or transient and includes, but is not limited to, query result sets, aggregated statistics, index structures, log records, and data backup blocks. Data information is typically generated by the computing unit 11220 after performing operations based on control information and is stored in memory or persistent media in a structured or semi-structured format. For example, in an online analysis scenario, data information can be a statistical report after multi-dimensional aggregation, compressed and transmitted to the client in a columnar storage format.
[0089] It should be noted that control information is characterized by a small amount of data, but complex types, and diverse data acquisition methods. While its transmission has a minimal impact on performance, it requires significant compatibility workload and complexity. Data information is characterized by a large amount of data, relatively simple types, and simple data acquisition methods. This significantly impacts performance, but requires minimal compatibility workload and complexity.
[0090] Therefore, by using the existing cross-module transmission link, the managed network service module 11110 in the managed code module 1110 transmits control information, thus reusing the existing link and avoiding complex redevelopment. Since the amount of data in this part is small, it has little impact on performance and stability. By using the native network service module 11210 in the newly added native code module 1120 to transmit data information, the copying of large amounts of data is avoided, significantly improving performance and stability.
[0091] For control information transmission, one optional method is to transmit control information through synchronous function calls, for example, using Java native interfaces to serialize Java objects into binary instruction streams recognizable by C++; another optional method is to transmit control information asynchronously based on an inter-process communication mechanism, for example, passing control instructions through a shared memory queue; another optional method is to transmit control information through remote procedure calls (RPCs), for example, using remote procedure calls to transmit control information encapsulated as HTTP requests between Java and C++ processes, which is not limited here.
[0092] For data information transmission, one optional method is to directly read the data information in the memory-mapped file output by the computing unit 11220, for example, directly push the shared memory area data pointed to by the file descriptor to the network socket; another optional method is to use remote procedure calls to transmit data information, for example, use remote procedure calls to achieve memory-to-memory zero-copy transmission with the client 120, which is not limited here.
[0093] Access computing unit 11220 to obtain data information. One optional method is to directly operate the memory buffer of computing unit 11220 through pointer reference to obtain data information. For example, the C++ module holds the first address and length metadata of the data block output by the Task computing unit, reads it through the memory pointer and encapsulates it as an HTTP response body; another optional method is to use the memory or cache of computing unit 11220 to temporarily store data information, and pull the corresponding data information through the key-value query interface, which is not limited here.
[0094] For example, Figure 2 A schematic diagram of the structure of a database system of an analytical database provided in one embodiment of this specification is shown:
[0095] The server 110 of the database system 10 includes a Java code module, a C++ code module, and a Java native interface.
[0096] Among them, the Java code module includes a network service module for the control link, the C++ code module includes a network service module for the data link and a Task computing unit, and the cross-module interface is used for transmitting control information between the Java code module and the C++ code module.
[0097] The control link's network service module uses HTTP to transmit control information (such as GET, POST, and DEL) to and from the client. The data link's network service module uses HTTP to transmit data information (such as GET) to and from the client. The data link's network service module directly accesses the Task Computing Unit to obtain data information.
[0098] Control link:
[0099] Sending link: The client initiates the control sending instruction:
[0100] POST / status / 1001 HTTP / 1.1
[0101] The HTTP protocol service in the network service module of the control link in the Java code module receives the data. The network service module of the control link parses the SQL to generate a logical plan, encapsulates it into control sending instructions, and passes the control information to the Task computing unit of the C++ code module through the Java native interface.
[0102] Pull link:
[0103] Pull link: The client initiates a control pull instruction:
[0104] GET / status / 1001 HTTP / 1.1
[0105] The HTTP protocol service in the network service module of the control link in the Java code module receives the data. The network service module of the control link parses the SQL to generate a logical plan, encapsulates it into control pull instructions, and pulls control information from the Task computing unit of the C++ code module through the Java native interface.
[0106] Data Link:
[0107] Client 120 initiates a data pull instruction:
[0108] GET / data / 1001 HTTP / 1.1
[0109] The HTTP protocol service in the network service module of the control link in the C++ code module receives the data, the Task calculation unit of the C++ code module writes the aggregation result into the shared memory, and the network service module of the data link directly reads the shared memory and pushes the data information to the client 120.
[0110] In the embodiments of this specification, the network services of the control link and the data link are decoupled and deployed, realizing a differentiated processing mechanism for cross-module transmission. The managed network service module processes the control link based on the protocol stack of the original managed code module to ensure protocol compatibility with the client, while the native network service module independently takes over the data link transmission and directly accesses the data information generated by the native computing unit, bypassing the redundant copy operations of the cross-module interface. The architecture of this database system enables the data link to be directly transmitted to the client in a zero-copy manner in the native code module, significantly reducing memory usage and transmission delay. At the same time, the control link still reuses the mature protocol stack of the managed code module, avoiding the repeated development of the complex protocol stack and interface of the native code module, thereby achieving a balance between development cost, compatibility guarantee and transmission performance.
[0111] In an optional embodiment of the present specification, the hosted network service module 11110 is specifically configured to receive control information sent by the client 120 and transmit the control information to the native code module 1120 via the cross-module interface 1130 ;
[0112] The computing unit 11220 is configured to update the running state of the native code module 1120 based on the control information.
[0113] The running state of the native code module 1120 is the dynamic context of the database system 10 when executing data computing tasks, including but not limited to: Task Execution Progress (TEP), resource usage status (such as CPU / memory occupancy), Transaction Lock Status (TLS), Data Sharding Distribution (DSD), and Fault Recovery Flag (FRF). The running state is synchronized in real time through control information to ensure consistency and transaction integrity across modules. For example, in a distributed aggregation query, the running state includes the data scanning progress of each node and the intermediate result cache address, which is used to coordinate the global aggregation logic.
[0114] Based on the control information, the running status of the native code module 1120 is updated. One optional method is: converting the control information into an operation instruction executable by the native computing unit through the Command Parser Engine (CPE), executing the operation instruction to update the running status of the native code module 1120, for example, deserializing the JSON format control instruction passed in by the Java native interface into a C++ structure to trigger the task scheduling of the Task computing unit; another optional method is: based on the State Synchronization Protocol (SSP), writing the control information directly into the status register of the native code module 1120, reading the value of the status register to update the running status of the native code module 1120, for example, mapping the state variable through the shared memory area to realize atomic state update, which is not limited here.
[0115] For example, Figure 3 FIG. 1 shows one of the flow diagrams of a database system of an analytical database provided by an embodiment of this specification, such as Figure 3 As shown:
[0116] The server 110 of the database system 10 includes a Java code module, a C++ code module, and a Java native interface.
[0117] Among them, the Java code module includes a network service module for the control link, the C++ code module includes a network service module for the data link and a Task computing unit, and the cross-module interface is used for transmitting control information between the Java code module and the C++ code module.
[0118] The network service module of the control link uses HTTP protocol services to complete the transmission of control information (GET, POST, DEL, etc.) with the client.
[0119] Control link sending link: The client initiates the control sending instruction:
[0120] POST / status / 1001 HTTP / 1.1
[0121] The HTTP protocol service in the network service module of the control link in the Java code module receives the data. The network service module of the control link parses the SQL to generate a logical plan, encapsulates it into control sending instructions, and passes the control information to the Task computing unit of the C++ code module through the Java native interface.
[0122] In the embodiments of this specification, the control link and the data link are decoupled. On the basis of reusing the existing links to ensure protocol compatibility, the control information is accurately sent through the cross-module interface to avoid complex repeated development and redundant data copying, significantly reduce the communication overhead of the database system, and improve the data transmission efficiency and accuracy.
[0123] In an optional embodiment of the present specification, the hosted network service module 11110 is specifically used to receive a pull request for control information sent by the client 120, obtain the control information corresponding to the pull request from the computing unit 11220 through the cross-module interface 1130, and return the control information to the client 120.
[0124] Pull requests for control information are requests from client 120 to query database system 10 for control information, including but not limited to querying task progress, requesting resource monitoring, checking transaction lock status, and obtaining fault-tolerance recovery progress. Pull requests are initiated via a standardized control link protocol (e.g., HTTP GET), triggering managed network service module 11110 to synchronize control information from native code module 1120. For example, a client sends the GET / task / 1001 / progress command to request the execution progress of a specific task.
[0125] The control information corresponding to the pull request is metadata in the native code module 1120 that matches the request instruction parameters of the pull request. For example, in response to a GET / task / 1001 / progress request, the control information returned is in JSON format: task ID: "1001", execution progress: 75%, CPU usage: 62%.
[0126] The control information corresponding to the pull request is obtained from the computing unit 11220 through the cross-module interface 1130. One optional method is: the control information is transmitted through a synchronous function call, and the control information corresponding to the pull request is obtained from the computing unit 11220 through the cross-module interface 1130. Another optional method is: based on the inter-process communication mechanism, the control information corresponding to the pull request is asynchronously obtained from the computing unit 11220 through the cross-module interface 1130. Another optional method is: using a remote procedure call, the control information corresponding to the pull request is obtained from the computing unit 11220 through the cross-module interface 1130, which is not limited here.
[0127] For example, Figure 4 FIG2 shows a second flow diagram of a database system of an analytical database provided by an embodiment of this specification. Figure 4 As shown:
[0128] The server 110 of the database system 10 includes a Java code module, a C++ code module, and a Java native interface.
[0129] Among them, the Java code module includes a network service module for the control link, the C++ code module includes a network service module for the data link and a Task computing unit, and the cross-module interface is used for transmitting control information between the Java code module and the C++ code module.
[0130] The network service module of the control link completes the transmission of control information (GET, POST, DEL, etc.) with the client 120 through HTTP protocol services.
[0131] Pull link of the control link: Client 120 initiates a control pull instruction:
[0132] GET / status / 1001 HTTP / 1.1
[0133] The HTTP protocol service in the network service module of the control link in the Java code module receives the data. The network service module of the control link parses the SQL to generate a logical plan, encapsulates it into control pull instructions, and pulls control information from the Task computing unit of the C++ code module through the Java native interface.
[0134] In the embodiments of this specification, the control link and the data link are decoupled. On the basis of reusing the existing links to ensure protocol compatibility, the control information is accurately pulled through the cross-module interface to avoid complex repeated development and redundant data copying, significantly reducing the communication overhead of the database system and improving the data transmission efficiency and accuracy.
[0135] In an optional embodiment of the present specification, the native network service module 11210 is specifically used to receive a pull request for data information sent by the client 120, access the computing unit 11220 to obtain the data information corresponding to the pull request, and return the data information to the client 120.
[0136] A pull request for data information is an instruction from client 120 requesting access to a persistent or temporarily stored data set in database system 10, including but not limited to: query result set fetch (QRSF), aggregated statistics request (ASR), log record read (LRR), and data backup block download (DBBD). Pull requests are initiated via a standardized data link protocol (e.g., HTTP GET), triggering native network service module 11210 to synchronize data information from computing unit 11220. For example, client 120 sends the GET / data / query_result_1001 instruction to request the query result set identified as "query_result_1001."
[0137] The data corresponding to the pull request is the data set in native code module 1120 that matches the request instruction parameters. It can be structured or semi-structured data. For example, in response to the GET / data / query_result_1001 request, the query result set returned includes fields such as user ID, transaction amount, and timestamp, such as: User ID: "U001", Transaction Amount: 1500, Timestamp: "2023-10-01 09:30:00".
[0138] Access computing unit 11220 to obtain data information corresponding to the pull request. One optional method is to directly operate the memory buffer of computing unit 11220 through pointer reference to obtain data information corresponding to the pull request. Another optional method is to use the memory or cache of computing unit 11220 to temporarily store data information, and pull the data information corresponding to the pull request through the key-value query interface. This is not limited here.
[0139] For example, Figure 5 The third flow chart of a database system of an analytical database provided by an embodiment of this specification is shown as follows: Figure 5 As shown:
[0140] The server 110 of the database system 10 includes a Java code module, a C++ code module, and a Java native interface.
[0141] Among them, the Java code module includes a network service module for the control link, the C++ code module includes a network service module for the data link and a Task computing unit, and the cross-module interface is used for transmitting control information between the Java code module and the C++ code module.
[0142] The network service module of the data link uses HTTP protocol services to complete data information (GET, etc.) transmission between the client 120. The network service module of the data link directly accesses the Task computing unit to obtain data information.
[0143] Data Link:
[0144] Client 120 initiates a data pull instruction:
[0145] GET / data / 1001 HTTP / 1.1
[0146] The HTTP protocol service in the network service module of the control link in the C++ code module receives the data, the Task calculation unit of the C++ code module writes the aggregation result into the shared memory, and the network service module of the data link directly reads the shared memory and pushes the data information to the client 120.
[0147] In the embodiments of this specification, the control link and the data link are decoupled, and the network service module of the data link is deployed in the native code module, which not only avoids the risks and compatibility issues of the process-level replacement solution, but also avoids the performance and stability problems caused by the cross-module interface copying of large amounts of data.
[0148] In an optional embodiment of this specification, the managed network service module 11110 and the native network service module 11210 are respectively deployed on independent ports in the database system 10;
[0149] The client 120 accesses the control information by connecting to the port of the managed network service module 11110;
[0150] The client 120 accesses data information by connecting to the port of the native network service module 11210 .
[0151] A port is a logical endpoint for network communication, used to identify the access address of different network service modules in server 110. Each port is bound to a specific protocol (such as HTTP / HTTPS) and code module (Java / C++). Port numbers are assigned or predefined by the operating system to ensure that ports of multiple service modules within the same process do not conflict with each other.
[0152] The port of the managed network service module 11110 is the logical address of the managed code module 1110 providing external control link services, such as the HTTP service binding port 8080 of the Java code module, which is used to process the control information transmission of the client 120 (such as connection management, SQL parsing).
[0153] The port of the native network service module 11210 is the logical address of the native code module 1120 providing external data link services, such as the HTTP service binding port 8081 of the C++ code module, which is used to process data information transmission of the client 120 (such as query result set push).
[0154] Illustratively, in the server side of the database system, the network service module (NetworkServer For ControlMsg) of the control link of the Java code module is bound to port 8080, and the network service module (NetworkServer For DataMsg) of the data link of the C++ code module is bound to port 8081.
[0155] The client 120 selects a target port based on the upstream task type:
[0156] If the upstream is a Java task, the client sends a control request (such as POST / query) to port 8080, and the network service module of the control link handles SQL parsing and task scheduling;
[0157] If the upstream is a Native task, the client 120 sends a data pull request (e.g., GET / data / 1001) to port 8081, and the network service module of the data link directly returns the result set from the shared memory.
[0158] In the embodiments of this specification, a service binding mechanism is implemented through port separation, and dynamic routing is achieved by clarifying the mapping relationship between network transmission tasks and ports in the planning stage, taking into account protocol compatibility, development cost control and high-throughput transmission, and achieving performance and stability optimization in a hybrid architecture database system.
[0159] In an optional embodiment of the present specification, the client 120 connects to the port of the corresponding network service module to access data in the current computing phase according to the data service port information of the upstream computing phase in the current process;
[0160] If the data service port information of the upstream computing stage is executed in the managed code module 1110, the client 120 accesses the control information of the current computing stage by connecting to the port of the managed network service module 11110;
[0161] Among them, if the data service port information of the upstream calculation stage is executed in the native code module 1120, the client 120 accesses the data information of the current calculation stage by connecting to the port of the native network service module 11210.
[0162] The current process is an independent running instance in database system 10 that performs a specific computing task. It consists of one or more computing stages, each corresponding to a logical unit in the data processing flow (such as data scanning, filtering, and aggregation). The process completes end-to-end operations through the coordination of control links and data links. For example, in a distributed aggregation query, the current process may include three stages: "shard scanning," "intermediate aggregation," and "global rollup."
[0163] The upstream computation stage is the logical unit of preceding data processing that the current computation stage relies on, and its output serves as the input for the current stage. For example, in a pipelined query, the "shard scan" stage is upstream of the "intermediate aggregation" stage, providing raw data shards for aggregation processing.
[0164] The current computation stage is a logical unit of data processing being performed. Its input depends on the output of upstream computation stages and may produce intermediate or final results required by downstream stages. For example, the "intermediate aggregation" stage receives sharded data and generates local statistics for further processing in the "global summary" stage.
[0165] The data service port information for a computation phase is the identifier of the network service port bound to that computation phase, used to indicate the logical endpoint of the access control or data link for client 120. For example, if the current phase is executed by a Java module, its port information is 8080; if it is executed by a C++ module, it is 8081. Port information is registered as a phase attribute during the planning phase for dynamic routing during the execution phase.
[0166] The control information for the current computation phase is the metadata that drives the execution of that computation phase, including but not limited to: task identification, resource configuration, and execution strategy (such as parallelism and fault tolerance). For example, the control information might include "maximum number of threads = 4" to limit concurrent resources in the aggregation phase.
[0167] The data information of the current calculation stage is the data collection result after the processing of this stage is completed, for example, the local statistical values (such as SUM, AVG) generated in the "intermediate aggregation" stage, or the final report of the "global summary" stage.
[0168] For example, during the planning phase:
[0169] The current process includes three computing stages: shard scanning (Stage 1), intermediate aggregation (Stage 2), and global summary (Stage 3).
[0170] Make sure that Stage 1 and Stage 3 are executed by the Java module (port 8080), and Stage 2 is executed by the C++ module (port 8081).
[0171] Register the port attributes of each stage: Stage1→8080, Stage2→8081, Stage3→8080.
[0172] Execution phase:
[0173] Stage 1 (Java) receives control instructions from port 8080, scans the data shards, and writes the intermediate results to the shared memory.
[0174] Stage 2 (C++) reads data from shared memory and performs aggregation based on the binding information of port 8081, and returns the results through port 8081.
[0175] Stage 3 (Java) pulls the results of Stage 2 through port 8080, completes the global summary and returns it to the client.
[0176] In the embodiments of this specification, during execution, the client is dynamically routed to the target service according to the upstream stage port to achieve accurate connection and data access. Through the dynamic service binding mechanism, the code modules and port mappings of each computing stage are clearly defined in the planning stage to achieve accurate dynamic routing and resource isolation.
[0177] In an optional embodiment of the present specification, data service port information of multiple computing stages in the current process is registered by performing a compatibility check to determine the execution modes of the multiple computing stages.
[0178] Compatibility checking is a process for evaluating the adaptability of code modules in the computing phase. Through multi-dimensional feature matching and resource constraint analysis, it determines the optimized execution modules for each phase and completes the dynamic binding of network service ports. Optionally, compatibility checking can be performed based on the following dimensions: 1. Computational feature analysis, for example, identifying whether the phase contains high-throughput operations such as vectorized calculations and columnar aggregation, and giving priority to assigning them to the native code module 1120; 2. Protocol dependency detection, for example, verifying whether the Java serialization interface or the MySQL protocol adaptation layer needs to be called in the verification phase, and retaining such phases in the managed code module 1110; 3. Resource isolation evaluation, for example, for phases where memory usage exceeds a threshold or requires exclusive GPU resources, forcing registration to the native code module 1120 for execution.
[0179] For example, a compatibility check is performed based on the operator type and resource requirements of the computation phase. If the computation phase involves intensive computational operations or requires zero-copy transmission, it is marked as executed by a native code module and associated with the port of the native network service module 11210. If the computation phase relies on a managed protocol stack or storage connector interface, it is marked as executed by a managed code module and associated with the port of the managed network service module 11110. The port binding information is registered as a phase attribute in the execution plan, providing dynamic routing connections for downstream phases.
[0180] In the embodiments of this specification, a multi-dimensional compatibility check mechanism is used to accurately divide the execution modules and network service ports of each computing stage in the planning stage, thereby realizing hybrid scheduling of native execution of performance-sensitive tasks and managed execution of protocol-dependent tasks.
[0181] In an optional embodiment of the present specification, the client 120 determines the data service port information of the upstream computing stage in the current process by querying the registration information of the current computing stage.
[0182] The registration information for the current computation stage is a collection of stage attributes recorded in the execution plan. This information can include the following metadata fields: Stage ID: a string or numeric value uniquely identifying the computation stage; Code Module Type: a value indicating whether the stage's execution module is Java or Native; Port Number: the network service port bound to the stage (e.g., 8080 or 8081); and Upstream Dependency List: a table of stage IDs and corresponding port mappings pointing to all preceding stages.
[0183] For example, in a distributed aggregation query scenario, when executing planned metadata and Stage_03, client 120 queries its upstream dependency as Stage_02@8081. According to the registration information of Stage_02, client 120 initiates a data pull request to port 8081 (such as GET / data / agg_result). The C++ network service module returns the aggregation result through port 8081, and client 120 continues to submit the final result after sorting through port 8080.
[0184] In the embodiments of this specification, by dynamically parsing the registration information in the execution plan, the client can accurately locate the service port of the upstream stage and achieve seamless data routing across modules.
[0185] In an optional embodiment of the present specification, the upstream and downstream relationships of the multiple computing stages are determined by dividing the multiple computing stages in the current process using an optimizer.
[0186] The optimizer is a logical component within database system 10 that optimizes process execution plans. It parses query semantics, analyzes data distribution and resource constraints, and applies rule-based reasoning and cost models to select optimization phase division strategies. The optimizer implements phase division based on the following core capabilities: 1. Mapping logical operators to physical operators: This converts abstract query operations into concrete computational phases (e.g., hash joins, sorting and aggregation); 2. Dependency analysis: This identifies data flow and order constraints between phases and constructs directed edge connections; and 3. Parallelism decision-making: This determines the parallel granularity of phase execution based on cluster resources and data sharding.
[0187] Use the optimizer to divide the current process into multiple computing stages. One optional method is to use the optimizer to divide the current process into multiple computing stages to form a directed acyclic graph. According to the directed acyclic graph, the upstream and downstream relationships of the multiple computing stages are determined. Another optional method is to split the computing stages into subtask groups based on resource constraints and data locality, and optimize the dependencies between subtasks through a dynamic programming algorithm. There is no limitation here.
[0188] For example, the optimizer parses the SQL statement SELECT SUM(revenue) FROM sales GROUP BY region into a logical plan, which includes three stages: full table scan (Scan), group aggregation (Aggregate), and result sorting (Sort).
[0189] The full table scan phase is split into shard scan subtasks and bound to the node where the data is located; the grouping and aggregation phase is hashed by the region field to generate local aggregation tasks; the result sorting phase merges the local aggregation results and performs a global sort.
[0190] Construct a directed acyclic graph:
[0191] Scan_Shard1 → LocalAgg_RegionA → GlobalSort
[0192] Scan_Shard2 → LocalAgg_RegionB → GlobalSort
[0193] The full table scan and result sorting phases rely on the Java protocol stack and are bound to port 8080. The group aggregation phase uses native computing and is bound to port 8081.
[0194] In the embodiments of this specification, efficient orchestration of computing stages and optimized resource allocation are achieved through phase division of the optimizer, thereby improving the performance of the database system.
[0195] Corresponding to the above database system embodiment, this specification also provides a data transmission method embodiment. Figure 6 A flowchart of a data transmission method provided by one embodiment of this specification is shown, which is applied to the above-mentioned database system. The method includes the following specific steps:
[0196] Step 602: calling the managed network service module to receive control information sent by the client, wherein the control information is metadata that instructs the database system to execute the request instruction logic.
[0197] Step 604: Call the managed network service module and transmit the control information to the native code module through the cross-module interface.
[0198] Step 606: Call the managed network service module and update the running status of the native code module based on the control information through the computing unit.
[0199] In the embodiments of this specification, the control link and the data link are decoupled. On the basis of reusing the existing links to ensure protocol compatibility, the control information is accurately sent through the cross-module interface to avoid complex repeated development and redundant data copying, significantly reduce the communication overhead of the database system, and improve the data transmission efficiency and accuracy.
[0200] The above is a schematic scheme of a data transmission method of this embodiment. It should be noted that the technical scheme of this data transmission method and the technical scheme of the above-mentioned database system are of the same concept. For details not described in detail in the technical scheme of the data transmission method, please refer to the description of the technical scheme of the above-mentioned database system.
[0201] Corresponding to the above database system embodiment, this specification also provides a data transmission method embodiment. Figure 7 The second flowchart of a data transmission method provided by one embodiment of this specification is shown and is applied to the above-mentioned database system. The method includes the following specific steps:
[0202] Step 702: calling the managed network service module to receive a pull request for control information sent by the client, wherein the control information is metadata that instructs the database system to execute the request instruction logic.
[0203] Step 704: Call the managed network service module to obtain control information corresponding to the pull request from the computing unit through the cross-module interface.
[0204] Step 706: Call the managed network service module and return the control information to the client.
[0205] In the embodiments of this specification, the control link and the data link are decoupled. On the basis of reusing the existing links to ensure protocol compatibility, the control information is accurately pulled through the cross-module interface to avoid complex repeated development and redundant data copying, significantly reducing the communication overhead of the database system and improving the data transmission efficiency and accuracy.
[0206] The above is a schematic scheme of a data transmission method of this embodiment. It should be noted that the technical scheme of this data transmission method and the technical scheme of the above-mentioned database system are of the same concept. For details not described in detail in the technical scheme of the data transmission method, please refer to the description of the technical scheme of the above-mentioned database system.
[0207] Corresponding to the above database system embodiment, this specification also provides a data transmission method embodiment. Figure 8The third flowchart of a data transmission method provided by one embodiment of this specification is shown and is applied to the above-mentioned database system. The method includes the following specific steps:
[0208] Step 802: calling the native network service module to receive a pull request for data information sent by the client, wherein the data information is a data set generated by the database system in response to the client request.
[0209] Step 804: Call the native network service module and access the computing unit to obtain data information corresponding to the pull request.
[0210] Step 806: Call the native network service module and return the data information to the client.
[0211] In the embodiments of this specification, the control link and the data link are decoupled, and the network service module of the data link is deployed in the native code module, which not only avoids the risks and compatibility issues of the process-level replacement solution, but also avoids the performance and stability problems caused by the cross-module interface copying of large amounts of data.
[0212] The above is a schematic scheme of a data transmission method of this embodiment. It should be noted that the technical scheme of this data transmission method and the technical scheme of the above-mentioned database system are of the same concept. For details not described in detail in the technical scheme of the data transmission method, please refer to the description of the technical scheme of the above-mentioned database system.
[0213] Corresponding to the above database system embodiment, this specification also provides a data transmission method embodiment. Figure 9 A fourth flowchart of a data transmission method provided by an embodiment of this specification is shown. The method includes the following specific steps:
[0214] Step 902: Use the optimizer to divide the multiple calculation stages in the current process and determine the upstream and downstream relationships of the multiple calculation stages.
[0215] Step 904: Perform compatibility checks on multiple computing stages to determine whether each computing stage is executed in a managed code module or a native code module in a server of a database system, wherein the database system is the aforementioned database system.
[0216] Step 906: Register data service port information of multiple computing stages according to the execution mode.
[0217] Step 908: Register the data service port information of the upstream computing stage of each computing stage into the current computing stage, so that when the current computing stage is executed in the computing stage, it connects to the corresponding hosted network service module port or native network service module port according to the data service port information of the registered upstream computing stage to complete data access control.
[0218] In the embodiments of this specification, not only are the control link and the data link decoupled, but also during specific network data routing, the network service ports adapted to the upstream and downstream computing stages are automatically selected for network transmission based on the optimized division and registration of the upstream and downstream computing stages, and accurate routing decisions are achieved through a dynamic service binding mechanism.
[0219] The above is a schematic scheme of a data transmission method of this embodiment. It should be noted that the technical scheme of this data transmission method and the technical scheme of the above-mentioned database system are of the same concept. For details not described in detail in the technical scheme of the data transmission method, please refer to the description of the technical scheme of the above-mentioned database system.
[0220] Figure 10 1000 is a block diagram of a computing device according to an embodiment of the present disclosure. Components of the computing device 1000 include, but are not limited to, a memory 1010 and a processor 1020. The processor 1020 is connected to the memory 1010 via a bus 1030, and a database 1050 is used to store data.
[0221] Computing device 1000 also includes an access device 1040 that enables computing device 1000 to communicate via one or more networks 1060. Examples of such networks include a Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the Internet. Access device 1040 may include one or more of any type of wired or wireless network interface (e.g., a Network Interface Controller (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, or a Near Field Communication (NFC) interface.
[0222] In one embodiment of the present specification, the above components of the computing device 1000 and Figure 10 Other components not shown in the figure may also be connected to each other, for example, via a bus. Figure 10 The computing device structure block diagram shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art may add or replace other components as needed.
[0223] Computing device 1000 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, personal digital assistant, laptop computer, notebook computer, netbook computer, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or personal computer (PC). Computing device 1000 can also be a mobile or stationary server.
[0224] The processor 1020 is configured to execute the following computer program / instruction, which implements the steps of the above-mentioned data transmission method when executed by the processor.
[0225] The above is a schematic solution of a computing device of this embodiment. It should be noted that the technical solution of the computing device and the technical solution of the above-mentioned data transmission method are of the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the above-mentioned data transmission method.
[0226] An embodiment of the present specification further provides a computer-readable storage medium storing a computer program / instruction, which implements the steps of the above-mentioned data transmission method when executed by a processor.
[0227] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned data transmission method are based on the same concept. For details not described in detail in the technical scheme of the storage medium, please refer to the description of the technical scheme of the above-mentioned data transmission method.
[0228] An embodiment of the present specification further provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned data transmission method when executed by a processor.
[0229] The above is an illustrative solution of a computer program product of this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the above-mentioned data transmission method are based on the same concept. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solution of the above-mentioned data transmission method.
[0230] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0231] The computer instructions include computer program code, which may be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium may include any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signals, telecommunication signals, and software distribution media. It should be noted that the content of the computer-readable medium may be appropriately increased or decreased based on the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media does not include electric carrier signals and telecommunication signals.
[0232] It should be noted that for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0233] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0234] The preferred embodiments disclosed above are intended only to help illustrate this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made based on the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that those skilled in the art can better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. A database system, wherein the server of the database system comprises: A managed code module, including a managed network service module, wherein the managed network service module is used to transmit control information to and from a client, wherein the control information is metadata that directs the database system to execute request instruction logic; A native code module, comprising a native network service module and a computing unit, wherein the native network service module is used to transmit data information to and from a client, and to access the computing unit to obtain data information, wherein the data information is a data set generated by the database system in response to a client request; The cross-module interface is used for transmitting control information between the managed code module and the native code module.
2. The database system according to claim 1, wherein the hosted network service module is specifically configured to receive control information sent by a client and transmit the control information to the native code module through the cross-module interface; The computing unit is configured to update the running state of the native code module based on the control information.
3. According to the database system of claim 1, the hosted network service module is specifically used to receive a pull request for control information sent by a client, obtain control information corresponding to the pull request from the computing unit through the cross-module interface, and return the control information to the client.
4. According to the database system of claim 1, the native network service module is specifically used to receive a pull request for data information sent by a client, access the computing unit to obtain data information corresponding to the pull request, and return the data information to the client.
5. The database system according to any one of claims 1 to 4, wherein the managed network service module and the native network service module are respectively deployed on independent ports in the database system; in, The client accesses the control information by connecting to the port of the managed network service module; The client accesses data information by connecting to the port of the native network service module.
6. The database system according to claim 5, wherein the client connects to the port of the corresponding network service module to access the data of the current computing stage according to the data service port information of the upstream computing stage in the current process; in, If the data service port information of the upstream computing stage is executed in a hosted code module, the client accesses the control information of the current computing stage by connecting to the port of the hosted network service module; Among them, if the data service port information of the upstream calculation stage is executed in the native code module, the client accesses the data information of the current calculation stage by connecting to the port of the native network service module.
7. The database system according to claim 6, wherein: The data service port information of the multiple computing stages in the current process is registered by determining the execution mode of the multiple computing stages through a compatibility check.
8. The database system according to claim 7, wherein the client determines the data service port information of the upstream computing stage in the current process by querying the registration information of the current computing stage.
9. The database system according to claim 5, wherein: The upstream and downstream relationships of multiple computing stages are determined by dividing the multiple computing stages in the current process using an optimizer.
10. A data transmission method, applied to the database system according to any one of claims 1 to 9, the method comprising: Invoking the managed network service module to receive control information sent by the client, wherein the control information is metadata for directing the database system to execute request instruction logic; calling the managed network service module and transmitting the control information to the native code module through the cross-module interface; The hosted network service module is called, and the running state of the native code module is updated based on the control information through the computing unit.
11. A data transmission method, applied to the database system according to any one of claims 1 to 9, the method comprising: Invoking the hosted network service module to receive a pull request for control information sent by a client, wherein the control information is metadata that instructs the database system to execute request instruction logic; calling the managed network service module to obtain control information corresponding to the pull request from the computing unit through the cross-module interface; The managed network service module is called to return the control information to the client.
12. A data transmission method, applied to the database system according to any one of claims 1 to 9, the method comprising: Calling the native network service module to receive a pull request for data information sent by a client, wherein the data information is a data set generated by the database system in response to the client request; Calling the native network service module to access the computing unit to obtain data information corresponding to the pull request; The native network service module is called to return the data information to the client.
13. A database system configuration method, comprising: Using an optimizer to divide multiple calculation stages in the current process and determine upstream and downstream relationships between the multiple calculation stages; Performing a compatibility check on the multiple computing stages to determine whether each computing stage is executed as a managed code module or a native code module in a server of a database system, wherein the database system is the database system according to any one of claims 1 to 9; registering data service port information of the plurality of computing stages according to the execution mode; The data service port information of the upstream computing stage of each computing stage is registered in the current computing stage, so that when the current computing stage is executed in the computing stage, it is connected to the corresponding hosted network service module port or native network service module port according to the data service port information of the registered upstream computing stage to complete data access control.
14. A computing device comprising: memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer program / instructions are executed by the processor, the steps of the method according to any one of claims 10 to 13 are implemented.
15. A computer-readable storage medium storing a computer program / instruction, wherein the computer program / instruction is executed by a processor to implement the steps of the method according to any one of claims 10 to 13.
16. A computer program product comprising a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 10 to 13.
Citation Information
Patent Citations
Pluggable visitor language database modularization
CN114341831A
Cloud-native workload optimization
US20230106228A1