Dimension table cache management method and system for data distribution characteristics in Gaia cluster

By adopting a multi-way balanced skip table structure and a full-cycle distributed cache management mechanism in the Gaia cluster, the performance bottleneck and development complexity of dimension table cache management in the big data computing system are solved, and efficient dimension table association calculations and Saving of memory resources.

CN113626434BActive Publication Date: 2024-09-27BEIJING INST OF TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110890099.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-04
Publication Date
2024-09-27
Estimated Expiration
2041-08-04

AI Technical Summary

Technical Problem

When existing big data computing systems process batch stream data, it is difficult to balance memory space occupancy and query efficiency, and lack an effective cache management mechanism, resulting in performance bottlenecks and development complexity.

Method used

In the Gaia cluster, a dimension table cache management method oriented to data distribution characteristics is adopted, and a cache index is built through a multi-way balanced skip table structure and a full-cycle distributed cache management mechanism, which supports everything from construction to query to incremental update, reducing the update cost. .

Benefits of technology

It implements efficient dimension table association calculations in the Gaia cluster, takes into account memory space and query efficiency, simplifies user programming work, is compatible with the execution characteristics of the underlying computing engine, and saves memory resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113626434B
    Figure CN113626434B
Patent Text Reader

Abstract

The present invention discloses a dimension table cache management method and system for data distribution characteristics in a Gaia cluster, and constructs a full-cycle distributed cache management mechanism from construction to query to incremental update. It includes a data distribution feature extraction module and a cache management module, and the cache management module is a cache construction, cache query and cache update submodule. The data distribution feature extraction module extracts data samples from the dimension table data, and counts the p quantiles of the sample data as the distribution characteristics of the full data. The cache construction submodule completes the initialization of the routing array according to the statistical p quantiles; uses the segment determination method to determine the segment to which each dimension table data belongs; and uses the index establishment method to establish an index for each dimension table data. The cache query submodule adopts a cache query method to query the corresponding dimension table data from the multi-way balanced jump table according to the keywords recorded in the flow data. The cache update submodule defines a balance adjustment method between p segment jump tables.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of big data technology, and in particular to a dimension table cache management method and system oriented to data distribution characteristics in a Gaia cluster. Background Art

[0002] Since the beginning of this century, big data processing technologies represented by Hadoop have provided reliable computing services for organizations from all walks of life, alleviating the pressure of processing huge amounts of data. However, driven by the booming development of information technology, massive data continues to grow, and real-time requirements are becoming increasingly stringent. Under this situation, the development direction of existing computing engines has moved towards stream computing, either Spark, which simulates the behavior of stream computing on the basis of the original batch computing engine, or Storm, which was designed for the characteristics of stream computing from the beginning. However, in the face of the dual processing requirements of offline batch data and real-time collected stream data, developers based on existing computing engines often need to maintain engineering projects written using two sets of independent APIs, or even build two different data processing platforms, which greatly increases the operating costs of enterprises. Therefore, developing a new big data computing system that can shield the underlying execution differences between batch computing and stream computing and integrate batch and stream computing is a hot research direction nowadays.

[0003] The Gaia system is a highly efficient and scalable new generation big data analysis system for the coexistence of multiple computing models. It solves a series of key technical problems in several core aspects of the big data analysis system, such as adaptive and scalable big data storage, batch-stream fusion big data computing, high-dimensional large-scale machine learning, and high-efficiency big data intelligent interactive wizards, to build an autonomous and controllable high-efficiency and scalable new generation big data analysis system, and master the core technologies of the internationally leading big data analysis system.

[0004] The Gaia system has full-cycle multi-scale optimization and a unified computing engine for batch-stream hybrid tasks. Existing big data computing systems either rely on their own computing engines to simulate the behavior of another type of framework, or define a set of general interfaces to shield the differences in the underlying computing engines, and have weak support for batch-stream fusion. At the same time, most of their optimizations are located in a specific period or specific level of execution, and the optimization capabilities for highly complex tasks are insufficient. In response to the above problems, a high-performance batch-stream fusion big data computing technology based on a unified computing engine and full-cycle multi-scale optimization has been innovatively developed. This technology provides unified expression logic support for batch-stream fusion processing, and integrates the computing model, data model, transformation model and action model of batch-stream processing through unified expression modeling to achieve true fusion of batch and stream processing. In view of the diversity, persistence, and iteration of jobs, optimization strategies such as multi-jobs, multi-tasks, iterative computing, and persistent computing are provided, and the optimization is more targeted. At the same time, full-cycle optimization is provided before and during execution, and is subdivided into multiple scales such as job level, task level, and transformation level to achieve extremely fast response and massive throughput.

[0005] Dimension table is a concept in the field of data warehouse. It is usually an offline data table stored in an external data storage system. It is often used to perform join operations with real-time user behavior logs collected from terminals to supplement additional information. Therefore, dimension table association technology is a good entry point for studying batch-stream interaction.

[0006] Among the existing dimension table association technologies, if you choose to query offline data in real time as streaming data is ingested, the performance bottleneck will be transferred to the external storage system; if a caching strategy is adopted, since common big data computing systems do not provide APIs for related services, developers need to build the cache themselves, which will undoubtedly increase the burden on developers. More importantly, it is not fully compatible with the execution characteristics of the system's underlying computing engine to maximize computing performance. Summary of the invention

[0007] In view of this, the present invention provides a dimension table cache management method and system for data distribution characteristics in a Gaia cluster. In order to take into account both memory space occupancy and query efficiency when Gaia performs dimension table association calculations, so as to support larger-scale dimension table data and achieve extremely fast response, the present invention fully considers the distribution characteristics of dimension table data, and on this basis develops a full-cycle distributed cache management mechanism from construction to query to incremental update.

[0008] To achieve the above object, the technical solution of the present invention is: a dimension table cache management method for data distribution characteristics in a Gaia cluster, comprising the following steps:

[0009] Step 1: Use data distribution characteristics to construct a dimension table associated cache index structure. The dimension table associated cache index structure is a multi-way balanced jump table, which consists of a routing array of a fixed size of 2p-1 and p balanced segment jump tables, where the parameter p is specified by the user through a configuration file or an API interface;

[0010] Step 2: Extract the distribution characteristic information of the dimension table data.

[0011] Step 3: Build a full-cycle distributed cache management mechanism, which includes the following steps:

[0012] S301, cache construction is performed, specifically: first, a method for initializing a routing array is defined, which is used to extract p quantiles according to the distribution characteristics of the full dimension table data to complete the initialization of the routing array; a segment determination method is also defined, which is used to determine the segment to which each dimension table data belongs; and an index establishment method is also defined, which is used to establish an index for each dimension table data.

[0013] S302: During the execution of the dimension table association calculation task, corresponding dimension table data is queried from the multi-way balance jump table according to the keyword of the stream data record.

[0014] S303: A balance adjustment method between p segment skip tables is used to support incremental updates to dimension table data cache and reduce update costs.

[0015] Furthermore, step 2 specifically includes the following steps:

[0016] S201: The Gaia cluster system takes dimension table data into the system's network buffer through the DataSet data source, and specifies the primary key column of the dimension table data as a keyword through the API interface.

[0017] S202: The DataSet data source calculates the Hash value of the keyword and distributes the dimension table data in the network buffer to the downstream associated calculation operator through the Hash partitioning method.

[0018] S203: extracting sample data from the collected dimension table data through a sampling algorithm, and then counting the p quantiles of the sample data, where the p quantiles of the sample data are used to represent the distribution characteristics of the full dimension table data; the p quantiles of the sample data are sent to the downstream associated operator together with the dimension table data in the network buffer.

[0019] Further, S301 includes the following steps:

[0020] S3011: After the cache construction submodule receives the p quantile of the sample data, it calls the initialization method of the routing array to complete the initialization of the routing array.

[0021] S3012: When subsequent dimension table data arrives, a segment determination method is called to determine the segment to which each dimension table data belongs.

[0022] S3013: Using an index creation method, a corresponding index is created for each dimension table data in the segmented skip list.

[0023] Further, S302 includes the following steps:

[0024] S3021: using the keyword recorded in the stream data as an index, determining the segment where the corresponding index is located through a segment determination algorithm;

[0025] S3022: Search the corresponding index in the segment according to the search method of the skip table;

[0026] S3023: Get the dimension table data pointed to by the index and return it.

[0027] Further, S303 includes the following steps:

[0028] S3031: The Gaia cluster system queries the external storage system through the DataSet data source and imports the newly added dimension table data into the system's network buffer.

[0029] S3032: Package the newly added dimension table data into ADD events, package the data with changed values ​​into MOD events, and package the expired dirty data into DEL events. The events contain complete dimension table data and are distributed to downstream associated calculation operators through Hash partitions.

[0030] S3033: Classify and process the events. First, locate the location of the newly added dimension table data in the cache. For ADD events, insert is performed. For MOD events, update is performed. For DEL events, delete is performed.

[0031] S3034: calling a balance adjustment method to adjust the p segment jump tables, redetermine the boundaries between the segment jump tables to keep their sizes balanced, and at the same time feed back the boundary values ​​of the segment jump tables to the routing array.

[0032] S3035: After receiving the boundary value fed back by the segment hop table, the routing array determines that a new p quantile point covers the old p quantile point to ensure the validity of the data distribution feature.

[0033] A dimension table cache management system for data distribution characteristics in a Gaia cluster includes a data distribution characteristic extraction module and a cache management module.

[0034] The cache index structure, called a multi-way balanced skip table, consists of a routing array with a fixed size of 2p-1 and p segment skip tables of balanced size, where the parameter p can be specified by the user through a configuration file or an API interface.

[0035] The data distribution feature extraction module is used to extract the distribution feature information of the dimension table data. Specifically, data samples are extracted from the dimension table data through a sampling algorithm, and then the p quantiles of the sample data are counted. The p quantiles of the sample data can represent the distribution characteristics of the full dimension table data.

[0036] The cache management module is further divided into a cache construction submodule, a cache query submodule and a cache update submodule, which are used to establish a full-cycle distributed cache management mechanism from construction to query to incremental update.

[0037] The cache construction submodule is used to complete the initialization of the routing array according to the p quantiles counted by the data distribution feature extraction module; it is also used to determine the segment to which each dimension table data belongs according to the segment determination method; and it also defines an index establishment method for establishing an index for each dimension table data.

[0038] The cache query submodule adopts a cache query method to query the corresponding dimension table data from the multi-way balanced jump table according to the keywords recorded in the flow data during the execution of the dimension table association calculation task.

[0039] The cache update submodule adopts a balanced adjustment method between p segmented skip tables to incrementally update the dimension table data cache and reduce the update cost.

[0040] Furthermore, the Gaia cluster system uses the DataSet data source to ingest dimension table data into the system's network buffer, and specifies the primary key column of the dimension table data as the keyword through the API interface; the DataSet data source calculates the Hash value of the keyword and distributes the dimension table data to downstream associated calculation operators through the Hash partitioning method.

[0041] The data distribution feature extraction module includes the following functions: extracting sample data from the collected dimension table data through a sampling algorithm, and then counting the p quantiles of the sample data. The p quantiles of the sample data are used to represent the distribution characteristics of the full dimension table data; the p quantiles of the sample data are sent to the downstream associated operators together with the dimension table data in the network buffer.

[0042] Furthermore, the cache construction submodule includes the following functions: after receiving the p quantile of the sample data, the cache construction submodule calls the initialization method of the routing array to complete the initialization of the routing array; for the arrival of subsequent dimension table data, the cache construction submodule calls the segment determination method to determine the segment to which each dimension table data belongs; the cache construction submodule adopts the index establishment method to establish a corresponding index for each dimension table data in the segment jump list.

[0043] Furthermore, the cache query submodule includes the following functions: the cache query submodule is used to determine the segment where the corresponding index is located through the segment determination algorithm according to the keywords recorded in the stream data, query the corresponding index in the segment according to the jump table search method, and then retrieve the dimension table data pointed to by the index and return it.

[0044] Furthermore, the cache update submodule includes the following functions:

[0045] The Gaia cluster system queries the external storage system through the DataSet data source and imports the newly added dimension table data into the system.

[0046] The cache update submodule packages the newly added dimension table data into ADD events, the data with changed values ​​into MOD events, and the expired dirty data into DEL events. The event contains complete dimension table data and is distributed to downstream associated calculation operators through Hash partitions, using the same Hash function as the feature extraction module.

[0047] The cache update submodule classifies and processes the received events, locates the location of the newly added dimension table data in the cache, performs insertion for ADD events, performs update for MOD events, and performs deletion for DEL events.

[0048] The cache update submodule calls the balance adjustment method to adjust the p segment skip tables, redefine the boundaries between the segment skip tables to keep their sizes balanced, and feed back the boundary values ​​to the routing array; after the routing array receives the boundary values ​​fed back by the segment skip tables, it determines that the new p quantiles cover the old p quantiles to ensure the validity of the data distribution characteristics.

[0049] Beneficial effects:

[0050] 1. The present invention provides a dimension table cache management method for data distribution characteristics in a Gaia cluster, which configures cache services for dimension table-related businesses on the underlying computing engine and exposes relevant interface APIs for users to use. This simplifies the user's programming workload while being compatible with the execution characteristics of the computing engine, making it convenient to give full play to the system performance. In addition, a cache index structure that supports incremental updates is designed in combination with the distribution characteristic information of the dimension table data, which can not only ensure the stability of query efficiency but also save memory resources.

[0051] 2. The present invention provides a dimension table cache management system for data distribution characteristics in a Gaia cluster, including a data distribution feature extraction module and a cache management module. The cache management module can be divided into a cache construction submodule, a cache query submodule and a cache update submodule. The data distribution feature extraction module extracts data samples from the dimension table data through a sampling algorithm, and counts the p quantiles of the sample data as the distribution characteristics of the full data. The cache construction submodule is responsible for the construction work divided into two parts. First, a routing array initialization method is defined, which is used to complete the initialization of the routing array according to the p quantiles counted by the data distribution feature extraction module; a segment determination method is also defined, which is used to determine the segment to which each dimension table data belongs; and an index establishment method is also defined, which is used to establish an index for each dimension table data. The cache query submodule defines a cache query method, which is used to query the corresponding dimension table data from the multi-way balanced jump table according to the keywords recorded in the stream data during the execution of the dimension table association calculation task. The cache update submodule defines a balance adjustment method between p segment jump tables, which is used to support incremental updates to the dimension table data cache and reduce the update cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 It is a schematic diagram of the overall framework composed of various modules in an embodiment of the present invention;

[0053] Figure 2 Schematic diagram of data distribution feature extraction in an embodiment of the present invention;

[0054] Figure 3 A schematic diagram of a multi-way balanced jump table structure in an embodiment of the present invention;

[0055] Figure 4 It is a schematic diagram of incremental update of cache and segmented balance adjustment of multi-way balanced jump table in an embodiment of the present invention. DETAILED DESCRIPTION

[0056] The present invention is described in detail below with reference to the accompanying drawings and embodiments.

[0057] The dimension table cache management method for data distribution characteristics in the Gaia cluster includes the following steps:

[0058] Step 1: Use data distribution characteristics to construct a dimension table associated cache index structure. The dimension table associated cache index structure is a multi-way balanced jump table, which consists of a routing array of a fixed size of 2p-1 and p balanced segment jump tables, where the parameter p is specified by the user through a configuration file or an API interface;

[0059] Step 2: extracting distribution feature information of dimension table data; Step 2 specifically includes the following steps:

[0060] S201: The Gaia cluster system imports dimension table data into the system's network buffer through the DataSet data source, and specifies the primary key column of the dimension table data as a keyword through the API interface;

[0061] S202: The DataSet data source calculates the Hash value of the keyword and distributes the dimension table data in the network buffer to the downstream associated calculation operator through the Hash partition method;

[0062] S203: extracting sample data from the collected dimension table data through a sampling algorithm, and then counting the p quantiles of the sample data, where the p quantiles of the sample data are used to represent the distribution characteristics of the full dimension table data; the p quantiles of the sample data are sent to the downstream associated operator together with the dimension table data in the network buffer.

[0063] Step 3: Build a full-cycle distributed cache management mechanism, which includes the following steps:

[0064] S301, cache construction is performed, specifically: first, a method for initializing a routing array is defined, which is used to extract p quantiles according to the distribution characteristics of the full dimension table data, and complete the initialization of the routing array; a segment determination method is also defined, which is used to determine the segment to which each dimension table data belongs; an index establishment method is also defined, which is used to establish an index for each dimension table data; S301 includes the following steps:

[0065] S3011: After the cache construction submodule receives the p quantile of the sample data, it calls the initialization method of the routing array to complete the initialization of the routing array;

[0066] S3012: When subsequent dimension table data arrives, a segment determination method is called to determine the segment to which each dimension table data belongs;

[0067] S3013: Using an index creation method, a corresponding index is created for each dimension table data in the segmented skip list.

[0068] S302, during the execution of the dimension table association calculation task, query the corresponding dimension table data from the multi-way balance jump table according to the keyword of the flow data record; S302, including the following steps:

[0069] S3021: using the keyword recorded in the stream data as an index, determining the segment where the corresponding index is located through a segment determination algorithm;

[0070] S3022: Search the corresponding index in the segment according to the search method of the skip table;

[0071] S3023: Get the dimension table data pointed to by the index and return it.

[0072] S303, a balance adjustment method between p segment skip tables, used to support incremental updates to dimension table data cache and reduce update costs. S303, including the following steps:

[0073] S3031: The Gaia cluster system queries the external storage system through the DataSet data source and imports the newly added dimension table data into the system's network buffer;

[0074] S3032: Package the newly added dimension table data into ADD events, package the data with changed values ​​into MOD events, and package the expired dirty data into DEL events. The events contain complete dimension table data and are distributed to downstream associated computing operators through Hash partitions.

[0075] S3033: Classify and process the events. First, locate the location of the newly added dimension table data in the cache. For ADD events, insert is performed. For MOD events, update is performed. For DEL events, delete is performed.

[0076] S3034: calling a balance adjustment method to adjust the p segment jump tables, re-determine the boundaries between the segment jump tables to keep their sizes balanced, and at the same time feed back the boundary values ​​of the segment jump tables to the routing array;

[0077] S3035: After receiving the boundary value fed back by the segment hop table, the routing array determines that a new p quantile point covers the old p quantile point to ensure the validity of the data distribution feature.

[0078] The present invention also provides a dimension table cache management system for data distribution characteristics in a Gaia cluster, which utilizes data distribution characteristics to construct a dimension table associated cache index structure, mainly including a data distribution feature extraction module and a cache management module. The cache management module can be divided into a cache construction submodule, a cache query submodule and a cache update submodule.

[0079] The cache index structure, called a multi-way balanced skip table, consists of a routing array of fixed size 2p-1 and p segment skip tables of balanced size, where the parameter p can be specified by the user through the configuration file or API interface. For example, p can be set to 9 based on experience.

[0080] The data distribution feature extraction module is responsible for extracting the distribution feature information of the dimension table data. Specifically, data samples are extracted from the dimension table data through a sampling algorithm, and then the p quantile of the sample data is counted. The p quantile of the sample data can represent the distribution characteristics of the full dimension table data.

[0081] The cache management module can be further divided into a cache construction submodule, a cache query submodule and a cache update submodule, which is responsible for establishing a full-cycle distributed cache management mechanism from construction to query to incremental update.

[0082] The cache construction submodule is responsible for two parts of construction work. First, it defines the initialization method of the routing array, which is used to complete the initialization of the routing array according to the p quantiles counted by the data distribution feature extraction module; it also defines the segment determination method, which is used to determine the segment to which each dimension table data belongs; it also defines the index establishment method, which is used to establish an index for each dimension table data.

[0083] The cache query submodule defines a cache query method, which is used to query the corresponding dimension table data from the multi-way balanced jump table according to the keywords of the stream data record during the execution of the dimension table association calculation task.

[0084] The cache update submodule defines a balance adjustment method between p segment skip tables to support incremental updates to the dimension table data cache and reduce the update cost.

[0085] The work of the data distribution feature extraction module includes the following specific steps:

[0086] Step 1: The Gaia cluster uses the DataSet data source (a data type, batch data) to ingest dimension table data into the system, and specifies the primary key column of the data as the keyword through the API interface;

[0087] Step 2: The DataSet data source calculates the hash value of the keyword and distributes the dimension table data to the downstream associated calculation operator through the hash partition method;

[0088] Step 3: The data distribution feature extraction module is responsible for statistically analyzing the distribution feature information of the dimension table data. Specifically, the data distribution feature information is collected through a sampling algorithm and represented by the p-quantile of the sample data to assist in initializing the cache index structure; the p-quantile of the sample data

[0089] Step 4: The p-quantiles counted by the data distribution feature extraction module are sent to the downstream associated operators along with the dimension table data in the network buffer. Each buffer corresponds to a set of p-quantiles; all associated operators 3 share a cache management module;

[0090] The work of caching submodules includes the following specific steps:

[0091] Step 1: After the cache construction submodule receives the p quantile sent by the data distribution feature extraction module, it calls the initialization method of the routing array to complete the initialization of the routing array;

[0092] Step 2: When subsequent dimension table data arrives, the cache construction submodule calls the segment determination method to determine the segment to which each dimension table data belongs;

[0093] Step 3: The cache construction submodule calls the index creation method to create a corresponding index for each dimension table data in the segmented skip list.

[0094] The work of the cache query submodule includes the following specific steps:

[0095] Step 1: According to the keyword of the stream data record, the segment where the corresponding index is located is determined by the segment determination algorithm;

[0096] Step 2: Go to the specified segment and search for the corresponding index according to the skip table search method;

[0097] Step 3: Get the dimension table data pointed to by the index and return it.

[0098] The work of the cache update submodule includes the following specific steps:

[0099] Step 1: The Gaia system queries the external storage system through the DataSet data source and imports the latest dimension table data into the system;

[0100] Step 2: To support incremental updates, newly added data needs to be packaged into ADD events, data with changed values ​​needs to be packaged into MOD events, and expired dirty data needs to be packaged into DEL events. The events contain complete dimension table data and are distributed to downstream association calculation operators through Hash partitions, using the same Hash function as the feature extraction module.

[0101] Step 3: The cache update submodule receives the events sent from step 2 and performs classification processing. First, it locates the data in the cache according to steps 2 and 3 of the cache construction submodule. For ADD events, it performs insertion, for MOD events, it performs update, and for DEL events, it performs deletion.

[0102] Step 4: Call the balance adjustment method to adjust the p segment jump tables, redefine the boundaries between the segment jump tables to keep their sizes balanced, and feed back the boundary values ​​to the routing array.

[0103] Step 5: After the routing data receives the boundary value fed back by the segment hopping table, it is used as the new p-quantile to overwrite the old p-quantile to ensure the validity of the data distribution characteristics.

[0104] The present invention provides a cache optimization method for data distribution characteristics in a Gaia cluster, which configures cache services for dimension table-related businesses on the underlying computing engine and exposes relevant interface APIs for users to use. This simplifies the user's programming workload while being compatible with the execution characteristics of the computing engine, making it convenient to give full play to the system performance. In addition, a cache index structure that supports incremental updates is designed in combination with the distribution characteristic information of dimension table data, which can not only ensure the stability of query efficiency but also save memory resources.

[0105] Figure 1 The figure shows a schematic diagram of the module composition of a cache optimization method for data distribution characteristics in a Gaia cluster provided by the present invention, including a data distribution characteristic extraction module and a cache management module. The cache management module can be further divided into a cache construction submodule, a cache query submodule and a cache update submodule.

[0106] The data distribution feature extraction module is used to extract data distribution feature information from the dimension table data stream, such as Figure 2 As shown, the present invention uses p quantiles as the distribution characteristics of the data, wherein p can be configured by the user through a configuration file or a system startup parameter or an API interface, and it is related to the number of segments of the cache index structure. The method for counting p quantiles may use a reservoir sampling algorithm, which is a sampling algorithm with a time complexity of O(n) and a space complexity of O(m) (where n is the data stream capacity and m is the sample data capacity). It can adapt to the characteristics of streaming data and complete the collection of sample data in a natural way as the data stream flows, thereby minimizing the additional delay caused by the data distribution feature extraction work. The work of the data distribution feature module also includes sorting the sample data according to the specified keywords. Dividing the ordered sample data set into p equal parts requires p-1 split points, namely [k0, k1, k2, k3, …, k p-2 ], the p-quantile of the sample data largely represents the overall data distribution characteristics of the dimension table data, so the keywords of the dimension table data need to implement the Comparable interface. Finally, the p-quantile array is sent to the cache construction submodule deployed in the association operator.

[0107] The cache management module is responsible for providing full-cycle management services for the dimension table cache from construction to query to update. The present invention optimizes the cache index structure based on the distribution feature information of the data, which is called a multi-way balanced skip table (p-way). The purpose is to improve the stability of query efficiency and support incremental updates while ensuring the cost of memory space. Figure 3 As shown, the multi-way balanced jump table consists of two parts: a routing array and a segment jump table. The routing array stores the distribution characteristic information of the dimension table data and plays a guiding role when searching for data. The segment jump table establishes an index for all dimension table data.

[0108] The cache construction submodule, when the Gaia system first ingests dimension table data, it will count the p quantiles through the data distribution feature collection module. The cache construction submodule is the receiver of the p quantiles and is responsible for the initialization of the routing array. After completing the initialization of the routing array, it can determine the segment to which the data belongs through binary search as the subsequent dimension table data arrives, and shunt the data to each segment jump table to establish an index. Figure 3Taking the multi-way balanced skip list shown as an example, there is a p-quantile array [k0, k1, k2, k3, …, k p-2 . For the target data with the keyword k, if k0 <= k < k1, it can be determined that the segment to which the target data belongs is segment1.

[0109] Cache query sub-module. During the subsequent fact table join calculation process, the Gaia system will look up the corresponding data in the multi-way balanced skip list according to the primary key column of the streaming data to be joined. The lookup method is similar to the method of constructing the index. First, the routing array is used to determine the segment where the data is located by binary search, and then it is looked up and returned in the specific segment skip list.

[0110] Cache update sub-module, which is responsible for updating the established cache data incrementally. As Figure 4 shown, when part of the data set changes, the update types of the data can be divided into three types: addition, deletion, and update. Among them, the addition and deletion operations will change the distribution characteristics of the data. If the routing array representing the data distribution characteristics in the previous round of update is still used, it will cause the problem of uneven data volume distribution in the segment skip list, where segment0 is too large and segment1 is too small, resulting in degraded query performance. Therefore, in order to ensure that the updated cache index can adapt to the changes in the data distribution characteristics, the present invention designs an index structure combining a routing array and a segment skip list, and uses a balance adjustment method in the cache update stage to split the larger segment0 and merge the smaller segment1, so that the data volume of each segment skip list is again in a relatively balanced state. At the same time, since the data in the skip list is ordered, the keyword k0' located at the boundary of the two segment skip lists can be used as a new quantile point and fed back to the routing array to update the data distribution characteristics.

[0111] In summary, the above is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A dimension table cache management method for data distribution characteristics in a Gaia cluster, characterized in that: The steps include: Step 1: construct a dimension table associated cache index structure using data distribution characteristics. The dimension table associated cache index structure is a multi-way balanced jump table, which consists of a routing array of a fixed size of 2p-1 and p segmented jump tables of balanced size, where the parameter p is specified by the user through a configuration file or an API interface; Step 2: Extract distribution characteristic information of dimension table data; The step 2 specifically includes the following steps: S201: The Gaia cluster system imports dimension table data into the system's network buffer through the DataSet data source, and specifies the primary key column of the dimension table data as a keyword through the API interface; S202: The DataSet data source calculates the Hash value of the keyword and distributes the dimension table data in the network buffer to the downstream associated calculation operator through the Hash partition method; S203: extracting sample data from the collected dimension table data by using a sampling algorithm, and then counting the p quantiles of the sample data, where the p quantiles of the sample data are used to represent the distribution characteristics of the full dimension table data; the p quantiles of the sample data are sent to the downstream associated operator together with the dimension table data in the network buffer; Step 3: Build a full-cycle distributed cache management mechanism, which includes the following steps: S301, cache construction is performed, specifically: first, a method for initializing a routing array is defined, which is used to extract p quantiles according to the distribution characteristics of the full dimension table data, and complete the initialization of the routing array; a segment determination method is also defined, which is used to determine the segment to which each dimension table data belongs; and an index establishment method is also defined, which is used to establish an index for each dimension table data; S301 includes the following steps: S3011: After the cache construction submodule receives the p quantile of the sample data, it calls the initialization method of the routing array to complete the initialization of the routing array; S3012: When subsequent dimension table data arrives, a segment determination method is called to determine the segment to which each dimension table data belongs; S3013: using an index establishment method to establish a corresponding index for each dimension table data in the segmented skip table; S302, in the process of executing the dimension table association calculation task, querying corresponding dimension table data from the multi-way balancing jump table according to the keyword of the stream data record; S303, a balancing adjustment method between the p segment jump tables is used to support incremental updates to the dimension table data cache; wherein the balancing adjustment method is called to adjust the p segment jump tables, redefine the boundaries between the segment jump tables to keep their sizes balanced, and feed back the boundary values ​​of the segment jump tables to the routing array.

2. The method according to claim 1, characterized in that The S302 includes the following steps: S3021: using the keyword recorded in the stream data as an index, determining the segment where the corresponding index is located through a segment determination algorithm; S3022: Search the corresponding index in the segment according to the search method of the skip table; S3023: Get the dimension table data pointed to by the index and return it.

3. The method according to claim 1, characterized in that The S303 includes the following steps: S3031: The Gaia cluster system queries the external storage system through the DataSet data source and imports the newly added dimension table data into the system's network buffer; S3032: Package the newly added dimension table data into ADD events, package the data with changed values ​​into MOD events, and package the expired dirty data into DEL events. The events contain complete dimension table data and are distributed to downstream associated computing operators through Hash partitions. S3033: Classify and process the events. First, locate the location of the newly added dimension table data in the cache. For ADD events, insert is performed. For MOD events, update is performed. For DEL events, delete is performed. S3034: calling a balance adjustment method to adjust the p segment jump tables, re-determine the boundaries between the segment jump tables to keep their sizes balanced, and at the same time feed back the boundary values ​​of the segment jump tables to the routing array; S3035: After receiving the boundary value fed back by the segment hopping table, the routing array determines that a new p quantile point covers the old p quantile point.

4. The dimension table cache management system for data distribution characteristics in Gaia cluster is characterized by: It includes a data distribution feature extraction module and a cache management module; The cache index structure, called a multi-way balanced skip table, consists of a routing array of fixed size 2p-1 and p balanced-size segment skip tables, where the parameter p is specified by the user through the configuration file or API interface; The data distribution feature extraction module is used to extract the distribution feature information of the dimension table data. Specifically, data samples are extracted from the dimension table data through a sampling algorithm, and then the p-quantiles of the sample data are counted. The p-quantiles of the sample data can represent the distribution features of the full dimension table data. The cache management module is divided into a cache construction submodule, a cache query submodule, and a cache update submodule, which is used to establish a full-cycle distributed cache management mechanism from construction to query to incremental update; The cache construction submodule is used to complete the initialization of the routing array according to the p quantiles counted by the data distribution feature extraction module; it is also used to determine the segment to which each dimension table data belongs according to the segment determination method; and it also defines an index establishment method for establishing an index for each dimension table data; The cache query submodule adopts a cache query method to query corresponding dimension table data from a multi-way balanced jump table according to a keyword recorded in the flow data during the execution of the dimension table association calculation task; The cache update submodule adopts a balance adjustment method between p segment skip tables to incrementally update the dimension table data cache; the cache update submodule calls the balance adjustment method to adjust the p segment skip tables, re-determine the boundaries between the segment skip tables to keep their sizes balanced, and feed back the boundary values ​​to the routing array; The Gaia cluster system uses the DataSet data source to ingest dimension table data into the system's network buffer, and specifies the primary key column of the dimension table data as the keyword through the API interface; the DataSet data source calculates the Hash value of the keyword and distributes the dimension table data to the downstream associated calculation operator through the Hash partitioning method; The data distribution feature extraction module includes the following functions: Sample data is extracted from the collected dimension table data through a sampling algorithm, and then the p-quantile of the sample data is counted. The p-quantile of the sample data is used to represent the distribution characteristics of the full dimension table data. The p-quantile of the sample data is sent to the downstream associated operator together with the dimension table data in the network buffer. The cache construction submodule includes the following functions: After receiving the p quantiles of the sample data, the cache construction submodule calls the initialization method of the routing array to complete the initialization of the routing array; When subsequent dimension table data arrives, the cache construction submodule calls the segment determination method to determine the segment to which each dimension table data belongs; The cache construction submodule adopts an index establishment method to establish a corresponding index for each dimension table data in the segmented skip table.

5. The system according to claim 4, characterized in that The cache query submodule includes the following functions: The cache query submodule is used to determine the segment where the corresponding index is located through the segment determination algorithm according to the keyword of the stream data record, query the corresponding index in the segment according to the skip table search method, and then retrieve the dimension table data pointed to by the index and return it.

6. The system according to claim 5, characterized in that The cache update submodule includes the following functions: The Gaia cluster system queries the external storage system through the DataSet data source and imports the newly added dimension table data into the system; The cache update submodule packages the newly added dimension table data into ADD events, the data with changed values ​​into MOD events, and the expired dirty data into DEL events. The events contain complete dimension table data and are distributed to downstream association calculation operators through Hash partitions, using the same Hash function as the feature extraction module. The cache update submodule classifies and processes the received events, locates the location of the newly added dimension table data in the cache, and performs insertion for ADD events, updates for MOD events, and deletion for DEL events. After receiving the boundary value fed back by the segment hopping table, the routing array determines that the new p quantile point covers the old p quantile point.