Machine Learning-Based Multi-Level Caching Adaptive System and Strategy
By using a machine learning-based multi-level caching adaptive system and strategy, the cache hierarchy is dynamically adjusted, solving the problem of low adaptability of existing caching strategies and achieving more efficient task execution and resource utilization.
Patent Information
- Application Number
- CN202311702325.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-12
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2043-12-12
AI Technical Summary
Existing caching strategies are not suitable for frequently executing new tasks. The fixed caching hierarchy has poor adaptability, resulting in low task execution efficiency in hybrid cloud environments.
A multi-level adaptive caching system and strategy based on machine learning are adopted. Through the cache prediction model, task prediction model and data prediction model in the decision-maker, the public cloud access to the cache area is monitored in real time, and the hierarchical structure of the cache area and the data storage strategy are dynamically adjusted.
It improved the data hit rate of the cache, saved space resources, reduced the bandwidth pressure on the data center, and improved task execution efficiency and public cloud performance.
Smart Images

Figure CN118012906B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data caching technology, and more specifically, to a multi-level adaptive caching system and strategy based on machine learning. Background Technology
[0002] With the rapid development of cloud computing, enterprises have set higher standards for cloud stability, security, and agility. Hybrid cloud combines private and public clouds, providing a more flexible deployment model. Users can build services requiring high reliability and low latency, such as databases, on the private cloud, while frequently accessed, rapidly iterating services, or services that exceed the capabilities of the private cloud, are built on the public cloud. Through inter-cloud connectivity, the high availability of services is greatly improved.
[0003] However, in the widespread application of hybrid cloud, when agile businesses on the public cloud are handling multiple concurrent requests, they will launch intensive read and write tasks on the database in the private cloud. Due to network bandwidth limitations, the processing speed in the private cloud cannot keep up, which will cause some congestion and affect the overall business efficiency.
[0004] Existing caching strategies have two main drawbacks: they are not suitable for frequently executing new tasks; and the caching hierarchy is fixed, resulting in low adaptability.
[0005] Therefore, adjusting caching strategies to save cache space resources while improving task execution efficiency has become a new trend in technological development. Summary of the Invention
[0006] In view of this, the present invention proposes a multi-level caching adaptive system and strategy based on machine learning, mainly to solve the problem of how to save cache space resources and improve task execution efficiency by adjusting the caching strategy.
[0007] In one aspect, this invention proposes a multi-level adaptive caching system based on machine learning, the system comprising:
[0008] Public cloud, private cloud, cache, and decision maker;
[0009] The cache area is mounted on the public cloud, and the cache area stores some or all of the data in the private cloud as initial cache data, and updates the stored data periodically according to the caching strategy.
[0010] The public cloud is used to determine the data to be queried based on the task to be executed, and to send a query request to the cache to obtain the target data in order to execute the task.
[0011] The decision-maker stores three prediction models and pre-trains them. When the public cloud sends a query request to the cache based on the data to be queried to obtain the target data for executing the task, the decision-maker is also used to monitor the public cloud's access to the cache in real time. When the public cloud accesses the cache, it obtains the access data and inputs it into the prediction model. Based on the output of the prediction model, it updates the priority hierarchy structure and update strategy of the cache.
[0012] The prediction models include: a cache prediction model, a task prediction model, and a data prediction model.
[0013] In some embodiments of this application, before the public cloud determines the data to be queried based on the task to be executed, and sends a query request to the cache based on the data to be queried to obtain the target data for executing the task, the process includes:
[0014] The decision-maker acquires the initial cache data and inputs it into the cache prediction model. The cache prediction model outputs an initial cache strategy based on the initial cache data. The initial cache strategy is used for the initial setup of the cache area.
[0015] The initial caching strategy includes: the initial number of cache layers, the initial tiering strategy, and the initial update strategy.
[0016] In some embodiments of this application, when the public cloud accesses the cache area, the decision-maker acquires the access data and inputs it into the prediction model, and updates the hierarchical cache structure of the cache area based on the output of the prediction model, including:
[0017] The decision-maker acquires access data and inputs it into the task prediction training model. The task prediction training model outputs a list of related tasks and the number of times each related task appears based on the access data.
[0018] The access data includes: user characteristic data, server data, and task execution data.
[0019] In some embodiments of this application, after the task prediction training model outputs a list of relevant tasks and the corresponding occurrence counts of each relevant task based on the access data, the process includes:
[0020] The decision-maker inputs the relevant task list into the data prediction training model. The data prediction training model outputs the data identifier corresponding to each relevant task and the occurrence frequency of each corresponding data identifier based on the relevant task list. It calculates the occurrence probability of each corresponding data identifier based on the data identifier corresponding to each relevant task and the corresponding data identifier, sorts the occurrence probabilities of each data identifier in descending order, and matches each data identifier corresponding to each relevant task with each initial cache layer according to the initial caching strategy. The matching results are recorded in a data table, and the decision-maker sends the data table to the cache area for data caching.
[0021] In some embodiments of this application, when the decision-maker sends the data table to the cache area for data caching, it includes:
[0022] Data is read from memory based on the data identifier and stored in different cache layers according to the storage path in the data table.
[0023] In some embodiments of this application, when the public cloud determines the data to be queried based on the task to be executed, and sends a query request to the cache to obtain target data for executing the task based on the data to be queried, the method includes:
[0024] The decision-maker updates the data table according to the update strategy of the cache area. The cache area adjusts its data according to the latest data table. If data in the data table does not exist in the cache area, it accesses the private cloud to obtain the data. If data in the cache area does not exist in the data table, it deletes the data from the cache area.
[0025] In some embodiments of this application, when the decision-maker pre-trains three prediction models, it includes:
[0026] The cache prediction model uses a reinforcement learning model, takes the initial cache resources of the cache area as input to obtain input feedback, and makes action decisions based on the input feedback.
[0027] The input feedback includes: penalty feedback and reward feedback. The penalty feedback is the amount of resources and time saved by cache hits, and the reward feedback is the space, resource usage, and memory access volume.
[0028] The action decisions include: a tiered strategy and an update strategy;
[0029] The layering strategy includes: the number of cache layers in the cache area and the proportion of data corresponding to each cache layer;
[0030] The update strategy includes: a data update time period threshold Ttask and a data update ratio threshold αnew.
[0031] In some embodiments of this application, the layering strategy specifically includes:
[0032] The cache prediction update cycle Tcache is preset. Within the cache prediction update cycle Tcache, the average reward / penalty value Feedback is obtained and calculated based on the time and resources saved due to data cache hits and the resource consumption of adjusting the data cache storage address due to data probability updates.
[0033] The formula for calculating the cache prediction update cycle Tcache is as follows:
[0034] T cache =max(24h, 10T) task );
[0035] Where T is the time since the last hierarchical strategy prediction;
[0036] The formula for calculating the average reward / penalty value (Feedback) is as follows:
[0037]
[0038] When T is within the cache prediction update cycle Tcache, the predicted hierarchical strategy and cache strategy are stored in the decision-maker to obtain the corresponding average reward and penalty value, without adjusting the structure of the cache area. When T is not within the cache prediction update cycle Tcache, the average reward time obtained by the update strategy executed in the previous round is obtained as FeedbacK / T, where T is the time since the last hierarchical strategy prediction.
[0039] When the average reward / penalty value (Feedback) is less than the previous round's tiered monitoring threshold σ cache When the next update strategy is updated, the hierarchical strategy is updated;
[0040]
[0041] In some embodiments of this application, the update strategy specifically includes:
[0042] At time threshold T task Then, using the latest executing task as the latest input, the latest data identifier and data probability are obtained. The latest data identifier and data probability are compared with the information in the previous data table, and the formula for calculating the probability value of the updated data is as follows:
[0043] P update =α new ×P new +(1-αnew )×P old ;
[0044] Among them, P new and P old These are the latest probability and the probability from the previous round, respectively, while α new The new probability is the determining factor for the probability to be updated, and is determined by the update strategy of the cached prediction model;
[0045] The new data identifier and data probability are updated in the data table and then sent to the cache to perform the data change.
[0046] In some embodiments of this application, when the decision-maker pre-trains the three prediction models, it further includes:
[0047] The task prediction model uses a data update time period threshold Ttask as a variable period. It takes the current task as input and outputs a list of other related tasks within the data update time period threshold Ttask. The model compares the task list predicted by the model with the actual task list and returns an error value to correct the model.
[0048] In some embodiments of this application, when the decision-maker pre-trains the three prediction models, it further includes:
[0049] The data prediction model is synchronously updated and trained once each time the task prediction model is updated. Within the data update time period threshold Ttask, the data prediction model takes each execution task as input and predicts the most frequently occurring data and the number of times it occurs for that execution task.
[0050] In another aspect, this invention proposes a multi-level caching adaptive strategy based on machine learning, which includes:
[0051] Use some or all of the data stored in the private cloud in the cache area as the initial cache data;
[0052] The public cloud determines the data to be queried based on the task to be executed, and sends a query request to the cache to obtain the target data in order to execute the task.
[0053] By storing and pre-training three prediction models within the decision-maker, when the public cloud sends a query request to the cache based on the data to be queried to obtain target data for executing the task to be executed, the decision-maker is also used to monitor the public cloud's access to the cache in real time. When the public cloud accesses the cache, it obtains the access data and inputs it into the prediction model, and updates the hierarchical cache structure of the cache based on the output result of the prediction model.
[0054] The prediction models include: a cache prediction model, a task prediction model, and a data prediction model.
[0055] Compared with the prior art, the present invention has the following beneficial effects: When selecting data in the cache area, the present invention can flexibly select cached data based on various conditions such as the task to be executed and the user's behavior habits, and establish a flexible hierarchical structure to ensure a high data hit rate, save space resources, effectively reduce data center bandwidth, and improve task execution efficiency. Attached Figure Description
[0056] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. In the drawings:
[0057] Figure 1 A functional block diagram of a machine learning-based multi-level cache adaptive system provided in an embodiment of the present invention;
[0058] Figure 2 A flowchart illustrating a machine learning-based multi-level caching adaptive strategy provided in an embodiment of the present invention. Detailed Implementation
[0059] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the disclosure to those skilled in the art. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0060] See Figure 1 As shown, this embodiment provides a multi-level adaptive caching system based on machine learning, including:
[0061] Public cloud, private cloud, cache, and decision maker;
[0062] The cache area is mounted on the public cloud, and the cache area stores some or all of the data in the private cloud as initial cache data, and updates the stored data periodically according to the caching strategy;
[0063] The public cloud is used to determine the data to be queried based on the task to be executed, and to send a query request to the cache to obtain the target data in order to execute the task.
[0064] The decision-maker stores three prediction models and pre-trains them. When the public cloud sends a query request to the cache based on the data to be queried to obtain the target data for executing the task, the decision-maker is also used to monitor the public cloud's access to the cache in real time. When the public cloud accesses the cache, it obtains the access data and inputs it into the prediction model, and updates the hierarchical cache structure of the cache based on the output of the prediction model.
[0065] The prediction models include: a cache prediction model, a task prediction model, and a data prediction model.
[0066] It is understood that, in this embodiment, by mounting the cache area on the public cloud, initial caching of some or all of the data in the private cloud can be achieved, improving the efficiency and speed of data query. The public cloud can determine the data to be queried based on the task to be executed and send a query request to obtain the target data to execute the task, making data processing more accurate and efficient. The decision-maker stores three prediction models and pre-trains them, which can monitor the public cloud's access to the cache area in real time, obtain access data and input it into the prediction model, and update the priority hierarchy cache structure of the cache area based on the output results of the prediction model, thereby further optimizing the efficiency of data query and processing. The prediction model includes a cache prediction model, a task prediction model and a data prediction model, which can more comprehensively consider various factors affecting data query and processing, thereby more accurately predicting and optimizing data query and processing.
[0067] Furthermore, this embodiment utilizes a caching layer to pre-extract data, reducing high-frequency access to the data center and alleviating network bandwidth pressure. Machine learning training clarifies the data storage rules within the cache area. Combining server characteristics and user habits, the most frequently used data list is inferred from business logic and saved in the cache area. The data content is updated in real-time according to task progress, greatly improving the data hit rate within the cache area and enabling more efficient and accurate extraction of target data. Machine learning training also infers a caching layer distribution strategy that achieves an optimal balance between resource cost and caching effect based on server resource scheduling, maximizing the utilization of server resources to achieve optimal caching performance.
[0068] In some embodiments of this application, before the public cloud determines the data to be queried based on the task to be executed, and sends a query request to the cache based on the data to be queried to obtain the target data for executing the task, the process includes:
[0069] The decision-maker acquires the initial cache data and inputs it into the cache prediction model. The cache prediction model outputs an initial cache strategy based on the initial cache data. The initial cache strategy is used for the initial setup of the cache area.
[0070] The initial caching strategy includes: the initial number of cache layers, the initial tiering strategy, and the initial update strategy.
[0071] In some embodiments of this application, when the public cloud accesses the cache area, the decision-maker acquires the access data and inputs it into the prediction model, and updates the hierarchical cache structure of the cache area based on the output of the prediction model, including:
[0072] The decision-maker acquires access data and inputs it into the task prediction training model. The task prediction training model outputs a list of related tasks and the number of times each related task appears based on the access data.
[0073] The access data includes: user characteristic data, server data, and task execution data.
[0074] In some embodiments of this application, after the task prediction training model outputs a list of relevant tasks and the corresponding occurrence counts of each relevant task based on the access data, the process includes:
[0075] The decision-maker inputs the relevant task list into the data prediction training model. The data prediction training model outputs the data identifier corresponding to each relevant task and the occurrence frequency of each corresponding data identifier based on the relevant task list. It calculates the occurrence probability of each corresponding data identifier based on the data identifier corresponding to each relevant task and the corresponding data identifier, sorts the occurrence probabilities of each data identifier in descending order, and matches each data identifier corresponding to each relevant task with each initial cache layer according to the initial caching strategy. The matching results are recorded in a data table, and the decision-maker sends the data table to the cache area for data caching.
[0076] In some embodiments of this application, when the decision-maker sends the data table to the cache area for data caching, it includes:
[0077] Data is read from memory based on the data identifier and stored in different cache layers according to the storage path in the data table.
[0078] In some embodiments of this application, when the public cloud determines the data to be queried based on the task to be executed, and sends a query request to the cache to obtain target data for executing the task based on the data to be queried, the method includes:
[0079] The decision-maker updates the data table according to the update strategy of the cache area. The cache area adjusts its data according to the latest data table. If data in the data table does not exist in the cache area, it accesses the private cloud to obtain the data. If data in the cache area does not exist in the data table, it deletes the data from the cache area.
[0080] Understandably, this embodiment combines the cache prediction model with the task prediction training model and the data prediction training model to achieve automated cache building and updating, improving cache data hit rate, reducing data access latency, and enhancing public cloud performance. Furthermore, by acquiring access data, task data, etc., and utilizing relevant models for predictive analysis, each task is provided with a corresponding data identifier and storage path. This allows the public cloud to quickly determine the data to be queried and obtain the target data to execute the task, thereby improving the execution efficiency of the public cloud.
[0081] In some embodiments of this application, when the decision-maker pre-trains three prediction models, it includes:
[0082] The cache prediction model uses a reinforcement learning model, takes the initial cache resources of the cache area as input to obtain input feedback, and makes action decisions based on the input feedback.
[0083] The input feedback includes: penalty feedback and reward feedback. The penalty feedback is the amount of resources and time saved by cache hits, and the reward feedback is the space, resource usage, and memory access volume.
[0084] The action decisions include: a tiered strategy and an update strategy;
[0085] The layering strategy includes: the number of cache layers in the cache area and the proportion of data corresponding to each cache layer;
[0086] The update strategy includes: a data update time period threshold Ttask and a data update ratio threshold αnew.
[0087] In some embodiments of this application, the layering strategy specifically includes:
[0088] The cache prediction update cycle Tcache is preset. Within the cache prediction update cycle Tcache, the average reward / penalty value Feedback is obtained and calculated based on the time and resources saved due to data cache hits and the resource consumption of adjusting the data cache storage address due to data probability updates.
[0089] The formula for calculating the cache prediction update cycle Tcache is as follows:
[0090] Tcachemax(24h, 10Ttask);
[0091] Where T is the time since the last hierarchical strategy prediction;
[0092] The formula for calculating the average reward / penalty value (Feedback) is as follows:
[0093]
[0094] When T is within the cache prediction update cycle Tcache, the predicted tiering strategy and caching strategy are stored in the decision-maker to obtain the corresponding average reward and penalty value, without adjusting the structure of the cache area. When T is not within the cache prediction update cycle Tcache, the average reward time value Feedback / T obtained from the update strategy executed in the previous round is obtained, where T is the time since the last tiering strategy prediction.
[0095] When the average reward / penalty value (Feedback) is less than the previous round's tiered monitoring threshold σ cache When the next update strategy is updated, the hierarchical strategy is updated;
[0096]
[0097] In some embodiments of this application, the update strategy specifically includes:
[0098] At time threshold T task Then, using the latest executing task as the latest input, the latest data identifier and data probability are obtained. The latest data identifier and data probability are compared with the information in the previous data table, and the formula for calculating the probability value of the updated data is as follows:
[0099] P update =α new ×P new +(1-α new )×P old ;
[0100] Among them, P new and P old These are the latest probability and the probability from the previous round, respectively, while α new The new probability is the determining factor for the probability to be updated, and is determined by the update strategy of the cached prediction model;
[0101] The new data identifier and data probability are updated in the data table and then sent to the cache to perform the data change.
[0102] It is understandable that this embodiment, by employing a reinforcement learning model for cache prediction, can make action decisions based on input feedback, thereby effectively improving cache hit rate and resource utilization. By using penalty and reward feedback as input feedback, it can more comprehensively consider factors such as the amount of resources saved, time, space, resource consumption, and memory access volume saved by cache hits, thus more accurately guiding the action decisions of the cache model. By combining hierarchical and update strategies, it can better handle the update and maintenance of cached data while ensuring cache hit rate, thereby improving the reliability and stability of the cache. By setting the cache prediction update cycle and calculating the average reward and penalty value, the cache strategy can be adjusted more flexibly to better adapt to different application scenarios and needs. By updating the probability value of the data and updating it in the data table, it can more accurately reflect the changes in the latest data identifier and data probability, thereby improving the accuracy and reliability of cache prediction.
[0103] In some embodiments of this application, when the decision-maker pre-trains the three prediction models, it further includes:
[0104] The task prediction model uses a data update time period threshold Ttask as a variable period. It takes the current task as input and outputs a list of other related tasks within the data update time period threshold Ttask. The model compares the task list predicted by the model with the actual task list and returns an error value to correct the model.
[0105] In some embodiments of this application, when the decision-maker pre-trains the three prediction models, it further includes:
[0106] The data prediction model is synchronously updated and trained once each time the task prediction model is updated. Within the data update time period threshold Ttask, the data prediction model takes each execution task as input and predicts the most frequently occurring data and the number of times it occurs for that execution task.
[0107] It is understood that in this embodiment, by comparing the task prediction model with the actual list of tasks and using the returned error value to correct the model, the accuracy of task prediction can be greatly improved. Since the data update time period threshold Ttask is variable, the model can adapt to different time scales and different task types, enabling the model to better adapt to the dynamically changing environment and improve the accuracy of prediction.
[0108] Specifically, the data prediction model is updated and trained synchronously with each update of the task prediction model. This helps ensure the model's freshness and accuracy. By predicting each execution task within the data update time period threshold Ttask, the latest changes in the task can be better captured. The decision-maker can pre-train multiple prediction models, which improves the comprehensiveness and accuracy of predictions. By integrating different prediction models, more comprehensive and accurate prediction results can be obtained.
[0109] Furthermore, by comparing the model's predictions with the actual task list, prediction error feedback can be obtained in real time. This helps to correct model errors promptly and improve model accuracy. This real-time feedback mechanism can continuously optimize model performance, making it better suited to real-world application scenarios.
[0110] See Figure 2 As shown, in another aspect, this invention proposes a multi-level caching adaptive strategy based on machine learning, which includes:
[0111] S101: Use some or all of the data stored in the private cloud in the cache area as the initial cache data;
[0112] S102: The public cloud determines the data to be queried based on the task to be executed, and sends a query request to the cache to obtain the target data to execute the task, and updates the stored data periodically according to the caching policy.
[0113] S103: By storing three prediction models in the decision-maker and pre-training them, when the public cloud sends a query request to the cache based on the data to be queried to obtain target data for executing the task to be executed, the decision-maker is also used to monitor the public cloud's access to the cache in real time. When the public cloud accesses the cache, it obtains the access data and inputs it into the prediction model, and updates the priority hierarchy structure and update strategy of the cache based on the output result of the prediction model.
[0114] The prediction models include: a cache prediction model, a task prediction model, and a data prediction model.
[0115] Understandably, in this embodiment, storing some or all of the data in the private cloud as initial cache data in the cache area provides an initial data source. This ensures an immediate response when the public cloud needs to query data. The public cloud determines the data to be queried based on the task to be executed and sends a query request to the cache area to obtain the target data for task execution. This makes task execution more efficient because the public cloud can directly query data in the cache area according to actual needs. By storing three prediction models in the decision-maker and pre-training them, the public cloud's access to the cache area can be monitored in real time. When the public cloud accesses the cache area, the access data is obtained and input into the prediction models. The hierarchical cache structure of the cache area is updated based on the prediction model's output. This design effectively predicts and adjusts the public cloud's access to the cache area, optimizing the efficiency of data querying and task execution.
[0116] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0117] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0118] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0119] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0120] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A multi-level adaptive caching system based on machine learning, characterized in that, include: Public cloud, private cloud, cache, and decision maker; The private cloud is used for storing all data and executing some low-latency tasks; The cache area is mounted on the public cloud, and the cache area stores some or all of the data in the private cloud as initial cache data, and updates the stored data periodically according to the caching strategy; The public cloud is used to determine the data to be queried based on the task to be executed, and to send a query request to the cache to obtain the target data in order to execute the task. The decision-maker stores three prediction models and pre-trains them. When the public cloud sends a query request to the cache based on the data to be queried to obtain the target data for executing the task, the decision-maker is also used to monitor the public cloud's access to the cache in real time. When the public cloud accesses the cache, it obtains the access data and inputs it into the prediction model. Based on the output of the prediction model, it updates the priority hierarchy structure and update strategy of the cache. The prediction models include: a cache prediction model, a task prediction model, and a data prediction model; Before the public cloud determines the data to be queried based on the task to be executed, and sends a query request to the cache to obtain the target data for executing the task based on the data to be queried, the process includes: The decision-maker acquires the initial cache data and inputs it into the cache prediction model. The cache prediction model outputs an initial cache strategy based on the initial cache data. The initial cache strategy is used for the initial setup of the cache area. The initial caching strategy includes: a caching layering strategy with an initial number of caching layers and a data percentage for each layer, and a caching update strategy with an initial data update time and a ratio of new to old data. When the public cloud accesses the cache area, the process of acquiring access data and inputting it into the prediction model, and updating the priority hierarchy structure and update strategy of the cache area based on the output of the prediction model, includes: the decision-maker acquiring access data and inputting it into the task prediction training model, and the task prediction training model outputting a list of related tasks and the number of occurrences of each related task based on the access data; The access data includes: user characteristic data, server capabilities, and tasks to be performed.
2. The machine learning-based multi-level adaptive caching system according to claim 1, characterized in that, After the task prediction training model outputs a list of relevant tasks and the corresponding occurrence counts of each relevant task based on the access data, the process includes: The decision-maker inputs the relevant task list into the data prediction training model. The data prediction training model outputs the data identifier corresponding to each relevant task and the occurrence frequency of each corresponding data identifier based on the task prediction model. It calculates the occurrence probability of each corresponding data identifier based on the data identifier corresponding to each relevant task and the corresponding data identifier, sorts the occurrence probabilities of each data identifier in descending order, and matches each data identifier corresponding to each relevant task with each initial cache layer according to the initial caching strategy. The matching results are recorded in a data table. The decision-maker sends the data table to the cache area for data cache update, reads data from memory according to the data identifier, and stores the data in different cache layers according to the storage path matched in the data table.
3. The machine learning-based multi-level adaptive caching system according to claim 2, characterized in that, When the public cloud determines the data to be queried based on the task to be executed, and sends a query request to the cache to obtain the target data for executing the task based on the data to be queried, it includes: The decision-maker updates the data table according to the update strategy of the cache area. The cache area adjusts its data according to the latest data table. If data in the data table does not exist in the cache area, it accesses the private cloud to obtain the data. If data in the cache area does not exist in the data table, it deletes the data from the cache area.
4. The machine learning-based multi-level adaptive caching system according to claim 3, characterized in that, When the decision-maker pre-trains the three prediction models, it includes: The cache prediction model uses a reinforcement learning model, takes the initial cache resources of the cache area as input to obtain input feedback, and makes action decisions based on the environmental feedback of the input. The input feedback includes: penalty feedback and reward feedback. The penalty feedback is the amount of resources and time saved by cache hits, and the reward feedback is the space, resource usage, and memory access volume. The action decisions include: a tiered strategy and an update strategy; The layering strategy includes: the number of cache layers in the cache area and the proportion of data corresponding to each cache layer; The update strategy includes: a data update time period threshold Ttask and a data update ratio threshold αnew.
5. The machine learning-based multi-level adaptive caching system according to claim 4, characterized in that, The layering strategy specifically includes: The cache prediction update cycle Tcache is preset. Within the cache prediction update cycle Tcache, the average reward / penalty value Feedback is obtained and calculated based on the time and resources saved due to data cache hits and the resource consumption of adjusting the data cache storage address due to data probability updates. The formula for calculating the cache prediction update cycle Tcache is as follows: T cache =max(24h,10T task ); Where T is the time since the last hierarchical strategy prediction; The formula for calculating the average reward / penalty value (Feedback) is as follows: When T is within the cache prediction update cycle Tcache, the predicted tiering strategy and caching strategy are stored in the decision-maker to obtain the corresponding average reward and penalty value, without adjusting the structure of the cache area. When T is not within the cache prediction update cycle Tcache, the average reward time value Feedback / T obtained from the update strategy executed in the previous round is obtained, where T is the time since the last tiering strategy prediction. When the average reward / penalty value Feedback is less than the previous round's tiered monitoring threshold σcache, the tiered policy is updated during the next round of the update policy update.
6. The machine learning-based multi-level adaptive caching system according to claim 5, characterized in that, The update strategy specifically includes: After the time threshold Ttask, the latest executing task is used as the latest input to obtain the latest data identifier and data probability. The latest data identifier and data probability are compared with the information in the previous data table, and the formula for calculating the probability value of the updated data is as follows: P update =a new ×P new +(1-a new )×P old ; Where Pnew and Pold are the latest probability and the previous probability of the data identifier, respectively, while αnew is the determining factor of the new probability for the probability to be updated, which is determined by the update strategy of the cache prediction model. The new data identifier and data probability are updated in the data table and then sent to the cache to perform the data change.
7. The machine learning-based multi-level adaptive caching system according to claim 6, characterized in that, When the decision-maker pre-trains the three prediction models, it also includes: The task prediction model uses a data update time period threshold Ttask as a variable period. It takes the current task as input and outputs a list of other related tasks within the data update time period threshold Ttask. The model compares the task list predicted by the model with the actual task list and returns an error value to correct the model. The data prediction model is synchronously updated and trained once each time the task prediction model is updated. Within the data update time period threshold Ttask, the data prediction model takes each execution task as input and predicts the most frequently occurring data and the number of times it occurs for that execution task.
8. A multi-level adaptive caching strategy based on machine learning, characterized in that, Applied to the machine learning-based multi-level caching adaptive system as described in any one of claims 1-7, comprising: Use some or all of the data stored in the private cloud in the cache area as the initial cache data; The public cloud determines the data to be queried based on the task to be executed, and sends a query request to the cache to obtain the target data in order to execute the task. By storing and pre-training three prediction models within the decision-maker, when the public cloud sends a query request to the cache to obtain target data for executing the task, the decision-maker is also used to monitor the public cloud's access to the cache in real time. When the public cloud accesses the cache, it obtains the access data and inputs it into the prediction model, and updates the priority hierarchy structure and update strategy of the cache based on the output of the prediction model. The prediction models include: a cache prediction model, a task prediction model, and a data prediction model.
Citation Information
Patent Citations
Method and system for caching data on risk control cloud
CN110674173A
Hybrid cloud system, data processing method and device thereof and storage medium
CN112565317A
Dynamic caching method and device based on deep learning, equipment and medium
CN116684491A