Industrial lake and reservoir construction method based on cold and hot data stratification
By adopting hot and cold data layering, cold data compression, caching and vectorization processing technologies in the industrial big data architecture, the problems of data islands and low processing efficiency are solved, efficient data storage and query are achieved, and digital twin applications are satisfied. requirements, improving data processing and storage efficiency.
Patent Information
- Application Number
- CN202411225935.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-10-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing industrial big data architecture has data islands, low data processing efficiency, and insufficient business relevance in data timeliness, making it unable to meet the needs of digital twin application scenarios.
Adopting an industrial lake warehouse construction method based on hot and cold data stratification, the query strategy is optimized by hot and cold stratification, cold data compression, cold data caching and vectorization processing, combined with columnar storage and vectorized function calculation frameworks. Achieve efficient storage and query of data.
It opens up the boundaries between data warehouse and data lake, integrates high performance and flexibility, supports real-time query and analysis, improves data processing efficiency and storage efficiency, and meets the needs of production line digital twin applications.
Smart Images

Figure CN118733686A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data storage query, and in particular relates to an industrial lake warehouse construction method based on cold and hot data stratification. Background Art
[0002] With the rapid development of Industry 4.0 and intelligent manufacturing, the application of industrial big data is becoming more and more extensive. As a bridge between the physical world and the virtual world, digital twin technology can achieve real-time monitoring of industrial production processes, predictive maintenance, and production optimization. However, the existing industrial big data architecture often has problems such as data silos, low data processing efficiency, and insufficient reflection of business relevance in data timeliness, which cannot meet the needs of digital twin application scenarios. Summary of the invention
[0003] The purpose of the present invention is to provide an industrial lake warehouse construction method based on cold and hot data stratification, aiming to solve the problems that the existing industrial big data architecture often has data islands, low data processing efficiency, insufficient reflection of business relevance in data timeliness, and cannot meet the needs of digital twin application scenarios.
[0004] The present invention is implemented as follows: a method for constructing an industrial lake warehouse based on cold and hot data stratification, the method comprising: By stratifying data into hot and cold data, an industrial lake warehouse system is constructed, wherein the industrial lake warehouse system divides data into hot data and cold data and stores them separately; Vectorize the data in the industrial warehouse system and optimize the query strategy; The industrial lake warehouse system includes a data acquisition layer, a storage layer and an application layer; Steps for hot and cold data tiering include cold data compression and cold data caching.
[0005] Preferably, the step of cold data compression includes: Data screening and identification: based on the frequency of data use and access time, data that is accessed infrequently in the historical process is marked as cold data; Physical deletion and reorganization: When the amount of cold data reaches a certain level or meets certain conditions, the ColdDataCompaction process is triggered to physically delete the cold data stored in the object storage and reorganize the scattered cold data into a preset format; Single copy compression optimization: Use a single copy for compaction; Background thread periodically executes: The BE background thread periodically selects a preset number of tablets from the cooling tablets for ColdDataCompaction; Flushing data and uploading objects: During the compaction process, each time a preset size of data is accumulated, a part is uploaded to the object storage and local storage space is released. Metadata synchronization: After the compaction is completed, the metadata of the cooling data is updated to the object storage, and other Replica nodes synchronize metadata from the object storage.
[0006] Preferably, the step of cold data caching includes: Cache granularity selection: Use cache implementation with Block as the granularity; Data download and cache: When you need to query a cold rowset, first download the cold data required for the query from the object storage to the local Block Cache according to the granularity of the block; Query performance optimization: The access performance of cold data stored in Block Cache is consistent with the data performance of non-cold and hot tiered tables; LRU cache strategy: adopt LRU strategy.
[0007] Preferably, the data in the industrial lake warehouse system consists of cold data blocks and hot data blocks. The cold data block stores a complete data snapshot at a specific time point, representing the static state of the data. Each cold data block has a unique serial number, which increases in chronological order. Each simulation entity or process has an initial air-cold data block B0 for recording its initial state. The hot data block contains the change instructions for converting the cold data block into a new cold data block. The change instructions are used to add, update or delete records. When the state of the simulation entity or process changes, one or more hot data blocks will be generated.
[0008] Preferably, the operations on data in the industrial lake warehouse system include merging operations, differentiation operations, and chain operations, and the process of applying hot data blocks to cold data blocks to form new cold data blocks is a merging operation; The merge operation is represented as , indicating that the hot data block Apply to cold data blocks Get the new cold data block ; Differentiation operation It is the reverse process of the merge operation. The specific operation is to compare two cold data blocks and create a hot data block, which represents the change instructions required to convert one cold data block into another cold data block. The differentiation operation is expressed as .
[0009] Preferably, the chain operation C is used to combine multiple hot data blocks together to form a single hot data block representing continuous changes; Chaining can be written as , indicating that two hot data blocks and Combined together, they form a hot data block representing the continuous change from Bi to Bk . Chain Function Used to combine multiple increment blocks: .
[0010] Preferably, the step of vectorizing the data in the industrial lake warehouse system includes: Perform dimensional modeling based on the DWD layer to determine business topics, define granularity, determine dimensions, and confirm fact tables to build the required data model; Extract, convert and load source data, and synchronize the source data to the industrial warehouse system in real time; The data in the industrial lake warehouse system adopts a column storage structure. In column storage, data of the same type are stored together continuously to form data columns.
[0011] Preferably, the step of optimizing the query strategy includes introducing a query execution process based on column storage, the query execution process includes generating a new column through a projection operator, which includes the result of adding the values of n columns in the table to a constant; Compare the newly generated column with the value of the m column through the selection operator to generate a selection vector, which contains the indexes of the rows that meet the conditions; The materialized operator selects the vector to extract the rows that meet the conditions from the original data block and returns the columns required by the user.
[0012] Preferably, the step of vectorizing the data in the industrial lake warehouse system includes constructing a vectorized function calculation framework, and the operation process of the vectorized function calculation framework is: Input: The original Block, which contains multiple columns of data and is organized in column storage; Processing flow: For the column that needs to perform vectorized calculation, only the data in this column is processed without involving other columns. During the function calculation process, only the data in column b is operated to generate a new calculation result column; Output: The updated Block contains the original columns and the newly added calculation result columns.
[0013] Preferably, the step of vectorizing the data in the industrial lake warehouse system also includes reconstructing the vectorized operator, using the Pipeline mechanism to realize data transmission between operators, and using the Push Based mode. The upstream operator actively pushes the processed data to the downstream operator, and optimizes the Push Based mode, including flow control: adjusting the push rate; cache management: setting the cache size, and realizing dynamic replacement and update of the cache according to the data access frequency and hot data situation; error handling: monitoring and handling errors during data transmission.
[0014] The method for constructing an industrial lake warehouse based on hot and cold data stratification provided by the present invention, in the application scenario of industrial digital twins of production lines, the hot and cold characteristics of production line data also put forward different requirements for storage and query efficiency. The present invention connects the data warehouse and the data lake, and integrates the high performance and management capabilities of the data warehouse with the flexibility of the data lake. It supports the coexistence of multiple data types at the bottom layer, and can realize mutual sharing between data. The upper layer can be accessed through a unified encapsulated interface, and can simultaneously support real-time query and analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A flowchart of the DWD layer dimension modeling steps provided in an embodiment of the present invention; Figure 2 A flowchart of a query execution process provided by an embodiment of the present invention; Figure 3 A schematic diagram of the implementation principle of column storage provided in an embodiment of the present invention; Figure 4 A schematic diagram of a vectorized computing and storage optimization process provided by an embodiment of the present invention; Figure 5 A schematic diagram of data storage provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0016] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0017] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but unless otherwise specified, these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first xx script may be referred to as a second xx script, and similarly, a second xx script may be referred to as a first xx script.
[0018] like Figure 1As shown, a method for constructing an industrial lake warehouse based on cold and hot data stratification includes: By stratifying data into hot and cold data, an industrial lake warehouse system is constructed, which divides data into hot data and cold data and stores them separately.
[0019] In this step, if Figure 5 As shown, the cold-hot tiering technology is adopted, including cold data compression and cold data caching. The present invention relates to an industrial lake warehouse system, and in particular to a cold data compression (ColdDataCompaction) technology introduced in an industrial digital twin scenario. In scenarios that deal with a large amount of patch data requirements, such as data migration and integration, data missing value processing, etc., historical data needs to be deleted, which is usually implemented through a delete where statement. In order to manage storage more efficiently, hot and cold data tiering is necessary, in which cold data needs to be reorganized and compressed. To this end, a cold data compression function is introduced, allowing users to reorganize and compress scattered cold data into a more compact format, thereby reducing storage space occupancy and improving storage efficiency. This function is implemented in a specific version and is compressed for a single copy to reduce data conflict processing and simplify operations. During the compression process, the system periodically selects a portion of the cold data for compression, and updates the compressed metadata to the object storage, and other copies synchronize these metadata to reduce IO and CPU overhead.
[0020] The technical points are summarized as follows: Delete historical data: Delete historical data through the delete where statement.
[0021] Hot and cold data tiering: To optimize storage management, hot and cold data are tiered.
[0022] Cold data compression: Reorganize and compress cold data through specific functions (similar to Compaction) to reduce storage space usage.
[0023] Single copy compression optimization: The plan is optimized to perform compression on a single copy, reducing data conflict processing and simplifying operations.
[0024] Metadata management during compression: After compression is completed, metadata is updated to the object storage, and other replicas synchronize metadata to reduce IO and CPU overhead.
[0025] An efficient caching mechanism for cold data is also proposed. Cold data usually refers to data with a large amount of data but relatively low usage frequency. If these data need to be read from the object storage for each query, the query efficiency will be significantly reduced. To solve this problem, the present invention adopts cold data caching technology to store cold data in the local disk, thereby significantly improving data reading speed and query efficiency.
[0026] The size of the cache granularity is crucial to cache efficiency. Too large a granularity may lead to a waste of cache space and bandwidth, while too small a granularity may affect the I / O efficiency of object storage. To this end, the present invention adopts a cache implementation method with Block as the granularity.
[0027] Specifically, the hot and cold data stratification of the present invention is performed at the Rowset level. When a Rowset is cooled, all its data will be uploaded to the object storage. During the query process, the system will read the Rowset of the Tablet involved for data aggregation and calculation. If a cooled Rowset is read, the system will download the cold data required for the query to the local Block cache.
[0028] Considering the performance requirements, the cache strategy of the present invention divides the data according to the block. The block cache adopts a simple LRU (Least Recently Used) replacement strategy to ensure that the data with higher frequency of use can be retained in the cache for a longer time.
[0029] Hot and cold data update and conversion Based on the aforementioned lake-warehouse integrated cold and hot data partitioning, in the digital twin environment, in order to efficiently manage and utilize massive data, the present invention introduces a lake-warehouse integrated cold and hot data partitioning strategy. The data blocks here are divided into two types: cold data blocks (basic data blocks) and hot data blocks (delta data blocks), which correspond to the unchanged part and the changed part of the data respectively.
[0030] Cold data blocks (basic data blocks) store a complete snapshot of data at a specific point in time, representing the static or "cold" state of the data. Each cold data block has a unique serial number, such as B1, B2, ..., Bn, which increases in chronological order. In a digital twin system, each simulated entity or process has an initial empty cold data block B0 to record its initial state.
[0031] A hot data block (delta data block) contains the change instructions that transform a cold data block into a new cold data block. These instructions can be to add, update, or delete records. When the state of a simulation entity or process changes, one or more hot data blocks are generated. For example, Indicates converting cold data block Bi into cold data block Bj (where ) required change instructions.
[0032] In a digital twin system, the process of applying a hot data block to a cold data block to form a new cold data block is called a merge. This operation allows the present invention to update the state of a simulated entity or process based on the latest changes. The merge operation can be written as , indicating that the hot data block Apply to cold data blocks Get the new cold data block .
[0033] The differentiation operation (D) is the inverse of the merge operation, which compares two cold data blocks and creates a hot data block that represents the change instructions required to transform one cold data block into another cold data block. This operation is very useful in digital twin systems because it allows the present invention to identify differences between simulated entity or process states and generate new change instructions accordingly. The differentiation operation can be written as .
[0034] Chaining (C) allows multiple hot blocks to be grouped together to form a single hot block representing consecutive changes. This is very useful when processing a series of consecutive change instructions. Chaining can be written as , indicating that two hot data blocks and Combined together, they form a hot data block representing a continuous change from Bi to Bk . Chain Function Used to combine multiple increment blocks: A common pattern is to use the merge and chain functions together to combine a cold data block with a series of hot data blocks, such as .
[0035] In a digital twin system, each simulated entity or process has its specific merging, chaining, and diffraction functions, which may vary depending on the type of entity or process, the type of data supported, and the frequency of data updates. By effectively managing and utilizing these hot and cold data blocks and their operations, efficient storage, query, and analysis of data in a digital twin system can be achieved, providing strong support for applications such as decision support, simulation optimization, and fault prediction.
[0036] Vectorize the data in the industrial lake warehouse system and optimize the query strategy.
[0037] In this step, in the application of vectorization technology, the present invention further introduces hot and cold data tiering technology to achieve efficient processing of massive data in the lake warehouse integrated system. Vectorization technology first converts the scalar code in the program into vector code, so that the processor can process multiple data items (such as a set of values) at a time instead of processing them individually, thereby making full use of the characteristics of the CPU, such as SIMD (single instruction multiple data) and Pipeline execution, etc., significantly improving the speed and efficiency of data processing. At the data level, hot and cold data tiering technology divides data into hot data and cold data according to the access frequency and importance of the data. Hot data usually refers to data that is frequently accessed and requires a quick response, while cold data refers to data with a lower access frequency and can tolerate a certain delay.
[0038] Vectorization implementation combining hot and cold stratification technology: In the construction of the lake-warehouse integrated system for industrial scenarios, the present invention uses multiple computing nodes to build a data lake for industrial data, and stores and manages massive data through a distributed storage architecture. At this time, combined with vectorization technology and hot and cold data stratification technology, processing resources can be more reasonably allocated to different data layers. For hot data, vectorization technology can be used for processing first to ensure its rapid response; for cold data, a lower-cost and slightly less efficient processing method can be used to balance the performance and cost of the entire system. In this way, not only can efficient processing of massive data be achieved, but also the data processing strategy can be flexibly adjusted according to the actual use of the data, thereby further improving the performance and stability of the entire lake-warehouse integrated system. The core work of realizing vectorization is mainly divided into the following two parts: Query execution optimization based on column storage: In a data processing environment that integrates lakes and warehouses, the traditional row-oriented query execution method has performance bottlenecks when facing large-scale data processing. These bottlenecks mainly include L2 data stagnation, L1 instruction cache stagnation, and inefficient branch prediction. With the development of hardware technology, especially the improvement of disk storage and CPU performance, CPU performance has gradually become a bottleneck for analysis engines. In order to overcome these limitations, this technical solution proposes a query execution optimization solution based on column-oriented storage.
[0039] Data transmission and collaboration between operators: In the industrial big data environment, the processing and analysis of massive data is crucial to improving production efficiency, optimizing resource allocation and decision support. Traditional database systems usually process data by converting input SQL statements into a series of operators and generating physical execution plans. However, in the big data scenario, how to efficiently realize data transmission and collaboration between these operators has become the key to improving data processing performance.
[0040] The industrial lake warehouse system includes data acquisition layer, storage layer and application layer.
[0041] In this embodiment, if Figure 1 As shown, DWD layer dimensional modeling: at the DWD (data warehouse detail layer) layer of the data warehouse (i.e., the industrial lake warehouse system), follow the steps of dimensional modeling to determine the business topics, define the granularity, determine the dimensions, and confirm the fact tables to build a data model that meets the needs of industrial twin applications.
[0042] ETL process: ETL (extraction, transformation, loading) is a key step in data warehouse construction. First, synchronize data from the source system database to the data warehouse's source layer in real time, and then incrementally process the data at the basic layer, general layer, and application layer according to business needs to generate real-time indicators and reports.
[0043] In this embodiment, in the lake-warehouse integrated data processing environment, the traditional row-oriented query execution method has performance bottlenecks when facing large-scale data processing. These bottlenecks mainly include L2 data stagnation, L1 instruction cache stagnation, and inefficient branch prediction. With the development of hardware technology, especially the improvement of disk storage and CPU performance, CPU performance has gradually become the bottleneck of the analysis engine. In order to overcome these limitations, this technical solution proposes a query execution optimization solution based on column-oriented storage.
[0044] Column storage design: Convert the traditional row storage structure to a column storage structure. In column storage, data of the same type is stored together continuously to form data columns. This storage method can significantly improve the locality of data access, reduce the number of data cache failures, and thus improve the utilization efficiency of the CPU cache.
[0045] Query execution optimization: Introducing a query execution process based on column storage. During query execution, data is transferred between operators in blocks. Each operator processes a data block that contains multiple rows of data in the same column.
[0046] like Figure 2 As shown, the query execution process example: Taking a specific query as an example, assume the query is "SELECT o FROM t WHERE m < n + 1". In the columnar storage model, the query execution process can be roughly described as follows: First, a new column is generated through the projection operator (projPlusIntIntConst), which contains the result of adding the values of column n in the table to the constant constArg.
[0047] Next, the select operator (selectLTIntInt) compares the newly generated column with the values of column m to generate a selection vector that contains the indices of the rows that meet the conditions.
[0048] Finally, the materialize operator extracts the rows that meet the conditions from the original data blocks according to the selection vector and returns the columns required by the user (i.e., column o).
[0049] The data memory structure in the original execution engine is based on row records (RowBatch) and tuples (Tuple), where the data is organized by row, and each Tuple contains all the columns of a row of data. Now, the present invention adopts a new data organization method, namely the block (Block) structure, which organizes the data by column, and the data of each column is stored in a continuous memory block.
[0050] As Figure 3 shown, in the implementation of columnar storage, the present invention changes the way the computing engine organizes data. The original row-based storage based on RowBatch and Tuple is replaced by columnar storage based on Column and Block. The new Block structure enables the data to be organized by column, and the data of each column is stored in a continuous memory block, thus facilitating the implementation of vectorized computing. On the right is the new structure Block, and it can be seen that its data is organized by column, and each column is a continuous memory structure.
[0051] As Figure 4 shown, on the basis of columnar storage, the present invention designs a brand-new vectorized function computing framework. This framework can make full use of the advantages of columnar storage to transform traditional row-based computing into column (or vector)-based computing. In this way, multiple data items can be processed at one time, greatly improving the computing efficiency.
[0052] In current data processing systems, Blocks are the basic units of data storage, usually containing multiple columns of continuous memory data, organized in columnar storage. However, in traditional row storage logic, although some function calculations (such as abs()) only operate on specific columns (such as column b), due to the continuous row arrangement of data in memory, other columns (such as column a) will logically participate in the calculation process, although they are not actually used.
[0053] The present invention also provides a vectorized function calculation framework: Input: The original Block, which contains multiple columns of data such as a and b, is organized in columnar storage.
[0054] Processing flow: For columns that need to be vectorized (such as column b), only the data in that column will be processed without involving other columns (such as column a). During function calculation (such as abs()), only the data in column b is operated to generate a new calculation result column (such as abs(b) column).
[0055] Output: The updated Block contains the original columns (such as column a) and the newly added calculation result columns (such as column abs(b)).
[0056] Column storage optimization: Memory structure: The optimized block maintains columnar storage organization, and each column of data occupies an independent continuous memory block. During the calculation process, each column of data is independent of each other in memory and does not interfere with each other.
[0057] Data update: When a column of data is calculated and a new result column is generated, the result column will be added to the Block as a new column, while the original column remains unchanged. Finally, you can choose to keep or remove the original column as needed.
[0058] By implementing this technical solution, the data processing efficiency and memory usage efficiency can be significantly improved. Since the vectorized function calculation framework only processes the target column, unnecessary memory access and calculation overhead are avoided. At the same time, column storage optimization ensures the independence of each column of data in memory, further reducing the possibility of data interaction and conflict. Ultimately, the Block that has been processed by vectorized calculation and column storage optimization will contain a clearer and more efficient data structure, providing strong support for subsequent data processing and analysis. By optimizing the data transmission method between operators, the number and size of data movements in memory are reduced, and the latency of data access is reduced.
[0059] Vectorized Operator Reconstruction In the field of data processing, traditional row-based storage execution logic has performance bottlenecks when processing data. Each time a row of data is processed, multiple type judgments and function calls are required, resulting in low computing efficiency. In contrast, vectorized function computing combined with column-based storage provides a more efficient data processing solution.
[0060] When implementing the present invention, the data processing system first receives a block containing multiple columns as input. Then, based on the characteristics of column storage, the system performs a type judgment on the entire block to determine the type of each column of data. Next, the system uses a vectorized function calculation framework to vectorize each column of data, that is, to process multiple data items at one time. During the processing, the system uses the continuity of the data to reduce the number of cache misses by accessing continuous memory segments, thereby improving data processing performance.
[0061] In the industrial big data environment, the processing and analysis of massive data is crucial to improving production efficiency, optimizing resource allocation and decision support. Traditional database systems usually process data by converting input SQL statements into a series of operators and generating physical execution plans. However, in the big data scenario, how to efficiently realize data transmission and collaboration between these operators has become the key to improving data processing performance.
[0062] The present invention proposes a technical solution for the integrated construction of an industrial big data lake and warehouse, aiming to improve the efficiency and performance of industrial big data processing by optimizing the data transmission mode between operators.
[0063] This technical solution uses Pipeline technology to realize data transmission between operators. Pipeline is divided into two modes: Push Based Mode: In this mode, the upstream operator actively pushes the processed data to the downstream operator. This mode can effectively utilize the cache, reduce the number of data reads, and improve data processing efficiency. The Push Based mode is particularly suitable for application scenarios with fast data generation speed and intensive computing.
[0064] Pull Based Mode (Classic Volcano Model): Downstream operators actively pull data from upstream operators based on demand. Although this mode is more flexible in data control, in big data scenarios, due to the large amount of data and high processing complexity, it may lead to low data pulling efficiency. Therefore, this technical solution mainly uses the Push Based mode in industrial big data processing.
[0065] To further improve the performance of the Push Based mode, this technical solution proposes the following optimization measures: Flow control: By adjusting the push rate, ensure that the upstream operator does not push data to the downstream operator too quickly, causing excessive processing pressure on the downstream operator.
[0066] Cache management: Set the cache size appropriately to avoid data loss or processing interruption caused by cache overflow. At the same time, dynamically replace and update the cache based on data access frequency and hot data.
[0067] Error handling: During data transmission, possible errors are monitored and handled to ensure the stability and reliability of data transmission.
[0068] Based on column storage and vectorized function computing framework, the present invention reconstructs SQL operators and implements vectorized versions of all operators. By vectorizing operators, data can be processed more efficiently, reducing data transmission and copying in memory, thereby reducing I / O and CPU overhead. The present invention proposes a data processing technology based on vectorized function computing and column storage, which significantly improves data processing performance in the following ways: Reduce the number of type judgments: In the execution logic of column storage, the data type of the entire block only needs to be judged once before processing. Compared with the traditional row storage execution logic, which requires type judgment for each row of data, the present invention significantly reduces the number of type judgments, thereby improving data processing efficiency.
[0069] Improve cache affinity: Since column-based data is stored continuously, vectorized function calculation can directly process continuous memory segments. This processing method makes the hit rate of data in the cache higher, that is, the cache affinity is higher, further improving the speed and efficiency of data processing.
[0070] The present invention applies the above-mentioned optimized Pipeline technology to the construction of an integrated industrial big data lake and warehouse. By building a unified data lake storage layer, the aggregation and integration of multi-source heterogeneous data is realized; at the same time, the lake and warehouse integrated architecture is used to realize real-time processing and analysis of data. By optimizing the data transmission mode between operators, this technical solution can significantly improve the efficiency and performance of industrial big data processing and provide strong data support for industrial production.
[0071] Steps for hot and cold data tiering include cold data compression and cold data caching.
[0072] System architecture: In the industrial twin scenario, the present invention uses Doris as the data lake analysis engine. The industrial lake warehouse architecture based on Doris is simple and efficient, and mainly includes two core components: Frontend (FE) and Backend (BE). FE is responsible for receiving and parsing SQL query statements, performing query optimization and query scheduling, while BE is responsible for data storage, reading and calculation processing.
[0073] Frontend (FE) operation: After receiving the SQL query statement, FE will go through a series of processing flows. First, it will perform SQL parsing and convert the query statement into an abstract syntax tree (AST). Subsequently, FE will perform syntax and semantic analysis to verify the legitimacy of the query. Next, FE will generate a logical execution plan based on the results of the analysis, and optimize it using the hot and cold data stratification technology through the optimizer. During the optimization process, FE will identify the hot and cold data involved in the query and assign them to different processing paths to maximize resource utilization efficiency and query performance. After optimization, FE will generate a physical execution plan (Plan Fragment) that BE can execute, and schedule it to the appropriate BE node for execution.
[0074] Backend (BE) operation: After receiving the Plan Fragment from FE, BE will read and process the data according to its instructions. Since FE has optimized the query by hot and cold data stratification, BE can process data of different temperatures more efficiently during execution. BE nodes are completely equal, and FE will distribute the data reading and processing tasks to the corresponding BE nodes according to certain strategies (taking into account the hot and cold properties of the data). BE will read files from the data lake and select appropriate readers to parse the data according to the hot and cold properties of the data. For hot data, BE may use a more efficient reading method; for cold data, it may adopt a lower-cost reading strategy. When processing data, BE will use the vectorized execution engine to perform efficient filtering and aggregation operations on the data, and finally return the processing results to FE. Through the application of hot and cold data stratification technology, BE can significantly improve the response speed and overall performance of queries while ensuring data accuracy.
[0075] In the industrial twin scenario, the operation process of the integrated lake-warehouse construction technology combined with Doris's industrial big data is as follows, with special attention paid to the cold and hot data stratification strategy: 1. Doris lake warehouse integrated deployment First, the Doris lake warehouse integrated architecture is deployed. The present invention selects a group of high-performance servers and installs Doris cluster nodes, including data nodes, management nodes, and query nodes. These nodes will be integrated into the existing Hadoop HDFS cluster to ensure that Doris can efficiently interact with the big data tools in the Hadoop ecosystem.
[0076] 2. Industrial data schema design Subsequently, according to the needs of the industrial twin scenario, a schema suitable for storing various types of industrial data is created. The schema defines the structure, field types, and attributes of the data table to ensure that the data can be stored and managed according to unified standards. The present invention fully considers the diversity and complexity of industrial data to ensure that the schema design can flexibly adapt to various industrial application scenarios.
[0077] 3. Data table creation and data loading After the Schema design is completed, the present invention starts to build and load the data table. Industrial big data is usually stored in Hadoop file format, and Doris can directly read data in these formats to achieve efficient data loading. At the same time, the present invention uses the partitioning function of Doris to group data according to industrial characteristics for fast query and processing.
[0078] 4. Industrial data query and visualization After the data is loaded, the present invention uses SQL query language to retrieve and analyze industrial data. In order to display the data results more intuitively, the present invention uses visualization tools such as Tableau and QlikView to display the query results with elements such as charts and data tags. These visualization tools can help the present invention quickly discover the laws and trends in the data and provide strong support for industrial twin applications.
[0079] 5. Doris configuration optimization In order to ensure the stability and performance of Doris under high load, the present invention has carried out a series of configuration optimization work. This includes adjusting the parameter settings of the query engine, optimizing the data loading strategy, and managing metadata storage. Through configuration optimization, Doris can accurately process and respond to data in various complex industrial scenarios, providing strong data support for industrial twin applications.
[0080] 6. Data warehouse layered design In the process of building an integrated industrial big data lake and warehouse, the present invention follows the principle of layered design. The data warehouse is divided into ODS (source layer), DW layer (data warehouse layer) and DM layer (data mart layer). Each layer has its specific role and function to ensure that data can flow in an orderly manner and be used efficiently during collection, storage, processing and exchange. At the same time, the present invention uses methods such as dimensional modeling and paradigm modeling to build a data model to ensure that the data warehouse system is scalable and high-performance. Through data layered design, the present invention can better manage industrial big data resources and provide stable and reliable data support for industrial twin applications.
[0081] 7. Optimization of hot and cold data stratification In the industrial twin scenario, the data stratification technology operation process of industrial big data includes the processing and utilization of cold data, which is specifically divided into two key steps: cold data compression and cold data caching: (1) Cold Data Compaction In industrial twin applications, as the amount of data continues to grow, some data will gradually cool down, that is, its access frequency will decrease. In order to optimize storage resources and improve storage efficiency, the present invention adopts cold data compression technology.
[0082] Data screening and identification: First, the system will mark historical and infrequently accessed data as cold data based on parameters such as data usage frequency and access time.
[0083] Physical deletion and reorganization: When the cold data reaches a certain amount or meets certain conditions, the system triggers the ColdDataCompaction process. Doris 2.0 and subsequent versions support physical deletion of cold data stored in object storage and reorganize the scattered cold data into a more compact format.
[0084] Single copy compression optimization: Considering that there is only one copy of cold data, Doris will use a single copy for compaction, which is not only the best solution, but also simplifies the operation of handling data conflicts.
[0085] Background thread periodic execution: The BE background thread will periodically select a certain number of tablets from the cooling tablets for ColdDataCompaction. Only CooldownReplica can perform ColdDataCompaction of the tablet to reduce the IO of the object storage and the CPU overhead of the node itself.
[0086] Flushing data and uploading objects: During the compaction process, every time a certain size of data (5 MB by default) is accumulated, a Part is uploaded to the object storage to free up local storage space.
[0087] Metadata synchronization: After the compaction is completed, CooldownReplica will update the metadata of the cooling data to the object storage. Other Replica only need to synchronize metadata from the object storage to ensure data consistency.
[0088] (2) Cold Data Cache In order to improve the query efficiency of cold data, the present invention adopts cold data caching technology.
[0089] Cache granularity selection: Considering the efficiency of cache, Apache Doris adopts the cache implementation with block as the granularity. This can avoid the waste of cache space and bandwidth caused by too large granularity, and prevent the low efficiency of object storage IO caused by too small granularity.
[0090] Data download and cache: When the system needs to query a cooled rowset, it first downloads the cold data required for the query from the object storage to the local Block Cache according to the granularity of the block.
[0091] Query performance optimization: The access performance of cold data stored in Block Cache is consistent with the data performance of non-cold and hot tiered tables, ensuring that query efficiency is not affected.
[0092] LRU cache strategy: Block Cache itself adopts a simple LRU (least recently used) strategy to ensure that frequently used data can be stored in the cache longer, thereby improving the hit rate of data access.
[0093] Through the above cold data compression and cold data caching technologies, efficient storage and fast query of industrial big data can be achieved in the industrial twin scenario, providing stable and reliable data support for industrial twin applications.
[0094] Through the above technical operation process, the integrated management of industrial big data lake and warehouse is realized in the industrial twin scenario, providing efficient and reliable data support for industrial twin applications. The architecture design and processing capabilities based on Doris data access can meet the complex needs of industrial big data processing, ensure the real-time and accuracy of data, and provide strong data support for industrial twin applications.
[0095] It should be understood that, although each step in the flow chart of each embodiment of the present invention is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0096] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0097] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0098] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.
[0099] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for constructing an industrial lake warehouse based on cold and hot data stratification, characterized in that: The method comprises: By stratifying data into hot and cold data, an industrial lake warehouse system is constructed, wherein the industrial lake warehouse system divides data into hot data and cold data and stores them separately; Vectorize the data in the industrial warehouse system and optimize the query strategy; The industrial lake warehouse system includes a data acquisition layer, a storage layer and an application layer; Steps for hot and cold data tiering include cold data compression and cold data caching.
2. The method for constructing an industrial lake warehouse based on cold and hot data stratification according to claim 1 is characterized in that: The steps of cold data compression include: Data screening and identification: based on the frequency of data use and access time, data that is accessed infrequently in the historical process is marked as cold data; Physical deletion and reorganization: When cold data meets the conditions, the ColdDataCompaction process is triggered to physically delete the cold data stored in the object storage and reorganize the scattered cold data into a preset format; Single copy compression optimization: Use a single copy for compaction; Background thread periodically executes: The BE background thread periodically selects a preset number of tablets from the cooling tablets for ColdDataCompaction; Flushing data and uploading objects: During the compaction process, each time a preset size of data is accumulated, a part is uploaded to the object storage and local storage space is released. Metadata synchronization: After the compaction is completed, the metadata of the cooling data is updated to the object storage, and other Replica nodes synchronize metadata from the object storage.
3. The method for constructing an industrial lake warehouse based on cold and hot data stratification according to claim 1 is characterized in that: The steps of cold data caching include: Cache granularity selection: Use cache implementation with Block as the granularity; Data download and cache: When you need to query a cold rowset, first download the cold data required for the query from the object storage to the local Block Cache according to the granularity of the block; Query performance optimization: The access performance of cold data stored in Block Cache is consistent with the data performance of non-cold and hot tiered tables; LRU cache strategy: adopt LRU strategy.
4. The method for constructing an industrial lake warehouse based on cold and hot data stratification according to claim 1 is characterized in that: The data in the industrial lake warehouse system consists of cold data blocks and hot data blocks. The cold data block stores a complete data snapshot at a specific time point, representing the static state of the data. Each cold data block has a unique serial number, which increases in chronological order. Each simulation entity or process has an initial air-cold data block B0 to record its initial state. The hot data block contains the change instructions for converting the cold data block into a new cold data block. The change instructions are used to add, update or delete records. When the state of the simulation entity or process changes, one or more hot data blocks will be generated.
5. The method for constructing an industrial lake warehouse based on cold and hot data stratification according to claim 1 is characterized in that: The data operations in the industrial lake warehouse system include merge operations, differentiation operations, and chain operations. The process of applying hot data blocks to cold data blocks to form new cold data blocks is called merge operations. The merge operation is represented as , indicating that the hot data block Apply to cold data blocks Get the new cold data block ; Differentiation operation It is the reverse process of the merge operation. The specific operation is to compare two cold data blocks and create a hot data block, which represents the change instructions required to convert one cold data block into another cold data block. The differentiation operation is expressed as .
6. The method for constructing an industrial lake warehouse based on cold and hot data stratification according to claim 1 is characterized in that: The chain operation C is used to combine multiple hot data blocks together to form a single hot data block representing continuous changes; Chaining can be written as , indicating that two hot data blocks and Combined together, they form a hot data block representing the continuous change from Bi to Bk ; Chain function Used to combine multiple increment blocks: .
7. The method for constructing an industrial lake warehouse based on cold and hot data stratification according to claim 1 is characterized in that: The steps to vectorize the data in the industrial lake warehouse system include: Perform dimensional modeling based on the DWD layer to determine business topics, define granularity, determine dimensions, and confirm fact tables to build the required data model; Extract, convert and load source data, and synchronize the source data to the industrial warehouse system in real time; The data in the industrial lake warehouse system adopts a column storage structure. In column storage, data of the same type are stored together continuously to form data columns.
8. The method for constructing an industrial lake warehouse based on cold and hot data stratification according to claim 7 is characterized in that: The steps of optimizing the query strategy include introducing a query execution process based on column storage, and the query execution process includes generating new columns through a projection operator; Compare the newly generated column with the value of the m column through the selection operator to generate a selection vector, which contains the indexes of the rows that meet the conditions; The materialized operator selects the vector to extract the rows that meet the conditions from the original data block and returns the columns required by the user.
9. The method for constructing an industrial lake warehouse based on cold and hot data stratification according to claim 1 is characterized in that: The steps of vectorizing the data in the industrial lake warehouse system include building a vectorized function calculation framework. The operation process of the vectorized function calculation framework is as follows: Input: The original Block, which contains multiple columns of data and is organized in column storage; Processing flow: For the column that needs to perform vectorized calculation, only the data in this column is processed without involving other columns. During the function calculation process, only the data in column b is operated to generate a new calculation result column; Output: The updated Block contains the original columns and the newly added calculation result columns.
10. The method for constructing an industrial lake warehouse based on cold and hot data stratification according to claim 1 is characterized in that: The steps of vectorizing the data in the industrial lake warehouse system also include reconstructing the vectorized operators, using the Pipeline mechanism to realize data transmission between operators, using the Push Based mode, the upstream operator actively pushes the processed data to the downstream operator, and optimizing the Push Based mode, including flow control: adjusting the push rate; Cache management: Set the cache size and dynamically replace and update the cache based on data access frequency and hot data conditions; Error handling: Monitor and handle errors during data transmission.
Citation Information
Patent Citations
distributed cold and hot data separation method based on Redis and HBase
CN109871367A
Data storage method and database
CN110134723A
Distributed storage method supporting mounting of multi-file system
CN111881107A
Hot and cold data-oriented hierarchical storage system and method
CN112948398A
Data processing method and device, electronic equipment and computer readable storage medium
CN114610760A
Cited By
Data storage method and system based on data compression technology
CN118915976A
Data lake and warehouse integrated management system and method based on port traffic
CN119025598A
Data management method based on real-time data warehouse
CN120407565A
Dynamic hierarchical storage method and system based on lake and warehouse integrated framework
CN120929022A
A dynamic hierarchical storage method and system based on lake-warehouse integrated architecture
CN120929022B
