Data vectorization acceleration method and system

By introducing optimizer rules and a vectorized execution engine into the Apache Flink framework, the problem of Flink failing to fully utilize hardware resources in batch processing mode was solved, thereby improving computational performance and resource utilization and adapting to the high-performance requirements of large-scale data processing.

CN120653308BActive Publication Date: 2026-11-27ZTE CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510675754.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2026-11-27
Estimated Expiration
2045-05-23

AI Technical Summary

Technical Problem

The existing Apache Flink framework fails to fully utilize the instruction set and vectorized hardware resources in batch mode, resulting in low computational efficiency and limiting its application in high-performance computing applications.

Method used

By introducing optimizer rules, vectorized execution operators, and a vectorized execution engine into the Apache Flink framework, optimizer rules are used to identify and fuse operators, and vectorized execution operators call the vectorized execution engine through the JNI bridge to accelerate data vectorization. Combined with adaptive memory management and fallback mechanisms, computational performance and resource utilization are improved.

Benefits of technology

It significantly improves Flink's computing performance and resource utilization, enhances its adaptability to complex data processing tasks, and meets the high-performance requirements of large-scale data processing and real-time analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120653308B_ABST
    Figure CN120653308B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a data vectorization acceleration method and system, the method comprises the following steps: writing an optimizer rule into an optimizer, fusing original operators in a first operator rule and a second operator rule respectively with replacement operators matched by the first operator rule and the second operator rule respectively according to the optimizer rule, to obtain a vectorization fusion operator; converting the vectorization fusion operator into a vectorization execution operator according to a conversion logic, so that the vectorization execution operator calls a vectorization execution engine through a local interface JNI bridge to perform data vectorization acceleration. Therefore, the embodiment of the application can solve the problem that the existing Flink framework cannot fully utilize instruction set and vectorization hardware resources in the batch processing mode, resulting in low calculation efficiency in large-scale data processing scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing, and more specifically, to a data vectorization acceleration method and system. Background Technology

[0002] With the rapid development of IoT technology and the rapid growth of data volume, big data processing technology has become crucial for solving the problem of massive data storage and analysis. Against this backdrop, vectorization technology utilizes the SIMD (Single Instruction Multiple Data) instruction set to achieve parallel data processing. However, when faced with large-scale batch processing tasks, traditional batch processing vectorization technologies mostly focus on the Spark framework. Especially for applications requiring high throughput and low latency, they heavily rely on the Spark framework during batch processing, lacking the ability to decouple from other computing platforms.

[0003] Meanwhile, distributed computing frameworks (such as Apache Flink) are powerful distributed data processing engines, and are mainly used for real-time batch processing tasks due to their excellent stream processing and real-time analysis capabilities. However, the existing Flink does not fully support vectorization technology in batch processing mode, and cannot make full use of vectorization hardware resources, which limits the application of Flink under high-performance computing requirements.

[0004] In summary, no effective solution has yet been proposed in the relevant technologies. Summary of the Invention

[0005] This application provides a data vectorization acceleration method and system to at least solve the problem that the existing Flink framework fails to fully utilize instruction set and vectorization hardware resources in batch processing mode, resulting in low computational efficiency in large-scale data processing scenarios.

[0006] According to one embodiment of this application, a data vectorization acceleration method is provided, comprising: writing optimizer rules into an optimizer, wherein the optimizer rules include a first operator rule and a second operator rule; according to the optimizer rules, fusing the original operators in the first operator rule and the second operator rule with the replacement operators matched by the first operator rule and the second operator rule respectively to obtain a vectorized fusion operator; and converting the vectorized fusion operator into a vectorized execution operator according to transformation logic, so that the vectorized execution operator calls the vectorized execution engine through the local interface JNI bridge to accelerate data vectorization.

[0007] According to another embodiment of this application, a data vectorization acceleration system is provided, comprising: an optimizer module, configured to fuse the original operators in a first operator rule and a second operator rule with the replacement operators matched in the first operator rule and the second operator rule, respectively, according to the optimizer rules, to obtain a vectorized fusion operator, wherein the optimizer rules include the first operator rule and the second operator rule; a vectorized execution operator, configured to call a vectorized execution engine through a JNI bridge to perform data vectorization acceleration; a vectorized execution engine, configured to receive the call from the JNI bridge and perform data vectorization acceleration; and a vectorization converter, configured to convert the physical plan applied to the current data processing into a local execution plan.

[0008] According to yet another embodiment of this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and the computer program is configured to perform the steps in any of the above method embodiments when it is run.

[0009] According to yet another embodiment of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in the above method embodiments.

[0010] According to yet another embodiment of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0011] The above embodiments of this application provide a data vectorization acceleration method. Optimizer rules are written into the optimizer, including first operator rules and second operator rules. According to the optimizer rules, the original operators in each of the first and second operator rules are fused with their respective matched replacement operators to obtain a vectorized fusion operator. The vectorized fusion operator is then converted into a vectorized execution operator according to transformation logic, enabling the vectorized execution operator to call the vectorized execution engine through the JNI bridge for data vectorization acceleration. In other words, by introducing core technologies such as optimizer rules, vectorized execution operators, and a vectorized execution engine, the performance of Flink-based batch processing is optimized, fully utilizing vectorized hardware resources to meet the high-efficiency requirements of large-scale data processing. Therefore, the embodiments of this application can solve the problem that existing Flink frameworks fail to fully utilize instruction sets and vectorized hardware resources in batch processing mode, resulting in low computational efficiency in large-scale data processing scenarios, thus improving Flink's computational efficiency and resource utilization. Attached Figure Description

[0012] Figure 1 This is a hardware structure block diagram of a computer terminal for a data vectorization acceleration method according to an embodiment of this application;

[0013] Figure 2 This is a system architecture block diagram of the runtime data vectorization acceleration method according to an embodiment of this application;

[0014] Figure 3 This is a flowchart of a data vectorization acceleration method according to an embodiment of this application;

[0015] Figure 4 This is a flowchart illustrating a data vectorization acceleration method according to an embodiment of this application;

[0016] Figure 5 This is a schematic diagram of operator fusion for a data vectorization acceleration method according to an embodiment of this application;

[0017] Figure 6 This is a structural block diagram of a data vectorization acceleration system according to an embodiment of this application. Detailed Implementation

[0018] The embodiments of this application will be described in detail below with reference to the accompanying drawings and examples.

[0019] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0020] This application's embodiments include, but are not limited to, support for the following operating systems: CentOS 7, Windows 10 & 11, and MacOS M1.

[0021] The methods and embodiments provided in this application can be executed on a mobile terminal, a computer terminal, or a similar computing device. Taking running on a computer terminal as an example, Figure 1 This is a hardware structure block diagram of a computer terminal according to the data vectorization acceleration method of this application. For example... Figure 1 As shown, a computer terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the computer terminal described above. For example, the computer terminal may also include components that are more complex than those described above. Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0022] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the data vectorization acceleration method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thus implementing the above-described method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0023] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the computer terminal. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0024] Currently, most traditional batch processing vectorization acceleration techniques focus on the Spark framework, such as MT Spark. These techniques utilize the SIMD (Single Instruction Multiple Data) instruction set of the CPU (Central Processing Unit) to achieve parallel processing of large-scale data. However, they are highly dependent on the Spark framework during batch processing and lack decoupling capabilities from other computing platforms. Meanwhile, for Apache Flink, vectorization acceleration techniques in batch processing mode are still in the exploratory and early development stages, failing to fully utilize the CPU's instruction set and vectorization hardware resources, thus limiting Flink's application potential in high-performance computing scenarios.

[0025] Existing Flink data processing solutions often focus on the real-time performance of streaming computing, while in batch processing tasks, how to improve computing performance and resource utilization has become a major problem that urgently needs to be solved.

[0026] In view of the above problems, this application proposes a data vectorization acceleration system based on the Apache Flink framework. A new optimizer rule injection technology enables Flink's optimizer to automatically identify and generate vectorized operators, ensuring the effective application of data vectorization acceleration in the execution plan. By integrating vectorized execution operators, the system fully utilizes the CPU's SIMD instruction set to achieve parallel processing of batch data, thereby significantly improving computational efficiency and throughput, and enhancing the computational performance of the Flink batch execution engine. Simultaneously, a custom vectorization converter allows for the dynamic generation of conversion operators based on specific needs in batch mode, improving the flexibility of the data vectorization acceleration system. The vectorized execution engine, as the core component of the data vectorization acceleration system, is independent of Flink's memory manager and can improve the performance of vectorized computation by optimizing memory usage, ensuring efficient system operation in large-scale data processing scenarios.

[0027] The aforementioned components are deployed in a plug-in manner within the data vectorization acceleration system. This allows the vectorization acceleration function to be integrated into the Flink framework in a modular fashion, enabling users to flexibly enable or disable the vectorization acceleration function according to their actual needs, simplifying the system configuration and maintenance process. Simultaneously, to ensure system stability and compatibility, a fallback mechanism is designed. When unsupported or poorly performing operators are encountered during vectorization acceleration execution, the system can automatically fall back to Flink's native operators for execution, ensuring the reliability of batch processing tasks.

[0028] Through the above embodiments, the data vectorization acceleration system based on the Apache Flink framework not only significantly improves Flink's computing performance and resource utilization, but also enhances its adaptability to complex data processing tasks, meeting the high-performance requirements of large-scale data processing and real-time analysis.

[0029] Figure 2 This is a system architecture block diagram of the runtime data vectorization acceleration method according to an embodiment of this application, such as... Figure 2 As shown, the system of the data vectorization acceleration method specifically includes the following parts:

[0030] (1) Glue layer

[0031] The Glue layer acts as a bridge between Apache Flink and the Flaze engine, connecting Flink's NativePlan Generator and Native Runtime Framework with the Flaze Engine to ensure that Flink's execution plan can be efficiently converted into a format that the Flaze engine can execute.

[0032] (2) Apache Flink

[0033] The Flink Java Runtime is a component of the Flink framework that runs in a Java environment. It is responsible for executing data stream or batch processing applications in the Java environment, including operator scheduling, task execution, state management, and network communication.

[0034] Local Single JVM refers to the local mode of running Flink on a Java Virtual Machine. Developers can directly start a Flink cluster in the JVM on their local machine to perform data processing tasks and verify them without the need for complex cluster configuration.

[0035] Cluster Deployment Modes refer to Flink's deployment modes in a cluster environment, including: Standalone, Mesos, Kubernetes (K8s), Docker, and YARN;

[0036] Cloud Platforms, including AWS (Amazon Web Services) and Google Cloud, provide abundant computing resources and services. Flink, when deployed on a cloud platform, can leverage distributed computing capabilities to achieve large-scale data processing.

[0037] Integrating with Hadoop enables Flink to integrate with the Hadoop ecosystem. Flink can directly read and write data in HDFS (Hadoop Distributed File System) and use the input and output formats of Hadoop MapReduce.

[0038] (3) Flaze Native Plugin

[0039] The Flaze Native plugin includes an optimizer module, a vectorized computation module, a data interface module, a configuration management module, and Blaze (Blaze Java Runtime, Arrow-DataFusion). The optimizer module includes optimizer rule injection. To improve Flink's performance in batch processing tasks, the data vectorization acceleration system adds an optimizer rule injection mechanism. By dynamically injecting optimizer rules `BatchPhysicalGlueSinkRule` (batch mode glue layer physical plan sink operator rule) and `BatchPhysicalGlueExchangeRule` (batch mode glue layer physical plan exchange operator rule) into Flink's optimizer, the optimal execution rule can be automatically selected based on data characteristics and the specific execution environment during the compilation and query plan. The optimizer rules can automatically identify and optimize the vectorized parts of the computation process according to the needs of vectorization acceleration, significantly improving data processing efficiency. By working in conjunction with vectorized execution operators, the optimizer not only reduces computational latency but also reduces resource consumption through parallelization and memory reuse, improving overall system performance. In actual deployment, these optimizer rules can be flexibly adjusted and extended to adapt to different workloads and data processing needs, thereby ensuring the scalability and flexibility of the data vectorization acceleration system.

[0040] The vectorized computation module, when executed, includes the following components: vectorized execution operator, vectorized converter, and vectorized execution engine;

[0041] Vectorized execution operators, a core component of Flaze Engine, improve data processing efficiency by transforming Flink's physical plan into an execution plan and incorporating vectorization techniques. The core function of vectorized execution operators is to handle the transformation of the Glue execution plan across three stages: BatchPhysicalPlan, BatchExecutionPlan, and Transformation. In batch data processing, they not only handle efficient data allocation and transformation but also reduce computation time using vectorization acceleration techniques. By combining with a vectorized execution engine, they can quickly convert input data into a computationally suitable format, ensuring efficient execution of subsequent processing. This allows the data vectorization acceleration system to maintain high processing power and stability even with large-scale data, especially in batch processing scenarios, effectively improving data throughput, reducing computational latency, and providing a scalable solution for complex batch processing tasks.

[0042] The vectorization transformer plays a crucial role in accelerating batch processing in Flink. As an intermediate layer component, it is responsible for converting the traditional Flink-supported Physical Plan into a Protobuf-supported Native Plan (a locally replaced physical plan) suitable for vectorized execution. During the plan conversion process, the vectorization transformer identifies the parts that can be optimized for vectorization and transforms them into vectorized operations. In this way, Flink can not only effectively utilize vectorized hardware acceleration but also improve data processing throughput. Specifically, the vectorization transformer employs an optimization strategy based on optimizer rules, which can adjust the plan at different stages of the query to adapt to the actual data patterns and operational characteristics.

[0043] The vectorized execution engine, a core component of the data vectorization acceleration system, executes vectorized execution plans processed by the optimizer and vectorization transformer. It efficiently schedules and executes vectorized operations, ensuring continuous high-performance computing support across various large-scale data scenarios. By using the Datafusion and Arrow open-source vectorized execution libraries and rewriting some operators, the engine effectively improves task throughput and execution speed. It also supports flexible execution modes, allowing for the selection of appropriate parallel strategies based on different task requirements, while ensuring data consistency and reliability during computation. The vectorized execution engine not only enhances Flink's processing capabilities but also provides a new technical path for batch data computation, ensuring efficient utilization of computing resources when processing large-scale datasets.

[0044] The data interface module handles data reading and writing, ensuring efficient data conversion between Flink's in-memory model and Flaze Engine's vectorized model.

[0045] The configuration management module allows users to control batch vectorization acceleration through simple configuration files, including enabling or disabling it, and adjusting related parameters, ensuring the operability and flexibility of the system.

[0046] Blaze consists of Blaze Java Runtime and Arrow-DataFusion. Blaze Java Runtime is responsible for the transformation between data and physical plans as well as resource management, while Arrow-DataFusion provides vectorized data structures and an efficient operator execution environment. The two work together to achieve vectorized acceleration of Flink in batch processing mode, which greatly improves data processing performance.

[0047] In this embodiment, the vectorized computation module, optimizer module, data interface module, configuration management module, and Blaze are deployed in a plug-in manner. Flexible configuration and optimizer rules allow users to flexibly enable or disable vectorized acceleration functions according to actual needs. This enables users to dynamically control the Glue layer functionality in batch processing mode through simple configuration switches, thereby optimizing resource utilization and computational performance. In the OptimizerConfigOptions, a configuration item `table.optimizer.batch-glue.enabled` is added. This item determines whether Flaze Glue (the Flaze vectorized execution engine) is enabled. During Flink execution, the optimizer uses the value of this configuration item to determine whether to trigger Glue layer optimization. Specifically, when a user sets the configuration item to true in flink.env, the optimizer enables the BatchPhysicalGlueExchangeRule and BatchPhysicalGlueSinkRule optimizer rules to further process and optimize the compute nodes in the data stream. When a user sets the configuration item to false in flink.env, the optimizer disables the BatchPhysicalGlueExchangeRule and BatchPhysicalGlueSinkRule optimizer rules. This eliminates the need for complex code modifications; users can simply set parameters in the configuration file to enable or disable this feature. This deployment method significantly simplifies system maintenance and upgrades, improves system maintainability, and enhances the user experience.

[0048] This application also proposes an adaptive memory management mechanism and a fallback mechanism, as detailed below:

[0049] The adaptive memory management mechanism automatically adjusts the memory usage of Flink batch processing tasks to cope with varying data volumes and computational complexity. Traditional data processing frameworks often employ fixed memory allocation strategies, leading to insufficient memory or excessive memory waste when dealing with large-scale data or complex tasks. The adaptive memory management mechanism dynamically monitors the memory requirements of tasks and flexibly adjusts the memory allocation strategy based on real-time computational load and data scale. Specifically, the system dynamically adjusts the memory allocation of each computing node based on the execution progress and memory usage of batch processing tasks, and automatically optimizes memory usage efficiency according to load changes. This adaptive memory management mechanism significantly improves task execution efficiency and ensures stable system operation even during large-scale data processing.

[0050] In Flink's batch vectorization acceleration system, the fallback mechanism determines whether to revert to the traditional execution path during the optimization phase, ensuring the system can run safely and efficiently even when certain conditions are not met. This is primarily reflected in the rule optimization process. As part of the optimizer rules, the optimizer can determine whether to abort the vectorization acceleration execution based on predefined fallback conditions and revert to the traditional operator execution path, ensuring stable system operation.

[0051] Figure 3 This is a flowchart of a data vectorization acceleration method according to an embodiment of this application, such as... Figure 3 As shown, the data vectorization acceleration process includes the following steps:

[0052] Step S302: Write the optimizer rules into the optimizer, wherein the optimizer rules include a first operator rule and a second operator rule;

[0053] In this embodiment, the optimizer rules include a first operator rule and a second operator rule. The first operator rule is BatchPhysicalGlueSinkRule (batch mode glue layer physical plan sink operator rule), and the second operator rule is BatchPhysicalGlueExchangeRule (batch mode glue layer physical plan exchange operator rule), which is responsible for optimizing Exchange and Sink type operators in the query execution plan.

[0054] In this embodiment, the batch data vectorization acceleration method of Flink injects optimizer rules into the optimization stage of the Flink-sql execution flow, thereby realizing subsequent vectorized execution.

[0055] Specifically, Figure 4This is a flowchart illustrating a data vectorization acceleration method according to an embodiment of this application, as shown below. Figure 4 As shown, the core of injecting optimizer rules is to modify Flink's physical optimizer. This requires defining a new optimization rule class that inherits from Flink's PhysicalRel class and implementing the rule logic. An optimizer rule class may be located in the org.apache.flink.table.planner.plan.rules.physical package. In this optimizer rule class, configuration items are created to determine whether the physical plan applied to the current data processing runs the optimizer rules in the optimizer.

[0056] In some embodiments, the optimizer rule has a configuration item created in it, which is used to determine whether the physical plan applied to the current data processing runs the optimizer rule in the optimizer.

[0057] In this embodiment, for any user interface, the user only needs to define a simple configuration item to control the enabling or disabling of batch vectorization acceleration. By setting `table.optimizer.batch-glue.enabled` (custom vectorization configuration) to `true` in the configuration file, Flaze Glue's batch processing vectorization acceleration can be enabled without modifying any code. This configuration item is located in `OptimizerConfigOptions` (optional vectorization configuration) and determines whether Flink enables optimizer rules (`BatchPhysicalGlueExchangeRule` and `BatchPhysicalGlueSinkRule`) during execution. Therefore, by creating configuration items in the optimizer rules, the operability and flexibility of the system are greatly improved.

[0058] In some embodiments, before writing optimizer rules into the optimizer, the method further includes: configuring an adaptive memory management mechanism and monitoring the memory usage of multiple tasks according to the adaptive memory management mechanism to adjust the memory allocation strategy.

[0059] In this embodiment, the adaptive memory management mechanism monitors the memory usage of multiple tasks to adjust the memory allocation strategy, including: triggering a task spill operation to spill the data of the current task to the disk when the memory usage of the current task is greater than or equal to a second preset threshold; or triggering a task wait operation to store the data of the current task in the memory space released by other tasks when the memory usage of the current task is greater than or equal to the second preset threshold.

[0060] In this embodiment, as Figure 4 As shown, the adaptive memory management mechanism is responsible for memory management during the execution of the vectorized execution engine. Typically, batch data processing tasks face two major problems: memory spill and uneven allocation of memory resources. Specifically, in executing vectorized tasks, some operations require a large amount of memory, while others may only require a small amount. To avoid wasting system memory resources and ensure efficient task execution, the adaptive memory management mechanism dynamically adjusts the memory allocation strategy based on task requirements and memory usage. This adaptive memory management mechanism not only addresses the differences in memory management between Flink and the native execution mode but also automatically optimizes the memory allocation strategy based on the task's vectorization coverage.

[0061] The core of the adaptive memory management mechanism lies in its multi-level memory management system. The MemManager class (memory manager) manages total memory allocation and consumers (i.e., tasks or modules that use memory). The MemManager class maintains a memory management status (MemManagerStatus) and multiple memory consumer information entries (MemConsumerInfo). Through the memory management status and memory consumer information, the system can monitor memory usage in real time and dynamically adjust memory allocation to ensure stable task execution.

[0062] In this embodiment, the MemManager class provides a global instance, which initializes the total system memory (e.g., 16GB) through the init method, and the get method is used to retrieve the current memory management instance. Each memory consumer registers with MemManager during initialization. The memory usage of the consumer is managed by the MemConsumerInfo class. MemManager automatically adjusts the allocation of memory resources based on the memory usage of different consumers, and performs memory overflow operations or waits for resource release.

[0063] The essence of adaptive memory management is adaptive memory allocation. The system automatically adjusts memory resource allocation based on the memory usage of each memory consumer. Specifically, the `update_consumer_mem_used_with_custom_updater` method (the method for updating current memory usage) calculates whether data needs to be spilled or resources need to be waited for each time memory usage is updated. If system memory is insufficient and the memory usage of a task exceeds a threshold (a second preset threshold), the system will trigger a spill operation to write data to disk, thereby freeing up memory space. If the spill operation cannot be completed, the task will be required to wait for other tasks to release resources.

[0064] During memory usage, MemManager can dynamically adjust the memory usage of each consumer. When a consumer's memory usage exceeds the system's threshold (a second preset threshold), MemManager can decide whether to spill the task's data to disk or let the task wait for other tasks to release memory resources. The system implements the waiting mechanism through a Condvar object; once sufficient memory is available, the task can continue execution. This adaptive memory management mechanism ensures that the system can smoothly handle tasks under high memory pressure, avoiding system crashes or task failures due to insufficient memory.

[0065] Step S304: According to the optimizer rules, the original operators in the first operator rule and the second operator rule are fused with the replacement operators matched by the first operator rule and the second operator rule respectively to obtain a vectorized fusion operator;

[0066] In some embodiments, according to the optimizer rules, the original operators in the first operator rule and the second operator rule are fused with the replacement operators matched by the first operator rule and the second operator rule respectively to obtain a vectorized fusion operator, including: obtaining batch processing type nodes in the physical plan applied to the current data processing according to the optimizer rules; when the number of batch processing type nodes is greater than a first preset threshold and the operators on the batch processing type nodes are replacement operators, the original operators in the first operator rule and the second operator rule are fused with the replacement operators matched by the first operator rule and the second operator rule respectively to obtain a vectorized fusion operator.

[0067] In this embodiment, as Figure 4 As shown, the sink operator and the exchange operator are fused separately. The original operator in the first operator rule is the sink operator, and the original operator in the second operator rule is the exchange operator. Starting from the sink / exchange operator, when each matches a replacement operator (e.g., Sort, Join, Agg, etc.), they are fused to obtain the vectorized fused operator.

[0068] In this embodiment, the optimizer rules recursively obtain all Batch (batch processing type node) type nodes in the physical plan applied to the current data processing, determine whether the number of Batch type nodes is greater than a first preset threshold (e.g., 1), and whether each Batch node can be fused into a type supported by the vectorized fusion operator. The replacement operator types supported for fusion in this embodiment include, but are not limited to, operators of the types Sink, Sort, Exchange, Join, Agg, SourceScan, and Calc.

[0069] When the `matches` method matches a replacement operator, the `onMatch` method is called to perform the merging operation. The `onMatch` method first retrieves the current `BatchPhysicalExchange` node (the batch mode physical plan Exchange node) and extracts necessary information from it, such as `RelOptCluster` (relationship optimization context), `RelTraitSet` (relationship trait set), and `RelDistribution` (data distribution characteristics). This information is a key parameter for task execution, determining how to efficiently execute tasks in a distributed system.

[0070] Specifically, Figure 5 This is a schematic diagram of operator fusion in the data vectorization acceleration method according to an embodiment of this application, as shown below. Figure 5 As shown, the `onMatch` method performs different fusion operations based on the current matching node. Starting from the current Sink / Exchange operator, it traverses the operator tree backwards, ending the replacement when a specific node is encountered. The entire replacement logic is as follows: Figure 5 As shown, there are six scenarios. For example, in a simple scenario, when the current Sink operator matches a BatchPhysicalTableSourceScan (the Source node of the physical plan in Flink batch mode), it can be replaced with the BatchPhysicalGlueSinkSource operator (a custom operator connecting the Sink and Source, also known as a vectorized fusion operator). In this case, the new Glue operator will directly handle the data source reading and output operations through the native vectorization engine, thereby improving the efficiency of data reading. Additionally, in some complex scenarios, there may be multiple inputs after a node. For example, operations such as BatchPhysicalHashJoin (the HashJoin node of the physical plan in Flink batch mode) may require processing multiple input data streams. In this case, the onMatch method applies the BatchPhysicalGlueSinkTwoInput operator (a custom operator connecting the Sink and Join) to the current execution plan, which can handle complex data stream operations involving two inputs (such as join operations) to ensure that data can be efficiently exchanged and processed.

[0071] The above embodiments allow for vectorized operator replacement of the operator tree based on the largest replaceable segment. This is implemented in the Optimize phase of the FlinkServer layer, and then delegated to the lower-level Glue operators for physical plan generation and Transformation generation. Furthermore, the Flink Shuffle module can be reused during task execution, ensuring data consistency and timeliness in a distributed environment.

[0072] Step S306: Convert the vectorized fusion operator into a vectorized execution operator according to the conversion logic, so that the vectorized execution operator can call the vectorized execution engine through the local interface JNI bridge to accelerate data vectorization.

[0073] In some embodiments, converting the vectorized fusion operator into a vectorized execution operator according to transformation logic includes: creating a vectorized glue layer operator corresponding to the vectorized fusion operator, wherein the glue layer operator includes a glue layer read operator, a glue layer single-input operator, and a glue layer multi-input operator; converting the vectorized fusion operator according to the physical plan, the execution plan, and the transformation order of data transformation operations, and calling the vectorized glue layer operator to obtain a vectorized execution operator.

[0074] In this embodiment, as Figure 4 As shown, after the optimizer rules are injected and the optimizer rules in the optimizer can be run and the vectorized fusion operator is generated, the vectorized execution operator is generated. This can be implemented in LogicalOperator, Physical Operator, Exec Operator, and Transformation. The vectorized execution operator component is responsible for generating the six BatchPhysicalGlue operators in the corresponding optimizer rules. It implements the transformation logic from PhysicalPlan to ExecutionPlan to Transformation based on different types, and creates corresponding vectorized operator operators supported by Flink-Table-Runtime for processing. Based on different types, they are divided into GlueSourceOperator (glue layer read operator), GlueOneInputOperator (glue layer single input operator), and GlueTwoInputOperator (glue layer multi-input operator). These three types of operators are mainly used to call the transformation from Flink-supported PhysicalPlanNode to Protobuf-supported PhysicalPlanNode and the execution of the vectorized execution engine.

[0075] Specifically, taking BatchPhysicalGlueExchangeOneInput (a batch-mode glue layer ExchangeOneInput physical plan) as an example, BatchPhysicalGlueExchangeOneInput is used to manage the allocation and processing of data streams. This class inherits from CommonPhysicalExchange and implements the BatchPhysicalRel interface. In this class, the constructor receives multiple parameters, including RelOptCluster (relationship optimization overlay), RelTraitSet (relationship trait set), and RelNode, used to set the environment and properties of the operator. In the translateToExecNode method, the physical operator is converted into an execution node. The converted BatchExecGlueExchangeOneInput instance will contain all the configurations required for execution, such as input attributes, output types, and specific execution descriptions.

[0076] The `BatchExecGlueExchangeOneInput` (batch mode glue layer `ExchangeOneInput` execution plan) class is an operator of the execution layer, inheriting from `CommonExecExchange` and implementing `BatchExecNode`. <rowdata>The interface indicates that the class is responsible for executing batch data. The constructor of this class receives multiple parameters, including ReadableConfig (readable configuration interface), InputProperty (input property descriptor), RowType (row type descriptor), etc., which set the necessary configuration of the execution node. The execution node is responsible for processing the data flow in the task, especially the computational logic involving partitioning, swapping, parallelism and other operations.

[0077] During the execution of BatchExecGlueExchangeOneInput (batch mode glue layer ExchangeOneInput execution plan), the translateToPlanInternal method is responsible for converting the logic into the actual execution plan. This translateToPlanInternal method obtains the output type from the input edge, constructs a suitable input transformation, and then calls GlueOneInputOperator (glue layer single input operator) to create a vectorized execution operator. GlueOneInputOperator is the data processing operator, responsible for converting the data into a physical form and handing it over to downstream operators for processing.

[0078] GlueOneInputOperator (the single-input operator for the glue layer) is the operator in Flink that actually performs data processing, and it inherits from TableStreamOperator. <rowdata>And implemented OneInputStreamOperator<RowData,RowData> This interface can receive and process data from a single input stream. The main task of this operator is to transform the data passed from upstream operators into arrow format batch data via a JNI (Java Native Interface) bridge call, and then pass it to downstream operators for further processing. In the `open` method, the operator initializes a data collector, a buffer, and a JNI bridge. These components ensure that the operator can efficiently process input data during execution and forward it downstream once it is ready. The `processElement` method processes each input data and stores it in the buffer. The `endInput` method performs final data processing and output after input is complete. Specifically, in `endInput`, the operator converts the data in the buffer to Arrow format, then calls the JNI bridge for native operations, and outputs the results through the collector.

[0079] In some embodiments, after converting the vectorized fusion operator into a vectorized execution operator according to the transformation logic, the method further includes: converting the physical plan applied to the current data processing into a local execution plan through a vectorization converter, wherein the local execution plan is converted into a data type supported by the vectorized execution engine according to the input data type, connection specification, and data field information.

[0080] In this embodiment, as Figure 4 As shown, after fusing the sink and exchange operators, the Vectorized Converter is responsible for transforming the native execution plan. It primarily converts specific operations (such as Hash Join) in Flink's physical execution plan into a format suitable for the vectorized execution engine, thereby accelerating batch data processing. Specifically, the Vectorized Converter can construct physical execution nodes suitable for the Protobuf format based on the input relational data type, join specification, and field information, and provide necessary support for the vectorized execution engine.

[0081] When implementing a vectorization converter, support for data types is required. In Flink, the `RelDataType` object describes the structure of the input data, while `JoinSpec` defines the details of the join operation, including the join fields and join type. After receiving the input `RelDataType` and `JoinSpec`, the vectorization converter constructs a `PhysicalPlanNode` object conforming to the Protobuf format. This is to convert Flink's raw data types into data types supported by Arrow, where the Arrow type allows for more efficient batch data processing, especially during vectorized computation.

[0082] Specifically, for example, in the constructor of the `BatchPhysicalHashJoinConv` class, the list of fields of the input data type (`inputRowType.getFieldList()`) is first converted into a set of `Field` objects. Each `Field` object contains information such as the field name, type, and whether null values ​​are allowed. In this way, the vectorization converter can map the data structure in Flink to the `Field` format in Protobuf for subsequent vectorized computation. During the construction of each `Field` object, the `convertDataTypeToArrowType` method is used to convert the field type to a type supported by `Arrow`, thus providing the necessary field information to the vectorization engine. In hash join operations, the construction of the join condition (i.e., `JoinOn`) is crucial. `JoinSpec` provides index information for the left and right join keys. The vectorization converter creates `JoinOn` objects one by one by traversing the index information. Each `JoinOn` object describes the left and right expressions for each join key. Each `JoinOn` object contains a `PhysicalExprNode`, representing an expression in the join condition. `PhysicalExprNode` uses `PhysicalColumn` to represent the specific column, mapping to the correct column information in Protobuf.

[0083] After transforming the fields and join conditions, the vectorized converter encapsulates the column information into a PhysicalPlanNode. A PhysicalPlanNode is a Protobuf object containing node information for the entire physical execution plan. In the case of hash joins, the PhysicalPlanNode contains a BroadcastJoinExecNode, which represents a broadcast join operation. Broadcast joins are typically used when one table has a smaller amount of data than the other, accelerating the join operation by broadcasting the smaller table to all execution nodes.

[0084] After completing the above steps, the vectorization converter returns the constructed PhysicalPlanNode via the convertToBroadcastJoinExecNode method (used to convert BroadcastJoinExecNode to NativeBroadcastJoinExecNode). This node can then be passed to the execution engine to perform specific vectorized computations. As the input node to the vectorization engine, the PhysicalPlanNode contains all the necessary information for the execution plan, ensuring efficient execution of broadcast join operations within the vectorized execution environment.

[0085] In some embodiments, after converting the physical plan applied to the current data processing into a local execution plan using a vectorization converter, the method further includes: invoking a vectorization execution engine via a JNI bridge to accelerate data vectorization based on the local execution plan and the vectorization execution operator, wherein the vectorization execution engine converts the original language format in the local execution plan into a target language format.

[0086] In this embodiment, after generating the native execution plan and vectorized execution operators, the vectorized execution engine is responsible for vectorized execution. This engine is based on Rust as its native execution code and utilizes the open-source libraries DataFusion (a vectorized operator library written in Rust) and Arrow (supporting vectorized data structures in Rust) to complete the underlying vectorized operator design. Specifically, Rust provides efficient memory management and concurrent execution capabilities, enabling the vectorized execution engine to handle the massive data streams in Flink jobs. In its implementation, the vectorized execution engine interacts with the Java Virtual Machine via JNI, receiving the physical execution plan from Flink and converting it into a Rust-executable format. In this way, the vectorized execution engine can efficiently schedule tasks and execute the various operations in the physical plan.

[0087] The vectorized execution engine relies on the JNI bridging mechanism, enabling Rust code to collaborate efficiently with Flink in the Java environment. Through the `callNative` method implemented via the JNI interface, Flink can pass the physical execution plan (in Protobuf format) to the Rust engine and convert it into the corresponding execution plan object in Rust. Specifically, the `parse_glue_exec` method parses the incoming Protobuf data, transforming it into a `PhysicalPlanNode` structure. Then, through the `ExecutionPlan` transformation logic, it generates an execution plan suitable for DataFusion. The `datafusion::physical_plan::collect` method performs batch calculations on the execution plans, and finally returns the results in Arrow format (the target language format).

[0088] The core logic of execution plan transformation is implemented through the `try_into` method in Rust. `ExecutionPlan` is an execution plan structure provided by DataFusion, abstracting specific physical execution nodes (such as scanning, filtering, projection, sorting, etc.) into a unified interface. Rust's `ExecutionPlan`, by implementing the DataFusion `ExecutionPlan` trait, is compatible with Flink's task scheduling and execution process. In this code, by matching each type of operation in the `PhysicalPlanNode`, the Rust code can generate corresponding execution engine operations based on different plan types. For example, when a `ParquetScan` node is received, the Rust engine will generate a scanner suitable for the Parquet format based on the configuration; and when a `Sort` node is received, it will generate a `SortExec` execution plan that supports external sorting.

[0089] In the implementation of the vectorized execution engine, to further improve execution efficiency, some vectorized operators are rewritten based on DataFusion's ExecutionPlan trait. Taking the Sort operation as an example, the vectorized execution engine optimizes SortExec by using an external sorting method instead of a memory-based sorting method. This external sorting method can not only handle large-scale data with limited memory, but also efficiently utilize disk storage, thus improving sorting performance.

[0090] Specifically, the SortExec operator in the vectorized execution engine manages the sorting process through ExternalSorter, which itself is implemented using Rust's Box::pin and other similar functionalities. This implementation allows the vectorized execution engine to perform sorting operations in memory, and when memory is insufficient, it can spill some data to disk, thus avoiding the risk of memory overflow. In its implementation, the SortExec operator not only provides data sorting functionality but also integrates performance statistics and resource management features. It tracks memory and disk usage during the sorting process using BaselineMetrics (which stores current system memory usage information) and SpillMetrics (which stores current disk usage information).

[0091] Furthermore, the vectorized execution engine has made similar optimizations to other common operations. For example, the FilterExec operator, through vectorization support, can execute multiple filtering conditions at once when processing each batch of data, thereby reducing the time overhead of operations; the ProjectionExec operator achieves more efficient data transformation through batch projection operations on fields.

[0092] Through Rust's asynchronous runtime `tokio::runtime::Runtime`, the vectorized execution engine can efficiently process each execution task in parallel and schedule and execute them according to the actual needs of the task. When the execution result of the data stream is returned, it undergoes `concat_batches` processing, merging all batches of data into a complete dataset. Finally, the data is transformed into `record_batch` in Arrow format and interacts with the Java Virtual Machine via FFI (Foreign Function Interface) to send the processing result back to Flink. The `record_batch` is then converted into `FFI_ArrowSchema` (provided by the Arrow library) and `FFI_ArrowArray` (provided by the Arrow library) formats so that Flink can read and process it through the JNI interface.

[0093] In some embodiments, the optimizer rule is configured with a rollback condition, which is used to determine whether to terminate the currently running data vectorization acceleration.

[0094] In some embodiments, the currently running data vectorization acceleration is terminated when at least one of the following fallback conditions is met: the replacement operator type is not met; an external data table is joined; very few operators are merged; the first operator is the merging endpoint and the predicted return order of magnitude is greater than a third preset threshold; the first operator is the merging starting point and the input order of magnitude is greater than a fourth preset threshold.

[0095] In this embodiment, as Figure 4 As shown, the data vectorization acceleration system is configured with a Fallback mechanism, which means that by configuring fallback conditions in the optimizer rules, it is possible to determine whether to terminate the currently running data vectorization acceleration.

[0096] In this embodiment, the fallback mechanism determines whether to revert to the traditional execution path, ensuring the system can run safely and efficiently even when specific conditions are not met. This fallback mechanism is primarily reflected in the optimizer rules, serving as part of the optimizer's rules. During Flink execution, the optimizer determines whether to abort vectorization acceleration based on the configured fallback conditions and revert to the traditional operator execution path. The fallback conditions typically include specific operator types or data volume conditions to avoid enabling vectorization acceleration in unsuitable scenarios. Specifically, the currently running data vectorization acceleration is terminated when at least one of the following fallback conditions is met:

[0097] 1. Fallback when native operator replacement conditions are not met: If a certain operator cannot be replaced by a native operator (for example, due to computational complexity or data characteristics), the optimizer will determine whether to enable the fallback mechanism to avoid trying inapplicable acceleration solutions;

[0098] 2. Rollback when joining large external tables: When large table join operations are involved, especially operations such as outer join, left join and right join, the intermediate results generated may not be processed efficiently due to the large data scale. In this case, the system will roll back to avoid performance degradation.

[0099] 3. Rollback when there are very few operators being merged: When the system detects a situation where there are very few operators being merged, such as single operator merging or Sink-Source operator merging, a rollback will be triggered. This is because the above merging situations may lead to large computational overhead when merging between operators, and rollback can avoid unnecessary computational overhead.

[0100] 4. Rollback when the Exchange operator is the merge endpoint and the predicted return value is large: When the Exchange operator is the merge endpoint and the optimizer predicts that the amount of data to be returned is large, the rollback mechanism is triggered, taking into account the overhead of the shuffle operator in row and column transformation.

[0101] 5. When the Exchange operator is the starting point for merging and the input volume is large, a rollback is performed: When the Exchange operator is used as the starting point for merging and the input data volume is large, a rollback is also performed, taking into account the overhead of the shuffle operator during row and column transformation.

[0102] Through the above embodiments, the data vectorization acceleration system improves the computational performance of the Flink batch execution engine by introducing vectorized execution operators and optimizer rule injection, solving the performance bottleneck problem of traditional vectorization technology in large-scale data processing. Simultaneously, the plug-in and modular design gives the system high flexibility and scalability to meet the needs of different business scenarios, solving the problem of high dependence on specific frameworks in traditional solutions. Furthermore, independent memory management and the vectorized execution engine optimize resource utilization efficiency, fully leveraging the CPU's SIMD instruction set and reducing system resource consumption. A fallback mechanism is also designed to ensure automatic switching to a backup solution when unsupported operators or performance failures are encountered during vectorized execution, guaranteeing system stability and compatibility. Finally, through the configuration management module, users can flexibly enable or disable vectorization acceleration and dynamically adjust relevant parameters, improving system usability and maintainability. In summary, the embodiments of this application not only effectively improve the computational performance and resource utilization efficiency of the Flink batch execution engine but also enhance the system's flexibility, stability, and usability. Therefore, the embodiments of this application can solve the problem that the existing Flink framework fails to fully utilize the instruction set and vectorized hardware resources in batch processing mode, resulting in low computational efficiency in large-scale data processing scenarios, and achieve the effect of improving Flink's computational efficiency and resource utilization.

[0103] This application also provides a data vectorization acceleration system. Figure 6 This is a structural block diagram of a data vectorization acceleration system according to an embodiment of this application, such as... Figure 6 As shown, the data vectorization acceleration system includes: an optimizer module, a vectorization execution operator, a vectorization execution engine, and a vectorization converter.

[0104] The optimizer module is used to fuse the original operators in the first operator rule and the second operator rule with the replacement operators matched in the first operator rule and the second operator rule according to the optimizer rules to obtain a vectorized fusion operator, wherein the optimizer rules include the first operator rule and the second operator rule;

[0105] Vectorized execution operators are used to accelerate data vectorization by calling the vectorized execution engine through the JNI bridge;

[0106] A vectorized execution engine is used to receive calls from the JNI bridge and perform data vectorization acceleration.

[0107] A vectorization converter is used to convert the physical plan applied to the current data processing into a local execution plan.

[0108] In some embodiments, the optimizer module, the vectorized execution operator, the vectorized execution engine, and the vectorization converter are deployed as plug-ins in the data vectorization acceleration system.

[0109] The Flink vectorization acceleration plugin system (vectorization acceleration system) in this embodiment enhances Flink's computational performance in real-time data batch processing tasks. This system effectively supports efficient data integration and synchronization between data lakes and data warehouses. In a lake-warehouse converged architecture, data often needs to be stored and preprocessed on a large scale in the data lake before being rapidly migrated to the data warehouse for high-performance query analysis. The vectorization acceleration plugin significantly reduces data processing time and improves the real-time performance and accuracy of data synchronization by optimizing the ETL (Extract, Transform, Load) process. Furthermore, in multi-source heterogeneous data environments, Flink's vectorization plugin enables efficient data processing and transformation, ensuring rapid integration and analysis of data from different data sources and improving overall data processing capabilities.

[0110] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0111] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.

[0112] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when run.

[0113] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0114] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0115] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0116] According to yet another embodiment of this disclosure, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps of the methods described in various embodiments of this disclosure.

[0117] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.

[0118] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.

[0119] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.< / rowdata> < / rowdata>

Claims

1. A data vectorization acceleration method, characterized in that, include: The optimizer rules are written into the optimizer, wherein the optimizer rules include a first operator rule and a second operator rule; According to the optimizer rules, the original operators in the first operator rule and the second operator rule are fused with the replacement operators matched by the first operator rule and the second operator rule respectively to obtain a vectorized fusion operator; Create a vectorized glue layer operator corresponding to the vectorized fusion operator, wherein the glue layer operator includes a glue layer read operator, a glue layer single-input operator, and a glue layer multi-input operator; transform the vectorized fusion operator according to the physical plan, execution plan, and the transformation order of data transformation operations, and call the vectorized glue layer operator to obtain a vectorized execution operator, so that the vectorized execution operator calls the vectorized execution engine through the native interface JNI bridge to accelerate data vectorization.

2. The method according to claim 1, characterized in that, in, The optimizer rules contain configuration items that are used to determine whether the physical plan applied to the current data processing runs the optimizer rules in the optimizer.

3. The method according to claim 1, characterized in that, According to the optimizer rules, the original operators in the first operator rule and the second operator rule are fused with the replacement operators matched by the first operator rule and the second operator rule, respectively, to obtain a vectorized fusion operator, including: Based on the optimizer rules, obtain the batch processing type nodes in the physical plan applied to the current data processing; When the number of batch processing type nodes is greater than a first preset threshold and the operator on the batch processing type node is a replacement operator, the original operators in the first operator rule and the second operator rule are fused with the replacement operators matched by the first operator rule and the second operator rule respectively to obtain a vectorized fusion operator.

4. The method according to claim 1, characterized in that, After converting the vectorized fusion operator into a vectorized execution operator according to the transformation logic, the method further includes: The physical plan used for current data processing is converted into a local execution plan by a vectorization converter. The local execution plan is converted into the data types supported by the vectorization execution engine based on the input data type, connection specification, and data field information.

5. The method according to claim 4, characterized in that, After converting the physical plan applied to the current data processing into a local execution plan using a vectorization converter, the method further includes: Based on the local execution plan and the vectorized execution operator, the vectorized execution engine is invoked through the JNI bridge to accelerate data vectorization, wherein the vectorized execution engine converts the original language format in the local execution plan into the target language format.

6. The method according to claim 1, characterized in that, Before writing the optimizer rules into the optimizer, the method further includes: Configure an adaptive memory management mechanism, and monitor the memory usage of multiple tasks according to the adaptive memory management mechanism to adjust the memory allocation strategy.

7. The method according to claim 6, characterized in that, The adaptive memory management mechanism monitors the memory usage of multiple tasks to adjust the memory allocation strategy, including: If the memory usage of the current task is greater than or equal to the second preset threshold, a task spill operation is triggered to spill the data of the current task to disk; or, If the memory usage of the current task is greater than or equal to the second preset threshold, a task waiting operation is triggered to store the current task's data in the memory space released by other tasks.

8. The method according to claim 1, characterized in that, in, The optimizer rules are configured with rollback conditions, which are used to determine whether to terminate the currently running data vectorization acceleration.

9. The method according to claim 8, characterized in that, The currently running data vectorization acceleration will be terminated if at least one of the following fallback conditions is met: The replacement operator type is not satisfied; Connect to external data tables; Very few operators are combined; The first operator is the merging endpoint and the predicted return value is greater than the third preset threshold. The first operator is the starting point for merging and the input order of magnitude is greater than the fourth preset threshold.

10. A data vectorization acceleration system, characterized in that, include: The optimizer module is used to fuse the original operators in the first operator rule and the second operator rule with the replacement operators matched in the first operator rule and the second operator rule according to the optimizer rules to obtain a vectorized fusion operator, wherein the optimizer rules include the first operator rule and the second operator rule; The vectorized execution operator is used to accelerate data vectorization by calling the vectorized execution engine through the JNI bridge. It involves creating a vectorized glue layer operator corresponding to the vectorized fusion operator, where the glue layer operator includes a glue layer read operator, a glue layer single-input operator, and a glue layer multi-input operator. The vectorized fusion operator is then transformed according to the physical plan, execution plan, and the transformation order of data transformation operations, and the vectorized glue layer operator is called to obtain the vectorized execution operator. A vectorized execution engine is used to receive calls from the JNI bridge and perform data vectorization acceleration. A vectorization converter is used to convert the physical plan applied to the current data processing into a local execution plan.

11. The system according to claim 10, characterized in that, The optimizer module, the vectorized execution operator, the vectorized execution engine, and the vectorization converter are deployed as plug-ins in the data vectorization acceleration system.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any one of claims 1-9.

13. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1-9.

14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method described in any one of claims 1-9.

Citation Information

Patent Citations

  • Flow process definition device and method based on flow system

    CN104020994A

  • Method and system for distributing operator fusion mechanism of vector quantization large language model

    CN119668894A