A cache management method, device, medium and electronic equipment
Patent Information
- Application Number
- CN202610581146.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-28
- Publication Date
- 2026-09-01
AI Technical Summary
然而,在在实际应用中,数据获取代价不仅取决于数据是否命中,更与未命中时的获取成本直接相关,这就使得仅基于访问频率或最近访问时间的管理策略无法准确反映数据的真实保留价值,从而导致系统整体响应延迟增加以及导致云端资源成本的浪费
[0009]在此方法中,首先确定待操作数据项及用于描述待操作数据项的历史访问规律以及待操作数据项的静态域的访问特征,然后将访问特征输入到预先确定的预测模型中,得到待操作数据项的下次访问间隔预测值,并确定将待操作数据项从存储节点获取至计算节点的过程中所产生的代价参数,其中,代价参数包括:传输代价数据、计算下推代价数据中的至少一种,最终基于待操作数据项的下次访问间隔预测值、代价参数,计算待操作数据项的效用预测值,并基于效用预测值,确定并执行针对待操作数据项的管理操作。
Smart Images

Figure CN122672707A_ABST
Abstract
Description
Technical Field
[0001] This specification relates to one or more embodiments in the field of large model inference technology, and more particularly to a cache management method, apparatus, medium and electronic device. Background Technology
[0002] Currently, in distributed databases, cloud-native systems, and big data processing platforms employing a compute-storage separation architecture, compute nodes and storage nodes are physically decoupled and interconnected via a network. In this case, because backend storage (such as remote storage nodes, distributed file systems, or object storage services) needs to be accessed across the network to the compute nodes, the access latency to backend storage is much higher than that to memory. Furthermore, due to limited network bandwidth resources, frequent direct access to backend storage can lead to slow system response and resource bottlenecks. Therefore, to improve overall system response speed and reduce backend load, compute nodes can cache copies of frequently accessed data. When subsequent data query requests arrive, the corresponding data can be retrieved directly from the cache, significantly reducing data access latency, alleviating the I / O load on backend storage, and reducing network transmission overhead.
[0003] However, due to limitations in the physical memory capacity of computing nodes, the cache size is much smaller than the full dataset. Therefore, to retain the most valuable data within limited storage space to optimize system performance, cache management is necessary to determine which data should be retained, which should be evicted, and whether new data should be accepted. Related technologies often manage caches by maximizing the hit rate, making management decisions based on data access frequency or recent access time. However, in practical applications, the cost of data retrieval depends not only on whether data is hit but also directly on the cost of retrieving data when it misses. This means that management strategies based solely on access frequency or recent access time cannot accurately reflect the true value of data retention, leading to increased overall system response latency and wasted cloud resource costs. Summary of the Invention
[0004] In view of the above, one or more embodiments of this specification provide the following technical solutions: According to a first aspect of one or more embodiments of this specification, a cache management method is proposed, the method being used to manage the cache of computing nodes in a cloud database system, comprising: Identify the data item to be operated on and its access characteristics; the access characteristics are used to describe the historical access patterns of the data item to be operated on and the static domain of the data item to be operated on. The access features are input into a pre-determined prediction model to obtain the predicted value of the next access interval of the data item to be operated on. Determine the cost parameters generated during the process of retrieving the data item to be operated from the storage node to the computing node, the cost parameters including at least one of: transmission cost data and calculation pushdown cost data; Based on the predicted next access interval and the cost parameter, the predicted utility value of the data item to be operated is calculated, and based on the predicted utility value, the management operation for the data item to be operated is determined and executed.
[0005] According to a second aspect of one or more embodiments of this specification, a cache management apparatus is provided, the apparatus being used to manage the cache of computing nodes in a cloud database system, comprising: The first determining module is used to determine the data item to be operated on and its access characteristics; the access characteristics are used to describe the historical access patterns of the data item to be operated on and the static domain of the data item to be operated on. The prediction module is used to input the access features into a pre-determined prediction model to obtain the predicted value of the next access interval of the data item to be operated on. The second determining module is used to determine the cost parameters generated during the process of obtaining the data item to be operated from the storage node to the computing node, the cost parameters including at least one of: transmission cost data and calculation pushdown cost data; The management module is used to calculate the utility prediction value of the data item to be operated on based on the next access interval prediction value and the cost parameter, and to determine and execute the management operation for the data item to be operated on based on the utility prediction value.
[0006] According to a third aspect of one or more embodiments of this specification, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor implements the steps of the cache management method described above by executing the executable instructions.
[0007] According to a fourth aspect of one or more embodiments of this specification, a computer-readable storage medium is provided that stores computer instructions thereon, which, when executed by a processor, implement the steps of the cache management method described above.
[0008] According to a fifth aspect of one or more embodiments of this specification, a computer program product is provided, comprising a computer program / instructions that, when executed by a processor, implement the steps of the cache management method described above.
[0009] In this method, the data item to be operated on is first determined, along with the access characteristics of the static domain of the data item to be operated on, which describe the historical access patterns of the data item. Then, the access characteristics are input into a pre-determined prediction model to obtain the predicted value of the next access interval of the data item to be operated on. The cost parameters generated during the process of retrieving the data item to be operated on from the storage node to the computing node are determined. The cost parameters include at least one of the following: transmission cost data and calculation pushdown cost data. Finally, based on the predicted value of the next access interval of the data item to be operated on and the cost parameters, the predicted value of the utility of the data item to be operated on is calculated. Based on the predicted value of the utility, the management operation for the data item to be operated on is determined and executed.
[0010] As can be seen from the above method, by determining the data item to be operated on and its access characteristics, the predicted value of the next access interval can be obtained using the prediction model. Based on this, the utility prediction value can be calculated by combining cost parameters such as the transmission cost and computation push-down cost of the data item to be operated on. This makes the calculated utility prediction value accurately reflect the true retention value of the data after considering the acquisition cost. As a result, when performing management operations on the data item to be operated on (including storing new data items in the cache and removing data items already stored in the cache) based on the utility prediction value, the overall system response latency can be reduced and the utilization rate of cloud resources can be improved. Attached Figure Description
[0011] Figure 1 This is a schematic diagram of the architecture of a cloud database system provided in an exemplary embodiment.
[0012] Figure 2 This is a flowchart illustrating a cache management method provided in an exemplary embodiment.
[0013] Figure 3 This is a schematic diagram of the prediction model training and inference process provided in an exemplary embodiment.
[0014] Figure 4 This is a schematic diagram of a sample data item filtering process provided in an exemplary embodiment.
[0015] Figure 5 This is a schematic diagram of a cache management process provided in an exemplary embodiment.
[0016] Figure 6 This is a schematic structural diagram of a device provided in an exemplary embodiment.
[0017] Figure 7 This is a block diagram of a cache management device provided in an exemplary embodiment. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this specification.
[0019] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties. The collection, use and processing of related data shall comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals shall be provided for users to choose to authorize or refuse.
[0020] In scenarios such as distributed databases, cloud-native systems, and large-scale model inference, the access latency of backend storage (such as disks or remote object storage) is much higher than that of memory, and network bandwidth resources are limited. Direct and frequent access to backend storage can lead to slow system response and resource bottlenecks. Therefore, to improve the overall system response speed and reduce backend load, compute nodes can store copies of frequently accessed data (i.e., copies of data that are easily accessed) in a cache. When subsequent data query requests arrive, the corresponding data can be retrieved directly from the cache, thereby significantly reducing data access latency, alleviating the I / O load on backend storage, and reducing network transmission overhead.
[0021] Specifically, when a data query request arrives at a compute node, the compute node first checks if a matching data item exists in its cache. If it does, the query is considered successful, and the compute node directly reads the corresponding data item from its local cache and returns it with extremely low latency. Conversely, if a match is not found, the compute node must initiate a remote access request to the backend storage, retrieve the corresponding data item over the network, and then return it. Alternatively, it can choose to cache the data item for later reuse.
[0022] Regarding the aforementioned data misses, since the access latency of backend storage is much higher than that of cache, and network bandwidth resources are limited, frequent direct access to backend storage will lead to slow system response. Each data query request miss introduces round-trip latency for remote I / O, which can easily saturate network bandwidth resources under high concurrency, causing subsequent data query requests to queue. Therefore, to improve the overall system response speed, compute nodes can store frequently accessed data copies (i.e., easily accessible data copies) in the cache. When subsequent data query requests arrive, they can directly retrieve the corresponding data from the cache, thereby significantly reducing data access latency, alleviating the I / O load on backend storage, and reducing network transmission overhead.
[0023] However, since the size of the cache is often limited by the physical memory capacity of the computing nodes and is much smaller than the size of the full dataset, cache management is necessary to optimize system performance by retaining the most valuable data within limited storage space. This involves determining which data should be retained, which should be evicted, and whether new data should be accepted. Related technologies often manage caches with the goal of maximizing the hit rate, making management decisions based on data access frequency or the most recent access time. However, in practical applications, the cost of data retrieval depends not only on whether the data is hit but also directly on the cost of retrieving it when it misses. This makes management strategies based solely on access frequency or the most recent access time unable to accurately reflect the true value of data retention.
[0024] For example, in a cloud database, suppose data item A is very small (only 1KB) and accessed frequently (100 times per second), and the transmission cost of fetching it from the backend storage when a cache miss is extremely low. Data item B is large (up to 1MB), and although accessed less frequently (10 times per second), due to network bandwidth limitations, each cache miss requires a significant amount of transmission time to fetch from the backend storage. In a management strategy focused on hit rate, the high-frequency A would be prioritized while the low-frequency B would be discarded. However, once B is discarded, every subsequent access to B will incur high transmission costs, while the cost of reloading A, even if discarded, is negligible. As a result, the overall average access latency is significantly higher due to the frequent absence of B.
[0025] For example, in cloud databases, many data query requests involve aggregation or filtering operations. Compute nodes can push some computations down to the storage layer to reduce the amount of data returned (that is, distributing aggregation and filtering operations to the storage layer for execution, and directly returning the final result after execution). In this case, suppose a query for data item C requires pushing down complex aggregation calculations. Each miss not only consumes network bandwidth but also heavily consumes the CPU resources of the remote storage node, resulting in extremely high computational costs. Meanwhile, a query for data item D only performs a simple point lookup, requiring no pushdown computation, and the cost of a miss is very low. When the access frequency of C (5 times per second) is lower than that of D (20 times per second), in a management strategy focused on hit rate, C would be eliminated due to its lower access frequency. However, each subsequent access to C would repeatedly trigger high-cost remote computations, causing a surge in storage node load and increased response latency. The cost of reloading D after elimination is negligible. Ultimately, the overall system performance and cost are far inferior to a strategy that retains C and eliminates D.
[0026] Based on this, this specification provides a cache management method that can determine the data item to be operated on and its access characteristics, use a prediction model to obtain the predicted value of the next access interval, and then calculate the utility prediction value by combining cost parameters such as the transmission cost and computation push-down cost of the data item to be operated on. This allows the calculated utility prediction value to accurately reflect the true retention value of the data after considering the acquisition cost. As a result, when performing management operations on the data item to be operated on (including storing new data items in the cache and removing data items already stored in the cache) based on the utility prediction value, the overall system response latency can be reduced and the utilization rate of cloud resources can be improved.
[0027] To clearly describe the cache management method provided in this manual, some concepts involved in this manual will be explained below.
[0028] Pending data items: refers to data items that need to be evaluated whether to be stored in the cache or removed from the cache. These can include newly added data items obtained from the storage node due to cache misses, as well as some cached data items selected from the current cache (i.e., candidate eviction items).
[0029] Access characteristics: These refer to the feature vectors used to describe the historical access patterns of the data items to be operated on, as well as the static domain. Access characteristics describing historical access patterns can include access frequency, statistics on the intervals between recent accesses, etc.; access characteristics describing static domains can include metadata attributes that do not change with numerical values, such as the table name, column name, and data type of the data item.
[0030] Cost parameter: refers to the quantified value of the overhead incurred in retrieving the data item to be operated on from the storage node to the computing node. In the embodiments of this application, the cost parameter includes at least one of transmission cost data and computation pushdown cost data. Transmission cost data is mainly related to the size of the data item and the current network bandwidth, while computation pushdown cost data is mainly related to the remote computing resources consumed by performing operators such as predicate filtering and aggregation calculation on the storage side. The cost parameter is used to reflect the degree of "penalty" when data is missed.
[0031] Utility prediction value: This refers to a score that measures the value of a data item in the cache. The higher the utility prediction value, the greater the likelihood that the data item will be accessed again in the future, and the higher the cost of retrieving it; therefore, it should be retained in the cache.
[0032] Freshness metric: This refers to the reliability of historical prediction results in describing the access patterns of data items to be operated on at the current moment. The freshness metric can be calculated based on historical utility prediction values and timeliness parameters (such as the length of time since the last execution of model inference or the number of requests processed). When the freshness metric meets preset conditions, historical prediction results can be reused to avoid redundant inference.
[0033] Distribution similarity: This refers to the degree of similarity in data distribution between the current batch of supervised samples and the supervised samples from previous batches, for example, measured by Jensen-Shannon (JS) divergence. Distribution similarity is used to determine whether the load pattern has shifted significantly, thereby deciding whether to reuse the historical model or trigger retraining.
[0034] The technical solutions provided in the various embodiments of this specification are described in detail below with reference to the accompanying drawings.
[0035] Figure 1 This is a schematic diagram of the architecture of a cloud database system provided in an exemplary embodiment. For example... Figure 1 As shown, the system may include: compute node 1, compute node 2, ..., compute node N, and storage nodes, etc.
[0036] In this context, each compute node can be a physical server containing an independent host, or it can be a virtual server hosted in a host cluster (such as a containerized compute instance). During operation, the compute node can run the compute-side programs of the cloud database system to receive and process data query requests from clients. Specifically, the compute node is responsible for executing SQL parsing, query optimization, execution plan generation, and data computation logic, and maintains a local memory cache to store copies of frequently accessed data. When a compute node receives a data query request, it first checks whether the required data exists in its local cache; if the cache is hit, the data is returned directly; if the cache is not hit, a data read request is initiated from the storage node via the internal network. After obtaining the data, the node decides whether to store the data item in the local cache or evict it based on the aforementioned cache management method.
[0037] Storage nodes can be storage servers or remote object storage services in a distributed storage cluster. Storage nodes are primarily responsible for persistent data storage, responding to data read requests from compute nodes, and, in scenarios supporting compute pushdown, performing operator operations such as predicate filtering and aggregation, returning the processed results to the compute nodes.
[0038] Compute nodes and storage nodes communicate via high-speed networks (such as RDMA networks, Ethernet, etc.).
[0039] Figure 2 This is a flowchart illustrating a cache management method provided in an exemplary embodiment. In this embodiment, the executing entity for implementing the cache management method can be a computing device located at the back end of a business application, such as a server or a cloud computing cluster, or a terminal device with data processing capabilities. For ease of description, a computing node is used as the executing entity in the following explanation. The method includes the following steps: S200: Determine the data item to be operated on and its access characteristics; the access characteristics are used to describe the historical access patterns of the data item to be operated on and the static domain of the data item to be operated on.
[0040] In this specification, the compute node can receive data query requests sent by users and perform cache lookups and corresponding data processing based on the received data query requests.
[0041] During this process, if the data query request is hit in the cache, the compute node can directly read the corresponding data item from the local cache and return it to the user as the query result, thereby ending the processing flow of this data query request.
[0042] Conversely, if the data query request is not found in the cache, the compute node can retrieve the data item that matches the data query request from the storage node based on the missing data query request, add it as a new data item, and return the new data item as the query result to the user, thereby ending the processing flow of this data query request.
[0043] Subsequently, in order to determine whether the new data item should be added to the cache, and which existing data items in the cache should be evicted when the cache space is insufficient, the compute node can sample each data item stored in the cache to select at least a portion of the data items stored in the cache, and treat the selected data items together with the new data item as data items to be operated on, so as to manage the data items to be operated on.
[0044] There are several ways for compute nodes to sample data items stored in the cache. For example, compute nodes can use a random sampling strategy to randomly select a fixed number (e.g., K) or a fixed proportion of data items from all the data items stored in the current cache.
[0045] For example, a computing node can sort all stored data items in the current cache according to their corresponding utility prediction values from largest to smallest, obtain the sorted data items, and select at least a portion of the sorted data items from each data item.
[0046] In practical applications, the data query requests mentioned above can also be complex query requests that include computational logic (e.g., SQL statements containing operations such as aggregation, filtering, or joining). In this case, after the computing node obtains the data items that match the data query request, it still needs to process the data before returning it to the user as the query result.
[0047] For example, if a user sends a data query request for "total order amount in region A over the past year", executing this data query request not only requires reading the raw order transaction data from the storage node, but also requires aggregating and calculating these data items to obtain the total order amount in region A over the past year, and then returning it as the query result to the user.
[0048] Based on this, when determining the data item to be operated on, the computing node can be divided into the following two cases: In the first scenario, the compute node pushes the computation operators down to the storage node for execution to reduce the amount of data transferred from the storage node to the compute node. In this case, the newly added data item returned by the storage node can be the processed query result. Therefore, the compute node can directly return the newly added data item as the query result to the user and include it along with the data item selected from the cache as the data item to be operated on.
[0049] For example, if a user sends a data query request that reads "Query the names of students whose Chinese language scores are less than 60," the compute node, when executing this query request, can send the filter condition "Chinese language scores less than 60" to the storage node. This allows the storage node to skip data blocks with Chinese language scores less than 60 and only return the "student names" corresponding to rows that match "Chinese language scores less than 60" to the compute node. In this case, the compute node can directly return the "student names" returned by the storage node as the query result to the user.
[0050] The second scenario involves the compute node not pushing computational operators down to the storage node for execution, or the compute node pushing down only some computational operators to the storage node for execution. In this case, the newly added data item returned by the storage node can be an unprocessed data item, or intermediate result data after preliminary filtering or processing. Therefore, the compute node needs to process the newly added data item before returning it as a query result to the user. In this case, the compute node can combine the newly added data item and / or the query result based on the processed data item with data items selected from the cache as the data items to be operated on.
[0051] For example, in the data query request "query the names of students whose Chinese language scores are less than 60", the compute node can retrieve all student names and Chinese language scores from the storage node (i.e., unfiltered data items or data items that have only undergone column trimming), perform filtering operations locally to select the names of students whose Chinese language scores are less than 60, and then return these as the final query result to the user. Simultaneously, these filtered student names, or the results of further processing based on this data (such as re-sorting, deduplication, etc.), can be used together with data items selected from the cache as data items to be operated on, for direct reuse in subsequent queries.
[0052] Furthermore, after determining the data item to be operated on, the computing node can obtain the access characteristics of the data item to be operated on, so as to predict the next access interval of the data item based on the access characteristics of the data item to be operated on.
[0053] The access characteristics of the data item to be operated on can be used to describe the historical access patterns of the data item and its static domain. Here, the static domain refers to static characteristics of the data item that do not change with the specific value of the data item, such as the database object hierarchy or metadata attributes to which the data item belongs. These characteristics typically remain unchanged throughout the lifecycle of the data item, reflecting its business affiliation or logical category.
[0054] For example: the access frequency of the data item to be operated on, the interval between the last n accesses of the data item to be operated on (which can be set according to actual needs, such as the interval between the last 3 accesses), the data size of the data item to be operated on, and the table name, column name, partition ID, index name, data type, etc. to which the data item to be operated on belongs.
[0055] In one embodiment, if the data item to be operated on is the first data item to appear, it may not have a corresponding historical access record. In this case, the computing node can initialize its default access feature as the access feature used to describe the historical access pattern of the data item to be operated on, or simply use the access feature of the static field used to describe the data item to be operated on.
[0056] If the data item to be operated on is an existing data item in the cache, the compute node can read its access characteristics, which describe the historical access patterns of the data item to be operated on, from the maintained cache directory index.
[0057] S202: Input the access features into a pre-determined prediction model to obtain the predicted value of the next access interval of the data item to be operated on.
[0058] Furthermore, after determining the data item to be operated on and its access characteristics, the computing node can input the access characteristics of the data item to be operated on into a pre-determined prediction model to obtain the predicted value of the next access interval of the data item to be operated on.
[0059] The predicted next access interval can be used to reflect the time elapsed since the next expected access to the data item, or the interval between the number of requests. The smaller the value, the higher the probability that the data item will be accessed again.
[0060] The aforementioned prediction model can be a gradient boosting machine (GBM), a neural network, or another machine learning model.
[0061] Furthermore, to reduce the computational overhead of online inference, the computing node can first determine whether the preset prediction result pool stores historical prediction results for the data item to be operated on. These historical prediction results represent the predicted next access interval for that data item.
[0062] If a computing node determines that a historical prediction result exists for the data item to be operated on, it can determine the freshness index corresponding to that historical prediction result. If the freshness index is not less than a preset freshness threshold, it indicates that the historical prediction result is still valid. In this case, the computing node can directly reuse the historical prediction result as the predicted value for the next access interval of the data item to be operated on, without needing to call the prediction model again for inference. Only when there is no historical prediction result for the data item to be operated on, or when the freshness index of the data item to be operated on is lower than the freshness threshold, will the access characteristics of the data item to be operated on be input into the prediction model, in order to reduce redundant computation in high-concurrency scenarios.
[0063] The aforementioned freshness index is used to reflect the reliability of historical prediction results in describing the access patterns of the data items to be operated on at the current moment.
[0064] The aforementioned freshness index can be calculated based on the historical utility forecast values and timeliness parameters corresponding to the historical forecast results. For details, please refer to the following formula: In the above formula, This refers to the freshness index corresponding to the i-th historical prediction result. That is, the historical utility prediction value corresponding to the i-th historical prediction result. This refers to the timeliness parameter of the i-th historical prediction result.
[0065] The aforementioned timeliness parameter refers to the length of time since the last execution of model inference or the number of requests processed.
[0066] As can be seen from the above formula, the higher the historical utility prediction value (i.e., the data item was previously assessed as having a high probability of reuse), the higher its corresponding freshness index, indicating that the historical prediction result has high retention value. Simultaneously, with the length of time since the last inference or the number of requests processed (i.e., ... With the increase of ), the denominator The freshness index gradually decreases as the number of data points increases. This logarithmic decay mechanism means that freshness decreases rapidly in the short period immediately after inference is completed to quickly reflect immediate changes in workload; however, as time goes on, the rate of freshness decreases gradually, thus avoiding excessive invalidation of prediction results for high-value data items that are stable in the long term but only occasionally accessed. This allows for maximizing the reuse of historical inference results while ensuring the timeliness of prediction results.
[0067] Furthermore, in high-concurrency scenarios, a large number of data items may simultaneously require freshness checks and result reuse. As the cloud database system operates, the number of historical prediction results accumulated in the prediction result pool will also grow increasingly large. Using a linear traversal approach for searching and updating would result in significant time delays, failing to meet the low-latency requirements of cache management. Therefore, to improve the retrieval efficiency of historical prediction results and the speed of maintaining freshness metrics, thereby reducing the overall time consumption of cache management, computing nodes can use balanced structures such as red-black trees to store the historical prediction results contained in the prediction result pool, enabling rapid searching, insertion, and deletion of historical prediction results.
[0068] Specifically, compute nodes can construct a red-black tree index using the unique identifier of each data item to be operated on as the key and the corresponding historical prediction result as the value. When it is necessary to determine whether a certain data item to be operated on has a historical prediction result, the compute node can perform a binary search in the red-black tree using the unique identifier. In addition, in order to efficiently filter out expired results that need to be invalidated or deleted due to freshness indicators below a threshold, compute nodes can also maintain an auxiliary index (such as a min-heap or another balanced tree) sorted based on timeliness parameters or freshness indicators, or additionally maintain the maximum or minimum freshness information of subtrees in the red-black tree nodes, thereby enabling the rapid identification and batch cleaning of historical prediction results with low freshness.
[0069] It should be noted that the aforementioned prediction model can only be used to predict the next access interval of data items after training. The method for training the prediction model can be as follows: At least a portion of historical data items are selected from each historical data item as a supervised sample set. For each sample data item in the supervised sample set, the computing node can use the actual access interval of that sample data item as its label. Then, each sample data item in the supervised sample set can be input into the prediction model to obtain its predicted next access interval. Based on the deviation between the label of the sample data item and the predicted next access interval, the target loss can be determined, and the prediction model is trained with the minimum target loss as the optimization objective.
[0070] Among them, the deviation between the label of the aforementioned sample data item and the predicted value of the next visit interval is positively correlated with the target loss.
[0071] The aforementioned historical data items may include data items that are actually accessed in historical data query requests. These data items may include: data items that are hit in the cache and data items that are not hit in the cache but are retrieved from the storage node.
[0072] In practical applications, the distribution, query types, and access frequency patterns of hot data in cloud database systems can change drastically over different time periods. Taking an e-commerce platform as an example: during the early morning hours, the e-commerce platform system primarily processes offline analysis tasks, with data query requests concentrated on large-scale analytical data items such as historical order tables and user behavior log tables. Data queries are mostly complex OLAP aggregations and multi-table joins, with low access frequency but high cost per query. During the morning peak, data query requests quickly shift to smaller tables such as popular product items and user shopping carts, with query types changing to simple point queries and short-range queries. During midday flash sales, data query requests concentrate on single-row inventory records, involving a mix of high-concurrency read and write operations, and so on.
[0073] Therefore, to ensure the accuracy of the prediction results, computing nodes can iteratively train the prediction model in parallel during the inference task performed by the prediction model, specifically as follows: Figure 3 As shown.
[0074] Figure 3 This is a schematic diagram of the prediction model training and inference process provided in an exemplary embodiment.
[0075] Combination Figure 3 It can be seen that the computing node can select at least some historical data items from each historical data item as the supervision sample set for the current batch, and based on the supervision sample set of the current batch, retrain the prediction model obtained after training on the supervision sample set of the previous batch to obtain the prediction model used for prediction.
[0076] There are several ways for computing nodes to select at least some historical data items from each historical data item. For example, computing nodes can extract all the data items that have been accessed within a preset time period (such as every fixed number of minutes or after processing a fixed number of requests) and their corresponding actual access intervals to construct a supervised sample set.
[0077] For example, computing nodes can sample historical data items from a preset historical data item sequence according to a preset sliding time window, and use these samples as the supervision sample set for the current batch.
[0078] Specifically, for any sample data item that appears repeatedly within the sliding window, the difference between the current position index of the sample data item in the historical data item sequence and the previous position index of the sample data item in the historical data item sequence is used as the label of the sample data item.
[0079] For example, if the sliding window length is 1000, and a data item is accessed at the 100th and 600th positions, then its current position index is 100, the previous position index of this sample data item in the historical data item sequence is 600, and the label is 500 (i.e., 600-100), indicating that its reuse interval is 500 data query requests.
[0080] For a sample data item that appears for the first time within the sliding window, the compute node can use a preset cold data label as the label for that sample data item. This cold data label is a preset value greater than the length of the sliding time window.
[0081] For example, if the sliding window length is 1000, and a certain data item appears only once in the window, its label is set to a preset value (such as 10000) to characterize the data item as "cold data" with low frequency of access, thereby guiding the model to reduce the prediction probability of its future short-term reuse.
[0082] It is worth noting that the above description only uses the number of requests with the tag of the sample data item as the reuse interval as an example. In practical applications, the tag of the sample data item can also be the reuse interval duration. In this case, the position index of the sample data item in the historical data item sequence is the time point when the sample data item was accessed, and the tag of the sample data item is used to characterize the time difference between the current access time point and the last access time point of the sample data item. This specification will not elaborate further here.
[0083] It is important to emphasize that the process of the predictive model performing inference tasks and the process of training the predictive model are independent and parallel in execution. Specifically, the process of using the currently determined predictive model to perform inference tasks and predict the next access interval of the data item to be operated on is executed in parallel with the training process used to optimize and update the predictive model. Furthermore, the training process used to optimize and update the predictive model does not block the processing of online query requests. Only after the predictive model has been trained on a new batch of supervised samples and passed consistency checks will the version of the predictive model used for online inference be atomically replaced.
[0084] As can be seen from the above, computing nodes can dynamically extract supervised sample sets through sliding time windows to capture short-term changes in data access patterns and provide real-time data for model training.
[0085] In practical applications, computing nodes can insert the data items accessed during the response to the data query request into the historical data item sequence as new historical data items after each data query operation is performed in response to the data query request. The supervised sample set of the current batch can be extracted from the historical data item sequence through a sliding time window.
[0086] However, if a large amount of computing resources are consumed to obtain a supervised sample set and retrain the prediction model for each data query request, the computing node can also extract the supervised sample set of the current batch from the historical data item sequence through a sliding time window after each update of the historical data item sequence, and calculate the distribution similarity between the supervised sample set of the current batch and the supervised sample set of at least one historical batch. If the distribution similarity meets the preset reuse conditions, the prediction model corresponding to the supervised sample set of the historical batch is directly reused as the updated prediction model.
[0087] Conversely, if the distribution similarity does not meet the preset reuse conditions, the prediction model obtained after training on the previous batch of supervised sample sets is trained again based on the current batch of supervised sample sets to obtain an updated prediction model.
[0088] The reuse conditions mentioned above can be set according to actual needs. For example, a distribution similarity threshold can be set. If the distribution similarity value between the current batch of supervised sample sets and a certain historical batch of supervised sample sets is greater than the distribution similarity threshold, then the reuse conditions can be considered to be met.
[0089] The aforementioned distribution similarity can be determined using statistical distance metrics such as JS divergence, KL divergence, and Wasserstein distance.
[0090] In the inference process, whenever a computing node needs to make a prediction on a data item to be operated on, it can call the current prediction model and predict the next access interval of the data item to be operated on based on the current prediction model.
[0091] In addition, in practical applications, there may be abnormal access behaviors caused by network jitter, sudden bursts of traffic, or system background maintenance tasks. The access intervals of these data items often exhibit great randomness or deviate from normal patterns.
[0092] Therefore, to prevent these anomalous samples from interfering with the training process of the prediction model and causing it to learn incorrect access patterns, thus reducing prediction accuracy, the computing node can also determine whether each sample data item in the current batch's supervised sample set is an anomalous sample based on the consistency between its short-term reuse characteristics and long-term historical access distribution characteristics. If so, the sample data item is removed from the current batch's supervised sample set. Specifically, as follows... Figure 4 As shown.
[0093] Figure 4 This is a schematic diagram of a sample data item filtering process provided in an exemplary embodiment.
[0094] Combination Figure 4 As can be seen, the computing node can use the difference between the current position index of the sample data item in the historical data item sequence and the next position index of the sample data item in the historical data item sequence as the span value of the sample data item. If the label value of the sample data item is greater than the preset span threshold and the span value of the sample data item is less than the span threshold, then the sample data item is identified as an abnormal sample.
[0095] For example, suppose the preset span threshold is 100. A data item's last occurrence in the historical sequence has an index of 10, its current index is 110, and its next occurrence index is 115. At this point, the data item's label value (the difference between the current and previous positions) is 100, equal to the preset span threshold, while its span value (the difference between the next and current positions) is 5 (115-110), much smaller than the span threshold of 100. This indicates that after a "cold cycle" of 100 requests, the data item is suddenly accessed again in the next 5 requests. This "sudden hot reappearance after a long cold period" may not conform to normal access patterns (e.g., it could be due to a chance batch scan or misoperation), and belongs to an anomaly where short-term characteristics are inconsistent with long-term historical access distribution characteristics. Therefore, it is judged as an abnormal sample and removed from the training set.
[0096] It should be noted that in practical applications, the prediction model can be deployed locally on the compute node. Alternatively, it can be deployed on a standalone model service cluster or a cloud-based machine learning platform. When the prediction model is deployed on a standalone service cluster, the compute node can send the access features of the data items to be operated on to the model service cluster via Remote Procedure Call (RPC) or API interface, and receive the returned prediction results. Furthermore, the model training process described above can be executed by the service cluster where the prediction model is deployed.
[0097] S204: Determine the cost parameters generated during the process of obtaining the data item to be operated from the storage node to the computing node, the cost parameters including at least one of: transmission cost data and calculation pushdown cost data.
[0098] As can be seen from the above, the data items to be operated on can be divided into two types. The first type can be newly added data items obtained from the storage node after a cache miss. The second type can be at least some data items selected from the data items already stored in the cache.
[0099] For both types of data items, the compute node can collect the actual cost parameters of the data item to be operated on during the process of obtaining the data item from the storage node to the compute node (i.e., it can collect the actual transmission cost data from the storage node to the compute node and the actual computation push-down cost data of the storage node), and perform management operations on the data item to be operated on based on the cost parameters of the data item to be operated on.
[0100] The aforementioned cost parameters may include at least one of the following: transmission cost data and calculation pushdown cost data.
[0101] S206: Based on the predicted value of the next access interval and the cost parameter, calculate the predicted value of the utility of the data item to be operated, and based on the predicted value of the utility, determine and execute the management operation for the data item to be operated.
[0102] Furthermore, the computing nodes can construct a temporary candidate pool through a pre-defined cache manager, and then store each data item to be operated on into the temporary candidate pool. Based on the predicted next access interval and cost parameters of each data item to be operated on, the predicted utility value corresponding to each data item to be operated on is determined, as shown in the following formula: In the above formula, That is, the predicted utility value corresponding to the i-th data item to be operated on. That is, the cost corresponding to the i-th data item to be operated on. It can be the sum of the transmission cost data corresponding to the i-th data item to be operated on and the calculation pushdown cost data corresponding to the i-th data item to be operated on. This can be the predicted reuse probability value of the i-th data item to be operated on in the near future. The size can be the data size of the i-th data item to be operated on.
[0103] The aforementioned reuse probability prediction value can be the reciprocal of the next access interval prediction value of the i-th data item to be operated on.
[0104] After determining the predicted utility value of each data item to be operated on, the compute nodes can select at least a portion of the data items to be evicted from the data items to be operated on according to the magnitude of the predicted utility value, and jointly execute the acceptance operation for newly added data items, as well as the eviction operation for at least a portion of the data items selected from the cache. Specifically, as follows... Figure 5 As shown.
[0105] Figure 5 This is a schematic diagram of a cache management process provided in an exemplary embodiment.
[0106] Combination Figure 5 As can be seen, the computing node can determine whether the utility prediction value of the new data item is the smallest among the data items to be operated on. If so, it will refuse to store the new data item in the cache. If not, it will take the data item with the smallest utility prediction value as the data item to be eliminated, and then remove the data item to be eliminated from the cache and re-determine until the remaining storage space in the cache is sufficient to accommodate the new data item. At this point, the new data item can be stored in the cache.
[0107] Among them, the predicted utility value of the data items to be eliminated is less than the predicted utility value of the remaining data items to be operated on.
[0108] For example, if there is a new data item with a size of 12MB and a utility prediction value of 80, and the cache already stores three data items: data item A (size 5MB, utility prediction value 90), data item B (size 10MB, utility prediction value 60), and data item C (size 3MB, utility prediction value 70). At this point, the compute node can treat the newly added data item and all three data items as pending data items. The compute node can first determine whether the newly added data item is the pending data item with the smallest predicted utility value among all pending data items. If so, the compute node can decide to reject the newly added data item from the cache. If not, the compute node can select the pending data item B with the smallest predicted utility value from all pending data items according to the size of the predicted utility value, as the pending data item to be replaced, and remove the pending data item from the cache. At this time, the remaining storage space in the cache is 10MB, which is less than the 12MB of the newly added data item. Therefore, the compute node can re-determine whether the newly added data item is the pending data item with the smallest predicted utility value among all pending data items. If not, it can again select the pending data item C with the smallest predicted utility value from all pending data items according to the size of the predicted utility value, as the pending data item to be replaced, and remove the pending data item from the cache. At this time, the remaining storage space in the cache is 13MB, which is greater than the 12MB of the newly added data item, which is sufficient to accommodate the newly added data item, so the newly added data item can be stored in the cache.
[0109] It should be noted that there are two scenarios for deciding whether a new data item should be added to the cache. The first scenario is when the cache is not full. The compute node can determine whether the remaining storage space in the cache is greater than the size of the new data item. If so, the new data item can be directly added to the cache. If not, the compute node can determine whether the new data item should be added to the cache and which existing data items in the cache should be evicted when the cache space is insufficient, in accordance with the above method.
[0110] The second scenario is when the cache is full. In this case, the compute node can directly use the method described above to determine whether the new data item should be added to the cache, and which existing data items in the cache should be evicted when the cache space is insufficient.
[0111] It is important to emphasize that in practical applications, if cache management adopts a "first accept, then evict" separation strategy, that is, by default all new data items are written directly to the cache, and when the cache space is insufficient, some data items are selected from the data items already stored in the cache for eviction, then when the new data item is a low-value data item or a data item accessed only once, the new data item is still stored in the cache first, while the data items already stored in the cache are squeezed out. As a result, the new data items with low value or accessed only once can easily occupy the space of high-value existing data items, causing serious cache pollution, which in turn leads to low cache space utilization and system performance degradation.
[0112] In this specification, the compute node can jointly execute the acceptance operation for new data items and the eviction operation for at least a portion of the data items selected from the cache. This can be understood as coupling the acceptance operation (determining whether to store new data items in the buffer) and the eviction operation (determining whether to evict existing data items in the cache) as a single optimization problem. Specifically, the compute node constructs a set of data items to be operated on, together with the new data items and candidate data items sampled from the cache. Within this set, the utility prediction value of each data item is calculated uniformly. Through global comparison rather than local replacement, the subset with the highest utility value is directly selected and retained in the cache, while data items with lower utility values are rejected or evicted. This achieves synchronous quantification and selective retention of the value of new and old data items, fundamentally avoiding the ineffective occupation of cache space by low-value new data.
[0113] As can be seen from the above, computing nodes can determine the data items to be operated on and their access characteristics, and use a prediction model to obtain the predicted value of the next access interval. Based on this, the utility prediction value is calculated by combining cost parameters such as the transmission cost and computation push-down cost of the data items to be operated on. This makes the calculated utility prediction value accurately reflect the true retention value of the data after considering the acquisition cost. As a result, when performing management operations on the data items to be operated on (including storing new data items in the cache and removing data items already stored in the cache) based on the utility prediction value, the overall system response latency can be reduced and the utilization rate of cloud resources can be improved.
[0114] Figure 6 This is a schematic structural diagram of a device provided in an exemplary embodiment. For example... Figure 6As shown, device 600 mainly consists of a communication interface 602, a user interface 604, a processor 606, and a data storage 608. These components are interconnected and communicate with each other via a system bus, network, or other connection mechanism 610. The communication interface 602 enables device 600 to communicate with other devices, access networks, and transmission networks via analog or digital modulation. For example, the communication interface 602 may include a chipset and antenna for wireless communication with a radio access network or access point. Furthermore, the communication interface 602 can be a wired interface such as Ethernet, Token Ring, or a USB port, or a wireless interface such as Wi-Fi, Bluetooth, Global Positioning System (GPS), or a wide-area wireless interface (e.g., WiMAX or LTE). Of course, the communication interface 602 can also support other forms of physical layer interfaces and standard or proprietary communication protocols. The communication interface 602 may also include multiple physical communication interfaces, such as Wi-Fi, Bluetooth, and wide-area wireless interfaces.
[0115] User interface 604 includes receiving user input and providing output to the user. Therefore, user interface 604 may include input components such as a keypad, keyboard, touch-sensitive or presence-sensitive panel, computer mouse, trackball, joystick, microphone, still camera, and video camera, and output components such as a display screen (which may be combined with a touch-sensitive panel), CRT, LCD, LED, display using DLP technology, printer, and other similar devices known or developed in the future. User interface 604 may also generate auditory output via speakers, speaker jacks, audio output ports, audio output devices, headphones, and other similar devices known or developed in the future. In some embodiments, user interface 604 may include software, circuitry, or other forms of logic capable of transmitting and receiving data from external user input / output devices. Additionally or alternatively, device 600 may support remote access from other devices via communication interface 602 or another physical interface (not shown). User interface 604 may be configured to receive user input, the position and movement of which may be indicated by indicators or cursors described herein. User interface 604 may also be configured as a display device for rendering or displaying text fragments.
[0116] Processor 606 may contain one or more general-purpose processors and / or special-purpose processors.
[0117] Data storage 608 may include one or more volatile and / or non-volatile storage components and may be integrated wholly or partially with processor 606. Data storage 608 may include removable and non-removable components.
[0118] Processor 606 is capable of executing program instructions 618 (e.g., compiled or uncompiled program logic and / or machine code) stored in data storage 608 to perform the various functions described herein. Data storage 608 may contain a non-transitory computer-readable medium on which program instructions are stored, which, when executed by device 600, enable device 600 to perform any methods, processes, or functions disclosed in this specification and / or the accompanying drawings. Execution of program instructions 618 by processor 606 may result in processor 606 using data 612.
[0119] For example, program instructions 618 may include an operating system 622 (e.g., an operating system kernel, device drivers, and / or other modules) installed on device 600 and one or more applications 620 (e.g., a browser, social application, or game application). Similarly, data 612 may include operating system data 616 and application data 614. Operating system data 616 is primarily accessible to the operating system 622, while application data 614 is primarily accessible to one or more applications 620. Application data 614 may reside in a file system visible or hidden from the user of device 600.
[0120] Application 620 can communicate with operating system 622 through one or more application programming interfaces (APIs). These APIs help application 620 read and / or write application data 614, transmit or receive information via communication interface 602, receive or display information on user interface 604, etc.
[0121] In some terminology, application 620 may be simply referred to as "app". Furthermore, application 620 can be downloaded to device 600 through one or more online app stores or app markets. However, applications can also be installed on device 600 in other ways, such as through a web browser or a physical interface on device 600 (e.g., a USB port).
[0122] Please refer to Figure 7 Cache management devices can be applied to, for example Figure 6 The device shown implements the technical solution described in this specification. The cache management device may include: The first determining module 701 is used to determine the data item to be operated on and its access characteristics; the access characteristics are used to describe the historical access patterns of the data item to be operated on and the static domain of the data item to be operated on. The prediction module 702 is used to input the access features into a predetermined prediction model to obtain the predicted value of the next access interval of the data item to be operated on. The second determining module 703 is used to determine the cost parameters generated during the process of obtaining the data item to be operated from the storage node to the computing node, the cost parameters including at least one of: transmission cost data and calculation pushdown cost data; The management module 704 is used to calculate the utility prediction value of the data item to be operated based on the next access interval prediction value and the cost parameter, and to determine and execute the management operation for the data item to be operated based on the utility prediction value.
[0123] Optionally, the first determining module 701 is specifically configured to: obtain data items matching the data query request from the storage node based on the missing data query request, and use them as new data items; and use the new data items and at least some data items selected from the cache as data items to be operated on.
[0124] Optionally, the management module 704 is specifically configured to select at least a portion of the data items to be eliminated from each data item to be operated on according to the size of the utility prediction value, and jointly perform an acceptance operation for the new data item and an elimination operation for the at least a portion of the data items selected from the cache; the utility prediction value of the data item to be eliminated is less than the utility prediction value of the remaining data items to be operated on.
[0125] Optionally, the management module 704 is specifically used to determine whether the utility prediction value of the newly added data item is the smallest among the data items to be operated on; if so, then refuse to store the newly added data item in the cache; if not, then take the data item to be operated with the smallest utility prediction value as the data item to be eliminated, remove the data item to be eliminated from the cache, and re-determine until the remaining storage space in the cache is sufficient to accommodate the newly added data item, and then store the newly added data item in the cache.
[0126] Optionally, the device further includes: a training module 705; The training module 705 is specifically used to select at least a portion of historical data items from each historical data item as the current batch of supervised sample sets; wherein, the label of each sample data item included in the supervised sample set is the actual access interval of the sample data item; based on the current batch of supervised sample sets, the prediction model obtained after training on the previous batch of supervised sample sets is trained again to obtain the current prediction model used for prediction.
[0127] Optionally, the training module 705 is specifically used to sample each historical data item from a preset historical data item sequence according to a preset sliding time window, and use it as the supervision sample set for the current batch; wherein, for any sample data item that appears repeatedly within the sliding window, the difference between the current position index of the sample data item in the historical data item sequence and the previous position index of the sample data item in the historical data item sequence is used as the label of the sample data item.
[0128] Optionally, for a sample data item that appears for the first time within the sliding window, a preset cold data label is used as the label for that sample data item; wherein, the cold data label is a preset value that is greater than the length of the sliding time window.
[0129] Optionally, the training module 705 is specifically used to determine whether a sample data item is an abnormal sample based on the consistency between the short-term reuse characteristics and the long-term historical access distribution characteristics of each sample data item in the current batch of supervised sample sets; if so, the sample data item is removed from the current batch of supervised sample sets.
[0130] Optionally, the training module 705 is specifically used to take the difference between the current position index of the sample data item in the historical data item sequence and the next position index of the sample data item in the historical data item sequence as the span value of the sample data item; if it is determined that the label value of the sample data item is greater than a preset span threshold and the span value of the sample data item is less than the span threshold, then the sample data item is determined as an abnormal sample.
[0131] Optionally, the training module 705 is specifically used to calculate the distribution similarity between the current batch of supervised sample sets and at least one historical batch of supervised sample sets; if the distribution similarity meets a preset reuse condition, the prediction model corresponding to the historical batch of supervised sample sets is directly reused as the updated prediction model; if the distribution similarity does not meet the preset reuse condition, the prediction model obtained after training on the previous batch of supervised sample sets is trained again based on the current batch of supervised sample sets to obtain the updated prediction model.
[0132] Optionally, the prediction module 702 is specifically used to determine whether historical prediction results for the data item to be operated on are stored; the historical prediction results are the predicted values of the next access interval for the data item to be operated on in the past; if so, the freshness index corresponding to the historical prediction results is determined, and when the freshness index is determined to be not less than a preset freshness threshold, the historical prediction results are reused as the predicted value of the next access interval for the data item to be operated on; the freshness index is used to reflect the credibility of the historical prediction results in describing the access pattern of the data item to be operated on at the current time.
[0133] Optionally, the prediction module 702 is specifically used to obtain the historical utility prediction value corresponding to the historical prediction result, and the timeliness parameter of the historical prediction result; wherein, the timeliness parameter includes: the length of time elapsed since the last execution of model inference or the number of requests processed; and to calculate the freshness index corresponding to the historical prediction result based on the historical utility prediction value and the timeliness parameter.
[0134] Optionally, the management module 704 is specifically used to: use the reciprocal of the predicted value of the next access interval as the predicted value of the reuse probability of the data item to be operated; and calculate the predicted value of utility based on the predicted value of reuse probability, the cost parameter, and the data size of the data item to be operated.
[0135] For ease of description, the above devices are described by dividing them into various modules or units based on their functions. Of course, when implementing one or more of these specifications, the functions of each module or unit can be implemented in the same or different software and / or hardware, or a module that performs the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0136] Based on the same concept as the methods described above, this specification also provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor performs the steps of the method as described in any of the above embodiments by executing the executable instructions.
[0137] Based on the same concept as the methods described above, this specification also provides a computer-readable storage medium having computer instructions stored thereon that, when executed by a processor, implement the steps of the methods as described in any of the above embodiments.
[0138] Based on the same concept as the methods described above, this specification also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the methods as described in any of the above embodiments.
[0139] What those skilled in the art will understand is: In this specification, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, product, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, product, or apparatus. Without further limitation, the presence of additional identical or equivalent elements in a process, method, product, or apparatus that includes said elements is not excluded.
[0140] In this specification, “a,” “an,” and “the” do not specifically refer to the singular, but may also include the plural.
[0141] In this specification, ordinal numbers such as "first," "second," etc., do not necessarily indicate order; they are often used to distinguish between objects. For example, "first server" and "second server" usually refer to two servers. To differentiate between these two servers, they are described as "first server" and "second server." Of course, sometimes these two servers may be the same server.
[0142] In this specification, unless explicitly stated otherwise, "receiving and sending data" does not necessarily mean direct receiving and sending; it can also mean indirect receiving and sending. For example, A receiving data sent by B can be understood as A directly receiving the data sent by B, or it can be understood as A indirectly receiving the data sent by B through other entities such as C. Similarly, B sending data to A can be understood as B sending the data directly to A, or it can be understood as B indirectly sending the data to A through other entities such as C. Here, C can be one entity, or it can be two or more entities.
[0143] In this specification, unless explicitly stated otherwise, the relationships between structures can be direct or indirect. For example, when describing "A is connected to B," unless it is explicitly stated that A and B are directly connected, it should be understood that A can be directly connected to B or indirectly connected to B. Similarly, when describing "A is on top of B," unless it is explicitly stated that A is directly above B (AB is adjacent and A is above B), it should be understood that A can be directly above B or indirectly above B (AB is separated by other elements, and A is above B). And so on.
[0144] This specification uses specific terms to describe embodiments thereof. Terms such as "an embodiment," "one embodiment," and / or "some embodiments" refer to a particular feature, structure, or characteristic associated with at least one embodiment of this specification. Therefore, it should be emphasized and noted that references to "an embodiment," "one embodiment," or "an alternative embodiment" in different locations throughout this specification do not necessarily refer to the same embodiment. Furthermore, those skilled in the art can combine and integrate the different embodiments or examples described herein, as well as the features of those different embodiments or examples, without contradiction.
[0145] Although one or more embodiments of this specification provide method steps as described in the embodiments or flowcharts, it is understood that the order of steps listed in the embodiments or flowcharts is only one of many possible execution orders and does not represent the only execution order. Therefore, when the claims involve method steps, any changes or adjustments to the order of such steps, or the parallelism between steps, are also within the scope of protection of the claims.
Claims
1. A cache management method, the method being used to manage the cache of computing nodes in a cloud database system, comprising: Identify the data item to be operated on and its access characteristics; the access characteristics are used to describe the historical access patterns of the data item to be operated on and the static domain of the data item to be operated on. The access features are input into a pre-determined prediction model to obtain the predicted value of the next access interval of the data item to be operated on. Determine the cost parameters generated during the process of retrieving the data item to be operated from the storage node to the computing node, the cost parameters including at least one of: transmission cost data and calculation pushdown cost data; Based on the predicted next access interval and the cost parameter, the predicted utility value of the data item to be operated is calculated, and based on the predicted utility value, the management operation for the data item to be operated is determined and executed.
2. The method as described in claim 1, wherein determining the data item to be operated on specifically includes: Based on the data query request that was not matched, the data item that matches the data query request is retrieved from the storage node and added as a new data item; The newly added data item and at least some of the data items selected from the cache are used as data items to be operated on.
3. The method as described in claim 2, wherein based on the utility prediction value, determining and performing management operations for the data item to be operated on specifically includes: Based on the magnitude of the predicted utility value, at least a portion of the data items to be eliminated are selected from each data item to be operated on, and an acceptance operation for the newly added data item and an elimination operation for the at least portion of the data items selected from the cache are jointly performed; the predicted utility value of the data item to be eliminated is less than the predicted utility value of the remaining data items to be operated on.
4. The method of claim 3, wherein at least a portion of the data items to be evicted are selected from each data item to be operated on according to the magnitude of the utility prediction value, and an acceptance operation for newly added data items and an evicting operation for at least a portion of the data items selected from the cache are jointly performed, specifically including: Determine whether the predicted utility value of the newly added data item is the smallest among all the data items to be operated on; If so, then refuse to store the newly added data item in the cache; If not, the data item with the smallest predicted utility value is selected as the data item to be eliminated, removed from the cache, and the process is repeated until the remaining storage space in the cache is sufficient to accommodate the new data item. The new data item is then stored in the cache.
5. The method of claim 1, further comprising: At least a portion of the historical data items are selected from each historical data item to form the supervisory sample set for the current batch; wherein, the label of each sample data item in the supervisory sample set is the actual access interval of that sample data item; Based on the current batch of supervised sample sets, the prediction model obtained after training on the previous batch of supervised sample sets is trained again to obtain the current prediction model used for prediction.
6. The method as described in claim 5, wherein at least a portion of the historical data items are selected from each historical data item as the supervisory sample set for the current batch, specifically includes: Each historical data item sampled from a preset historical data item sequence according to a preset sliding time window is used as the supervision sample set for the current batch; wherein, for any sample data item that appears repeatedly within the sliding window, the difference between the current position index of the sample data item in the historical data item sequence and the previous position index of the sample data item in the historical data item sequence is used as the label of the sample data item.
7. The method as described in claim 6, wherein for a sample data item that appears for the first time within the sliding window, a preset cold data label is used as the label for that sample data item; wherein, The cold data label is a preset value that is greater than the length of the sliding time window.
8. The method of claim 6, further comprising: For each sample data item in the current batch of the supervised sample set, determine whether the sample data item is an abnormal sample based on the consistency between the short-term reuse characteristics and the long-term historical access distribution characteristics of the sample data item. If so, the sample data item is removed from the current batch of supervised samples.
9. The method as described in claim 8, wherein determining whether a sample data item is an anomalous sample based on the consistency between the short-term reuse characteristics and the long-term historical access distribution characteristics of the sample data item, specifically includes: The difference between the current position index of the sample data item in the historical data item sequence and the next position index of the sample data item in the historical data item sequence is used as the span value of the sample data item. If the label value of a sample data item is greater than a preset span threshold, and the span value of the sample data item is less than the span threshold, then the sample data item is identified as an abnormal sample.
10. The method according to any one of claims 5 to 9, further comprising: Calculate the distribution similarity between the current batch of supervised sample sets and at least one historical batch of supervised sample sets; If the distribution similarity meets the preset reuse conditions, the prediction model corresponding to the supervised sample set of the historical batch is directly reused as the updated prediction model. If the distribution similarity does not meet the preset reuse conditions, then based on the current batch of supervised sample sets, the prediction model obtained after training on the previous batch of supervised sample sets is trained again to obtain an updated prediction model.
11. The method as described in claim 1, wherein the access features are input into a predetermined prediction model to obtain a predicted value for the next access interval of the data item to be operated on, specifically includes: Determine whether historical prediction results for the data item to be operated on are stored; the historical prediction results are the predicted values of the next access interval for the data item to be operated on in the past. If so, the freshness index corresponding to the historical prediction result is determined, and when the freshness index is determined to be not less than the preset freshness threshold, the historical prediction result is reused as the next access interval prediction value of the data item to be operated on; the freshness index is used to reflect the credibility of the historical prediction result in describing the access pattern of the data item to be operated on at the current time.
12. The method of claim 11, wherein determining the freshness index corresponding to the historical prediction results specifically includes: Obtain the historical utility prediction value corresponding to the historical prediction result, and the timeliness parameter of the historical prediction result; wherein, the timeliness parameter includes: the length of time since the last execution of model inference or the number of requests processed; Based on the historical utility prediction value and the timeliness parameter, calculate the freshness index corresponding to the historical prediction result.
13. The method as described in claim 1, wherein calculating the utility prediction value of the data item to be operated on based on the next access interval prediction value and the cost parameter specifically includes: The reciprocal of the predicted next access interval is used as the predicted reuse probability value of the data item to be operated on. The utility prediction value is calculated based on the reuse probability prediction value, the cost parameter, and the data size of the data item to be operated on.
14. A cache management device, the device being used to manage the cache of computing nodes in a cloud database system, comprising: The first determining module is used to determine the data item to be operated on and its access characteristics; the access characteristics are used to describe the historical access patterns of the data item to be operated on and the static domain of the data item to be operated on. The prediction module is used to input the access features into a pre-determined prediction model to obtain the predicted value of the next access interval of the data item to be operated on. The second determining module is used to determine the cost parameters generated during the process of obtaining the data item to be operated from the storage node to the computing node, the cost parameters including at least one of: transmission cost data and calculation pushdown cost data; The management module is used to calculate the utility prediction value of the data item to be operated on based on the next access interval prediction value and the cost parameter, and to determine and execute the management operation for the data item to be operated on based on the utility prediction value.
15. An electronic device comprising: processor; A memory for storing processor-executable instructions; wherein the processor implements the steps of the method as described in any one of claims 1-13 by executing the executable instructions.
16. A computer-readable storage medium having stored thereon computer instructions that, when executed by a processor, implement the steps of the method as claimed in any one of claims 1-13.
17. A computer program product comprising a computer program / instructions that, when executed by a processor, implement the steps of the method as claimed in any one of claims 1-13.