Learning index performance improvement method based on distribution drift detection algorithm
By embedding a distribution drift detector and a virtual point smoother within the data nodes of the learning index, combined with optimistic locking concurrency control, the performance degradation and concurrency safety issues of the learning index in dynamic data and multi-threaded scenarios are solved, achieving more efficient data retrieval and system stability.
Patent Information
- Application Number
- CN202611258589.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-19
- Publication Date
- 2026-11-24
AI Technical Summary
Existing learning indexes suffer from problems such as degraded model prediction accuracy, decreased search throughput, and insufficient concurrency safety in scenarios involving dynamic data distribution, nonlinear key value distribution, and multi-threaded concurrent access.
By embedding distribution drift detectors, virtual point smoothers, and optimistic locking objects within data nodes, real-time monitoring and concurrent control of data distribution are achieved, dynamically adjusting model training and concurrent operations to improve indexing performance.
It improves the response speed to dynamic data loads, reduces unnecessary CPU and memory maintenance overhead, avoids concurrent deadlocks and index structure corruption, and improves search throughput and system stability.
Smart Images

Figure CN123157708A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of database index optimization technology, specifically to a learning index performance improvement method for dynamic workloads, and more particularly to a learning index optimization method based on distributed drift detection, adaptive virtual point smoothing, and optimistic lock coupling concurrency control. Background Technology
[0002] Database indexes are a core component in data management systems for achieving efficient data access. Traditional index structures such as B+ trees primarily rely on comparisons and tree navigation to locate key values. While possessing mature and stable engineering characteristics, they still face limitations in memory usage, caching efficiency, and dynamic adaptability in in-memory databases, large-scale data, and high-concurrency access scenarios. Learning indexes view the index as a mapping function from key values to storage locations. By fitting the cumulative distribution function of the data through machine learning models, they predict the storage location of keys, achieving lower memory usage and faster search speeds in certain scenarios.
[0003] ALEX (Adaptive Learned Index) is a representative structure of updatable learned indexes. It routes data through model nodes, stores ordered key-value pairs and locally linear models through data nodes, and uses gap arrays to support insertion operations. This structure enables learned indexes to handle dynamic data, but several issues still exist in practical deployments.
[0004] First, insertion, deletion, and update operations in a dynamic database environment continuously alter the underlying key-value distribution. As the runtime data distribution gradually deviates from the data distribution during model training, the prediction accuracy of the local linear model decreases, the search process requires more error correction, and insertion operations may incur greater shift overhead. Existing learned indexes are mostly passively retrained only after performance has significantly deteriorated, lacking a node-level, online proactive distribution drift awareness mechanism.
[0005] Secondly, real-world data often exhibits skewed, long-tailed, multimodal, or locally nonlinear distributions. A single linear regression model struggles to accurately fit such cumulative distribution functions, leading to increased prediction residuals. Existing distribution smoothing methods typically employ fixed budgets or offline processing, failing to dynamically adjust based on the nonlinearity of different data nodes and runtime drift.
[0006] Furthermore, modern database systems typically operate in multi-core concurrent environments, where lookups, insertions, node splits, and model retraining of learned indexes may occur concurrently. Without fine-grained concurrency control mechanisms, multi-threaded read / write operations can not only cause data inconsistencies but may also compromise the integrity of the index structure during node splits or root pointer switching. Therefore, a performance improvement method is needed that can collaboratively integrate drift detection, model fitting optimization, and concurrency control into the data nodes of learned indexes. Summary of the Invention
[0007] The purpose of this invention is to provide a method for improving the performance of learning indexes based on a distribution drift detection algorithm, which addresses the problems of degradation in model prediction accuracy, decreased search throughput, and insufficient concurrency safety of existing learning indexes in scenarios involving dynamic data distribution, nonlinear key value distribution, and multi-threaded concurrent access.
[0008] To solve the above problems, the technical solution adopted by the present invention is as follows:
[0009] A method for improving the performance of a learned index based on a distribution drift detection algorithm includes the following steps:
[0010] S1. Construct an enhanced data node, which includes an ordered key-value storage structure, a local linear model, a gap array, and a distribution drift detector, a virtual point smoother, and an optimistic lock object embedded within the enhanced data node.
[0011] S2. After the enhanced data node completes the initial batch loading, local model retraining, and node splitting, a baseline distribution histogram is established by traversing the real key values within the node. During operation, the current distribution histogram is updated according to the increment of newly added key values, and the exponential moving average of the prediction error is updated according to the error between the predicted position and the actual position of the local linear model.
[0012] S3. Perform distribution drift detection on the enhanced data node according to the preset inspection interval; if the exponential moving average of the prediction error exceeds the error threshold, or if the drift factor calculated from the baseline distribution histogram and the current distribution histogram exceeds the adaptive threshold, then it is determined that the enhanced data node has experienced distribution drift, and local model retraining is triggered.
[0013] S4. Before retraining the local model, calculate the overall nonlinearity and piecewise nonlinearity of the enhanced data nodes; allocate virtual point smoothing budgets based on the calculation results of the overall nonlinearity and piecewise nonlinearity, and use a greedy virtual point injection algorithm to add the generated virtual training samples to the sufficient statistics of linear regression.
[0014] S5. Calculate the residual sum of squares for the old model parameters and the new model parameters using the real key values respectively; when the residual sum of squares for the new model parameters is less than the residual sum of squares for the old model parameters, adopt the new model parameters and reconstruct the baseline distribution histogram; otherwise, revert to the old model parameters or the model without virtual points.
[0015] S6. Perform concurrency control: During the processes of searching, inserting, drift statistics updating, local model retraining, and node structure modification, the optimistic locking object is used for concurrency control.
[0016] Further, in step S2, the distribution drift detector maintains the baseline distribution histogram, the current distribution histogram, the baseline total number of keys, the current total number of keys, the minimum key value, the maximum key value, the exponential moving average of the prediction error, the cumulative number of retraining attempts, and the number of insertions since the last check; wherein, the number of buckets in the histogram is a preset constant, and newly added key values are mapped to the corresponding histogram bucket index through a linear mapping method.
[0017] Further, in step S3, the process of calculating the drift factor specifically includes: normalizing the baseline distribution histogram and the current distribution histogram to a first probability distribution and a second probability distribution, respectively; calculating the mixed probability distribution of the first probability distribution and the second probability distribution; calculating the first relative entropy of the first probability distribution relative to the mixed probability distribution and the second relative entropy of the second probability distribution relative to the mixed probability distribution, respectively; calculating the divergence value by weighted summation of the first relative entropy and the second relative entropy, and normalizing the divergence value to a specified interval as the drift factor.
[0018] Furthermore, in step S3, the adaptive threshold is jointly determined by the base threshold, the cumulative number of retraining times of the enhanced data node, and the threshold decay adjustment factor; the adaptive threshold is positively correlated with the cumulative number of retraining times, so that data nodes that frequently trigger retraining have a higher drift trigger threshold, thereby avoiding additional overhead caused by repeated retraining.
[0019] Further, in step S4, the virtual point smoother calculates the overall determination coefficient between the real key values and the local linear model; divides the real key value set into multiple segments, independently calculates the segmental determination coefficient for each segment, identifies locally high nonlinearity segments by comparing the segmental determination coefficient with a preset nonlinearity threshold, and obtains the segmental nonlinearity; calculates the overall nonlinearity using the mean of the segmental determination coefficients; when the overall nonlinearity or the segmental nonlinearity exceeds the set threshold, a basic virtual point smoothing budget is generated within the linear interpolation range.
[0020] The method of adding virtual training samples to the sufficient statistic of linear regression specifically includes: traversing the intervals between adjacent real key values in each iteration, estimating the change in the sum of squared residuals after adding virtual points in each interval, selecting the position that reduces the sum of squared residuals the most as the position of the virtual training sample in this round, and updating the sufficient statistic of linear regression by additive increment.
[0021] In step S4, the virtual training samples only participate in model training statistics and are not written into the real ordered key-value storage structure; when it is determined that the enhanced data node has a distribution drift, the virtual point smoothing budget is obtained by weighting and adjusting the basic virtual point smoothing budget according to the drift factor, specifically the product of the basic virtual point smoothing budget and an adjustment parameter, and is subject to a set budget upper limit; the adjustment parameter is the sum of 1 and the drift factor.
[0022] Further, in step S6, the optimistic lock object uses a 64-bit atomic integer to encode the lock state, with bit 0 being a lock flag, bit 1 being an obsolete flag, and bits 2 to 63 being a version counter. The process of using the optimistic lock object for concurrency control includes: before accessing the data, the read operation reads and saves the version counter; after accessing the data, the read operation reads the version counter again for version comparison. If the versions are consistent and no lock flag or obsolete flag is observed to be set, the read result is deemed valid; otherwise, the read operation is re-executed. The write operation sets the lock flag through atomic comparison and exchange instructions to obtain exclusive write permission. After completing the data modification, the lock flag is cleared and the version counter is incremented. After a node split or replacement, the obsolete flag of the old data node is set to trigger concurrent read operations to re-traverse and retry from a safe location.
[0023] Compared with the prior art, the beneficial effects of the present invention are:
[0024] (1) This invention embeds distribution drift detection into enhanced data nodes, overcoming the shortcomings of existing learning indexes that are passively retrained only after significant performance degradation. Among them, the exponential moving average of prediction error (EMA) can quickly capture sudden degradation of model quality, while the Jensen-Shannon divergence (drift factor) calculated based on the baseline and the current distribution histogram normalization can stably identify the slow and gradual evolution of data. The two complement each other, greatly improving the detection coverage and the system's response speed to dynamic data loads.
[0025] (2) This invention employs an adaptive threshold mechanism that combines the cumulative number of retraining iterations of nodes. For hot nodes that frequently experience changes in data distribution and trigger retraining, the system automatically raises their subsequent drift trigger threshold. This mechanism effectively avoids system oscillations caused by repeated model retraining under rapidly changing loads and significantly reduces unnecessary CPU and memory maintenance overhead.
[0026] (3) To address the problem of poor fitting of a single linear regression due to the nonlinear distribution of real data, such as skewness and multimodality, this invention combines virtual point smoothing with distribution drift detection. By evaluating the overall and piecewise nonlinearity in real time and dynamically allocating the virtual point smoothing budget in conjunction with the drift factor, the budget can be adaptively allocated on demand. More importantly, the virtual training samples are only used to update the sufficient statistics of the linear regression and are not written into the real ordered key-value storage structure. This significantly reduces the prediction error (sum of squared residuals) while avoiding the encroachment of virtual data on physical storage space and interference with the real data retrieval process.
[0027] (4) The present invention adopts an optimistic locking coupled concurrency control mechanism based on 64-bit atomic integer encoding state. Read operations do not require locking and blocking. Consistency can be guaranteed by comparing the version counters before and after, maximizing the concurrent read throughput. Write operations accurately lock the target node through atomic comparison and swap (CAS). An obsolete flag is introduced, which can guide concurrent read threads to retry from a safe position when low-frequency structural modifications such as node splitting or root node replacement occur, thus eliminating the risk of concurrent deadlock and index structure corruption.
[0028] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, embodiments of the present invention are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0029] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0030] Figure 1 This is a schematic diagram of the overall architecture of the learning index performance improvement system according to an embodiment of the present invention.
[0031] Figure 2 This is a schematic diagram of the node-level distributed drift detection process in an embodiment of the present invention.
[0032] Figure 3 This is a schematic diagram of the linearity-aware virtual point smoothing process in an embodiment of the present invention.
[0033] Figure 4 This is a schematic diagram of optimistic locking concurrency control and version verification in an embodiment of the present invention. Detailed Implementation
[0034] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0035] This embodiment uses the ALEX learned index as the basic platform, embedding distribution drift detection, virtual point smoothing, and optimistic locking concurrency control into the index execution path. The overall system architecture is as follows: Figure 1 As shown, external requests enter the index scheduling layer through the user access layer, the model navigation layer locates the target node, and performs operations such as search, insertion, drift detection, model retraining, and smoothing optimization within the node.
[0036] The performance improvement method for learned indexes based on the distribution drift detection algorithm in this embodiment specifically includes the following steps:
[0037] S1. Construct enhanced data nodes.
[0038] The enhanced data node preserves the ordered key-value storage structure (for storing real key-value pairs), gap array, and local linear model from the original ALEX node. It also adds and embeds a distribution drift detector, a virtual point smoother, an optimistic locking object, and local maintenance state within the enhanced data node. Specifically, the distribution drift detector monitors the difference between the runtime key-value distribution and the training-time distribution; the virtual point smoother improves model fitting under nonlinear distributions; and the optimistic locking object ensures consistency between concurrent access and local maintenance.
[0039] S2. Establish a baseline distribution histogram and record statistical information during the operation period.
[0040] After the enhanced data nodes complete initial batch loading, local model retraining, and node splitting to generate new nodes, a baseline distribution histogram is built by traversing the real key values within each node. The number of buckets in the histogram is a preset constant. The key value range is equally divided into several buckets using a linear mapping formula, and the number of keys in each bucket is counted.
[0041] The distribution drift detector maintains the baseline distribution histogram, the current distribution histogram, the baseline total number of keys, the current total number of keys, the minimum key domain value, the maximum key domain value, the exponential moving average of the prediction error, the cumulative number of retraining attempts, and the number of insertions since the last check.
[0042] When an insertion operation occurs, the system maps the new key-value increment to the corresponding bucket index in the current distribution histogram and increments the count; after obtaining the predicted and actual positions of the local linear model through a lookup or insertion operation, the system calculates the absolute error between the two and updates the exponential moving average (EMA) of the prediction error according to the following formula:
[0043]
[0044] in, This is the updated exponential moving average of the prediction error; This is the current exponential moving average of the prediction error; This represents the absolute error between the predicted position and the actual position during the current operation. This is the smoothing weight constant.
[0045] S3. Perform dual drift detection.
[0046] Distribution drift detection process as follows Figure 2 As shown, the system periodically performs dual drift detection on the enhanced data node according to a preset inspection interval.
[0047] The first detection is EMA fast detection: when the exponential moving average of the prediction error exceeds the set error threshold, it indicates that the model output quality has deteriorated significantly, and the enhanced data node is determined to have distribution drift. The system directly triggers local model retraining of the target enhanced data node.
[0048] The second level of detection is the precise detection of the drift factor: if the first level of detection is not triggered, the system will normalize the baseline distribution histogram and the current distribution histogram to the first probability distribution respectively. Second probability distribution Calculate the mixture probability distribution Next, calculate the first probability distribution. Second probability distribution The Jensen-Shannon divergence is calculated using the following formula:
[0049]
[0050] in, Represents probability distribution Relative probability distribution The relative entropy (i.e., Kullback-Leibler divergence). Further, Divide by Normalize to the [0,1] interval to obtain the drift factor. If the drift factor If the adaptive threshold is exceeded, it is determined that the enhanced data nodes have experienced significant distribution drift, and local model retraining is triggered.
[0051] The adaptive threshold is dynamically adjusted based on the cumulative number of retraining iterations of the node, and the specific formula is as follows:
[0052]
[0053] in, An adaptive threshold; Basic threshold; This represents the cumulative number of retraining attempts for this enhanced data node. This is the threshold decay adjustment factor. This mechanism requires data nodes that are frequently retrained to experience more significant drift before triggering maintenance again, thereby avoiding retraining oscillations caused by hot nodes under rapidly changing loads.
[0054] S4. Perform virtual point smoothing based on data distribution characteristics.
[0055] Virtual point smoothing process as follows Figure 3 As shown, before local model retraining, the system calculates the overall nonlinearity and piecewise nonlinearity of the enhanced data nodes using a virtual point smoother.
[0056] Specifically, for enhanced data nodes A real key value and its corresponding actual position rank. Local linear model After fitting using the least squares method, first calculate the global coefficient of determination between the true key values and the local linear model. :
[0057]
[0058] in, This indicates that the actual position rank revolves around the mean. The degree of dispersion (total sum of squares); , representing the deviation (sum of squared residuals) between the actual position rank and the model-predicted position. When the number of bonds is large, a sampling strategy can be used to reduce the evaluation overhead.
[0059] Furthermore, the real key-value set is divided into Each segment is divided into segments, and the coefficient of determination for each segment is calculated independently (denoted as ). If a certain segment If the value is lower than (1 - the preset nonlinearity threshold), the segment is identified as a locally high nonlinearity segment, thus obtaining the segmental nonlinearity. The overall nonlinearity is calculated using the mean of the determination coefficients of each segment:
[0060]
[0061] in, For overall nonlinearity, The total number of segments, For the first The segmentation determination coefficient. When the nonlinearity exceeds the threshold, the algorithm normalizes it to the [0,1] interval. When the overall nonlinearity or segmental nonlinearity exceeds the set threshold, the system generates a basic virtual point smoothing budget within the linear interpolation range.
[0062] Since this step is triggered upon detecting distribution drift, the virtual point smoothing budget will be weighted and adjusted according to the drift factor. The adjusted final budget formula is:
[0063]
[0064] in, Smooth the budget for the final assigned virtual points; Smooth the budget based on virtual points; The drift factor calculated in step S3 ; This is a set budget ceiling constraint. This mechanism ensures that the greater the drift, the higher the smoothing budget allocated by the system; when the data is approximately linear, the system does not allocate a smoothing budget to control additional overhead.
[0065] In the greedy virtual point injection algorithm, the system adds the generated virtual training samples only to the sufficient statistic of linear regression, without writing them into the real ordered key-value storage structure. In each iteration, the system traverses the interval between adjacent real keys, estimates the change in the sum of squared residuals after adding virtual training samples to that interval, and selects the position that reduces the sum of squared residuals the most as the position of the virtual training sample for this round. Since the sufficient statistic of linear regression is updated incrementally through addition, it is not necessary to repeatedly traverse all data to recalculate the model.
[0066] S5. Execution cost model verification.
[0067] The system generates new local linear model parameters (i.e., new model parameters) using real key values and virtual training samples. Then, the system calculates the sum of squared residuals for both the old and new model parameters using only the real key values. If the sum of squared residuals for the new model parameters is lower, it is adopted and written into the new model parameters, and the incremental histogram is cleared to reconstruct the baseline distribution histogram. If the new model parameters do not improve the residuals, the influence of the virtual training samples is discarded, and the system reverts to the old model parameters or a model without virtual points. This validation step ensures that smoothing and retraining do not introduce negative benefits.
[0068] S6. Perform concurrency control.
[0069] The system employs optimistic locking objects for concurrency control during processes such as searching, inserting, drift statistics updates, local model retraining, and node structure modification. For example... Figure 4As shown, each enhanced data node maintains a 64-bit atomic integer encoded lock state. Bit 0 is the locked flag, bit 1 is the obsolete flag, and bits 2 through 63 are the version counters.
[0070] For read operations (such as lookups): The read thread reads and saves the version counter before accessing the data; after accessing the data, it reads the atomic integer again for version comparison. If the version counters are consistent before and after, and no lock flag or obsolescence flag is observed to be set, the read result is considered valid; otherwise, the read operation is re-executed.
[0071] For write operations (such as normal insertion and model retraining): During the write lock holding period, the normal insertion path only performs lightweight counting and EMA updates; if the retraining or other operations that require updating model parameters are triggered, the write thread sets the lock flag to obtain exclusive write permission through atomic compare-and-swap (CAS) instructions, clears the lock flag after completing the data modification, and increments the version counter.
[0072] For low-frequency structural modifications (such as node splitting, domain expansion, root node switching, etc.): the system first releases the optimistic locks on the relevant enhanced data nodes, and then acquires a global structural lock to protect cross-node pointer modifications. New nodes are published via atomic storage. After an old data node is replaced, its obsolete flag is set; concurrent read threads, upon observing that the obsolete flag has been set, will retry traversing from a safe location (such as the new root node). This sequence effectively avoids circular waits and deadlocks.
[0073] Practical results demonstrate that this embodiment can significantly improve the stability and throughput of the learned index under dynamic workloads. Taking the SOSD benchmark dataset as an example, in the OSM dataset skewed insertion scenario, the drift detection mechanism can effectively improve search throughput; the virtual point smoothing mechanism can reduce the average prediction error; the combined search throughput is further improved after the two mechanisms work together; under a 16-thread read-write mixed load, the fully optimized version combined with optimistic locking concurrency control still achieves a considerable throughput improvement compared to the basic version that only enables concurrency control.
[0074] In summary, this invention integrates distribution drift detection, virtual point smoothing, and optimistic locking concurrency control into a unified learning index data node, achieving collaborative processing of dynamic distribution changes, insufficient nonlinear fitting, and multi-threaded concurrency conflicts. The above embodiments are merely preferred implementations of this invention and should not be used to limit the scope of protection of this invention. All equivalent substitutions, improvements, or refinements made based on the main design concept and spirit of this invention should be included within the scope of protection of this invention.
Claims
1. A method for improving the performance of a learning-based index based on a distribution drift detection algorithm, characterized in that, Includes the following steps: S1. Construct an enhanced data node, which includes an ordered key-value storage structure, a local linear model, a gap array, and a distribution drift detector, a virtual point smoother, and an optimistic lock object embedded within the enhanced data node. S2. After the enhanced data node completes the initial batch loading, local model retraining, and node splitting, a baseline distribution histogram is established by traversing the real key values within the node. During operation, the current distribution histogram is updated according to the increment of newly added key values, and the exponential moving average of the prediction error is updated according to the error between the predicted position and the actual position of the local linear model. S3. Perform distribution drift detection on the enhanced data node according to the preset inspection interval; if the exponential moving average of the prediction error exceeds the error threshold, or if the drift factor calculated from the baseline distribution histogram and the current distribution histogram exceeds the adaptive threshold, then it is determined that the enhanced data node has experienced distribution drift, and local model retraining is triggered. S4. Before retraining the local model, calculate the overall nonlinearity and piecewise nonlinearity of the enhanced data nodes; allocate virtual point smoothing budgets based on the calculation results of the overall nonlinearity and piecewise nonlinearity, and use a greedy virtual point injection algorithm to add the generated virtual training samples to the sufficient statistics of linear regression. S5. Calculate the residual sum of squares for the old model parameters and the new model parameters using the real key values respectively; when the residual sum of squares for the new model parameters is less than the residual sum of squares for the old model parameters, adopt the new model parameters and reconstruct the baseline distribution histogram; otherwise, revert to the old model parameters or the model without virtual points. S6. Perform concurrency control: During the processes of searching, inserting, drift statistics updating, local model retraining, and node structure modification, the optimistic locking object is used for concurrency control.
2. The method for improving the performance of a learning index based on a distributed drift detection algorithm according to claim 1, characterized in that, In step S2, the distribution drift detector maintains the baseline distribution histogram, the current distribution histogram, the total number of baseline keys, the current total number of keys, the minimum key value, the maximum key value, the exponential moving average of the prediction error, the cumulative number of retraining attempts, and the number of insertions since the last check; wherein, the number of buckets in the histogram is a preset constant, and newly added key values are mapped to the corresponding histogram bucket index through a linear mapping method.
3. The method for improving the performance of a learning index based on a distributed drift detection algorithm according to claim 1 or 2, characterized in that, In step S3, the process of calculating the drift factor specifically includes: normalizing the baseline distribution histogram and the current distribution histogram to a first probability distribution and a second probability distribution, respectively; calculating the mixed probability distribution of the first probability distribution and the second probability distribution; calculating the first relative entropy of the first probability distribution relative to the mixed probability distribution and the second relative entropy of the second probability distribution relative to the mixed probability distribution, respectively; calculating the divergence value by weighted summation of the first relative entropy and the second relative entropy, and normalizing the divergence value to a specified interval as the drift factor.
4. The method for improving the performance of a learning index based on a distributed drift detection algorithm according to claim 1, characterized in that, In step S3, the adaptive threshold is determined by the base threshold, the cumulative number of retraining times of the enhanced data node, and the threshold decay adjustment factor; the adaptive threshold is positively correlated with the cumulative number of retraining times.
5. The method for improving the performance of a learning index based on a distributed drift detection algorithm according to claim 1, characterized in that, In step S4, the virtual point smoother calculates the overall determination coefficient between the real key values and the local linear model; divides the real key value set into multiple segments, calculates the segmental determination coefficient for each segment independently, identifies locally high nonlinearity segments by comparing the segmental determination coefficient with a preset nonlinearity threshold, and obtains the segmental nonlinearity; calculates the overall nonlinearity using the mean of the segmental determination coefficients; when the overall nonlinearity or the segmental nonlinearity exceeds the set threshold, a basic virtual point smoothing budget is generated within the linear interpolation range. The method of adding virtual training samples to the sufficient statistic of linear regression specifically includes: traversing the intervals between adjacent real key values in each iteration, estimating the change in the sum of squared residuals after adding virtual points in each interval, selecting the position that reduces the sum of squared residuals the most as the position of the virtual training sample in this round, and updating the sufficient statistic of linear regression by additive increment.
6. The method for improving the performance of a learning index based on a distributed drift detection algorithm according to claim 5, characterized in that, In step S4, the virtual training samples only participate in model training statistics and are not written into the real ordered key-value storage structure; when it is determined that the enhanced data node has a distribution drift, the virtual point smoothing budget is obtained by weighting and adjusting the basic virtual point smoothing budget according to the drift factor, specifically the product of the basic virtual point smoothing budget and an adjustment parameter, and is subject to a set budget upper limit; the adjustment parameter is the sum of 1 and the drift factor.
7. The method for improving the performance of a learning index based on a distributed drift detection algorithm according to claim 1, characterized in that, In step S6, the optimistic lock object uses a 64-bit atomic integer to encode the lock state, including a lock flag, an obsolete flag, and a version counter. The process of using the optimistic lock object for concurrency control includes: before accessing the data, the read operation reads and saves the version counter; after accessing the data, it reads the version counter again for version comparison. If the versions match and no lock flag or obsolete flag is observed to be set, the read result is deemed valid; otherwise, the read operation is re-executed. The write operation sets the lock flag through atomic comparison and exchange instructions to obtain exclusive write permission. After data modification is completed, the lock flag is cleared and the version counter is incremented. After node splitting or replacement, the obsolete flag of the old data node is set to trigger concurrent read operations to re-traverse and retry from a safe location.
