Cache management optimization method and system
By dynamically adjusting the location of cached data and predicting future access needs, and prioritizing the retention of high-value data and migrating low-value data, the shortcomings of existing cache management solutions in high concurrency and changeable access modes are solved, and efficient utilization of cache resources and system performance is achieved.
Patent Information
- Application Number
- CN202510040140.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-05-09
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing cache management solutions cannot be dynamically adjusted under high concurrency and changeable access mode, resulting in low efficiency in cache resource utilization, unpredictable future access needs, prone to cache breakdown, and inability to effectively distinguish high-value and low-value data, resulting in valuable cache resources occupied by low-value data.
By receiving cache access requests initiated by the application, the access popularity of data is evaluated based on identification information, and the location of data in the cache hierarchy structure is dynamically adjusted based on the current cache status and preset cache policies. When insufficient cache space is detected, access needs in the future are predicted based on the access pattern of the data to be accessed, high-value data are retained first, and low-value data is selectively migrated to low-level cache or storage devices through intelligent algorithms.
It realizes efficient utilization of cache resources, reduces access latency to the back-end storage system, improves the system's performance and response efficiency, and can better cope with high concurrency and variable access modes.
Smart Images

Figure CN119961189A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of cache management technology in the field of computer science and technology, and in particular, to a cache management optimization method and system. Background Art
[0002] With the rapid development of the Internet and big data technology, various online services and applications have put forward higher requirements for the real-time and efficient access of data. Especially in high-concurrency access scenarios, the traditional single cache mechanism can no longer meet the requirements of high performance and low latency.
[0003] At present, common cache management schemes mainly include the following. Among them, the LRU algorithm eliminates the data items that have not been accessed for the longest time based on the most recent access time of the data items. This method is simple and easy to implement, but it is easy to cause high-value data to be mistakenly eliminated under high concurrency and variable access patterns. The LFU algorithm eliminates the data items with the least access times based on the access frequency of the data items. Although it can better reflect the access popularity of the data, it performs poorly when processing burst access and long-tail data. The ARC algorithm combines the advantages of LRU and LFU and dynamically adjusts the position of data items by maintaining two cache lists. Although the performance is good, it is complex to implement and has limited effect on large-scale data sets.
[0004] Although the above cache management scheme has improved the performance of the system to a certain extent, it still has the following major defects: Most existing schemes adopt fixed cache strategies and cannot be dynamically adjusted according to real-time access conditions, resulting in inefficient use of cache resources. Existing schemes mainly rely on historical access records and lack the ability to predict future access needs, which is prone to cache breakdown under high concurrency and burst access conditions. When cache space is insufficient, existing schemes often adopt simple elimination strategies and fail to effectively distinguish between high-value and low-value data, resulting in valuable cache resources being occupied by low-value data, increasing access pressure on the back-end storage system. In large-scale data sets and high-concurrency access scenarios, the performance bottleneck of existing schemes is obvious, and it is difficult to meet the real-time and efficiency requirements of modern application systems.
[0005] In summary, existing cache management solutions have many deficiencies under high-concurrency and variable access modes, and cannot fully meet the requirements of modern application systems for real-time and efficient data access. Therefore, a more intelligent and dynamic cache management method is needed, which can evaluate the access popularity of data based on identification information when receiving cache access requests initiated by applications, and dynamically adjust the position of data in the cache hierarchy structure based on the current cache status and preset cache policies. At the same time, when the cache space is insufficient, by predicting the access needs in the future, high-value data is retained first, and low-value data is selectively migrated to low-level caches or storage devices through intelligent algorithms, thereby ensuring efficient use of cache resources and reducing access delays to the back-end storage system. Summary of the invention
[0006] The embodiments of the present application provide a cache management optimization method and system to solve the problems of low performance and efficiency of cache management systems in the prior art.
[0007] In a first aspect, an embodiment of the present application provides a method for optimizing cache management, including:
[0008] Receiving a cache access request initiated by an application, wherein the cache access request includes identification information of data to be accessed;
[0009] Based on the identification information, evaluate the access popularity of the data to be accessed, and dynamically adjust the position of the data to be accessed in the cache hierarchy structure in combination with the current cache state and a preset cache strategy;
[0010] When insufficient cache space is detected, the access demand in the future is predicted based on the access pattern of the data to be accessed, high-value data to be accessed is retained first, and low-value data to be accessed is selectively migrated to a low-level cache or storage device through an intelligent algorithm;
[0011] Based on historical access records and real-time access conditions, the cache strategy is continuously optimized to ensure efficient use of cache resources while reducing access delays to the backend storage system.
[0012] Optionally, the evaluating the access popularity of the to-be-accessed data based on the identification information, and dynamically adjusting the position of the to-be-accessed data in the cache hierarchy structure in combination with a current cache state and a preset cache strategy, includes:
[0013] Obtaining a corresponding cache entry according to the identification information, collecting and analyzing historical access records of the to-be-accessed data from the cache entry, including indicators of access frequency, most recent access time, and average access interval, so as to evaluate access popularity of the to-be-accessed data;
[0014] According to the access popularity, combined with the current state of the cache hierarchy structure and a preset cache strategy, the optimal position of the to-be-accessed data in the cache hierarchy structure is determined.
[0015] Optionally, when insufficient cache space is detected, access needs in the future are predicted based on the access pattern of the data to be accessed, high-value data to be accessed is retained first, and low-value data to be accessed is selectively migrated to a lower-level cache or storage device through an intelligent algorithm, including:
[0016] Monitor the usage status of the cache system in real time, and trigger the cache optimization process when the available cache space is found to be lower than the preset threshold;
[0017] Based on the historical access records and the acquired real-time access conditions, predict the access demand of the to-be-accessed data in a future period of time, and generate an access demand prediction model;
[0018] Calculate the value score of the data to be accessed according to the prediction result of the access demand prediction model, wherein factors such as high access frequency, short access interval, and long duration can increase the value score of the data to be accessed;
[0019] sorting all the data to be accessed according to the value scores, treating the data to be accessed whose value scores are higher than a set threshold as high-value data to be accessed, and retaining the high-value data to be accessed;
[0020] The accessed data with a value score lower than the set threshold is regarded as low-value accessed data, and the low-value accessed data is selectively migrated to a low-level cache or storage device through an intelligent algorithm to release high-level cache or storage devices.
[0021] Optionally, the method of continuously optimizing the cache strategy based on historical access records and real-time access conditions to ensure efficient use of cache resources while reducing access delays to the backend storage system includes:
[0022] Combining the historical access records with the real-time access situation, evaluating the effect of the current cache strategy to obtain an evaluation result;
[0023] According to the evaluation results, a cache strategy optimization model is established, and the cache strategy optimization model can automatically generate optimization suggestions based on different application scenarios and business requirements;
[0024] According to the optimization suggestion of the optimized cache strategy optimization model, the cache strategy parameters are dynamically adjusted to generate an adjusted cache strategy;
[0025] Deploy the adjusted cache policy in the actual environment and verify the effect of the adjusted cache policy to ensure efficient use of cache resources while reducing access latency to the backend storage system.
[0026] Optionally, calculating the value score of the data to be accessed includes:
[0027] Calculate the value scoring formula V of the data to be accessed i :
[0028]
[0029] Among them, V i represents the value score of the i-th data to be accessed; F i is the access frequency of the i-th data to be accessed; θ is the exponential adjustment parameter of the access frequency; Indicates a sinusoidal function, which is used to introduce nonlinear changes; An exponential decay function representing the access interval of the data to be accessed; I i is the access interval of the i-th data to be accessed; λ is the attenuation coefficient of the access interval; D i is the access duration of the i-th data to be accessed; Indicates limiting the impact of long-term visits to avoid excessive impact of extreme values on the score; μ is the adjustment parameter of the visit duration; S i is the security level score of the i-th data to be accessed, which is set according to the data sensitivity and access rights; Q i is the user feedback quality score of the i-th data to be accessed, which indirectly reflects the quality of the data by collecting users' evaluation of the data to be accessed; α, β, γ, δ, η are the weight coefficients of each factor, which can be dynamically adjusted through machine learning algorithms to adapt to different application scenarios; F max It is the maximum access frequency among all the data to be accessed and is used to normalize the access frequency.
[0030] Introducing the time decay factor, we get the adjusted value score, which is defined as:
[0031] V i (t) = V i ·e -ρt
[0032] Among them, V i (t) The adjusted value score of the i-th data to be accessed, V i represents the value score of the i-th data to be accessed, t represents the time interval from the last access to now, and ρ is the time decay coefficient, which is used to simulate the phenomenon that data gradually loses its value over time.
[0033] Optionally, establishing a cache strategy optimization model includes:
[0034] Define the optimization goal O for overall cache performance:
[0035]
[0036] Among them, O is the optimization target of the overall cache performance; N is the total number of data to be accessed in the cache; P i represents the probability that the i-th accessed data is correctly predicted; V i (t) represents the value score of the i-th data to be accessed, taking into account time decay; is a nonlinear function used to adjust the impact of prediction probability on the score; k represents the parameter for adjusting the speed of the impact of prediction probability on the score; P0 represents the threshold of prediction probability; C represents the cost of maintaining the cache system per unit time; L represents the average delay of loading or migrating data in the cache system; ζ represents the weight coefficient of the system health index; H represents the system health index; E is the energy consumption index, which is quantified by calculating the energy consumed by the cache operation per unit time; ω is the weight coefficient of the energy consumption index, which reflects the importance of energy conservation and emission reduction in cache strategy optimization.
[0037] In a second aspect, an embodiment of the present application provides a cache management optimization system, including:
[0038] A receiving module, configured to receive a cache access request initiated by an application, wherein the cache access request includes identification information of data to be accessed;
[0039] An adjustment module, used to evaluate the access popularity of the data to be accessed based on the identification information, and dynamically adjust the position of the data in the cache hierarchy structure in combination with the current cache state and a preset cache strategy;
[0040] A detection migration module is used to predict the access demand in the future based on the access pattern of the data to be accessed when insufficient cache space is detected, give priority to retaining high-value data to be accessed, and selectively migrate low-value data to be accessed to a low-level cache or storage device through an intelligent algorithm;
[0041] The optimization module is used to continuously optimize the cache strategy based on historical access records and real-time access conditions, ensuring efficient use of cache resources while reducing access delays to the backend storage system.
[0042] In a third aspect, an embodiment of the present application provides a computing device, comprising a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement a cache management optimization method as described in any one of the first aspects.
[0043] In a fourth aspect, an embodiment of the present application provides a computer storage medium storing a computer program, wherein when the computer program is executed by a computer, a cache management optimization method as described in any one of the first aspects is implemented.
[0044] In an embodiment of the present application, a cache access request initiated by an application is received, and the cache access request contains identification information of the data to be accessed; based on the identification information, the access popularity of the data to be accessed is evaluated, and in combination with the current cache state and the preset cache strategy, the position of the data to be accessed in the cache hierarchy is dynamically adjusted; when insufficient cache space is detected, the access demand in the future is predicted based on the access pattern of the data to be accessed, and high-value data to be accessed is retained first, and low-value data to be accessed is selectively migrated to a low-level cache or storage device through an intelligent algorithm; based on historical access records and real-time access conditions, the cache strategy is continuously optimized to ensure efficient use of cache resources while reducing access delays to the back-end storage system. The technical solution provided by the present application improves the performance and efficiency of the cache management system.
[0045] These and other aspects of the present application will become more clearly understood in the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0047] Figure 1 A flowchart of a cache management optimization method provided in an embodiment of the present application;
[0048] Figure 2 A schematic diagram of the structure of a cache management optimization system provided in an embodiment of the present application;
[0049] Figure 3 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0051] In some of the processes described in the specification and claims of this application and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.
[0052] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0053] Figure 1 A flowchart of a method for optimizing cache management is provided for an embodiment of the present application, such as Figure 1 As shown, the method includes:
[0054] 101. Receive a cache access request initiated by an application, where the cache access request includes identification information of data to be accessed;
[0055] In this step, the cache access request is a request issued by the application to obtain or update specific data from the cache. The identification information of the data to be accessed is an identifier used to uniquely identify the data in the cache, which can be a file name, database key value, or other unique identifiers. Access popularity is an indicator of how often data is accessed, and is usually used to determine the location of data in the cache hierarchy. The cache hierarchy structure is a layered cache architecture, and caches at different levels have different performance characteristics. Generally, the closer the cache is to the top layer, the faster the access speed but the higher the cost. The cache policy is a series of rules that define how to manage and maintain the cache, including but not limited to the addition, elimination, and migration of data. Intelligent algorithms are algorithms that use machine learning or artificial intelligence technology to predict and optimize data access patterns. Historical access records are the history of data access in the past period of time, which are used to analyze access patterns and predict future access needs.
[0056] In this step, the cache management system first receives a request from the application, which contains the unique identification information of the data to be accessed. This process is the entry point of the entire data access process, ensuring that the system can accurately locate the specific data that the user wants to access.
[0057] In the embodiment of the present application, it is assumed that an e-commerce website is running, which provides a large amount of product information browsing function. In order to improve the user experience, a multi-level cache system is implemented to speed up the loading time of the product details page. The following is the process of the system processing a typical cache access request:
[0058] A customer clicks on a product link on a website and wants to see detailed information about the product.
[0059] After receiving the client's request, the website's application server constructs a cache access request that includes the unique ID of the product (for example, the product ID is 123456).
[0060] The application server sends this request to the cache management system. At this time, the cache management system receives the request and parses the identification information of the data to be accessed, that is, the product ID 123456.
[0061] Next, the system will search for the corresponding cache data based on the product ID. If found, it will be returned directly to the application server. If not found, it will need to read the data from the backend database and consider whether to add it to the cache for future quick access.
[0062] By implementing the above solution, the delay caused by frequent access to the backend database can be significantly reduced, improving the website's response speed and user experience. At the same time, by intelligently managing cache content, limited cache resources can be effectively utilized to reduce operating costs. In addition, for high-visited product information, since they will be preferentially retained in a high-level cache, the access speed of these hot data can be further accelerated, which is crucial to improving the overall performance of the website.
[0063] 102. Based on the identification information, evaluate the access popularity of the to-be-accessed data, and dynamically adjust the position of the to-be-accessed data in the cache hierarchy structure in combination with the current cache state and a preset cache strategy;
[0064] In this step, after receiving the request, the system analyzes the access frequency and pattern of the data to determine its "hotness". Then, based on the current cache status and the preset cache strategy, it decides whether to adjust the position of the data in the multi-level cache system to achieve optimal access performance.
[0065] In an embodiment of the present application, assuming that there is an online video platform, if a certain movie is found to be very popular, the system may move it from a lower-level cache to a higher-level cache in order to respond to the user's viewing request more quickly.
[0066] In existing cache management systems, static cache strategies are usually used to manage data locations. Although this strategy is simple, it is not flexible enough when faced with complex and changing access patterns. Specifically, there are several major problems: static cache strategies cannot dynamically adjust the location of data based on the actual access situation of the data, resulting in hot data being placed in inefficient cache levels, affecting access performance. Static strategies may cause some cache levels to be overcrowded while other levels are idle, resulting in a waste of resources. When the system suddenly faces a large number of access requests, static strategies are difficult to adjust quickly, resulting in performance bottlenecks.
[0067] In order to solve these problems, an embodiment of the present invention proposes an optional solution for dynamically adjusting the cache location. By more finely evaluating the access popularity of the data and combining the current cache status and the preset cache strategy, the location of the data in the cache hierarchy structure is dynamically adjusted, thereby improving the utilization and access performance of the cache resources.
[0068] The options are as follows:
[0069] Optionally, the step 102 evaluates the access popularity of the data to be accessed based on the identification information, and dynamically adjusts the position of the data to be accessed in the cache hierarchy structure in combination with the current cache status and the preset cache strategy, including: obtaining the corresponding cache entry according to the identification information, collecting and analyzing the historical access records of the data to be accessed from the cache entry, including indicators such as access frequency, most recent access time, and average access interval, so as to evaluate the access popularity of the data to be accessed; and determining the optimal position of the data to be accessed in the cache hierarchy structure according to the access popularity, in combination with the current status of the cache hierarchy structure and the preset cache strategy.
[0070] In this step, a cache entry is a data item stored in the cache, which usually includes the data itself and its metadata. Access popularity is a comprehensive indicator that measures the frequency of data access and the time of the most recent access, and is used to determine the location of data in the cache hierarchy. Historical access records record the access of data in the past period of time, including access frequency, the time of the most recent access, the average access interval, etc. The cache hierarchy structure is a multi-level cache architecture. Caches at different levels have different performance characteristics. Generally, higher-level caches have faster access speeds but higher costs. The cache policy is a series of rules that define how to manage and maintain the cache, including the addition, elimination, and migration of data.
[0071] First, the system searches for the corresponding cache entry from the cache based on the identification information in the cache access request. The cache entry contains not only the data itself, but also metadata related to the data, such as access time, frequency, etc.
[0072] Secondly, the system extracts historical access records from cache entries, including indicators such as access frequency, last access time, and average access interval, to evaluate the access popularity of the data.
[0073] Further, according to the access popularity, combined with the current state of the cache hierarchy and the preset cache strategy, the optimal position of the to-be-accessed data in the cache hierarchy is determined.
[0074] In the embodiment of the present application, it is assumed that an e-commerce website is running, which provides a large amount of product information browsing function. In order to improve the user experience, a multi-level cache system is implemented to speed up the loading time of the product details page. The following is the process of the system processing a typical cache access request:
[0075] A customer clicks on a product link on the website and wants to view detailed information about the product. The product ID is 123456.
[0076] After receiving the client's request, the website's application server constructs a cache access request that includes product ID 123456.
[0077] The application server sends this request to the cache management system. The system searches for the corresponding cache entry from the cache based on the product ID 123456. The entry contains the following information:
[0078] Product data
[0079] Last access time: 2024-09-2510:00:00
[0080] Access frequency: 10 times a day
[0081] Average visit interval: 1 hour
[0082] The system extracts historical access records from cache entries and assesses that the product is highly visited.
[0083] The system checks the status of the current cache hierarchy and finds that the memory cache has enough space. According to the preset cache strategy, the system decides to migrate the product data from the disk cache to the memory cache.
[0084] The system quickly reads product data from the memory cache and returns it to the application server, which is finally displayed to the user.
[0085] By implementing the above optional solutions, the following beneficial effects can be achieved: hot data is dynamically adjusted to a higher level cache, reducing access latency and improving user experience. The system can dynamically adjust cache content according to actual access conditions, avoiding waste of resources and improving the utilization of cache resources. The system can quickly respond to changes in access patterns, dynamically adjust cache strategies, effectively respond to sudden access requests, and maintain high system performance.
[0086] In summary, this optional solution solves the problem of inflexible cache management in the prior art by more finely evaluating the access popularity of data and dynamically adjusting the cache location, thereby significantly improving the system performance and resource utilization.
[0087] 103. When insufficient cache space is detected, predict access needs in the future based on the access pattern of the data to be accessed, prioritize and retain high-value data to be accessed, and selectively migrate low-value data to be accessed to a low-level cache or storage device through an intelligent algorithm;
[0088] In this step, when the system detects that the cache space is about to be exhausted, it uses prediction algorithms to estimate the access demand for each data in the future. Based on these predictions, the system selectively eliminates data that is expected to have less access, or migrates them to lower-level storage devices to make room for more frequently accessed data.
[0089] In an embodiment of the present application, assuming that the cache space of the video platform is tight and the number of views of certain movies has dropped significantly, the system may automatically transfer the data of these movies from the cache to a slower but larger capacity storage device, such as a cloud storage service.
[0090] In existing cache management systems, when cache space is insufficient, simple elimination strategies are usually used to free up space. However, these strategies are often too simple and fail to fully consider future access needs of data, resulting in some high-value data being mistakenly eliminated while low-value data is retained. Specifically, there are several major problems: Traditional elimination strategies are based only on current or past data access situations and cannot predict future access needs, which may cause important data to be mistakenly eliminated. Simple elimination strategies may lead to frequent data migration, increase system overhead, and may also cause a waste of cache resources. When cache space is insufficient, traditional elimination strategies may cause unstable system performance, especially under high load conditions.
[0091] In order to solve these problems, an embodiment of the present invention proposes a cache optimization solution based on access pattern prediction and intelligent algorithm. By more accurately evaluating the future access needs of data, high-value data is retained first, and low-value data is migrated to low-level cache or storage devices, thereby improving the utilization of cache resources and the overall performance of the system.
[0092] The options are as follows:
[0093] Optionally, when insufficient cache space is detected in step 103, access needs in the future are predicted based on the access pattern of the data to be accessed, high-value data to be accessed is retained first, and low-value data to be accessed is selectively migrated to a lower-level cache or storage device through an intelligent algorithm, including: real-time monitoring of the use status of the cache system, and triggering a cache optimization process when the available cache space is found to be lower than a preset threshold; based on the historical access records and the obtained real-time access situation, predicting the access needs of the data to be accessed in the future, and generating an access demand prediction model; predicting the access needs of the data to be accessed based on the access needs; The prediction result of the test model is used to calculate the value score of the data to be accessed, wherein factors such as high access frequency, short access interval, and long duration can increase the value score of the data to be accessed; all the data to be accessed are sorted according to the value score, and the data to be accessed with a value score higher than a set threshold is regarded as high-value data to be accessed, and the high-value data to be accessed is retained; the data to be accessed with a value score lower than the set threshold is regarded as low-value data to be accessed, and the low-value data to be accessed is selectively migrated to a low-level cache or storage device through an intelligent algorithm to release a high-level cache or storage device.
[0094] In this step, insufficient cache space means that the available space of the cache system is lower than the preset threshold, and measures need to be taken to free up space. The access pattern is a combination of data access frequency, access interval, access duration and other characteristics, which is used to predict future access needs. The access demand prediction model is a model generated by machine learning or statistical methods based on historical access records and real-time access conditions, and is used to predict data access needs in the future. The value score is an indicator that quantitatively evaluates the importance of data by comprehensively considering factors such as access frequency, access interval, and access duration. Intelligent algorithms are algorithms that use machine learning or optimization algorithms to automatically and selectively migrate low-value data to low-level caches or storage devices.
[0095] First, the system continuously monitors the usage status of the cache. When the available cache space is lower than the preset threshold, the cache optimization process is started to free up space.
[0096] Secondly, the system uses historical access records and real-time access conditions to generate an access demand prediction model through machine learning or statistical methods to predict the access demand for data in the future.
[0097] Next, the system calculates the value score of each data based on the prediction results of the access demand prediction model. Factors such as high access frequency, short access interval, and long duration can increase the value score of the data. The method for calculating the value score can be set according to demand, such as through a preset formula, and the embodiments of the present application are not limited to this.
[0098] Furthermore, the system sorts all data according to the calculated value scores, marks data with value scores higher than a set threshold as high-value data, and retains these data.
[0099] Finally, the system marks data with a value score below the set threshold as low-value data, and selectively migrates this data to low-level cache or storage devices through intelligent algorithms to free up high-level cache space.
[0100] In the embodiment of the present application, it is assumed that an e-commerce website is running, which provides a large amount of product information browsing function. In order to improve the user experience, a multi-level cache system is implemented to speed up the loading time of the product details page. The following is how the system handles insufficient cache space:
[0101] The system continuously monitors cache usage and triggers the cache optimization process when it detects that the available cache space has dropped to 8%.
[0102] The system collects access records of all data in the past month, including access frequency, the last access time, and the average access interval. Combined with real-time access data, the system generates an access demand forecasting model to predict the access demand of each data in the next week.
[0103] The system calculates the value score of each piece of data based on the results of the access demand prediction model.
[0104] The system sorts all data according to the calculated value score, assuming the threshold is 0.6, and retains data with a value score higher than 6.0. The system migrates data with a value score lower than 6.0 from the memory cache to the disk cache to free up space in the memory cache.
[0105] By implementing the above optional solutions, the following beneficial effects can be achieved: By predicting future access needs, the system can retain high-value data in high-level caches, reduce access delays, and improve user experience. The system can allocate cache resources more reasonably, avoid resource waste, and improve cache resource utilization. The system can dynamically adjust cache content, effectively respond to sudden access requests, and maintain high performance and stability of the system. Low-value data can be selectively migrated through intelligent algorithms, reducing frequent data migration and elimination operations and reducing the risk of system performance fluctuations.
[0106] In summary, this optional solution solves the problem of inflexible cache management in the prior art by optimizing the cache based on access pattern prediction, significantly improves the system's performance and resource utilization, and improves the user experience.
[0107] In existing cache management technologies, when the system detects insufficient cache space, simple strategies such as LRU or LFU are usually used to decide which data should be eliminated from the cache. However, these methods often ignore the actual value of the data, that is, the likelihood of them being accessed again in the future and the importance of the access. This may cause some high-value data to be mistakenly eliminated, while some low-value data occupies valuable cache space, thereby reducing the overall system performance and user experience.
[0108] In order to solve this problem, the embodiment of the present invention proposes an intelligent cache management solution based on data access pattern prediction. This solution not only takes into account the historical access frequency of data, but also integrates multiple dimensions such as data access interval, access duration, security level score, and user feedback quality score. The value score of each piece of data is calculated through an intelligent algorithm, and a more reasonable cache decision is made based on this, which effectively improves the utilization rate of cache space and the response efficiency of the system.
[0109] The options are as follows:
[0110] Optionally, the calculating of the value score of the to-be-accessed data in step 103 includes:
[0111] Calculate the value scoring formula V of the data to be accessed i :
[0112]
[0113] Among them, V i represents the value score of the i-th data to be accessed; F i is the access frequency of the i-th data to be accessed; θ is the exponential adjustment parameter of the access frequency; Indicates a sinusoidal function, which is used to introduce nonlinear changes; An exponential decay function representing the access interval of the data to be accessed; I i is the access interval of the i-th data to be accessed; λ is the attenuation coefficient of the access interval; D i is the access duration of the i-th data to be accessed; Indicates limiting the impact of long-term visits to avoid excessive impact of extreme values on the score; μ is the adjustment parameter of the visit duration; S i is the security level score of the i-th data to be accessed, which is set according to the data sensitivity and access rights; Q i is the user feedback quality score of the i-th data to be accessed, which indirectly reflects the quality of the data by collecting users' evaluation of the data to be accessed; α, β, γ, δ, η are the weight coefficients of each factor, which can be dynamically adjusted through machine learning algorithms to adapt to different application scenarios; F max It is the maximum access frequency among all the data to be accessed and is used to normalize the access frequency.
[0114] Introducing the time decay factor, we get the adjusted value score, which is defined as:
[0115] V i (t) = V i ·e -ρt
[0116] Among them, V i (t) The adjusted value score of the i-th data to be accessed, V i represents the value score of the i-th data to be accessed, t represents the time interval from the last access to now, and ρ is the time decay coefficient, which is used to simulate the phenomenon that data gradually loses its value over time.
[0117] In this step, the solution first applies the following formula:
[0118]
[0119] Calculate the value score V of each piece of data to be accessed i ,The formula comprehensively considers factors such as data access frequency, access interval, access duration, security level score and user feedback quality score, and ,by assigning corresponding weight coefficients α, β, γ, δ, η to different factors, ,ensuring that the final score can accurately reflect the true value of the data.
[0120] Among them, V i represents the value score of the i-th data to be accessed; F i is the access frequency of the i-th data to be accessed; θ is the exponential adjustment parameter of the access frequency; Indicates a sinusoidal function, which is used to introduce nonlinear changes; An exponential decay function representing the access interval of the data to be accessed; I i is the access interval of the i-th data to be accessed; λ is the attenuation coefficient of the access interval; D i is the access duration of the i-th data to be accessed; Indicates limiting the impact of long-term visits to avoid excessive impact of extreme values on the score; μ is the adjustment parameter of the visit duration; S i is the security level score of the i-th data to be accessed, which is set according to the data sensitivity and access rights; Q i is the user feedback quality score of the i-th data to be accessed, which indirectly reflects the quality of the data by collecting users' evaluation of the data to be accessed; α, β, γ, δ, η are the weight coefficients of each factor, which can be dynamically adjusted through machine learning algorithms to adapt to different application scenarios; F max It is the maximum access frequency among all the data to be accessed and is used to normalize the access frequency.
[0121] Subsequently, in order to more accurately reflect the value of data changing over time, a time decay factor is introduced to obtain the adjusted value score V i (t) = V i ·e -ρt , where t is the time interval from the last access to now. This ensures that the value of data that has not been accessed for a long time will gradually decrease, so that it will be eliminated first when the cache space is tight.
[0122] Among them, V i (t) The adjusted value score of the i-th data to be accessed, V i represents the value score of the i-th data to be accessed, t represents the time interval from the last access to now, and ρ is the time decay coefficient, which is used to simulate the phenomenon that data gradually loses its value over time.
[0123] In the embodiment of the present application, it is assumed that in a cache management system of an online video platform, there are two pieces of data A and B to be accessed, and the relevant parameters are as follows:
[0124] Data A: F A =100,I A =2 hours, D A = 30 minutes, S A =8,Q A =9;
[0125] Data B: F B =50,I B = 10 hours, D B = 10 minutes, S B =6, Q B =7;
[0126] F max =100, α=0.4, β=0.2, γ=0.1, δ=0.2, ζ=0.1, θ=1.5, λ=0.1, μ=0.05, ρ=0.01;
[0127] The value score of data A is:
[0128]
[0129]
[0130] The value score of data B is:
[0131]
[0132] Assuming that the time interval t from the last visit to now is 1 day and 2 days for data A and B respectively, the adjusted value scores are:
[0133] V A (1) = 162.8945 e -0.01·24 ≈162.8945·0.7871≈128.17
[0134] V B (2) = 81.0939 e -0.01·48 ≈81.0939·0.6065≈49.21
[0135] Through the above calculation, it can be seen that even if the initial value score of data A is higher, its adjusted value score is still higher than that of data B due to its shorter access interval. Therefore, when the cache space is insufficient, data A should be retained first.
[0136] This solution evaluates data value from multiple dimensions, which not only improves the intelligence level of cache management, but also effectively avoids the risk of high-value data being eliminated by traditional methods, ensuring that the system can provide better service quality and user experience with limited resources.
[0137] 104. Based on historical access records and real-time access conditions, continuously optimize the cache strategy to ensure efficient use of cache resources while reducing access delays to the back-end storage system.
[0138] In this step, in order to ensure long-term optimal performance, the system will continuously learn and adapt to new access patterns. By analyzing historical access records and current access trends, it will automatically adjust the cache strategy, including but not limited to data migration rules, cache size allocation, etc., to minimize latency and maximize cache utilization.
[0139] In the embodiment of the present application, it is assumed that the video platform can regularly review changes in user viewing behavior. For example, a newly released movie often has a large number of visitors in the early stage, and then gradually decreases over time. Based on such observations, the system can automatically adjust the cache strategy for new content to ensure that popular content can always be loaded quickly without occupying too many long-term cache resources.
[0140] In existing cache management technologies, cache policies are often static, that is, once determined, they will not be easily changed. However, this static cache policy is difficult to cope with the ever-changing access patterns and business needs, resulting in low utilization of cache resources and even increased access latency to the backend storage system. Especially in Internet applications, user behavior and business needs change very frequently, and static cache policies cannot adapt to these changes in a timely manner, thus affecting system performance and user experience.
[0141] To solve this problem, the embodiment of the present invention proposes a dynamic cache strategy optimization solution based on historical access records and real-time access conditions. The solution continuously evaluates the effect of the current cache strategy, automatically generates optimization suggestions based on the evaluation results, and dynamically adjusts the cache strategy parameters to ensure efficient use of cache resources while reducing access delays to the backend storage system.
[0142] The options are as follows:
[0143] Optionally, the method in step 104 continuously optimizes the cache strategy based on historical access records and real-time access conditions to ensure efficient use of cache resources while reducing access delays to the back-end storage system, including: evaluating the effect of the current cache strategy in combination with the historical access records and the real-time access conditions to obtain evaluation results; establishing a cache strategy optimization model based on the evaluation results, wherein the cache strategy optimization model can automatically generate optimization suggestions based on different application scenarios and business needs; dynamically adjusting cache strategy parameters based on the optimization suggestions of the optimized cache strategy optimization model to generate an adjusted cache strategy; deploying the adjusted cache strategy in an actual environment, and verifying the effect of the adjusted cache strategy to ensure efficient use of cache resources while reducing access delays to the back-end storage system.
[0144] In this step, historical access records refer to detailed records of all access requests to the system in the past period of time, including access time, access frequency, access data and other information. Real-time access status refers to the access requests currently occurring in the system, including current access frequency, access mode and other information. The evaluation results are obtained by analyzing historical access records and real-time access status to evaluate the effectiveness of the current cache strategy, including indicators such as cache hit rate and access delay. The cache strategy optimization model is a model based on machine learning or optimization algorithms, which can automatically generate optimization suggestions based on the evaluation results to help dynamically adjust the cache strategy parameters. The cache strategy parameters include cache size, cache replacement algorithm, data prefetching strategy, etc. These parameters directly affect the performance of the cache. The adjusted cache strategy is the cache strategy adjusted according to the optimization suggestions, which aims to improve the utilization of cache resources and reduce access delays.
[0145] First, the effectiveness of the current cache strategy is evaluated by combining historical access records and real-time access conditions to obtain evaluation results, which usually include key indicators such as cache hit rate and average access latency.
[0146] Secondly, based on the evaluation results, a cache strategy optimization model is established. The model can automatically generate optimization suggestions based on different application scenarios and business needs. Optimization suggestions may include adjusting cache size, changing cache replacement algorithms, optimizing data prefetching strategies, etc.
[0147] Furthermore, according to the optimization suggestions of the optimized cache strategy optimization model, the cache strategy parameters are dynamically adjusted to generate an adjusted cache strategy. These adjustments can be made in real time to adapt to changing access patterns and business needs.
[0148] Finally, deploy the adjusted cache strategy in the actual environment and verify its effect to ensure efficient use of cache resources while reducing access latency to the backend storage system. If the verification results show poor results, continue to optimize the model and generate new optimization suggestions until the expected results are achieved.
[0149] In the embodiment of the present application, it is assumed that in a cache management system of an e-commerce platform, the effect evaluation result of the current cache strategy is as follows:
[0150] Cache hit rate: 70%
[0151] Average access delay: 200ms
[0152] By analyzing historical access records and real-time access situations, we found the following problems: some hot products have a very high access frequency, but a low cache hit rate. Some unpopular products occupy a certain proportion of cache space, but have a very low access frequency.
[0153] Based on the evaluation results, a cache strategy optimization model based on machine learning is established. The model generates optimization suggestions in the following ways: Increase the cache space for popular products and reduce the cache space for unpopular products. Switch from the LRU algorithm to the LFU algorithm to better adapt to data with high access frequency. Pre-fetch the product data that may be accessed in advance based on the user's browsing behavior.
[0154] According to the optimization suggestions, dynamically adjust the cache policy parameters: increase the cache space of hot products from 10% to 30%. Switch the cache replacement algorithm from LRU to LFU. Enable the data prefetching strategy based on user behavior.
[0155] Deploy the adjusted cache strategy in the actual environment and verify its effect:
[0156] Cache hit rate: increased to 85%
[0157] Average access delay: reduced to 150ms
[0158] Through the above dynamic cache strategy optimization solution, the cache system of the e-commerce platform can use cache resources more effectively, significantly improve the cache hit rate, and reduce the access delay to the backend storage system. This not only improves the overall performance of the system, but also improves the user experience, especially in the case of high concurrent access, the system can better cope with burst traffic and ensure the stability and reliability of the service.
[0159] In existing cache management technologies, cache strategy optimization usually relies on static rules or simple performance indicators such as cache hit rate and access latency. However, these methods often ignore the overall performance of the cache system, including cost, latency, system health, and energy consumption. This single optimization method is difficult to fully meet the needs of different application scenarios, especially in large-scale distributed systems, where efficient use of cache resources and performance optimization become more complicated.
[0160] To solve this problem, the embodiment of the present invention proposes a cache strategy optimization model based on multi-objective optimization. The model establishes an optimization goal for overall cache performance by comprehensively considering multiple factors such as cache performance, cost, latency, system health, and energy consumption, and ensures efficient use of cache resources by dynamically adjusting cache strategy parameters while reducing access latency to the backend storage system.
[0161] The options are as follows:
[0162] Optionally, the establishing of the cache strategy optimization model in step 104 includes:
[0163] Define the optimization goal O for overall cache performance:
[0164]
[0165] Where O is the optimization target of the overall cache performance; N is the total number of data to be accessed in the cache; P i represents the probability that the i-th accessed data is correctly predicted; V i (t) represents the value score of the i-th data to be accessed, taking into account time decay; is a nonlinear function used to adjust the impact of prediction probability on the score; k represents the parameter for adjusting the speed of the impact of prediction probability on the score; P0 represents the threshold of prediction probability; C represents the cost of maintaining the cache system per unit time; L represents the average delay of loading or migrating data in the cache system; ζ represents the weight coefficient of the system health index; H represents the system health index; E is the energy consumption index, which is quantified by calculating the energy consumed by the cache operation per unit time; ω is the weight coefficient of the energy consumption index, which reflects the importance of energy conservation and emission reduction in cache strategy optimization.
[0166] In this step, first, the following formula is used:
[0167]
[0168] The optimization target O of the overall cache performance is defined. This formula takes into account multiple factors such as the predicted probability of data, value score, system maintenance cost, loading delay, system health and energy consumption.
[0169] Where O is the optimization target of the overall cache performance; N is the total number of data to be accessed in the cache; P i represents the probability that the i-th accessed data is correctly predicted; V i (t) represents the value score of the i-th data to be accessed, taking into account time decay; is a nonlinear function used to adjust the impact of prediction probability on the score; k represents the parameter for adjusting the speed of the impact of prediction probability on the score; P0 represents the threshold of prediction probability; C represents the cost of maintaining the cache system per unit time; L represents the average delay of loading or migrating data in the cache system; ζ represents the weight coefficient of the system health index; H represents the system health index; E is the energy consumption index, which is quantified by calculating the energy consumed by the cache operation per unit time; ω is the weight coefficient of the energy consumption index, which reflects the importance of energy conservation and emission reduction in cache strategy optimization.
[0170] Secondly, the effectiveness of the current cache strategy is evaluated by combining historical access records and real-time access situations to obtain evaluation results.
[0171] Next, based on the evaluation results, a cache strategy optimization model is established, which can automatically generate optimization suggestions based on different application scenarios and business needs.
[0172] Furthermore, according to the optimization suggestion of the optimized cache strategy optimization model, the cache strategy parameters are dynamically adjusted to generate an adjusted cache strategy.
[0173] Finally, the adjusted cache strategy is deployed in the actual environment and its effect is verified to ensure efficient utilization of cache resources while reducing access latency to the backend storage system.
[0174] In the embodiment of the present application, it is assumed that in a cache management system of a large e-commerce website, the effect evaluation result of the current cache strategy is as follows:
[0175] Cache hit rate: 70%
[0176] Average access delay: 200ms
[0177] System health: 85 (out of 100)
[0178] Energy consumption: 1000 watt-hours / hour
[0179] According to the formula Define the optimization target O of the overall cache performance. Where N = 1000; P i The average value is 0.8; V i The average value of (t) is 150; k = 5; P0 = 0.5; C = 10; L = 200; ζ = 0.1; H = 85; ω = 0.05; E = 1000;
[0180] Calculate O:
[0181]
[0182] First calculate the nonlinear function part:
[0183]
[0184] Then calculate the sum:
[0185]
[0186] Finally, calculate the optimization target O of the overall cache performance:
[0187] O=72000-10·200-0.1·85-0.05·1000
[0188] O=69941.5
[0189] By analyzing historical access records and real-time access situations, we found the following problems: some hot products have a very high access frequency, but a low cache hit rate. Some unpopular products occupy a certain proportion of cache space, but have a very low access frequency.
[0190] Based on the evaluation results, a cache strategy optimization model based on machine learning is established. The model generates optimization suggestions in the following ways: Increase the cache space for popular products and reduce the cache space for unpopular products. Switch from the LRU algorithm to the LFU algorithm to better adapt to data with high access frequency. Pre-fetch the product data that may be accessed in advance based on the user's browsing behavior.
[0191] According to the optimization suggestions, dynamically adjust the cache policy parameters: increase the cache space of hot products from 10% to 30%. Switch the cache replacement algorithm from LRU to LFU. Enable the data prefetching strategy based on user behavior.
[0192] Deploy the adjusted cache strategy in the actual environment and verify its effect:
[0193] Cache hit rate: increased to 85%
[0194] Average access delay: reduced to 150ms
[0195] System health: increased to 90
[0196] Energy consumption: reduced to 800 watt-hours / hour
[0197] Recalculate the optimization target O of the optimized overall cache performance:
[0198]
[0199] First calculate the nonlinear function part:
[0200]
[0201] Then calculate the sum:
[0202]
[0203] Finally, calculate the optimization target O of the overall cache performance:
[0204] O=77460-10·150-0.1·90-0.05·800
[0205] O=75911
[0206] Through the above dynamic cache strategy optimization solution, the cache system of the e-commerce platform not only significantly improves the cache hit rate and reduces access latency, but also improves system health and reduces energy consumption. This not only optimizes the overall performance of the system, but also improves the user experience. Especially in the case of high concurrent access, the system can better cope with burst traffic and ensure the stability and reliability of the service. In addition, through energy conservation and emission reduction, it also meets the requirements of green environmental protection and has important economic and social benefits.
[0207] Figure 2 A schematic diagram of a cache management optimization system is provided for an embodiment of the present application. Figure 2 As shown, the system includes:
[0208] A receiving module 21, configured to receive a cache access request initiated by an application, wherein the cache access request includes identification information of data to be accessed;
[0209] An adjustment module 22, for evaluating the access popularity of the to-be-accessed data based on the identification information, and dynamically adjusting the position of the data in the cache hierarchy structure in combination with the current cache state and a preset cache strategy;
[0210] A detection migration module 23 is used to predict the access demand in the future according to the access pattern of the data to be accessed when insufficient cache space is detected, give priority to retaining the high-value data to be accessed, and selectively migrate the low-value data to be accessed to a low-level cache or storage device through an intelligent algorithm;
[0211] The optimization module 24 is used to continuously optimize the cache strategy based on historical access records and real-time access conditions to ensure efficient use of cache resources while reducing access delays to the backend storage system.
[0212] Figure 2 The cache management optimization system can perform Figure 1 The implementation principle and technical effect of the cache management optimization system described in the illustrated embodiment will not be described in detail. The specific manner in which each module and unit performs operations in the cache management optimization system in the above embodiment has been described in detail in the embodiment of the method, and will not be described in detail here.
[0213] In one possible design, Figure 2 The cache management optimization system of the illustrated embodiment can be implemented as a computing device, such as Figure 3 As shown, the computing device may include a storage component 31 and a processing component 32;
[0214] The storage component 31 stores one or more computer instructions, wherein the one or more computer instructions are called and executed by the processing component 32 .
[0215] The processing component 32 is used to: receive a cache access request initiated by an application, the cache access request containing identification information of the data to be accessed; based on the identification information, evaluate the access popularity of the data to be accessed, and dynamically adjust the position of the data to be accessed in the cache hierarchy structure in combination with the current cache status and the preset cache strategy; when insufficient cache space is detected, predict the access demand in the future period based on the access pattern of the data to be accessed, give priority to retaining high-value data to be accessed, and selectively migrate low-value data to be accessed to a low-level cache or storage device through an intelligent algorithm; continuously optimize the cache strategy based on historical access records and real-time access conditions to ensure efficient use of cache resources while reducing access delays to the back-end storage system.
[0216] The processing component 32 may include one or more processors to execute computer instructions to complete all or part of the steps in the above method. Of course, the processing component may also be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.
[0217] The storage component 31 is configured to store various types of data to support operations at the terminal. The storage component can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0218] Of course, the computing device may also include other components, such as input / output interfaces, display components, communication components, etc.
[0219] The input / output interface provides an interface between the processing component and the peripheral interface module, which may be an output device, an input device, etc.
[0220] The communication component is configured to facilitate, among other things, wired or wireless communications between the computing device and other devices.
[0221] Among them, the computing device can be a physical device or an elastic computing host provided by a cloud computing platform, etc. In this case, the computing device can refer to a cloud server, and the above-mentioned processing components, storage components, etc. can be basic server resources rented or purchased from the cloud computing platform.
[0222] The present application also provides a computer storage medium storing a computer program, wherein the computer program can achieve the above-mentioned Figure 1 The optimization method of cache management of the illustrated embodiment.
[0223] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0224] The system embodiment described above is merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.
[0225] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0226] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A cache management optimization method, characterized in that: include: Receiving a cache access request initiated by an application, wherein the cache access request includes identification information of data to be accessed; Based on the identification information, evaluate the access popularity of the data to be accessed, and dynamically adjust the position of the data to be accessed in the cache hierarchy structure in combination with the current cache state and a preset cache strategy; When insufficient cache space is detected, the access demand in the future is predicted based on the access pattern of the data to be accessed, high-value data to be accessed is retained first, and low-value data to be accessed is selectively migrated to a low-level cache or storage device through an intelligent algorithm; Based on historical access records and real-time access conditions, the cache strategy is continuously optimized to ensure efficient use of cache resources while reducing access delays to the backend storage system.
2. The method according to claim 1, characterized in that The step of evaluating the access popularity of the to-be-accessed data based on the identification information and dynamically adjusting the position of the to-be-accessed data in the cache hierarchy structure in combination with the current cache state and a preset cache strategy includes: Obtaining a corresponding cache entry according to the identification information, collecting and analyzing historical access records of the to-be-accessed data from the cache entry, including indicators of access frequency, most recent access time, and average access interval, so as to evaluate access popularity of the to-be-accessed data; According to the access popularity, combined with the current state of the cache hierarchy structure and a preset cache strategy, the optimal position of the to-be-accessed data in the cache hierarchy structure is determined.
3. The method according to claim 2, characterized in that When insufficient cache space is detected, the access demand in the future is predicted based on the access pattern of the data to be accessed, high-value data to be accessed is retained first, and low-value data to be accessed is selectively migrated to a lower-level cache or storage device through an intelligent algorithm, including: Monitor the usage status of the cache system in real time, and trigger the cache optimization process when the available cache space is found to be lower than the preset threshold; Based on the historical access records and the acquired real-time access conditions, predict the access demand of the to-be-accessed data in a future period of time, and generate an access demand prediction model; Calculate the value score of the data to be accessed according to the prediction result of the access demand prediction model, wherein factors such as high access frequency, short access interval, and long duration can increase the value score of the data to be accessed; sorting all the data to be accessed according to the value scores, treating the data to be accessed whose value scores are higher than a set threshold as high-value data to be accessed, and retaining the high-value data to be accessed; The accessed data with a value score lower than the set threshold is regarded as low-value accessed data, and the low-value accessed data is selectively migrated to a low-level cache or storage device through an intelligent algorithm to release high-level cache or storage devices.
4. The method according to claim 3, characterized in that: The cache strategy is continuously optimized based on historical access records and real-time access conditions to ensure efficient use of cache resources while reducing access delays to the backend storage system, including: Combining the historical access records with the real-time access situation, evaluating the effect of the current cache strategy to obtain an evaluation result; According to the evaluation results, a cache strategy optimization model is established, and the cache strategy optimization model can automatically generate optimization suggestions based on different application scenarios and business requirements; According to the optimization suggestion of the optimized cache strategy optimization model, the cache strategy parameters are dynamically adjusted to generate an adjusted cache strategy; Deploy the adjusted cache policy in the actual environment and verify the effect of the adjusted cache policy to ensure efficient use of cache resources while reducing access latency to the backend storage system.
5. The method according to claim 3, characterized in that: The calculating the value score of the to-be-accessed data includes: Calculate the value scoring formula V of the data to be accessed i : Among them, V i represents the value score of the i-th data to be accessed; F i is the access frequency of the i-th data to be accessed; θ is the exponential adjustment parameter of the access frequency; Indicates a sinusoidal function, which is used to introduce nonlinear changes; represents the exponential decay function of the access interval of the data to be accessed; I i is the access interval of the i-th data to be accessed; λ is the attenuation coefficient of the access interval; D i is the access duration of the i-th data to be accessed; Indicates limiting the impact of long-term visits to avoid excessive impact of extreme values on the score; μ is the adjustment parameter of the visit duration; S i is the security level score of the i-th data to be accessed, which is set according to the data sensitivity and access rights; Q i is the user feedback quality score of the i-th data to be accessed, which indirectly reflects the quality of the data by collecting users' evaluation of the data to be accessed; α, β, γ, δ, η are the weight coefficients of each factor, which can be dynamically adjusted through machine learning algorithms to adapt to different application scenarios; F max It is the maximum access frequency among all the data to be accessed and is used to normalize the access frequency. Introducing the time decay factor, we get the adjusted value score, which is defined as: V i (t)=V i ·e -ρt Among them, V i (t) The adjusted value score of the i-th data to be accessed, V i represents the value score of the i-th data to be accessed, t represents the time interval from the last access to now, and ρ is the time decay coefficient, which is used to simulate the phenomenon that data gradually loses its value over time.
6. The method according to claim 4, characterized in that The establishing of the cache strategy optimization model includes: Define the optimization goal O for overall cache performance: Where O is the optimization target of the overall cache performance; N is the total number of data to be accessed in the cache; P i represents the probability that the i-th accessed data is correctly predicted; V i (t) represents the value score of the i-th data to be accessed, taking into account time decay; is a nonlinear function used to adjust the impact of prediction probability on the score; k represents the parameter for adjusting the speed of the impact of prediction probability on the score; P0 represents the threshold of prediction probability; C represents the cost of maintaining the cache system per unit time; L represents the average delay of loading or migrating data in the cache system; ζ represents the weight coefficient of the system health index; H represents the system health index; E is the energy consumption index, which is quantified by calculating the energy consumed by the cache operation per unit time; ω is the weight coefficient of the energy consumption index, which reflects the importance of energy conservation and emission reduction in cache strategy optimization.
7. A cache management optimization system, characterized in that: include: A receiving module, configured to receive a cache access request initiated by an application, wherein the cache access request includes identification information of data to be accessed; An adjustment module, used to evaluate the access popularity of the data to be accessed based on the identification information, and dynamically adjust the position of the data in the cache hierarchy structure in combination with the current cache state and a preset cache strategy; A detection migration module is used to predict the access demand in the future based on the access pattern of the data to be accessed when insufficient cache space is detected, give priority to retaining high-value data to be accessed, and selectively migrate low-value data to be accessed to a low-level cache or storage device through an intelligent algorithm; The optimization module is used to continuously optimize the cache strategy based on historical access records and real-time access conditions, ensuring efficient use of cache resources while reducing access delays to the backend storage system.
8. A computing device, characterized in that It comprises a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement a cache management optimization method as described in any one of claims 1 to 6.
9. A computer storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a computer, a cache management optimization method according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
CAD drawing loading method and system combined with cache optimization
CN120315779A
A CAD drawing loading method and system combined with cache optimization
CN120315779B
Memory prefetching control method and device, storage medium and program product
CN120541004A
Data storage method and device, equipment, storage medium and program product
CN120704599A
Data optimization storage method and system based on artificial intelligence
CN120723735A