A multi-level multi-node caching method, device, equipment and storage medium
By using preset dual multi-group sliding windows and deep learning models in a multi-level caching system, the cache level is dynamically adjusted, which solves the problem of poor performance of traditional caching strategies in complex data access mode, and realizes efficient cache management and personalized services.
Patent Information
- Application Number
- CN202411259783.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-09-10
AI Technical Summary
The traditional multi-level cache management strategy does not perform well in the face of complex and dynamically changing data access patterns, and ignores the differences between nodes, and cannot provide the optimal caching solution, resulting in uneven resource utilization and cache hotspot issues.
A multi-level multi-node cache method based on preset dual multi-group sliding windows and deep learning models is adopted. The cache level is dynamically adjusted through feature acquisition and data access probability prediction to provide customized cache strategies.
Improve the cache hit rate and system personalized service capabilities, enhance user experience, and avoid uneven resource utilization and cache hot issues.
Smart Images

Figure CN118779257B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of computer networks and data management, and in particular to a multi-level multi-node caching method, device, equipment and storage medium. Background Art
[0002] In today's information age, the speed of data generation, storage and access is increasing. With the popularity of microservice architecture, efficient data exchange and processing between services has become particularly important. In order to increase the speed of data access and reduce latency, multi-level cache systems are widely used in various computing environments.
[0003] However, traditional multi-level cache management strategies, such as the Least Recently Used (LRU) algorithm, although simple, often perform poorly when faced with complex and dynamically changing data access patterns. In addition, since the data access pattern of each node may be unique, traditional cache strategies often ignore the differences between nodes and therefore cannot provide the optimal cache solution. Moreover, existing cache systems usually adopt a centralized cache management strategy, which may lead to uneven resource utilization and cache hotspot problems in a multi-node environment. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a multi-level multi-node caching method, device, equipment and storage medium, which can not only intelligently manage cache content and improve cache hit rate, but also provide customized caching strategies for each node in a distributed computing environment, thereby improving the personalized service capabilities of the system and user experience. The specific scheme is as follows:
[0005] In a first aspect, the present application provides a multi-level multi-node caching method, which is applied to a preset multi-level multi-node caching system, including:
[0006] Based on the preset dual multi-group sliding windows and the corresponding preset periodic feature collection rules, feature collection is performed on the corresponding data items to obtain corresponding feature collection results; wherein the preset dual multi-group sliding windows include a corresponding basic sliding window and each node sliding window, and the basic sliding window and each node sliding window include multiple independent sliding windows;
[0007] When the corresponding feature collection is completed, based on the plurality of feature collection results stored in each of the sliding windows in the preset dual multiple groups of sliding windows and the deep learning models corresponding to each network node, a corresponding data access probability prediction operation is triggered for each of the data items to obtain a prediction result output by each of the deep learning models;
[0008] Based on each of the prediction results, the preset shared cache decision rule and the preset node-specific cache decision rule, a target cache level corresponding to each of the data items is obtained, and data caching is performed based on the corresponding target cache level.
[0009] Optionally, the performing feature collection on corresponding data items based on the preset dual multiple groups of sliding windows and corresponding preset periodic feature collection rules includes:
[0010] Based on the basic sliding window in the preset dual multi-group sliding window and the corresponding first preset periodic feature collection rule, feature collection is performed on all data items to obtain corresponding first feature collection results; wherein the first feature collection results include corresponding data access frequency and data size;
[0011] Based on the node sliding window in the preset dual multi-group sliding window and the corresponding second preset periodic feature collection rule, feature collection is performed on the data item corresponding to the current network node to obtain a corresponding second feature collection result; wherein the second feature collection result includes a corresponding data access frequency.
[0012] Optionally, when the corresponding feature collection is completed, triggering a corresponding data access probability prediction operation for each of the data items based on the multiple feature collection results stored in each of the sliding windows in the preset dual multiple groups of sliding windows and the deep learning model corresponding to each network node, includes:
[0013] When the corresponding feature collection is completed, the deep learning model of each network node is run separately by starting multiple processes or threads;
[0014] Based on the multiple feature collection results stored in each of the sliding windows in the preset dual multiple groups of sliding windows, and each of the deep learning models triggers a corresponding data access probability prediction operation for each of the data items.
[0015] Optionally, the triggering of a corresponding data access probability prediction operation for each of the data items based on the plurality of feature collection results stored in each of the sliding windows of the preset dual plurality of groups of sliding windows and the deep learning model corresponding to each of the network nodes includes:
[0016] For any network node, based on the plurality of feature acquisition results stored in each of the sliding windows in the preset dual multiple groups of sliding windows, target model input information corresponding to each of the data items is obtained;
[0017] Based on the input information of each target model and the corresponding deep learning model, a prediction result of each data item corresponding to the current network node is obtained.
[0018] Optionally, obtaining a target cache level corresponding to each of the data items based on each of the prediction results, a preset shared cache decision rule, and a preset node-specific cache decision rule includes:
[0019] For any of the data items, using the corresponding prediction results and the preset function to obtain a corresponding probability mean, and based on the probability mean and the space remaining information of the current caches at all levels and the cache decision threshold, obtaining a corresponding shared cache decision;
[0020] Obtain a corresponding node-specific cache decision using the corresponding prediction result output by the deep learning model of the corresponding network node, as well as the space remaining information of the current caches at all levels and the cache decision threshold;
[0021] Based on the shared cache decision and the node-specific cache decision, a corresponding target cache level is obtained.
[0022] Optionally, the method further includes:
[0023] Collecting data access logs of each network node; wherein the data access log is a log that stores the access time and access frequency of the corresponding data item;
[0024] Record data cache success events and data cache failure events.
[0025] Optionally, the method further includes:
[0026] Perform corresponding model performance evaluation based on the preset period, the data access log and the recorded data cache success events to obtain corresponding evaluation results;
[0027] When there is an evaluation result that is less than the corresponding preset performance threshold, a corresponding model update operation and a cache decision threshold update operation are triggered.
[0028] In a second aspect, the present application provides a multi-level multi-node cache device, which is applied to a preset multi-level multi-node cache system, including:
[0029] A feature collection module, used to collect features of corresponding data items based on preset dual multi-group sliding windows and corresponding preset periodic feature collection rules to obtain corresponding feature collection results; wherein the preset dual multi-group sliding windows include corresponding basic sliding windows and each node sliding window, and the basic sliding window and each node sliding window include multiple independent sliding windows;
[0030] A probability prediction module, configured to trigger a corresponding data access probability prediction operation on each of the data items based on a plurality of the feature collection results stored in each of the sliding windows in the preset dual multiple groups of sliding windows and a deep learning model corresponding to each network node when the corresponding feature collection is completed, so as to obtain a prediction result output by each of the deep learning models;
[0031] The data cache module is used to obtain the target cache level corresponding to each of the data items based on each of the prediction results, the preset shared cache decision rules and the preset node-specific cache decision rules, and cache the data based on the corresponding target cache level.
[0032] In a third aspect, the present application provides an electronic device, including:
[0033] Memory, used to store computer programs;
[0034] The processor is used to execute the computer program to implement the steps of the aforementioned multi-level multi-node caching method.
[0035] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, which implements the steps of the aforementioned multi-level multi-node caching method when executed by a processor.
[0036] It can be seen that in the present application, feature collection is performed on corresponding data items based on preset dual multi-group sliding windows and corresponding preset periodic feature collection rules to obtain corresponding feature collection results; wherein, the preset dual multi-group sliding windows include corresponding basic sliding windows and each node sliding window, and the basic sliding window and each node sliding window include multiple independent sliding windows; when the corresponding feature collection is completed, based on the multiple feature collection results stored in each sliding window in the preset dual multi-group sliding windows, and the deep learning models corresponding to each network node respectively, the corresponding data access probability prediction operation is triggered for each data item to obtain the prediction results output by each deep learning model; based on each of the prediction results, the preset shared cache decision rules and the preset node-exclusive cache decision rules, the target cache levels corresponding to each of the data items are obtained, and data caching is performed based on the corresponding target cache levels. That is, the present application captures the features of each data item based on a sliding window, and whenever the feature collection is completed, it will trigger the corresponding data access probability prediction operation for each data item based on the multiple feature collection results stored in each sliding window in the preset dual multiple sliding windows, and the deep learning model corresponding to each network node, and then complete the data cache based on the obtained prediction results. In this way, not only can the cache content be managed intelligently and the cache hit rate be improved, but also a customized cache strategy can be provided for each node in the distributed computing environment, thereby improving the system's personalized service capabilities and user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0038] Figure 1 A flow chart of a multi-level multi-node caching method provided by this application;
[0039] Figure 2 A schematic diagram of a multi-level multi-node cache system framework provided for this application;
[0040] Figure 3 A schematic diagram of a sliding window architecture provided for this application;
[0041] Figure 4 A schematic diagram of a multi-level node cache architecture provided for this application;
[0042] Figure 5A schematic diagram of a process for predicting and updating cache based on multiple groups of LSTM models provided for this application;
[0043] Figure 6 A schematic diagram of the structure of a multi-level multi-node cache device provided by this application;
[0044] Figure 7 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] However, traditional multi-level cache management strategies, such as the least recently used algorithm, although simple, often perform unsatisfactorily when faced with complex and dynamically changing data access patterns. In addition, since the data access pattern of each node may be unique, and traditional cache strategies often ignore the differences between nodes, they cannot provide the optimal cache solution. Moreover, existing cache systems usually adopt a centralized cache management strategy, which may lead to uneven resource utilization and cache hotspot problems in a multi-node environment. To this end, the present application provides a multi-level multi-node cache solution that can not only intelligently manage cache content and improve cache hit rate, but also provide customized cache strategies for each node in a distributed computing environment, thereby improving the system's personalized service capabilities and user experience.
[0047] See also Figure 1 As shown, an embodiment of the present invention discloses a multi-level multi-node caching method, which is applied to a preset multi-level multi-node caching system, including:
[0048] Step S11, based on the preset dual multi-group sliding windows and the corresponding preset periodic feature collection rules, feature collection is performed on the corresponding data items to obtain corresponding feature collection results; wherein the preset dual multi-group sliding windows include the corresponding basic sliding windows and each node sliding window, and the basic sliding window and each node sliding window include multiple independent sliding windows.
[0049] Specifically, in this embodiment, the sliding window technology is first used to capture the dynamic characteristics of time series data, which include data access frequency, data size, etc. between nodes. In this embodiment, dual multi-group sliding windows are specifically used for feature collection, that is, the feature collection of corresponding data items based on the preset dual multi-group sliding windows and the corresponding preset periodic feature collection rules includes: based on the basic sliding window in the preset dual multi-group sliding window and the corresponding first preset periodic feature collection rule, feature collection is performed on all data items to obtain a corresponding first feature collection result; wherein the first feature collection result includes the corresponding data access frequency and data size; based on the node sliding window in the preset dual multi-group sliding window and the corresponding second preset periodic feature collection rule, feature collection is performed on the data item corresponding to the current network node to obtain a corresponding second feature collection result; wherein the second feature collection result includes the corresponding data access frequency. Combined with Figure 2 As shown, this embodiment performs feature collection based on the saved microservice log. Moreover, it can be understood that the first preset periodic feature collection rule and the second preset periodic feature collection rule can be the same or different; and the second preset periodic feature collection rules corresponding to different node sliding windows can be the same or different, depending on actual needs.
[0050] Combination Figure 3 As shown, in this embodiment, regarding the basic sliding window, it is necessary to understand that the basic sliding window stores the index information of all accessed data items, such as the type of data item (picture, text, number, etc.) and the size of the data item. And the length of each window is fixed, and each item in the window is the index information of all data items accessed in a period of time. For example, the length of all windows is l, and each element in the window is a feature collection result collected every 10 minutes. For example, the latest element is S(t), which represents all data items collected within the time [t-1, t). For example, the window F(t-l+1) that captures the frequency of data item access and the window S(t) that captures the size characteristics of data items. S(t) includes S1(t), S2(t),..., S k (t), indicating that there are k data items in this period (D1, D2…D k ). The content of each data item is the query key and the corresponding data size. For example, if a user's avatar is stored, the key is the user's account number and the value is the size of the avatar file, for example, 200kB. In addition to S(t), there are various indicators related to the data item, organized in the above manner.
[0051] At the same time, regarding the sliding windows of each node, it is important to understand that each node sliding window maintains the access frequency of different network nodes (such as microservice programs or servers). Figure 3 As shown, for example, P1(t) means that node 1 visits the current node in [t-1, t) time (such as Figure 2 P2(t) represents the frequency of all data items of node i in [t-1, t); P2(t) represents the frequency of node 2 accessing the current node (such as Figure 2 The frequency of all data items of node i in . Since the requirements of each node are different, the access frequency is very different. The purpose of setting up a sliding window for each node here is to use them as independent indicators so that they can be used to train the models of each node later, so that each node can find a cache suitable for itself to access.
[0052] Step S12: When the corresponding feature collection is completed, based on the multiple feature collection results saved in each of the sliding windows in the preset dual multi-group sliding windows, and the deep learning models corresponding to each network node, the corresponding data access probability prediction operation is triggered for each data item to obtain the prediction results output by each deep learning model.
[0053] It should be understood that whenever the sliding window updates all the data in the window, the model prediction is triggered. That is to say, in this embodiment, whenever the feature collection of the data item is completed and a new feature collection result is obtained, a prediction will be made. Specifically, the system will start multiple processes or threads to run the exclusive LSTM (Long Short-Term Memory) model of different nodes, that is, the deep learning model. That is, when the corresponding feature collection is completed, based on the multiple feature collection results saved in each of the sliding windows in the preset dual multiple groups of sliding windows, and the deep learning models corresponding to each network node, the corresponding data access probability prediction operation is triggered for each of the data items, including: when the corresponding feature collection is completed, the deep learning model of each network node is run separately by starting multiple processes or threads; based on the multiple feature collection results saved in each of the sliding windows in the preset dual multiple groups of sliding windows, and each of the deep learning models triggers the corresponding data access probability prediction operation for each of the data items.
[0054] Furthermore, in this embodiment, combined with Figure 2 , taking the exclusive LSTM model of node k as an example, for each data item D i , will construct a feature vector X for the input model i , contains all the data of the basic sliding window and all the data in the window belonging to node k in each node sliding window:
[0055] ;
[0056] Among them, Figure 3 As shown, t represents the current time; l represents the window length; F i (t-l+1) represents the basic sliding window access data item D within [tl, t-l+1) time i Frequency; F i (t-l+2) represents the basic sliding window access data item D within the time [t-l+1, t-l+2) i Frequency; F i (t) represents the basic sliding window access data item D within [t-1, t) time i The frequency of S i (t-l+1) means that the basic sliding window collects data item D within [tl, t-l+1) time. i The data size of S i (t-l+2) means that the basic sliding window collects data item D within the time [t-l+1, t-l+2) i The data size of S i (t) represents the data item D collected by the basic sliding window within the time [t-1, t) i The data size of P ki (t-l+1) means the sliding window access data item D of node k within the time [tl, t-l+1) i The frequency of P ki (t-l+2) means the sliding window access data item D of node k within the time [t-l+1, t-l+2) i The frequency of P ki (t) represents the sliding window access data item D of node k within the time [t-1, t) i frequency.
[0057] For each LSTM model, its input is the feature vector X i , the output is the predicted access probability Y i The output of the LSTM model of node k can be expressed as follows, where k∈[1,r].
[0058] ;
[0059] Wherein, θ represents the parameters of the LSTM model. The triggering of corresponding data access probability prediction operations for each data item based on the multiple feature collection results stored in each sliding window in the preset dual multi-group sliding window and the deep learning model corresponding to each network node includes: for any network node, based on the multiple feature collection results stored in each sliding window in the preset dual multi-group sliding window, obtaining target model input information corresponding to each data item; based on each target model input information and the corresponding deep learning model, obtaining prediction results for each data item corresponding to the current network node.
[0060] Step S13, based on each of the prediction results, the preset shared cache decision rule and the preset node-specific cache decision rule, obtain the target cache level corresponding to each of the data items, and cache the data based on the corresponding target cache level.
[0061] Combination Figure 4 and Figure 5 As shown, in this embodiment, the cache is divided into a shared cache L m and node-specific cache L m_1 , L m_2 …L m_r , and are all subdivided into m levels. When determining where each data item is cached, both caches need to be considered, and then the better one is selected. That is, based on each of the prediction results, the preset shared cache decision rules, and the preset node-specific cache decision rules, the target cache level corresponding to each of the data items is obtained, including: for any of the data items, the corresponding probability mean is obtained using the corresponding prediction results and the preset function, and the corresponding shared cache decision is obtained based on the probability mean and the spatial remaining information and cache decision threshold of the current caches at all levels; the corresponding node-specific cache decision is obtained using the corresponding prediction results output by the deep learning model of the corresponding network node, as well as the spatial remaining information and the cache decision threshold of the current caches at all levels; the corresponding target cache level is obtained based on the shared cache decision and the node-specific cache decision.
[0062] Specifically, regarding the shared cache, the access probability Y predicted by all LSTM models is ki To determine the data item D i Which level of cache should it be stored in? The specific cache decision can be expressed as a function:
[0063] ;
[0064] In the formula, This is the data item D iThe shared cache decision. This function can be used to calculate the mean probability of multiple node model predictions using a weighted average method, and then the remaining cache space and the thresholds of each level of cache can be used to determine which level of cache the data item should be placed in.
[0065] Regarding the node-specific cache, the access probability Y predicted by the corresponding node LSTM model ki To determine the data item D i Which level of cache should it be stored in? The specific cache decision can be expressed as a function:
[0066] ;
[0067] In the formula, This is the data item D i The node-specific cache decision is made by using the remaining cache space and the thresholds of each level of cache to determine which level of cache the data item should be placed in.
[0068] It is important to understand that, generally speaking, the probability of node-specific cache being needed is higher than that of shared cache at the same level, because nodes first access data in the specific cache, and then access data in the shared cache.
[0069] In addition, in this embodiment, it also includes: collecting data access logs of each network node; wherein the data access log is a log that stores the access time and access frequency of the corresponding data item; and recording data cache success events and data cache failure events. Figure 2 The microservice logs in the ,include the access time, frequency, size and other information of the data items. In addition, when recording events, the corresponding data items and ,node information also need to be saved.
[0070] Furthermore, in this embodiment, it also includes: performing corresponding model performance evaluation based on a preset period, the data access log, and the recorded data cache success events to obtain corresponding evaluation results; when there is an evaluation result that is less than the corresponding preset performance threshold, triggering the corresponding model update operation and cache decision threshold update operation. Specifically, the model performance evaluation is performed by periodically calculating the F1 score of the cache system. The F1 score includes precision and recall; precision refers to the ratio of data items correctly predicted as cache hits to all data items predicted as cache hits. Recall refers to the ratio of data items correctly predicted as cache hits to data items that are actually cache hits. It should be understood that when the F1 score is lower than the preset threshold or a performance degradation trend is observed based on the F1 score, the model update process and cache decision threshold update operation are triggered.
[0071] For update operations, the latest data access logs are used to retrain or fine-tune the LSTM model in this embodiment. Online learning or incremental learning methods are used to update model parameters so that the model can quickly adapt to changes in data access patterns. Then, based on the updated model prediction results, the cache decision threshold is adjusted, for example, the probability threshold for a data item to be cached is increased or decreased. If a data item frequently appears in cache miss events, consider raising its priority to make it more easily cached.
[0072] In this way, the system performance is monitored by using the cache hit rate and F1 score as feedback information, and the LSTM model and cache decision threshold are continuously optimized to achieve continuous performance improvement.
[0073] In summary, we can use advanced deep learning models, such as long short-term memory networks (LSTM), to predict data access patterns, and combine sliding window technology to capture dynamic changes in time series, so as to achieve intelligent management of multi-level cache content. And by providing each node with a dedicated cache, the performance and personalized service capabilities of the cache system are further improved, so that it can better adapt to the specific needs and access patterns of each node. In this way, it can be applied to various application scenarios that require efficient data cache management, such as blockchain, big data analysis, real-time data processing, content distribution network (CDN, Content Delivery Network) and other environments that require cache optimization.
[0074] It can be seen that in an embodiment of the present application, feature collection is performed on corresponding data items based on preset dual multi-group sliding windows and corresponding preset periodic feature collection rules to obtain corresponding feature collection results; wherein, the preset dual multi-group sliding windows include corresponding basic sliding windows and each node sliding window, and the basic sliding window and each node sliding window include multiple independent sliding windows; when the corresponding feature collection is completed, based on the multiple feature collection results stored in each sliding window in the preset dual multi-group sliding windows, and the deep learning models corresponding to each network node respectively, the corresponding data access probability prediction operation is triggered for each data item to obtain the prediction results output by each deep learning model; based on each of the prediction results, the preset shared cache decision rules and the preset node-exclusive cache decision rules, the target cache levels corresponding to each of the data items are obtained, and data caching is performed based on the corresponding target cache levels. That is, the present application captures the features of each data item based on a sliding window, and whenever the feature collection is completed, it will trigger the corresponding data access probability prediction operation for each data item based on the multiple feature collection results stored in each sliding window in the preset dual multiple sliding windows, and the deep learning model corresponding to each network node, and then complete the data cache based on the obtained prediction results. In this way, not only can the cache content be managed intelligently and the cache hit rate be improved, but also a customized cache strategy can be provided for each node in the distributed computing environment, thereby improving the system's personalized service capabilities and user experience.
[0075] Combine the following Figure 2 as well as Figure 5 The schematic diagram disclosed in the figure specifically illustrates the technical solution of the embodiment of the present application.
[0076] In this embodiment, taking node i as an example, nodes 1, 2, ..., r belonging to the same network can access data by sending data access requests to their microservices, and each interaction process will be saved in the form of logs. Afterwards, as long as the basic sliding window and / or each node sliding window in the dual multi-group sliding window of node i collects the features of the data item and obtains a new collection result, the prediction operation will be triggered. Node 1, 2, ..., r calls itself and node i to predict the data access probability of each data item for the deep learning model, so as to predict the data access probability of each data item for different data items D. i Get the corresponding prediction result P i1 , P i2 ,…,P ir. Then, the cache level of the shared cache is calculated by weighted average, or the cache level of the node-specific cache with a higher call probability is selected for data caching, and so on, and the data in the cache is updated. In addition, the deep learning model will be monitored in real time by calculating the F1 score and the model will be adjusted when the conditions are met to ensure that the cache strategy is always in the optimal state.
[0077] See also Figure 6 As shown, the embodiment of the present application also discloses a multi-level multi-node cache device, which is applied to a preset multi-level multi-node cache system, including:
[0078] The feature collection module 11 is used to collect features of corresponding data items based on preset dual multi-group sliding windows and corresponding preset periodic feature collection rules to obtain corresponding feature collection results; wherein the preset dual multi-group sliding windows include corresponding basic sliding windows and each node sliding window, and the basic sliding window and each node sliding window include multiple independent sliding windows;
[0079] The probability prediction module 12 is used to trigger a corresponding data access probability prediction operation on each of the data items based on the plurality of feature collection results stored in each of the sliding windows in the preset dual multiple groups of sliding windows and the deep learning models corresponding to each network node when the corresponding feature collection is completed, so as to obtain the prediction results output by each of the deep learning models;
[0080] The data cache module 13 is used to obtain the target cache level corresponding to each of the data items based on each of the prediction results, the preset shared cache decision rules and the preset node-specific cache decision rules, and cache the data based on the corresponding target cache level.
[0081] Among them, for more specific working processes of the above-mentioned modules, please refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.
[0082] It can be seen that the present application captures the features of each data item based on the sliding window, and whenever the feature collection is completed, it will trigger the corresponding data access probability prediction operation for each data item based on the multiple feature collection results stored in each sliding window in the preset dual multiple groups of sliding windows, and the deep learning model corresponding to each network node, and then complete the data cache based on the obtained prediction results. In this way, not only can the cache content be managed intelligently and the cache hit rate be improved, but also a customized cache strategy can be provided for each node in the distributed computing environment, thereby improving the system's personalized service capabilities and user experience.
[0083] In some specific embodiments, the feature acquisition module 11 may specifically include:
[0084] A first feature collection unit is used to collect features of all data items based on the basic sliding window in the preset dual multi-group sliding window and the corresponding first preset periodic feature collection rule to obtain corresponding first feature collection results; wherein the first feature collection results include corresponding data access frequency and data size;
[0085] The second feature collection unit is used to collect features of the data item corresponding to the current network node based on the node sliding window in the preset double multi-group sliding window and the corresponding second preset periodic feature collection rule to obtain a corresponding second feature collection result; wherein the second feature collection result includes a corresponding data access frequency.
[0086] In some specific embodiments, the probability prediction module 12 may specifically include:
[0087] A model startup unit is used to start multiple processes or threads to run the deep learning model of each network node respectively when the corresponding feature collection is completed;
[0088] A model prediction unit is used to trigger a corresponding data access probability prediction operation for each data item based on the multiple feature collection results stored in each sliding window in the preset dual multiple groups of sliding windows and each deep learning model.
[0089] In some specific embodiments, the probability prediction module 12 may specifically include:
[0090] A model input information acquisition unit, configured to obtain, for any network node, target model input information corresponding to each of the data items based on a plurality of feature acquisition results stored in each of the preset dual groups of sliding windows;
[0091] A prediction result acquisition unit is used to obtain the prediction result of each data item corresponding to the current network node based on the input information of each target model and the corresponding deep learning model.
[0092] In some specific embodiments, the data cache module 13 may specifically include:
[0093] A shared cache decision acquisition unit, for obtaining a corresponding probability mean for any of the data items using the corresponding prediction results and a preset function, and obtaining a corresponding shared cache decision based on the probability mean and the space remaining information of the current caches at all levels and a cache decision threshold;
[0094] A node-specific cache decision acquisition unit, used to obtain a corresponding node-specific cache decision by using the corresponding prediction result output by the deep learning model of the corresponding network node, as well as the space remaining information of the current caches at all levels and the cache decision threshold;
[0095] The target cache level acquisition unit is used to obtain the corresponding target cache level based on the shared cache decision and the node-specific cache decision.
[0096] In some specific embodiments, the multi-level multi-node cache device may further include:
[0097] A log collection unit, used to collect data access logs of each network node; wherein the data access log is a log that stores the access time and access frequency of the corresponding data item;
[0098] The event recording unit is used to record data cache success events and data cache failure events.
[0099] In some specific embodiments, the multi-level multi-node cache device may further include:
[0100] A model evaluation unit, used to perform corresponding model performance evaluation based on a preset period, the data access log and the recorded data cache success events to obtain corresponding evaluation results;
[0101] The update trigger unit is used to trigger the corresponding model update operation and cache decision threshold update operation when there is an evaluation result that is less than the corresponding preset performance threshold.
[0102] Furthermore, the present application also discloses an electronic device. Figure 7 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0103] Figure 7 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the multi-level multi-node caching method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0104] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0105] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0106] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the multi-level multi-node caching method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 may further include a computer program that can be used to complete other specific tasks.
[0107] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the multi-level multi-node cache method disclosed above is implemented. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, and no further description will be given here.
[0108] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0109] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0110] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0111] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0112] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A multi-level multi-node caching method, characterized in that: Applied to preset multi-level multi-node cache system, including: Based on the preset dual multi-group sliding windows and the corresponding preset periodic feature collection rules, feature collection is performed on the corresponding data items to obtain corresponding feature collection results; wherein the preset dual multi-group sliding windows include the corresponding basic sliding windows and each node sliding window, and the basic sliding window and each node sliding window include multiple independent sliding windows; the feature collection results include the corresponding data access frequency and data size; When the corresponding feature collection is completed, based on the plurality of feature collection results stored in each of the sliding windows in the preset dual multiple groups of sliding windows and the deep learning models corresponding to each network node, a corresponding data access probability prediction operation is triggered for each of the data items to obtain a prediction result output by each of the deep learning models; Based on each of the prediction results, the preset shared cache decision rule and the preset node-specific cache decision rule, a target cache level corresponding to each of the data items is obtained, and data caching is performed based on the corresponding target cache level.
2. The multi-level multi-node caching method according to claim 1, characterized in that: The feature collection of corresponding data items based on the preset dual multiple groups of sliding windows and the corresponding preset periodic feature collection rules includes: Based on the basic sliding window in the preset dual multi-group sliding window and the corresponding first preset periodic feature collection rule, feature collection is performed on all data items to obtain corresponding first feature collection results; wherein the first feature collection results include corresponding data access frequency and data size; Based on the node sliding window in the preset dual multi-group sliding window and the corresponding second preset periodic feature collection rule, feature collection is performed on the data item corresponding to the current network node to obtain a corresponding second feature collection result; wherein the second feature collection result includes a corresponding data access frequency.
3. The multi-level multi-node caching method according to claim 1, characterized in that: When the corresponding feature collection is completed, based on the plurality of feature collection results stored in each of the sliding windows in the preset dual multiple groups of sliding windows and the deep learning models corresponding to each network node, a corresponding data access probability prediction operation is triggered for each of the data items, including: When the corresponding feature collection is completed, the deep learning model of each network node is run separately by starting multiple processes or threads; Based on the multiple feature collection results stored in each of the sliding windows in the preset dual multiple groups of sliding windows, and each of the deep learning models triggers a corresponding data access probability prediction operation for each of the data items.
4. The multi-level multi-node caching method according to claim 1, characterized in that: The triggering of a corresponding data access probability prediction operation for each of the data items based on the plurality of feature collection results stored in each of the sliding windows in the preset dual plurality of sliding windows and the deep learning model corresponding to each of the network nodes includes: For any network node, based on the plurality of feature acquisition results stored in each of the sliding windows in the preset dual multiple groups of sliding windows, target model input information corresponding to each of the data items is obtained; Based on the input information of each target model and the corresponding deep learning model, a prediction result of each data item corresponding to the current network node is obtained.
5. The multi-level multi-node caching method according to any one of claims 1 to 4, characterized in that: The step of obtaining a target cache level corresponding to each of the data items based on each of the prediction results, the preset shared cache decision rule, and the preset node-specific cache decision rule includes: For any of the data items, using the corresponding prediction results and the preset function to obtain a corresponding probability mean, and based on the probability mean and the space remaining information of the current caches at all levels and the cache decision threshold, obtaining a corresponding shared cache decision; Obtain a corresponding node-specific cache decision using the corresponding prediction result output by the deep learning model of the corresponding network node, as well as the space remaining information of the current caches at all levels and the cache decision threshold; Based on the shared cache decision and the node-specific cache decision, a corresponding target cache level is obtained.
6. The multi-level multi-node caching method according to claim 5, characterized in that: Also includes: Collecting data access logs of each network node; wherein the data access log is a log that stores the access time and access frequency of the corresponding data item; Record data cache success events and data cache failure events.
7. The multi-level multi-node caching method according to claim 6, characterized in that: Also includes: Perform corresponding model performance evaluation based on the preset period, the data access log and the recorded data cache success events to obtain corresponding evaluation results; When there is an evaluation result that is less than the corresponding preset performance threshold, a corresponding model update operation and a cache decision threshold update operation are triggered.
8. A multi-level multi-node cache device, characterized in that: Applied to preset multi-level multi-node cache system, including: A feature collection module, used for collecting features of corresponding data items based on preset dual multi-group sliding windows and corresponding preset periodic feature collection rules to obtain corresponding feature collection results; wherein the preset dual multi-group sliding windows include corresponding basic sliding windows and each node sliding window, and the basic sliding window and each node sliding window include multiple independent sliding windows; the feature collection results include corresponding data access frequency and data size; A probability prediction module, configured to trigger a corresponding data access probability prediction operation on each of the data items based on a plurality of the feature collection results stored in each of the sliding windows in the preset dual multiple groups of sliding windows and a deep learning model corresponding to each network node when the corresponding feature collection is completed, so as to obtain a prediction result output by each of the deep learning models; The data cache module is used to obtain the target cache level corresponding to each of the data items based on each of the prediction results, the preset shared cache decision rules and the preset node-specific cache decision rules, and cache the data based on the corresponding target cache level.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the multi-level multi-node caching method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the multi-level multi-node caching method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Data prefetching for graphics data processing
CN113454609A
Intelligent cache replacement method based on machine learning
CN115237825A