A method and system for dynamic management and eviction of microservice manuscript cache
By collecting multi-dimensional business metrics and memory usage in real time to calculate the popularity level of articles and dynamically adjusting the elimination strategy, the problems of resource waste and accidental deletion of hot data in cache management are solved, and intelligent cache management and system response speed are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 山东齐鲁壹点传媒有限公司
- Filing Date
- 2026-03-11
- Publication Date
- 2026-06-30
AI Technical Summary
Existing caching management methods cannot dynamically adjust based on the popularity and access frequency of articles, resulting in cold data occupying memory for a long time, causing resource waste, and potentially leading to the accidental deletion of hot data.
By collecting multi-dimensional business metrics in real time, the popularity score and popularity level of articles are calculated. Combined with memory usage, the article elimination time is dynamically adjusted. A two-dimensional cache management rule is adopted, and the strategy is monitored and adjusted in real time to optimize cached data.
It enables intelligent caching management based on the overall situation of the manuscript, reducing resource waste, ensuring timely retention of hot data, and improving system response speed.
Smart Images

Figure CN122309868A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer software and data storage technology, specifically relating to a method and system for dynamic management and eviction of microservice manuscript cache. Background Technology
[0002] In the microservice architecture of internet content platforms (such as news and social media), article (news) services are typically stored in relational databases such as MySQL for persistent storage, and high-performance in-memory databases such as Redis are introduced as a caching layer to handle high-concurrency read requests, helping to improve system response speed. In the early stages of article publication, access is usually frequent, and caching benefits are significant. However, internet content is highly time-sensitive; over time, the popularity of most articles rapidly declines, access frequency drops sharply, and they become "cold data," while data with higher popularity becomes "hot data."
[0003] If cold data is not cleaned up for a long time, it will affect memory capacity and consequently the storage of other data. Therefore, it is necessary to clean up cold data according to the actual situation. Currently, common cache management methods in the industry are mainly based on the following strategies: 1. Set a uniform eviction time for all cached data; after the set time, the cache automatically expires. 2. Rely on Redis's own eviction algorithms such as LRU (Least Recently Used), LFU (Least Frequently Used), or Random (random). When the Redis instance's memory usage reaches the configured limit (maxmemory), the eviction mechanism is triggered, removing some keys to free up space. 3. Simple cleanup combined with business logic: Use scheduled tasks (such as CronJob) to scan and delete cached keys that have not been accessed for more than a certain period of time (such as 30 days) during off-peak business periods (such as early morning).
[0004] However, the aforementioned caching management methods have the following drawbacks: Relying on a uniform eviction time cannot differentiate the popularity of cached data, potentially leading to situations where "cold" and "hot" data remain in the cache for the same amount of time. This results in Redis memory being occupied by a large amount of invalid data for extended periods, causing resource waste. Furthermore, Redis's built-in LRU / LFU eviction policies and timed deletion are general, passive management methods that do not incorporate data read volume, publication time, etc., potentially leading to the accidental deletion of high-value but recently inaccessible hot data, making the management approach rather rigid. Therefore, to achieve intelligent and dynamic management, a method is needed that can manage and evict data based on its overall business popularity. This invention addresses this technical problem. Summary of the Invention
[0005] This invention provides a method and system for dynamic management and eviction of microservice manuscript cache, which can manage and evict cached data based on the overall data situation, thereby achieving intelligent management of cached data.
[0006] A method for dynamic management and eviction of microservice manuscript cache, applied to a server, includes the following steps:
[0007] The system collects multi-dimensional business metrics of articles in real time, including readership, comment count, likes, and shares. It calculates the weighted score of the articles, calculates the decay factor based on the time decay coefficient and the time difference of the articles' publication, and calculates the popularity score of the articles based on the weighted score and the decay factor to obtain the popularity level of the articles.
[0008] The memory usage of the data acquisition server is used to calculate the trend of the popularity of the manuscript over time.
[0009] Based on a preset elimination strategy, manuscript data is eliminated according to the manuscript's popularity level, popularity trend, and memory usage. A strategy instruction containing the elimination time is obtained, and the eliminated manuscript data is deleted according to the elimination time.
[0010] Monitor various metrics of manuscripts and cached resources, and issue alerts based on monitoring results and thresholds;
[0011] Adjust the elimination strategy based on the alarm situation.
[0012] Furthermore, the method for calculating the popularity score of an article to obtain its popularity level is as follows:
[0013] The multi-dimensional business indicators collected in real time are normalized; the weighted total score W of the multi-dimensional business indicators is calculated according to the preset weights; the time difference t between the current time and the manuscript publication time is calculated, and the time decay factor D(t) is calculated in combination with the manuscript type.
[0014] Where e is a mathematical constant and λ is the time decay coefficient. Weight values corresponding to different manuscript types;
[0015] The weighted total score W and the time decay factor D(t) are calculated to obtain the final popularity score of the manuscript. Based on the preset popularity threshold and the final popularity score, the popularity level corresponding to the manuscript is obtained.
[0016] Furthermore, the calculation method for the trend of popularity of the manuscript over time is as follows:
[0017] The system sets a preset time window, calculates the final popularity score difference and time difference within the corresponding time period, and uses this to calculate the slope of the current article's popularity score change. Based on the preset slope threshold, it judges the current article's popularity change trend.
[0018] For articles whose popularity is rapidly declining, add a pre-downgrade tag; for articles whose popularity is rapidly rising, add a pre-upgrade tag.
[0019] Furthermore, the method for eliminating manuscript data based on the manuscript's popularity level, popularity trend, and memory usage is as follows:
[0020] Real-time collection of memory usage rate, classifying memory status according to preset thresholds for different memory usage rates; and real-time reception of article popularity level, popularity trend, and tagging data;
[0021] Predefined two-dimensional cache management rules include business popularity and memory status. Different retention levels are set for different ranges of popularity level and memory status, and different retention levels correspond to different expiration times. Based on the current popularity level and memory status of the manuscript, the corresponding retention level is matched and the corresponding expiration time is refreshed.
[0022] For manuscripts with a pre-degradation flag, if the memory status exceeds the threshold, the manuscript's retention level will be reduced by one level from its original level; for manuscripts with a pre-upgrade flag, the retention level will be increased by one level from its original level.
[0023] Furthermore, the method for refreshing the corresponding elimination time is as follows:
[0024] Refer to the elimination time value in the policy instructions to set the elimination time for the cached manuscript data; periodically re-evaluate the popularity level of all cached manuscripts, and refresh the elimination time of the corresponding manuscripts after the evaluation;
[0025] Calculate the similarity between the manuscript and trending events. When the similarity exceeds a threshold, reset the manuscript's elimination time and write the manuscript data into memory.
[0026] Furthermore, the method for iteratively optimizing the parameters of the heat model based on monitoring data is as follows:
[0027] Set an alarm threshold for memory usage. Once the memory usage reaches the alarm threshold, delete the manuscripts with the lowest retention level and monitor memory usage in real time.
[0028] Memory usage is analyzed in real time. If memory usage is still high after eliminating manuscripts of the corresponding level, the alarm threshold is lowered; otherwise, the alarm threshold is raised.
[0029] The system analyzes the correlation between popularity level and elimination time in real time. If a manuscript of a certain popularity level maintains high popularity for a long time, the corresponding elimination time will be extended; otherwise, the elimination time will be shortened.
[0030] Furthermore, the business scenario for publishing new articles is pre-defined: collect the type of articles and the memory usage of the server, calculate the initial popularity score based on the article type, and determine the initial popularity level of the article.
[0031] The system presets the initial elimination time for different popularity levels. Based on the current initial popularity level of the article and the current memory usage, the article data is written to the cache, and the corresponding initial elimination time is configured for it.
[0032] Furthermore, a business scenario for updating existing manuscripts is pre-defined: existing manuscripts are processed based on their update status;
[0033] When the content of an article is significantly increased or deleted, the publication time of the article is reset, the revised time is used as the publication time, and the initial popularity level is recalculated.
[0034] If the content of the article is modified only slightly and the keywords remain unchanged, the original popularity level will be retained.
[0035] Furthermore, when the popularity level of a manuscript remains constant, the higher the memory usage rate, the lower the retention level and the shorter the elimination time; when the memory usage rate remains constant, the higher the popularity level of a manuscript, the higher the retention level and the longer the elimination time.
[0036] A system for dynamic management and eviction of microservice manuscript caches, based on the aforementioned method for dynamic management and eviction of microservice manuscript caches, includes:
[0037] Popularity Calculation and Scoring Module: Used to calculate the popularity score of an article and determine its popularity level;
[0038] Dynamic strategy decision module: Predefines cache management strategies corresponding to different popularity levels, thereby generating specific cache operation instructions;
[0039] Cache lifecycle execution module: Used to interact with the cache layer and clean up cached data;
[0040] Monitoring and alarm module: Used to monitor data in various dimensions, issue alarms when data anomalies occur, and allow staff to manually adjust parameters.
[0041] The technical effects of this invention are as follows:
[0042] This solution can determine the retention level of articles based on their popularity and memory usage in real time. Different retention levels correspond to different expiration times. Once the expiration time is reached, the corresponding article data is deleted. The system can also dynamically adjust the retention level and expiration time of articles based on current trending events and monitor memory usage. This allows for the management and eviction of cached data based on a comprehensive assessment of the article data, facilitating effective cache data management. Attached Figure Description
[0043] Figure 1 This is a flowchart of the process of the present invention. Detailed Implementation
[0044] The technical solution of the present invention will be clearly and completely described below with reference to specific embodiments and accompanying drawings.
[0045] See Figure 1 A method for dynamic management and eviction of microservice manuscript cache, applied to a server, includes the following steps:
[0046] The system collects multi-dimensional business metrics of articles in real time, including views, comments, likes, and shares. It calculates the weighted score of the articles, calculates the decay factor based on the time decay coefficient and the time difference of the articles' publication, and calculates the popularity score of the articles based on the weighted score and the decay factor to obtain the popularity level of the articles.
[0047] The memory usage of the data acquisition server is used to calculate the trend of the popularity of the manuscript over time.
[0048] Based on a preset elimination strategy, manuscript data is eliminated according to the manuscript's popularity level, popularity trend, and memory usage. A strategy instruction containing the elimination time is obtained, and the eliminated manuscript data is deleted according to the elimination time.
[0049] Monitor various metrics of manuscripts and cached resources, and issue alerts based on monitoring results and thresholds;
[0050] Adjust the elimination strategy based on the alarm situation.
[0051] Furthermore, the popularity score of the manuscript is calculated to obtain its popularity level, as follows:
[0052] The multi-dimensional business indicators collected in real time are normalized; the weighted total score W of the multi-dimensional business indicators is calculated according to the preset weights; the time difference t between the current time and the article publication time is calculated, and the time decay factor D(t) is calculated in combination with the article type.
[0053] Where e is a mathematical constant and λ is the time decay coefficient. The weight values corresponding to different article types are set (for example, the weight value of breaking news is set to 0.8, and the weight value of entertainment news is set to 0.2).
[0054] The weighted total score W and the time decay factor D(t) are calculated to obtain the final popularity score of the manuscript. Based on the preset popularity threshold and the final popularity score, the corresponding popularity level of the manuscript is obtained.
[0055] In this embodiment, the weight of readership is 0.4, the weight of comments is 0.3, the weight of shares is 0.2, and the weight of readership is 0.1. The weighted total score W is multiplied by the time decay factor D(t) to obtain the final popularity score. For the final popularity score, three thresholds can be set to divide it into four popularity levels, ranked from highest to lowest popularity level and from longest to shortest elimination time: HOT (peak period), WARM (stable period), COLD (decay period), and EXPIRED (decay period).
[0056] Furthermore, the method for calculating the trend of manuscript popularity over time is as follows:
[0057] The system sets a preset time window, calculates the final popularity score difference and time difference within the corresponding time period, and uses this to calculate the slope of the current article's popularity score change. Based on the preset slope threshold, it judges the current article's popularity change trend.
[0058] For articles whose popularity is rapidly declining, add a pre-downgrade tag; for articles whose popularity is rapidly rising, add a pre-upgrade tag.
[0059] In this embodiment, a one-hour time window is used to calculate the slope K of the change in popularity score within that time period. K = (Score2 − Score1) / (t2 − t1), where Score2 is the current final popularity score, t2 is the current time, Score1 is the final popularity score one hour ago, and t1 is the time one hour ago. If the value of K is less than or equal to a set threshold one (0.05 in this embodiment), the popularity is determined to be rapidly decreasing; if it is greater than or equal to a set threshold two (0.1 in this embodiment), the popularity is determined to be rapidly increasing. When memory usage is tight, the retention level of manuscript data can be dynamically adjusted based on the pre-downgrade or pre-upgrade flags of the manuscripts.
[0060] Furthermore, the methods for eliminating manuscripts based on their popularity level, popularity trend, and memory usage are as follows:
[0061] Real-time collection of memory usage rate, classifying memory status according to preset thresholds for different memory usage rates; and real-time reception of article popularity level, popularity trend, and tagging data;
[0062] Predefined two-dimensional cache management rules include business popularity and memory status. Different retention levels are set for different ranges of popularity level and memory status, and different retention levels correspond to different eviction times. Based on the current popularity level and memory status of the manuscript, the corresponding retention level is matched and the corresponding eviction time (TTL) is refreshed.
[0063] For manuscripts with a pre-degradation flag, if the memory status exceeds the threshold, the manuscript's retention level will be reduced by one level from its original level; for manuscripts with a pre-upgrade flag, the retention level will be increased by one level from its original level.
[0064] In this embodiment, when memory usage is <70%, the memory status is normal; 70% ≤ memory usage < 80%, the memory status is warning; 80% ≤ memory usage < 90%, the memory status is alert; and memory usage ≥ 90%, the memory status is limit. If the memory status is warning, alert, or limit, based on the original retention level, manuscripts pre-downgraded and pre-upgraded are upgraded or downgraded accordingly to proactively remove (eliminate) manuscripts with low popularity or declining popularity trends, thereby reducing memory usage.
[0065] Furthermore, the corresponding elimination time is refreshed in the following way:
[0066] Refer to the elimination time value in the policy instructions to set the elimination time for the cached manuscript data; periodically re-evaluate the popularity level of all cached manuscripts, and refresh the elimination time of the corresponding manuscripts after the evaluation;
[0067] Calculate the similarity between the manuscript and trending events. When the similarity exceeds a threshold, reset the manuscript's elimination time and write the manuscript data into memory.
[0068] In this embodiment, when the similarity between the article and the hot topic exceeds the threshold, the popularity level is recorded as HOT level, which is the highest popularity level.
[0069] Furthermore, the parameters of the heat model are iteratively optimized based on monitoring data as follows:
[0070] Set an alarm threshold for memory usage. Once the memory usage reaches the alarm threshold, delete the manuscripts with the lowest retention level and monitor memory usage in real time.
[0071] Memory usage is analyzed in real time. If memory usage is still high after eliminating manuscripts of the corresponding level, the alarm threshold is lowered; otherwise, the alarm threshold is raised.
[0072] The system analyzes the correlation between popularity level and elimination time in real time. If a manuscript of a certain popularity level maintains high popularity for a long time, the corresponding elimination time will be extended; otherwise, the elimination time will be shortened.
[0073] Furthermore, the business scenario for publishing new articles is pre-defined: collect the type of articles and the memory usage of the server, calculate the initial popularity score based on the article type, and determine the initial popularity level of the article.
[0074] The system presets the initial elimination time for different popularity levels. Based on the current initial popularity level of the article and the current memory usage, the article data is written to the cache, and the corresponding initial elimination time is configured for it.
[0075] In this embodiment, the initial popularity score is calculated in the same way as the time decay factor, but the time difference t is 0, indicating that the article has just been published. After determining the initial popularity level, the system will also collect multi-dimensional business indicators of the article in real time, normalize the above multi-dimensional business indicators, and then calculate the popularity score of the article periodically or in real time to obtain the real-time popularity level. Then, the corresponding retention level and elimination time are obtained based on this.
[0076] Furthermore, a business scenario for updating existing manuscripts is pre-defined: existing manuscripts are processed based on their update status;
[0077] When the content of an article is significantly increased or deleted, the publication time of the article is reset, the revised time is used as the publication time, and the initial popularity level is recalculated.
[0078] If the content of the article is modified only slightly and the keywords remain unchanged, the original popularity level will be retained.
[0079] The criteria for major and minor revisions can be defined by staff. For example, a major revision is defined as a text content that has been revised by 10% or more (e.g., 50 words out of 500 words is 10%), while a minor revision is defined as less than 10%.
[0080] Furthermore, when the popularity level of a manuscript remains constant, the higher the memory usage rate, the lower the retention level and the shorter the elimination time; when the memory usage rate remains constant, the higher the popularity level of a manuscript, the higher the retention level and the longer the elimination time.
[0081] For example, when the memory status is normal, the elimination time for HOT-level manuscript data is 170 hours, and when the memory status is warning, the elimination time for HOT-level manuscript data is 150 hours.
[0082] Furthermore, the analysis method for manuscript types is as follows:
[0083] Establish keyword databases that include different types of articles; for breaking news, entertainment news, etc., establish different keyword databases for different types of articles. For example, keywords for breaking news include breaking news, quick news, etc.
[0084] Extracting keywords from the manuscript text; specifically, performing natural language processing on the text to extract keywords and other features;
[0085] Based on the classified historical manuscript data, a classification model is trained, which is used to output the similarity score between the manuscript and multiple types of manuscripts;
[0086] The type of manuscript with the highest similarity score is selected as the type of the current manuscript.
[0087] Furthermore, the similarity between the article and the trending event is calculated as follows:
[0088] Real-time collection of trending events and identification of the collected content; calculation of the similarity between multiple trending events; and grouping trending events with high similarity into the same category.
[0089] The text content of trending events is processed to extract keywords from the trending events, and the similarity between the keywords of the trending events and the keywords of the article text is calculated.
[0090] Preferably, in this embodiment, indicators of various dimensions such as manuscripts and cached resources can be monitored, and intelligent alarms and alarm information feedback can be given based on the monitoring results. When data anomalies occur, such as low memory usage or a large number of discarded manuscripts, an alarm is issued and the reason for the alarm is displayed.
[0091] Preferably, a manual intervention interface with tiered permissions can be set up for staff to perform emergency operations; multiple permission levels can be set up according to permissions, with different operation interfaces corresponding to different positions, for viewing and modifying some parameters of the system, such as elimination time, threshold, etc.
[0092] A system for dynamic management and eviction of microservice manuscript caches, based on the aforementioned method for dynamic management and eviction of microservice manuscript caches, includes:
[0093] Popularity Calculation and Scoring Module: Used to calculate the popularity score of an article and determine its popularity level. After an article is published, the Popularity Calculation and Scoring Module collects and calculates the initial basic indicators of the article, and then collects and calculates the multi-dimensional business indicators of the article in real time to update (refresh) the popularity level of the article.
[0094] Dynamic strategy decision module: Predefines cache management strategies corresponding to different popularity levels, thereby generating specific cache operation instructions; combines the popularity level, popularity trend, and memory usage of the article to set corresponding elimination time for the article, so as to prioritize the retention of data with higher popularity when resources are scarce;
[0095] Cache lifecycle execution module: used to interact with the cache layer and clean up cached data; used to set the initial expiration time and refresh the expiration time thereafter, and automatically clear the corresponding manuscript data after the expiration time is reached; the cache layer in this embodiment is Redis.
[0096] Monitoring and alarm module: Used to monitor data in various dimensions, issue alarms when data anomalies occur, and allow staff to manually adjust parameters.
[0097] The workflow of this embodiment is as follows:
[0098] When an article is published, or after significant revisions, it is considered a new article. An initial popularity score is calculated to determine its initial popularity level. Based on this initial popularity level and current memory usage, the system allocates a corresponding eviction period for the article's cached data. During this eviction period, the system periodically or in real-time collects data on the article's views, comments, likes, shares, and the time difference between the current time and the article's publication time. This comprehensive calculation determines the article's current popularity score and its current popularity level. If the current popularity level differs from the initial popularity level, the current level takes precedence. Combined with the current memory usage, the system determines the article's current retention level and corresponding eviction period, thus refreshing the eviction time. This helps improve system response speed when users access highly popular articles.
[0099] In the subsequent process, the system will still periodically or in real time recalculate and evaluate the popularity of each manuscript's cached data to determine whether the popularity level has changed. If it has changed, the corresponding time-to-live (TTL) will be updated.
[0100] If memory usage changes from normal to strained, exceeding the set safety threshold, the retention level and eviction time of cached manuscript data are adjusted according to the preset memory state under strain, triggering an emergency eviction process. For example, normally, the eviction time for a particular cached manuscript is one hour; if memory usage is strained, this will be temporarily adjusted to immediate deletion. Manuscripts pre-marked as downgraded or upgraded will also undergo corresponding upgrade or downgrade processing to proactively delete low-intensity cached manuscript data, helping to quickly restore memory usage to normal.
[0101] When the similarity between an article and a trending event exceeds a threshold, the popularity level is recorded as the highest popularity level. This helps to prioritize the retention of cached data for highly popular articles, making it easier for users to access them.
[0102] The above are merely exemplary embodiments of the present invention and do not limit the scope of the patent of the present invention. All equivalent structural transformations made using the contents of the present invention specification and drawings under the technical concept of the present invention, or direct / indirect applications in other related technical fields, are included within the scope of patent protection of the present invention.
Claims
1. A method for dynamic management and eviction of microservice manuscript cache, applied to a server, characterized in that, Includes the following steps: The system collects multi-dimensional business metrics of articles in real time, including readership, comment count, likes, and shares. It calculates the weighted score of the articles, calculates the decay factor based on the time decay coefficient and the time difference of the articles' publication, and calculates the popularity score of the articles based on the weighted score and the decay factor to obtain the popularity level of the articles. The memory usage of the data acquisition server is used to calculate the trend of the popularity of the manuscript over time. Based on a preset elimination strategy, manuscript data is eliminated according to the manuscript's popularity level, popularity trend, and memory usage. A strategy instruction containing the elimination time is obtained, and the eliminated manuscript data is deleted according to the elimination time. Monitor various metrics of manuscripts and cached resources, and issue alerts based on monitoring results and thresholds; Adjust the elimination strategy based on the alarm situation.
2. The method for dynamic management and eviction of microservice manuscript cache according to claim 1, characterized in that, The method for calculating the popularity score of an article and obtaining its popularity level is as follows: The multi-dimensional business indicators collected in real time are normalized; the weighted total score W of the multi-dimensional business indicators is calculated according to the preset weights; the time difference t between the current time and the manuscript publication time is calculated, and the time decay factor D(t) is calculated in combination with the manuscript type. Where e is a mathematical constant and λ is the time decay coefficient. Weight values corresponding to different manuscript types; The weighted total score W and the time decay factor D(t) are calculated to obtain the final popularity score of the manuscript. Based on the preset popularity threshold and the final popularity score, the popularity level corresponding to the manuscript is obtained.
3. The method for dynamic management and eviction of microservice manuscript cache according to claim 2, characterized in that, The method for calculating the trend of popularity of a manuscript over time is as follows: The system sets a preset time window, calculates the final popularity score difference and time difference within the corresponding time period, and uses this to calculate the slope of the current article's popularity score change. Based on the preset slope threshold, it judges the current article's popularity change trend. For articles whose popularity is rapidly declining, add a pre-downgrade tag; for articles whose popularity is rapidly rising, add a pre-upgrade tag.
4. The method for dynamic management and eviction of microservice manuscript cache according to claim 3, characterized in that, The method for eliminating manuscripts based on their popularity level, popularity trend, and memory usage is as follows: Real-time collection of memory usage rate, classifying memory status according to preset thresholds for different memory usage rates; and real-time reception of article popularity level, popularity trend, and tagging data; Predefined two-dimensional cache management rules include business popularity and memory status. Different retention levels are set for different ranges of popularity level and memory status, and different retention levels correspond to different expiration times. Based on the current popularity level and memory status of the manuscript, the corresponding retention level is matched and the corresponding expiration time is refreshed. For manuscripts with a pre-degradation flag, if the memory status exceeds the threshold, the manuscript's retention level will be reduced by one level from its original level; for manuscripts with a pre-upgrade flag, the retention level will be increased by one level from its original level.
5. The method for dynamic management and eviction of microservice manuscript cache according to claim 4, characterized in that, The method for refreshing the corresponding elimination time is as follows: Refer to the elimination time value in the policy instructions to set the elimination time for the cached manuscript data; periodically re-evaluate the popularity level of all cached manuscripts, and refresh the elimination time of the corresponding manuscripts after the evaluation; Calculate the similarity between the manuscript and trending events. When the similarity exceeds a threshold, reset the manuscript's elimination time and write the manuscript data into memory.
6. The method for dynamic management and eviction of microservice manuscript cache according to claim 5, characterized in that, The method for adjusting the elimination strategy based on alarm status is as follows: Set an alarm threshold for memory usage. Once the memory usage reaches the alarm threshold, delete the manuscripts with the lowest retention level and monitor memory usage in real time. Memory usage is analyzed in real time. If memory usage is still high after discarding manuscripts of the corresponding level, the alarm threshold is lowered; otherwise, the alarm threshold is raised. The system analyzes the correlation between popularity level and elimination time in real time. If a manuscript of a certain popularity level maintains high popularity for a long time, the corresponding elimination time will be extended; otherwise, the elimination time will be shortened.
7. The method for dynamic management and eviction of microservice manuscript cache according to claim 1, characterized in that, The pre-defined business scenario for publishing new articles is as follows: collect the type of articles and the memory usage of the server, calculate the initial popularity score based on the article type, and determine the initial popularity level of the article. The system presets the initial elimination time for different popularity levels. Based on the current initial popularity level of the article and the current memory usage, the article data is written to the cache, and the corresponding initial elimination time is configured for it.
8. The method for dynamic management and eviction of microservice manuscript cache according to claim 7, characterized in that, Pre-defined business scenario for updating existing manuscripts: Process existing manuscripts based on their update status; When the content of an article is significantly increased or deleted, the publication time of the article is reset, the revised time is used as the publication time, and the initial popularity level is recalculated. If the content of the article is modified only slightly and the keywords remain unchanged, the original popularity level will be retained.
9. The method for dynamic management and eviction of microservice manuscript cache according to claim 5, characterized in that, When the popularity level of an article remains constant, the higher the memory usage rate, the lower the retention level and the shorter the elimination time; when the memory usage rate remains constant, the higher the popularity level of an article, the higher the retention level and the longer the elimination time.
10. A system for dynamic management and eviction of microservice manuscript cache, based on the method for dynamic management and eviction of microservice manuscript cache as described in claims 1-9, characterized in that, include: Popularity Calculation and Scoring Module: Used to calculate the popularity score of an article and determine its popularity level; Dynamic strategy decision module: Predefines cache management strategies corresponding to different popularity levels, thereby generating specific cache operation instructions; Cache lifecycle execution module: Used to interact with the cache layer and clean up cached data; Monitoring and alarm module: Used to monitor data in various dimensions, issue alarms when data anomalies occur, and allow staff to manually adjust parameters.