A multi-computing replica oriented distributed cache latency optimization method and system

By sharding the data set and managing cache replicas, a value evaluation function is constructed to optimize cache scheduling, solving the problem of insufficient cache replica value evaluation in existing technologies and achieving high cache hit rate and optimized task response time.

CN120371480BActive Publication Date: 2025-11-28北京镜舟科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510845967.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-24
Publication Date
2025-11-28
Estimated Expiration
2045-06-24

AI Technical Summary

Technical Problem

Existing distributed caching systems lack a time-dimensional quantitative assessment of the value of cached replicas in large-scale data processing scenarios, resulting in low cache hit rates, frequent data retrieval from the source, and scheduling delays between nodes, which affect system throughput and task processing efficiency.

Method used

By sharding the dataset to be processed, generating multiple data shards, and creating cache replicas on each computing node, a value evaluation function based on historical time segments and time intervals is constructed to generate cache weight values, optimize the cache scheduling algorithm, and combine cache preheating strategies and incremental data replication mechanisms to achieve intelligent node selection and cache acceleration.

Benefits of technology

It significantly improves cache hit rate and computational throughput, reduces cross-node communication overhead for cache access, improves data access efficiency and task response speed, and ensures efficient utilization of computing resources and task execution performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371480B_ABST
    Figure CN120371480B_ABST
Patent Text Reader

Abstract

The application relates to a multi-computing-copy-oriented distributed cache delay optimization method and system. The method comprises the following steps: performing sharding processing on a data set to be processed to generate a plurality of data shards; scheduling the data shards to different computing nodes respectively, creating a computing copy for each data shard on the corresponding computing node, and establishing a corresponding cache copy on the computing node where each computing copy is located; constructing a value evaluation function of the cache copy based on a historical existence time section of the cache copy in each computing node and a time interval of each time section from a current time point, and generating a cache weight value corresponding to each computing node according to the value evaluation function; and after allocating the computing copy of a target data shard to a new computing node, constructing a new cache copy corresponding to the target data shard on the new computing node. The application has the effects of improving cache performance and management efficiency of the cache.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of distributed computing and cache scheduling, in particular to a distributed cache delay optimization method and system for multiple computing replicas. BACKGROUND

[0002] In current large-scale data processing scenarios, a distributed computing framework usually divides the data to be processed into multiple shards and distributes them to multiple computing nodes for parallel processing. To improve processing efficiency, a cache replica is usually configured near each computing replica to speed up data access. However, as the number of computing tasks and nodes increases, the traditional cache scheduling strategy has difficulty in effectively evaluating the dynamic availability and value of cache replicas in each node, resulting in low cache hit rate and frequent data backsource and inter-node scheduling delay.

[0003] In the prior art, most distributed cache systems use static or least recently used (LRU) based strategies for replica scheduling, lack of analysis mechanism for the timeliness of cache replicas in nodes, and cannot dynamically evaluate the delay impact of cache replicas on different nodes. In addition, existing scheduling algorithms usually do not fully consider the actual availability of cache replicas and the cooperation of future warm-up mechanisms when scheduling computing replicas, which can easily cause cache cold start at the initial stage of new replica startup, further affecting processing performance.

[0004] The prior art in the above has the following defects: lack of time dimension quantitative evaluation of cache replica value, insufficient consideration of cache replica existence time history and warm-up ability in scheduling process, resulting in increased cache response delay after computing replica scheduling, affecting overall system throughput performance and task processing efficiency, and therefore there is room for improvement. SUMMARY

[0005] In order to improve cache performance and management efficiency, the present application provides a distributed cache delay optimization method and system for multiple computing replicas.

[0006] The above invention purpose of the present application is realized by the following technical scheme:

[0007] A distributed cache delay optimization method for multiple computing replicas, the distributed cache delay optimization method for multiple computing replicas comprises:

[0008] Sharding the data set to be processed to generate multiple data shards;

[0009] The data shards are respectively scheduled to different computing nodes, a computing replica is created for each data shard on the corresponding computing node, and a corresponding cache replica is established on the computing node where each computing replica is located;

[0010] construct a value evaluation function of the cache copy based on a historical existing time section of each cache copy in each computing node and a time interval of each time section from a current time point, and generate a cache weight value corresponding to each computing node according to the value evaluation function;

[0011] input the cache weight value corresponding to each cache copy in each computing node into a copy scheduling algorithm, and take the corresponding cache weight value as a priority reference factor for computing node selection when scheduling a computing copy of each data shard;

[0012] construct a new cache copy corresponding to the target data shard on the new computing node when the copy scheduling algorithm allocates the computing copy of the target data shard to the new computing node;

[0013] perform a cache data warm-up operation on the new cache copy in the new computing node according to a cache warm-up strategy pre-associated with the target data shard;

[0014] establish an incremental data replication mechanism between each computing node containing the target data shard, and perform incremental replication of write data between each cache copy containing the target data shard when performing data writing involving the target data shard.

[0015] By using the above technical solutions, the data set to be processed is divided into multiple data shards through sharding processing, which can divide the data set into smaller units, improve the utilization efficiency of computing resources, and reduce the parallel computing pressure in the big data processing scenario. By synchronously constructing the bound cache copy on the computing copy deployment node, a same-node collaboration mechanism of computing and caching is formed, which solves the problem of insufficient affinity caused by independent deployment of cache service and computing service in common distributed cache systems, thereby significantly reducing the cross-node communication overhead of cache access, effectively improving the cache data acquisition efficiency and task execution response speed. In high-frequency access and low-latency computing scenarios, a high cache hit rate and computing throughput can be maintained; by scheduling the data shards to different computing nodes and creating a computing copy and a cache copy for each data shard on the computing node, parallel distribution and cache acceleration of tasks can be achieved, thereby improving the overall computing speed and data access performance; by constructing a value evaluation function based on the historical existing time section and the time interval, and generating the cache weight value of each node, the relative value of the cache copy in different nodes can be accurately quantified, thereby improving the priority utilization of efficient cache nodes during scheduling; by inputting the cache weight value into the copy scheduling algorithm and scheduling the computing copy according to the weight priority, intelligent node selection based on the cache state can be realized, thereby further reducing the cache hit delay and task response time.

[0016] The application can be further configured in an example as follows: the sharding processing of the to-be-processed data set generates a plurality of data shards, which includes:

[0017] The to-be-processed data set is scattered by using a hash algorithm, and the data set is divided into the plurality of data shards;

[0018] When the plurality of data shards are generated, a distribution balancing strategy is used to control the data size of each data shard, so as to ensure that the computing load of the generated data shards after distribution among different computing nodes remains balanced, and to avoid excessive computing pressure of a single node.

[0019] By using the above technical solution, the to-be-processed data set is scattered by using a hash algorithm, and the shard data size is controlled in combination with a distribution balancing strategy, so as to avoid data skew and single-point bottleneck, thereby ensuring that the processing pressure of each computing node is relatively balanced, and improving the overall system throughput.

[0020] The application can be further configured in an example as follows: the creation of a computing replica for each data shard on a corresponding computing node and the establishment of a corresponding cache replica on the computing node where each computing replica is located includes:

[0021] Based on the scheduling result after sharding processing, a computing task bound to a corresponding data shard is deployed in each scheduling target computing node, and a corresponding computing replica is generated;

[0022] When the deployment of the computing replica is completed, a cache replica bound to the computing replica is constructed based on the running environment configuration, task context and data access path of the computing replica in the target computing node.

[0023] By using the above technical solution, the computing replica bound to the computing task is deployed in the target computing node, and the cache replica is constructed based on the running environment and data path, so that the cache replica can accurately match the computing demand, thereby improving the data loading efficiency and task starting speed.

[0024] The application can be further configured in an example as follows: the value evaluation function of the cache replica is constructed based on the historical existence time segments of the cache replica in each computing node and the time interval of each time segment from the current time point, and the cache weight value corresponding to each computing node is generated according to the value evaluation function, which includes:

[0025] A plurality of historical existence time segments of each cache replica in the corresponding computing node are collected, and each historical existence time segment is represented as a time interval set composed of a start time and an end time;

[0026] For the historical existence time section of the cache copy, a duration of the historical existence time section and a time distance between an end time and a current time point are calculated as time characteristic parameters of the cache copy;

[0027] A value evaluation function of the cache copy is constructed based on the time characteristic parameters, the value evaluation function is obtained by integrating a time decay function and a state indication function applied to a historical time section, and a value score of the cache copy is obtained;

[0028] The value score of the cache copy is normalized as a cache weight value corresponding to the computing node where the cache copy is located.

[0029] By adopting the above technical solution, the historical existence time section and the time interval of the cache copy are collected, and the value evaluation function is constructed based on the time characteristics, so that the timeliness and the activity of the cache copy can be comprehensively evaluated, thereby more reasonably guiding the scheduling and elimination of the cache resource; by normalizing the value score into the cache weight value, the node cache capability can be compared in a unified scale, thereby optimizing the scoring input index of the scheduling algorithm.

[0030] In an example, the application can be further configured to: the value evaluation function of the cache copy is constructed based on the time characteristic parameters, the value evaluation function is obtained by integrating a time decay function and a state indication function applied to a historical time section, and a value score of the cache copy is obtained.

[0031] A time decay function is constructed for each historical existence time section, and the time decay function is used to measure the value weight between any time point in the historical existence time section and the current time point;

[0032] A state indication function is defined in each historical existence time section, and the state indication function takes a value of 1 when the cache copy is in an effective existence state at a certain computing node, and takes a value of 0 when the cache copy is invalid or does not exist;

[0033] The time decay function and the state indication function are integrated in sections to form an integral expression:

[0034] Cache copy value score = , wherein v(x) is the time decay function, g(x) is the state indication function, x represents the historical time point, t is the start time of the historical existence time section, and 0 is the current time point.

[0035] By adopting the technical scheme, the weight of different historical time points and the current time point is measured by constructing a time decay function, and integral calculation is performed in combination with a state indication function, so that the existence length and use effectiveness of the cache copy are comprehensively considered, and therefore the accuracy and discrimination ability of the cache evaluation result are improved.

[0036] In an example, the application can be further configured to: the cache weight value corresponding to each cache copy in each computing node is input into the replica scheduling algorithm, and when scheduling the computing copy of each data shard, the corresponding cache weight value is used as a priority reference factor for computing node selection, including:

[0037] The cache weight values of all cache copies associated with the to-be-scheduled data shard in the respective computing nodes are collected, a corresponding relationship between the cache copy identifier and the computing node identifier is established, and the cache weight values associated with each computing node are extracted;

[0038] The cache weight values of each computing node and the current processing load index, task queuing waiting time index and resource utilization index of the corresponding computing node are input into the replica scheduling algorithm as multi-dimensional scheduling factors;

[0039] According to the comprehensive score results of each candidate computing node obtained by the replica scheduling algorithm, the computing node with the highest comprehensive score in the comprehensive score result is selected as the computing copy deployment node of the to-be-scheduled data shard.

[0040] By adopting the technical scheme, the cache copy weight values related to the to-be-scheduled data shard are collected and a mapping relationship is established, so as to form an evaluation channel between the cache copy and the node performance; by introducing the real-time load, queuing time and resource occupation index of the node as the scheduling factor, multi-dimensional and multi-objective comprehensive scheduling optimization can be realized, so as to improve the scientificity and rationality of data shard copy deployment.

[0041] In an example, the application can be further configured to: according to the cache warm-up strategy pre-associated with the target data shard, performing a cache data warm-up operation on the new cache copy in the new computing node, including:

[0042] In the new computing node, based on the computing copy task startup pre-loading stage of the target data shard, the parameters of the cache warm-up strategy pre-associated with the target data shard are parsed, and the historical access path, pre-reading data block range and access frequency threshold in the cache warm-up strategy are obtained;

[0043] According to the warm-up trigger condition and warm-up mode defined in the cache warm-up strategy, the new cache copy is scheduled to perform a data warm-up operation;

[0044] After the data pre-warming operation is completed, a pre-warming data index and a mapping structure of the target data shard are constructed.

[0045] By adopting the technical solution, the pre-warming operation is controllable and targeted by analyzing the cache pre-warming strategy of the target data shard in the computing replica startup phase. The cache hit rate and startup efficiency are improved by performing data loading based on the pre-warming parameters and constructing the pre-warming data index, thereby reducing the first computing response time delay and improving the startup performance of the system.

[0046] The second application purpose is achieved by the following technical solution:

[0047] A distributed cache delay optimization system for multiple computing replicas, comprising:

[0048] A shard module for sharding a to-be-processed data set to generate multiple data shards;

[0049] A replica creation module for scheduling the data shards to different computing nodes respectively, creating a computing replica for each data shard on the corresponding computing node, and establishing a corresponding cache replica on the computing node where each computing replica is located;

[0050] A construction function module for constructing a value evaluation function of the cache replica based on the historical existence time segments of the cache replica in each computing node and the time interval of each time segment from the current time point, and generating a cache weight value corresponding to each computing node according to the value evaluation function;

[0051] An input module for inputting the cache weight value corresponding to each cache replica in each computing node into a replica scheduling algorithm, and taking the corresponding cache weight value as a priority reference factor for computing node selection when scheduling the computing replica of each data shard;

[0052] A scheduling module for constructing a new cache replica corresponding to the target data shard on a new computing node when the replica scheduling algorithm assigns the computing replica of the target data shard to the new computing node;

[0053] A pre-warming module for performing a cache data pre-warming operation on the new cache replica in the new computing node according to a cache pre-warming strategy pre-associated with the target data shard;

[0054] An incremental replication module for establishing an incremental data replication mechanism between each computing node containing the target data shard, and performing incremental replication of write data between each cache replica containing the target data shard when performing data writing involving the target data shard.

[0055] By adopting the technical scheme, the data set is divided into smaller units by generating multiple data shards through sharding the data set to be processed, the utilization efficiency of computing resources is improved, and the parallel computing pressure in the big data processing scenario is reduced; the parallel distribution and cache acceleration of tasks are realized by scheduling the data shards to different computing nodes respectively and creating a computing replica and a cache replica for each data shard on the computing node, so that the overall computing speed and data access performance are improved; the relative value of the cache replica in different nodes is accurately quantified by constructing a value evaluation function based on the historical existence time section and time interval and generating the cache weight value of each node, so that the efficient cache node is preferentially utilized during scheduling; intelligent node selection based on the cache state is realized by inputting the cache weight value into the replica scheduling algorithm and scheduling the computing replicas according to the weight priority, so that the cache hit delay and task response time are further reduced.

[0056] In summary, the present application has the following beneficial technical effects:

[0057] 1. The data set is divided into smaller units by generating multiple data shards through sharding the data set to be processed, the utilization efficiency of computing resources is improved, and the parallel computing pressure in the big data processing scenario is reduced; the parallel distribution and cache local access acceleration of tasks are realized by scheduling the data shards to different computing nodes respectively and creating a computing replica and a cache replica for each data shard on the computing node, so that the overall computing speed and data access performance are improved.

[0058] 2. The relative value of the cache replica in different nodes is accurately quantified by constructing a value evaluation function based on the historical existence time section and time interval and generating the cache weight value of each node, so that the efficient cache node is preferentially utilized during scheduling; intelligent node selection based on the cache state is realized by inputting the cache weight value into the replica scheduling algorithm and scheduling the computing replicas according to the weight priority, so that the cache hit delay and task response time are further reduced. BRIEF DESCRIPTION OF DRAWINGS

[0059] Figure 1 is a flowchart of a distributed cache delay optimization method for multiple computing replicas in an embodiment of the present application;

[0060] Figure 2 is an implementation flowchart of step S10 in a distributed cache delay optimization method for multiple computing replicas in an embodiment of the present application;

[0061] Figure 3is an implementation flowchart of step S20 in a distributed cache delay optimization method for multiple computing replicas according to an embodiment of the present application.

[0062] Figure 4 is an implementation flowchart of step S30 in a distributed cache delay optimization method for multiple computing replicas according to an embodiment of the present application.

[0063] Figure 5 is an implementation flowchart of step S33 in a distributed cache delay optimization method for multiple computing replicas according to an embodiment of the present application.

[0064] Figure 6 is an implementation flowchart of step S40 in a distributed cache delay optimization method for multiple computing replicas according to an embodiment of the present application.

[0065] Figure 7 is an implementation flowchart of step S60 in a distributed cache delay optimization method for multiple computing replicas according to an embodiment of the present application.

[0066] Figure 8 is a principle block diagram of a distributed cache delay optimization system for multiple computing replicas according to an embodiment of the present application. DETAILED DESCRIPTION

[0067] The present application will be further described in detail below with reference to the accompanying drawings.

[0068] In an embodiment, as shown in Figure 1 The present application discloses a distributed cache delay optimization method for multiple computing replicas, which specifically includes the following steps:

[0069] S10: performing sharding processing on a to-be-processed data set to generate multiple data shards.

[0070] Specifically, after receiving the to-be-processed data set transmitted by the upper-layer task distribution module, a preset data sharding engine is used to perform key-based hash partitioning or range cutting operation on the data set, and the to-be-processed data set is decomposed into multiple data subsets with consistent structure and no overlap according to the data primary key or specified field value. Each data subset logically constitutes an independent data shard, and each data shard is managed by a unique shard identifier to ensure that it can be quickly searched and located in subsequent scheduling process. The generated data shard can adopt a dynamic data structure to support subsequent state tracking and scheduling state management of the computing replica. In the big data batch processing scenario, for example, hundreds of millions of user behavior log data can be divided into day-by-day shards or user number modulo shards, each of which is used as an independently schedulable task unit for processing.

[0071] S20: The data shards are respectively dispatched to different computing nodes, a computing replica is created for each data shard on the corresponding computing node, and a corresponding cache replica is established on the computing node where each computing replica is located.

[0072] Specifically, after the data shard is completed, based on the resource utilization, computing capacity evaluation value and scheduling priority of each computing node in the current cluster, each data shard is distributed to a suitable computing node through the scheduling controller, and a task execution container is allocated on the selected computing node for deploying the computing replica of the shard. After the deployment of the computing replica is completed, the local cache area associated with its input and output data path is automatically loaded in its running environment and initialized as an independent cache replica. The cache replica is bound to the current computing replica as a unique task, loads the historical intermediate state or necessary index structure during the initialization of the computing task, and sets the access strategy to ensure continuous monitoring of data hotness and replica effectiveness.

[0073] S30: Based on the historical existence time period of the cache replica in each computing node and the time interval between the end time of each time period and the current time point, a value evaluation function of the cache replica is constructed, and a cache weight value corresponding to each computing node is generated according to the value evaluation function.

[0074] Specifically, in the cache replica state record module maintained in the background of the system, the historical existence state change log of each cache replica on its own computing node is queried, the time period continuously in the effective state is extracted as a sample set of the historical existence time period, and the time interval between the end time of each time period and the current time point is calculated according to the current timestamp. A time decay factor is assigned to each time period through a function interface call to represent the degree of decay of the period to the current replica value. An integral value function model is constructed using the above period samples, the duration of the historical existence time period and the time decay factor are combined, and after the cumulative integral operation, the relative value score of the cache replica is obtained. Then, the scores of multiple cache replicas are normalized to the cache weight values corresponding to each computing node, which are used to represent the response ability and value level of the cache resources on the node.

[0075] S40: The cache weight value corresponding to each cache replica in each computing node is input into the replica scheduling algorithm, and the corresponding cache weight value is used as a priority reference factor for selecting a computing node when scheduling a computing replica of each data shard.

[0076] Specifically, before the replica scheduling engine prepares to perform the calculation replica allocation, the cache value weight acquisition module is called to retrieve the cache weight values of the cache replicas corresponding to the target data shard in all candidate computing nodes, and a mapping table of cache replica identifiers and computing node identifiers is constructed to support the input binding of the scheduling function. At the same time, the cache weight values are combined with real-time load information such as CPU usage, memory remaining capacity, and task latency of the current computing node to form comprehensive scoring factors of the scheduling algorithm, which are input into the replica scheduling algorithm model designed based on the hierarchical priority strategy for scoring and sorting processing. Finally, the target node most suitable for executing the shard computing task is selected according to the scoring results. Further, when constructing the priority reference factors of the replica scheduling algorithm, the node affinity between the cache replica and the computing task can be introduced as a weighted parameter. If there is a cache replica of the target data shard in a computing node and the computing replica and the cache replica have physical node consistency, the scheduling priority of the node is improved. In this way, data availability and scheduling efficiency are considered, and the fusion mechanism of localized computing and local cache is further strengthened, thereby reducing the overhead of cross-node migration and cache cold start in actual deployment.

[0077] S50: When the replica scheduling algorithm allocates the computing replica of the target data shard to a new computing node, a new cache replica corresponding to the target data shard is constructed on the new computing node.

[0078] Specifically, when the replica scheduling result determines that a new computing replica of the target data shard needs to be generated on a new computing node, a data processing flow instance is first initialized in the task scheduling container of the node, and the task configuration and dependency metadata of the target data shard are loaded. Then, a cache area dedicated to the shard computing replica is created. The cache area is indexed and bound to the task running path as a new cache replica, maintains an independent namespace with the original cache structure, initializes the data mapping table and cache replacement strategy in a lazy loading mode, and sets a monitoring probe for the cache replica for subsequent trigger control of preheating and data writing synchronization.

[0079] S60: According to the cache preheating strategy pre-associated with the target data shard, a cache data preheating operation is performed on the new cache replica in the new computing node.

[0080] Specifically, before the newly constructed cache copy is formally written into the data, according to the cache preheating strategy template issued by the system configuration center, the preheating parameter configuration of the target data shard is extracted, including access frequency threshold, preheating data block range, historical access path and other information, a local access heat prediction model is constructed to select the pre-reading data block, and a data puller is used to asynchronously load related data from the upstream data source or other copies to fill into the specified space segment in the cache copy. During the data preheating loading, the main task execution is not blocked, but a callback hook is set to notify the task container to complete the cache structure update after the preheating is completed.

[0081] S70: Establish an incremental data replication mechanism between each computing node containing the target data shard, and perform incremental replication of the write data between each cache copy containing the target data shard when executing data write involving the target data shard.

[0082] Specifically, to maintain data consistency between multiple copies, record all copy distribution locations of the target data shard in the scheduling console, and register with the unified copy synchronization management module. After detecting any write request to the target data shard on any copy node, collect the specific data block of this write through the write interceptor and construct an incremental write data packet, and consult the copy distribution mapping table to determine the target node list that needs to be synchronized. Incremental data is pushed to the cache write interface of each copy in turn through the lightweight network synchronization protocol, ensuring that each copy maintains a consistent state with small communication and computing overhead, avoiding read-write conflicts and consistency failure risks.

[0083] In an embodiment, when establishing an incremental data replication mechanism between each computing node containing the target data shard, the synchronous replication or asynchronous replication strategy can be selected according to the business consistency requirements and performance trade-offs: when using synchronous replication for data write, the write operation on the target data shard in a certain computing node is blocked at the same time until all other cache copies containing the target data shard successfully receive the write data and complete the write, ensuring that the consistency of all copies is always kept in the same state. However, synchronous replication may cause an increase in overall write latency, which is suitable for critical data scenarios with extremely high consistency requirements; when using asynchronous replication for data write, the write operation on the target data shard in a certain computing node can return a response result immediately after completion, without waiting for other copies to complete the data update operation. Subsequently, a background thread or replication agent asynchronously pushes the write data to other cache copies containing the target data shard within a specified time window, improving write throughput efficiency and system response speed, but may cause a short-term delay in data consistency, which is suitable for business scenarios with high time efficiency requirements but tolerable short-term copy differences.

[0084] By adopting the technical scheme, the data set is divided into smaller units by performing the sharding processing on the data set to be processed to generate a plurality of data shards, the utilization efficiency of the computing resources is improved, and the parallel computing pressure in the big data processing scenario is reduced; the data shards are respectively dispatched to different computing nodes, and the computing replicas and cache replicas are created for each data shard on the computing nodes, the parallel distribution and cache acceleration of the tasks are realized, and the overall computing speed and data access performance are improved; the value evaluation function based on the historical existence time section and time interval is constructed, and the cache weight value of each node is generated, the relative value of the cache replica in different nodes is accurately quantified, and the efficient cache node is preferentially utilized during the dispatching; the cache weight value is input into the replica dispatching algorithm, and the computing replica is dispatched according to the weight priority, the intelligent node selection based on the cache state is realized, and the cache hit delay and task response time are further reduced.

[0085] In an embodiment, as shown in FIG. 10, in step S10, the data set to be processed is sharded to generate a plurality of data shards, specifically including: Figure 2

[0086] S11: The data set to be processed is scattered by using a hash algorithm, and the data set is divided into a plurality of data shards.

[0087] Specifically, after receiving the data set to be processed, the data splitting module calls the built-in hash function to perform a hash mapping operation on the primary key field of each data record in the data set, and the data records are distributed to different data buckets by taking the modulus of the fixed number of shards on the hash value. In the hash process, a consistent hash strategy is used to ensure that when the number of shards or computing nodes changes, the impact of existing data migration can be minimized. At the same time, by setting the hash seed and partition range, the distribution characteristics of the shard generation are controlled, for example, when processing one million user logs, ten shards can be generated based on the user ID field, and each shard is mapped to a data queue for subsequent independent dispatching processing, so that the original data set is scattered into a plurality of data subsets with processing isolation.

[0088] S12: When generating a plurality of data shards, a distribution balancing strategy is used to control the data size of each data shard to ensure that the computing load of the generated data shards remains balanced after being distributed among different computing nodes, avoiding excessive computing pressure on a single node.

[0089] ​Specifically, after the initial division of several data shards, the distributed balanced adjustment logic is executed to statistically analyze the number of data records of each data shard. By setting the maximum tolerance deviation range, it is determined whether the current data distribution is significantly unbalanced. If it is found that the data volume of some shards exceeds the preset mean value threshold, the oversized shards are split or some data is migrated to the shards with smaller data volume to fill them up according to the sorted data density curve. In the adjustment process, the principle of constant data popularity is adopted to avoid frequent migration of high-frequency access data among multiple nodes. The final output data shard set maintains a controllable deviation range in physical size, record quantity and access pressure, so as to improve the resource allocation efficiency and task running stability in the subsequent computing node scheduling stage.

[0090] In an embodiment, as shown in FIG. 2, in step S20, a computing replica is created for each data shard on the corresponding computing node, and a corresponding cache replica is established on the computing node where each computing replica is located. Specifically, the steps include: Figure 3

[0091] S21: Based on the scheduling result after the shard processing, deploy the computing task bound to the corresponding data shard in each scheduling target computing node to generate the corresponding computing replica.

[0092] Specifically, after completing the shard processing of the to-be-processed data set and obtaining the shard scheduling target, the task scheduling module assembles the task context and processing logic of each data shard into an independent computing task unit. Combined with the target computing node identifier specified in the scheduling result, the computing task unit is issued to the task receiving interface of the target node. Subsequently, the task initialization operation is performed within the computing node to load the execution environment and running dependencies. After the task binding data shard is completed, the computing replica is formally generated, and the local resources such as memory buffer and computing thread pool are allocated to support subsequent data processing work. In this process, the one-to-one correspondence between the shard identifier and the computing replica is maintained, thereby ensuring that the computing logic of each shard is reliably mapped to the specified computing node.

[0093] S22: When the deployment of the computing replica is completed, based on the running environment configuration, task context and data access path of the computing replica in the target computing node, a cache replica bound to the computing replica is constructed.

[0094] ​Specifically, after the computing replica completes the deployment and enters the ready state, the cache construction logic parses the task context information of the computing replica, including the data processing function entry, access mode identification, and input and output interface constraints, and determines the read and write data paths that the computing replica may involve in the execution process in combination with the running environment configuration of the current target computing node, such as the local storage directory, memory usage limit, and inter-process communication structure. The hot data and commonly used index files associated with the path are loaded into the local cache area, and the mapping rules between the data access path and the cache data structure are established for quick cache space hit during running, finally completing the construction of the cache replica bound to the computing replica, and generating a unique identifier in the cache directory structure to support subsequent data synchronization and hotness evaluation operations. Further, in the process of constructing the cache replica bound to the computing replica, the cache replica and the computing replica are further directly allocated cache space physically adjacent to each other within the target computing node, realizing node affinity between the cache replica and the computing replica. The affinity mechanism ensures that the cache data access path does not rely on cross-node network communication, thereby significantly reducing cache access delay and improving data locality processing efficiency. Compared with the traditional distributed computing mode relying on external independent cache service, the system inter-synchronization overhead and I / O bottleneck are reduced while ensuring computing efficiency.

[0095] In an embodiment, as shown in FIG. 3, in step S30, a value evaluation function of the cache replica is constructed based on the historical existence time segments of the cache replica in each computing node and the time interval of each time segment from the current time point, and the cache weight value corresponding to each computing node is generated according to the value evaluation function, specifically including: Figure 4

[0096] S31: Collect multiple historical existence time segments of each cache replica in the computing node, and represent each historical existence time segment as a time interval set composed of start time and end time.

[0097] Specifically, after the cache replica initialization is completed and enters the life cycle management phase, the cache monitoring logic is called to record the residence state changes of each cache replica on the computing node in real time. When the cache replica is converted from the created state to the valid state, the entry timestamp is recorded, and when the cache replica is cleaned up, replaced, or removed due to the space eviction policy, the exit timestamp is recorded. Then, each time period of valid residence is recorded as a time interval composed of start time and end time, and the historical existence time segment set of the cache replica on the node is continuously accumulated as time goes on, and is saved in the metadata management structure of the cache replica in the form of interval list for subsequent value analysis call.

[0098] ​S32: For the historical existence time section of the cache copy, the duration of the historical existence time section and the time distance between the end time and the current time point are calculated as the time characteristic parameters of the cache copy.

[0099] Specifically, the collected historical existence time section list is traversed, and for each time interval, the duration thereof, i.e., the time length obtained by subtracting the start time from the end time, is calculated, and the time difference between the end time of the time interval and the current system time is calculated as a time decay measurement basis. Finally, the duration of each time section is combined with the current time interval to form a set of time characteristic parameters corresponding to the cache copy in the current computing node, which is used to describe the activity and historical contribution degree of the cache copy in the time sequence dimension and provide basic input for subsequent construction of a value evaluation function.

[0100] S33: A value evaluation function of the cache copy is constructed based on the time characteristic parameters. The value evaluation function is obtained by integrating the time decay function and the state indication function applied to the historical time section.

[0101] Specifically, each historical existence time section is selected, and the start time of the time section to the current time point is taken as the integral interval. A time decay function v(x) is defined to represent the value decrease relationship of any historical time point x relative to the current time, and a state indication function g(x) is defined to mark whether the cache copy is in an effective state at the time point. When the cache copy is effective, g(x) takes 1, otherwise, it takes 0. The time decay function and the state indication function are integrated by time section, and the calculation expression is where t is the start time of the section, 0 is the current time, and the integral results of all time sections are summed to obtain the comprehensive value evaluation value of the cache copy in the current node, i.e., the value score of the cache copy.

[0102] S34: The value score of the cache copy is normalized to be the cache weight value corresponding to the computing node where the cache copy is located.

[0103] Specifically, the value scores corresponding to all cache copies in multiple computing nodes are collected to form a sample set. The maximum and minimum values of the sample set are calculated, and a normalization processing formula is applied to each cache copy value score, such as linear normalization to convert it to a relative value between 0 and 1. The normalized result is the cache weight value of the cache copy in its own computing node. Subsequently, the cache weight value is mapped to the scheduling input structure associated with the corresponding computing node for subsequent calculation of the replica scheduling priority decision.

[0104] In an embodiment, as Figure 5As shown, in step S33, a value evaluation function of the cache copy is constructed based on the time characteristic parameter, the value evaluation function is obtained by integrating the time decay function and the state indication function applied to the historical time section, and the value evaluation function is used to calculate the value score of the cache copy, and the value evaluation function specifically includes:

[0105] S331: A time decay function is constructed for each historical existing time section, and the time decay function is used to measure the value weight between any time point in the historical existing time section and the current time point.

[0106] Specifically, in the historical existing time section of each cache copy, a time point closer to the current time point is given a higher weight, and a time point farther away is given a lower weight, and a time decay function v(x) is constructed to represent the influence factor of the time point x relative to the current time point 0, wherein the time decay function can be selected as an exponential function, a hyperbolic function or a piecewise linear function to realize nonlinear enhancement expression of the time difference, for example, when the exponential decay form is selected, v(x)=e^(-λ·(0-x)), wherein λ is an attenuation coefficient, which can control the speed of attenuation, when λ value is larger, it is more inclined to emphasize the influence of near-time effective data and ignore long-term data, by setting λ value, the attention degree of historical time contribution can be flexibly adjusted and the importance of data freshness is reflected.

[0107] S332: A state indication function is defined in each historical existing time section, and the state indication function takes a value of 1 when the cache copy is in an effective existing state at a certain computing node, and takes a value of 0 when the cache copy is invalid or does not exist.

[0108] Specifically, for each cache copy in the historical existing time section of the computing node, a state indication function g(x) is set to identify whether any time point in the section is in an effective existing state, when a time point x is located in the effective phase of the cache copy which is loaded and can normally respond to data requests, the value of g(x) is set to 1, indicating that the time point has actual efficiency in the life cycle of the copy; if x falls in the idle phase of the cache copy which has not been established or has been cleaned up, the value of g(x) is set to 0, indicating that the cache copy does not have data access ability at this time. The state indication function is constructed in the form of a Boolean function combined with the effective time boundary in the time section, and is used to eliminate the influence of invalid time in the integration processing stage.

[0109] S333: The time decay function and the state indication function are integrated in sections to form an integral expression:

[0110] The value score of the cache copy is: where v(x) is a time decay function, g(x) is a state indicator function, x represents a historical time point, t is a start time of a historical existence time section, and 0 is a current time point.

[0111] Specifically, an interval integral operation is performed on each historical existence time section of the cache replica, and the time decay function v(x) is multiplied and combined with the state indicator function g(x) to establish an integral expression between the section start time t and the current time point 0 During the integral calculation, if g(x) of a certain time point is 0, the time point does not contribute to the integral value, and if g(x) is 1, the contribution degree will be determined according to the value of v(x). Finally, the value of the section under the joint action of time and state is obtained, and the integral results of all historical existence time sections are added to obtain the total value score of the cache replica at the current computing node. The integral method can accurately reflect the historical importance distribution of the cache replica in the effective time range and eliminate invalid time interference.

[0112] In an embodiment, as shown in FIG. 4, in step S40, the cache weight value corresponding to each cache replica in each computing node is input into the replica scheduling algorithm, and the corresponding cache weight value is used as a priority reference factor for selecting a computing node when scheduling a computing replica of each data shard. Specifically, the following steps are included: Figure 6

[0113] S41: Collect the cache weight values of all cache replicas associated with the data shard to be scheduled in the computing nodes to which the cache replicas belong, establish a corresponding relationship between the cache replica identifier and the computing node identifier, and extract the cache weight values associated with each computing node.

[0114] Specifically, before scheduling the data shard to be processed, the identifier information of the current scheduling target is used to retrieve the complete cache replica list associated with the data shard, and each cache replica is located in the computing node. The cache weight value corresponding to each cache replica in its home computing node is extracted from the cache resource management data structure, and an association mapping structure between the cache replica and the computing node is constructed. In the mapping structure, the cache replica unique identifier and the computing node identifier are used to form a key-value pair relationship, so that the cache distribution state can be quickly checked and matched in the subsequent scheduling link. Finally, the available cache weight value set of the data shard to be scheduled in different computing nodes is sorted out, providing original input parameters for priority sorting of the scheduling computing node.

[0115] S42: The cache weight values of each computing node are input into the replica scheduling algorithm together with the current processing load index, task queuing waiting time index and resource utilization index of the corresponding computing node as multi-dimensional scheduling factors.

[0116] ​Specifically, to improve the overall rationality and execution efficiency of replica scheduling, when preparing the factor parameters for inputting the replica scheduling algorithm, the number of tasks waiting to be executed in the current processing queue of all candidate computing nodes is collected to measure the task queuing time. CPU and memory resource utilization indicators are obtained to reflect the node resource load. These are combined with the aforementioned cache weight values ​​as components of the scheduling evaluation model. A multi-dimensional feature vector with a unified format is constructed for each node and standardized to ensure that each indicator has a unified measurement scale during the evaluation process. This multi-dimensional factor combination can not only reflect the historical cache availability of each computing node, but also reflect the node's operating pressure and processing capacity in real time, providing a decision basis for the scheduling algorithm to comprehensively weigh cache hit rate and node carrying capacity.

[0117] S43: Based on the comprehensive score results of each candidate computing node obtained by the replica scheduling algorithm, select the computing node with the highest comprehensive score as the computing replica deployment node for the data shard to be scheduled.

[0118] Specifically, the constructed multidimensional scheduling factor vector is sequentially input into the replica scheduling algorithm to perform the calculation and scoring process. The scheduling algorithm assigns scoring weights to the cache weight value, load index, queuing time and resource utilization index according to the preset scoring weight rules and performs weighted accumulation to obtain the comprehensive score result of each candidate computing node. By sorting the scores of all candidate nodes, the computing node with the highest score is selected as the computing replica deployment position of the data shard to be scheduled. This node is considered to have the best cache matching degree and scheduling response capability at the current moment, thereby improving the cache hit rate of subsequent computing tasks and reducing the overall computing latency.

[0119] In one embodiment, such as Figure 7 As shown, in step S60, according to the cache preheating strategy pre-associated with the target data shard, a cache data preheating operation is performed on the new cache replica in the new compute node, specifically including:

[0120] S61: In the new computing node, during the loading phase before the computing replica task based on the target data shard is started, the parameters of the cache preheating strategy corresponding to the target data shard are parsed to obtain the historical access path, the range of pre-read data blocks and the access frequency threshold in the cache preheating strategy.

[0121] Specifically, in the computing copy loading initialization stage of the target data shard, according to the cache warm-up strategy identifier bound to the target data shard, a preset strategy configuration file or strategy template is called, the parameter fields defined therein are parsed, the historical access path information is extracted to determine the data access track that has been frequently accessed, the pre-read data block range is read to determine the offset segment and length interval of the cache data to be loaded in the data shard, the access frequency threshold is extracted as a condition standard for judging whether specific data should be loaded into the cache in advance, and then the initialization preparation of the cache warm-up strategy parameters is completed, laying a configuration foundation for the subsequent accurate warm-up scheduling of the cache copy.

[0122] S62: According to the warm-up trigger condition and warm-up mode defined in the cache warm-up strategy, a new cache copy is scheduled for data warm-up operation.

[0123] Specifically, according to the trigger condition field defined in the aforementioned cache warm-up strategy, it is judged whether the current computing copy loading stage meets the logical threshold for starting warm-up, for example, it is detected whether the task life cycle state is in the preprocessing stage or whether there is a historical data missing mark, and after it is judged that the warm-up condition is met, the warm-up mode parameter specified in the strategy is read, if it is set to synchronous warm-up, the target data block is loaded immediately in the main thread scheduling process, if it is set to asynchronous warm-up, the loading task is dispatched to the auxiliary thread or background process for processing, and when the specific warm-up operation is performed, the high-frequency segments in the target data shard are read in blocks according to the order of the historical access path marked in the strategy, and the warm-up data is loaded into the corresponding buffer area of the local cache copy, ensuring that the subsequent computing process can directly hit the cache area, thereby improving the data access response speed.

[0124] S63: After completing the data warm-up operation, the warm-up data index and mapping structure of the target data shard are constructed.

[0125] Specifically, after the target cache copy completes the loading action of all marked warm-up data blocks, the offset information of the loaded data blocks and the storage location in the memory address space are extracted, the warm-up data index structure is constructed to realize the fast mapping from data offset to physical address, and the access priority and life cycle management mark of each warm-up data block are recorded in the index structure, for example, the access weight field can be set for the subsequent cache replacement strategy judgment, or the expiration field can be set for the cache cleaning process to judge the validity of the warm-up content, and finally the generated data index and mapping structure are stored as metadata of the cache copy in the cache directory table, and are loaded into the context when the computing copy task is started, for fast retrieval in the subsequent data access stage.

[0126] It should be understood that the size of the serial number of each step in the above embodiment does not mean the order of execution, and the execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.

[0127] In an embodiment, a distributed cache delay optimization system for multiple computing replicas is provided, which corresponds to the distributed cache delay optimization method for multiple computing replicas described above. As shown in the figure, the distributed cache delay optimization system for multiple computing replicas includes a sharding module, a replica creation module, a build function module, an input module, a scheduling module, a warm-up module, and an incremental replication module. The functions of each module are described in detail as follows: Figure 8

[0128] The sharding module is configured to perform sharding processing on the data set to be processed to generate a plurality of data shards.

[0129] The replica creation module is configured to schedule the data shards to different computing nodes respectively, create a computing replica for each data shard on the corresponding computing node, and establish a corresponding cache replica on the computing node where each computing replica is located.

[0130] The build function module is configured to construct a value evaluation function of the cache replica based on the historical existence time period of the cache replica in each computing node and the time interval of each time period from the current time point, and generate a cache weight value corresponding to each computing node according to the value evaluation function.

[0131] The input module is configured to input the cache weight value corresponding to each cache replica in each computing node into the replica scheduling algorithm, and use the corresponding cache weight value as a priority reference factor for computing node selection when scheduling the computing replica of each data shard.

[0132] The scheduling module is configured to construct a new cache replica corresponding to the target data shard on the new computing node when the replica scheduling algorithm assigns the computing replica of the target data shard to the new computing node.

[0133] The warm-up module is configured to perform a cache data warm-up operation on the new cache replica in the new computing node according to a cache warm-up strategy pre-associated with the target data shard.

[0134] The incremental replication module is configured to establish an incremental data replication mechanism between each computing node containing the target data shard, and perform incremental replication of the write data between each cache replica containing the target data shard when performing data write involving the target data shard.

[0135] Optionally, the sharding module includes:

[0136] ​The hash fragmentation submodule is configured to fragment the data set to be processed by using a hash algorithm, and divide the data set into a plurality of data fragments.

[0137] The balance control submodule is configured to control the data size of each data fragment by using a distribution balance strategy when the plurality of data fragments are generated, so as to ensure that the calculation load of the generated data fragments after distribution among different calculation nodes remains balanced, and avoid excessive calculation pressure on a single node.

[0138] Optionally, the replica creation module comprises:

[0139] The replica deployment submodule is configured to deploy, based on the scheduling result after the fragmentation, a calculation task bound to a corresponding data fragment in each target calculation node to generate a corresponding calculation replica.

[0140] The cache binding submodule is configured to construct, when the calculation replica is deployed, a cache replica bound to the calculation replica based on the running environment configuration of the calculation replica in the target calculation node, the task context and the data access path.

[0141] Optionally, the construction function module comprises:

[0142] The history collection submodule is configured to collect a plurality of historical existence time segments of each cache replica in the corresponding calculation node, and represent each historical existence time segment as a time interval set composed of a start time and an end time.

[0143] The time parameter extraction submodule is configured to calculate, for the historical existence time segment of the cache replica, a duration of the historical existence time segment and a time distance between the end time and a current time point as time characteristic parameters of the cache replica.

[0144] The value evaluation submodule is configured to construct a value evaluation function of the cache replica based on the time characteristic parameters, and obtain a value score of the cache replica by integrating the time decay function and the state indication function applied to the historical time segment.

[0145] The weight normalization submodule is configured to normalize the value score of the cache replica as a cache weight value corresponding to the calculation node where the cache replica is located.

[0146] Optionally, the value evaluation submodule comprises:

[0147] The decay function construction unit is configured to construct a time decay function for each historical existence time segment, and the time decay function is used to measure the value weight between any time point in the historical existence time segment and the current time point.

[0148] a state function construction unit configured to define a state indicator function in each historical existence time segment, the state indicator function taking a value of 1 when the cache replica is in a valid existence state at a certain computing node, and taking a value of 0 when the cache replica is invalid or does not exist;

[0149] an integral calculation unit configured to perform segment integration of the time decay function and the state indicator function to form an integral expression:

[0150] a cache replica value score = where v(x) is the time decay function, g(x) is the state indicator function, x represents a historical time point, t is a start time of the historical existence time segment, and 0 is a current time point.

[0151] Optionally, the input module comprises:

[0152] a cache index extraction submodule configured to collect cache weight values of all cache replicas associated with the data shard to be scheduled in respective computing nodes to which the cache replicas belong, establish a corresponding relationship between cache replica identifiers and computing node identifiers, and extract cache weight values associated with each computing node;

[0153] a scheduling factor fusion submodule configured to input the cache weight values of each computing node, a current processing load index of the corresponding computing node, a task queuing waiting time index, and a resource utilization index into a replica scheduling algorithm as multi-dimensional scheduling factors;

[0154] a scoring decision submodule configured to select, based on comprehensive score results of each candidate computing node obtained by the replica scheduling algorithm, a computing node with the highest comprehensive score in the comprehensive score results as a computing replica deployment node of the data shard to be scheduled.

[0155] Optionally, the preheating module comprises:

[0156] a policy analysis submodule configured to, in the new computing node, parse parameters of a cache preheating strategy corresponding to the target data shard based on a pre-loading stage before starting of a computing replica task of the target data shard, and obtain a historical access path, a pre-read data block range, and an access frequency threshold in the cache preheating strategy;

[0157] a preheating execution submodule configured to schedule the new cache replica to perform a data preheating operation according to a preheating trigger condition and a preheating mode defined in the cache preheating strategy;

[0158] an index construction submodule configured to construct a preheated data index and a mapping structure of the target data shard after the data preheating operation is completed.

[0159] The specific limitation of the distributed cache delay optimization system for multiple computing replicas can refer to the limitation of the distributed cache delay optimization method for multiple computing replicas described above, which will not be repeated here. Each module in the distributed cache delay optimization system for multiple computing replicas can be realized by software, hardware and their combinations in whole or in part. The above-mentioned modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to call and execute the operations corresponding to each module by the processor.

[0160] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is exemplified, and in actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the system is divided into different functional units or modules to complete all or part of the functions described above.

[0161] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. A distributed cache latency optimization method for multiple compute replicas, characterized in that, The distributed cache latency optimization method for multiple compute replicas includes: The dataset to be processed is sharded to generate multiple data shards; The data shards are scheduled to different computing nodes, and a computing replica is created for each data shard on the corresponding computing node. A corresponding cache replica is also created on the computing node where each computing replica is located. Based on the historical existence time segments of the cache replicas in each computing node and the time interval between each time segment and the current time point, a value evaluation function for the cache replicas is constructed, and a cache weight value corresponding to each computing node is generated according to the value evaluation function. The step of constructing a value evaluation function for the cache replicas based on the historical existence time segments of the cache replicas in each computing node and the time interval between each time segment and the current time point, and generating cache weight values ​​corresponding to each computing node based on the value evaluation function includes: Collect multiple historical existence time segments of each cache replica in its respective compute node, and represent each historical existence time segment as a set of time intervals consisting of start time and end time; For the historical existence time segment of the cached copy, calculate the duration of the historical existence time segment and the time distance between the end time and the current time point, as the time feature parameter of the cached copy; The value evaluation function of the cached copy is constructed based on the time feature parameters. The value evaluation function is calculated by applying a time decay function and a status indication function to the historical time segment and performing integral calculation to obtain the value score of the cached copy. The value score of the cached replica is normalized and used as the cache weight value corresponding to the computing node where the cached replica is located; The value evaluation function for constructing the cached replica based on the time feature parameters is obtained by integrating a time decay function and a status indicator function over a historical time period to obtain the value score of the cached replica, including: A time decay function is constructed for each historical time period, which is used to measure the value weight between any point in time in the historical time period and the current point in time. A status indicator function is defined for each historical existence time segment. The status indicator function takes a value of 1 when the cache replica is in a valid existence state on a certain computing node, and takes a value of 0 when the cache replica is invalid or does not exist. Integrate the time decay function and the state indication function in segments to form the integral expression: , where v(x) is the time decay function, g(x) is the state indication function, x represents a historical time point, t is the start time of the historical time segment, and 0 is the current time point; The cache weight value corresponding to each cache replica in each compute node is input into the replica scheduling algorithm. When scheduling the compute replica of each data shard, the corresponding cache weight value is used as the priority reference factor for compute node selection. After the replica scheduling algorithm allocates the computation replica of the target data shard to a new computing node, a new cache replica corresponding to the target data shard is constructed on the new computing node. According to the cache preheating strategy pre-associated with the target data shard, a cache data preheating operation is performed on the new cache copy in the new computing node; An incremental data replication mechanism is established among the computing nodes containing the target data shard. When data writing involving the target data shard is performed, the written data is incrementally replicated among the cache replicas containing the target data shard.

2. The distributed cache latency optimization method for multiple compute replicas according to claim 1, characterized in that, The process of splitting the data set to be processed into multiple data fragments includes: The data set to be processed is shuffled using a hash algorithm, and the data set is divided into the multiple data fragments; When generating the multiple data shards, a distribution balancing strategy is used to control the data size of each data shard, ensuring that the computing load of the generated data shards is balanced after being distributed among different computing nodes, and avoiding excessive computing pressure on a single node.

3. The distributed cache latency optimization method for multiple compute replicas according to claim 1, characterized in that, The step of creating a compute replica for each data shard on the corresponding compute node and establishing a corresponding cache replica on the compute node where each compute replica resides includes: Based on the scheduling results after sharding, a computing task bound to the corresponding data shard is deployed in each scheduling target computing node to generate a corresponding computing replica; Once the compute replica is deployed, a cache replica bound to the compute replica is constructed based on the compute replica's runtime environment configuration, task context, and data access path in the target compute node.

4. The distributed cache latency optimization method for multiple compute replicas according to claim 1, characterized in that, The step of inputting the cache weight value corresponding to each cache replica in each computing node into the replica scheduling algorithm, and using the corresponding cache weight value as a priority reference factor for computing node selection when scheduling the computing replica of each data shard, includes: Collect the cache weight values ​​of all cache replicas associated with the data shard to be scheduled in their respective compute nodes, establish the correspondence between cache replica identifiers and compute node identifiers, and extract the cache weight values ​​associated with each compute node; The cache weight value of each computing node, along with the current processing load index, task queuing time index, and resource utilization index of the corresponding computing node, are used as multi-dimensional scheduling factors and input into the replica scheduling algorithm. Based on the comprehensive score results of each candidate computing node obtained by the replica scheduling algorithm, the computing node with the highest comprehensive score is selected as the computing replica deployment node for the data shard to be scheduled.

5. The distributed cache latency optimization method for multiple compute replicas according to claim 1, characterized in that, The step of performing cache data preheating operation on the new cache replica in the new computing node according to the cache preheating strategy pre-associated with the target data shard includes: In the new computing node, during the pre-load phase of the computing replica task based on the target data shard, the parameters of the preset associated cache preheating strategy corresponding to the target data shard are parsed to obtain the historical access path, pre-read data block range and access frequency threshold in the cache preheating strategy. According to the preheating trigger conditions and preheating methods defined in the cache preheating strategy, the new cache copy is scheduled to perform data preheating operations. After completing the data preheating operation, construct the preheating data index and mapping structure for the target data shard.

6. A distributed cache latency optimization system for multiple compute replicas, characterized in that, The distributed cache latency optimization system for multiple compute replicas includes: The sharding module is used to shard the data set to be processed, generating multiple data shards. The replica creation module is used to schedule the data shards to different computing nodes, create a computing replica for each data shard on the corresponding computing node, and establish a corresponding cache replica on the computing node where each computing replica is located. The function module is used to construct a value evaluation function for the cache replica based on the historical existence time segments of the cache replica in each computing node and the time interval between each time segment and the current time point, and to generate a cache weight value corresponding to each computing node based on the value evaluation function. The input module is used to input the cache weight value corresponding to each cache replica in each compute node into the replica scheduling algorithm. When scheduling the compute replica of each data shard, the corresponding cache weight value is used as the priority reference factor for the selection of compute nodes. The scheduling module is used to construct a new cache replica corresponding to the target data shard on the new computing node after the replica scheduling algorithm allocates the computing replica of the target data shard to the new computing node; The preheating module is used to perform cache data preheating operations on the new cache copy in the new computing node according to a cache preheating strategy pre-associated with the target data shard. The incremental replication module is used to establish an incremental data replication mechanism among the computing nodes containing the target data shard. When performing data writing involving the target data shard, the written data is incrementally replicated among the cache replicas containing the target data shard. The construction function module includes: The historical data collection submodule is used to collect multiple historical existence time segments of each cached replica in its respective compute node, and represent each historical existence time segment as a set of time intervals consisting of start time and end time. The time parameter extraction submodule is used to calculate the duration of the historical existence time segment and the time distance between the end time and the current time point for the historical existence time segment of the cached copy, and use them as the time feature parameters of the cached copy. The value assessment submodule is used to construct a value assessment function for the cached copy based on the time characteristic parameters. The value assessment function calculates the value score of the cached copy by applying a time decay function and a status indication function to a historical time segment and performing integral calculation. The weight normalization submodule is used to normalize the value score of the cache replica and use it as the cache weight value corresponding to the computing node where the cache replica is located. The valuation submodule includes: The decay function construction unit is used to construct a time decay function for each historical time segment, wherein the time decay function is used to measure the value weight between any point in time in the historical time segment and the current point in time. A state function construction unit is used to define a state indicator function in each historical existence time segment. The state indicator function takes a value of 1 when the cache replica is in a valid existence state at a certain computing node, and takes a value of 0 when the cache replica is invalid or does not exist. The integration unit is used to perform segmental integration of the time decay function and the state indication function to form an integral expression: , where v(x) is the time decay function, g(x) is the state indication function, x represents the historical time point, t is the start time of the historical time segment, and 0 is the current time point.

Citation Information

Patent Citations

  • Multi-copy-based task scheduling method and system for edge computing environment

    CN111381950A

  • Dynamic telescopic distribution method based on multi-copy cache

    CN113590039A