Cache pool load optimization method and device, electronic equipment and storage medium

By monitoring and dynamically adjusting the retention time of rollback segment pages, the cache pool overload problem was resolved, improving the stability and performance of the database.

CN120849389BActive Publication Date: 2025-11-21SHENZHEN INST OF COMPUTING SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511377941.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-25
Publication Date
2025-11-21
Estimated Expiration
2045-09-25

AI Technical Summary

Technical Problem

In high-load business scenarios, the excessive retention time of database rollback segment pages leads to an excessive proportion of cache pool resources, causing the cache pool to frequently evict data pages, thus affecting business performance.

Method used

By monitoring the proportion and eviction information of rollback segment pages in the cache pool, the retention time of rollback segment pages can be dynamically adjusted to reduce new page requests, improve the reuse rate of rollback segment pages, and avoid overloading the cache pool.

Benefits of technology

This effectively avoids cache pool anomalies, improves cache pool stability and business performance, and ensures smooth business operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120849389B_ABST
    Figure CN120849389B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of databases, and in particular provides a cache pool load optimization method and device, electronic equipment and a computer readable storage medium. Storage information of space occupied by a rollback segment page in a cache pool changing with time and page elimination information of the rollback segment page in the cache pool are acquired, a retention time adjustment mode of the rollback segment page is determined according to the storage information, the current retention time is adjusted according to the adjustment mode and the page elimination information, an adjusted retention time is obtained, the rollback segment page is processed according to the adjusted retention time, and load optimization of the cache pool is realized. Through adjustment of the retention time of the rollback segment page, the overloading condition caused by the rollback segment page in the cache pool is controlled, so that working abnormities of the cache pool are avoided, and the stability of the cache pool is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of database, and particularly relate to a cache pool load optimization method and device, electronic equipment and storage medium. BACKGROUND

[0002] The rollback segment page retention time in the database determines the retention of the data history version of the committed transaction in the past period of time. In a high-load business scenario (such as a TPCC scenario), the demand of the database for the rollback segment page resources increases rapidly. If the rollback segment page retention time of the database is configured to be too large, the rollback segment pages retained are the pages used by the recent committed transactions, and most of them are hot pages of the database cache. Since the system cannot reuse these large amount of data rollback segment hot pages, new rollback segment pages are constantly applied for from the rollback segment table space. The application of the new rollback segment pages needs to be read from the disk to the cache pool. The reading time is much higher than the reuse of the hot rollback segment pages in the cache pool, and causes the proportion of the rollback segment pages in the cache pool to be too large. The cache pool is constantly evicted, a large number of data pages are also evicted, and finally the cache pool is broken through. The database business performance is constantly fluctuated, and the smooth operation of the business is affected.

[0003] Therefore, how to optimize the load optimization processing of the rollback segment pages in the cache pool to improve the cache pool performance becomes a problem to be solved. SUMMARY

[0004] Embodiments of the present application provide a cache pool load optimization method and device, electronic equipment and storage medium, which aims to solve the problem of how to optimize the load optimization processing of the rollback segment pages in the cache pool to improve the cache pool performance.

[0005] In a first aspect, a cache pool load optimization method is provided, comprising:

[0006] obtaining storage information of the space occupied by the rollback segment pages in the cache pool changing with time, and page eviction information of the rollback segment pages in the cache pool;

[0007] determining an adjustment mode of the retention time of the rollback segment pages according to the storage information, adjusting the current retention time according to the adjustment mode and the page eviction information, and obtaining an adjusted retention time;

[0008] processing the rollback segment pages according to the adjusted retention time, so as to realize the load optimization of the cache pool.

[0009] In a second aspect, a cache pool load optimization device is provided, comprising:

[0010] an information obtaining module, configured to obtain storage information of a change of a space occupied by a rollback segment page in the cache pool over time and page eviction information of the rollback segment page in the cache pool;

[0011] a time adjusting module, configured to determine an adjusting mode of a retention time of the rollback segment page according to the storage information, adjust the current retention time according to the adjusting mode and the page eviction information, and obtain an adjusted retention time;

[0012] a load optimizing module, configured to process the rollback segment page according to the adjusted retention time, so as to optimize the load of the cache pool.

[0013] In a third aspect, an electronic device is provided, including a processor and a memory, wherein,

[0014] the memory is configured to store a computer program;

[0015] the processor is configured to execute the program stored in the memory, and implement the cache pool load optimizing method in the first aspect.

[0016] In a fourth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the cache pool load optimizing method in the first aspect.

[0017] Compared with the prior art, the present application has the following beneficial effects: the present application obtains the storage information of the change of the space occupied by the rollback segment page in the cache pool over time and the page eviction information of the rollback segment page in the cache pool, determines the adjusting mode of the retention time of the rollback segment page according to the storage information, adjusts the current retention time according to the adjusting mode and the page eviction information, obtains the adjusted retention time, and processes the rollback segment page according to the adjusted retention time, so as to optimize the load of the cache pool. By adjusting the retention time of the rollback segment page, the overloading condition caused by the rollback segment page in the cache pool is controlled, so that the working exception of the cache pool is avoided, and the stability of the cache pool is improved. BRIEF DESCRIPTION OF DRAWINGS

[0018] Figure 1 is a flowchart of the cache pool load optimizing method provided by the first embodiment of the present application;

[0019] Figure 2 is a flowchart of the cache pool load optimizing method provided by the second embodiment of the present application;

[0020] Figure 3 is a flowchart of the cache pool load optimizing method provided by the third embodiment of the present application;

[0021] Figure 4 is a structural schematic diagram of the cache pool load optimization device provided in Embodiment Four of the present application;

[0022] Figure 5 is a structural diagram of an electronic device provided in Embodiment Five of the present application. DETAILED DESCRIPTION

[0023] In order to make the technical problems, technical solutions and beneficial effects solved by the present application clearer, the present application will be further described in detail below in combination with embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.

[0024] The rollback segment pages and the data pages in the database are usually shared in the cache pool. When the retention time of the rollback segment is too long, the rollback segment pages used by the committed transactions in a long period of time cannot be reused, the system cannot reuse the hot pages and instead applies new rollback segment pages to the cache pool, the elimination rate of the rollback segment pages is increased, the proportion of the rollback segment pages in the cache pool is also increased, the cache pool resources of the data pages are reduced, and the business performance is decreased.

[0025] The present application periodically monitors the proportion of the rollback segment pages in the cache pool and the number of the eliminated rollback segment pages per unit time, dynamically adjusts the retention time of the rollback segment, and ensures the stable operation of the business. If the retention time of the rollback segment is too long under the sudden business pressure, the system keeps applying new rollback segment pages, the proportion of the rollback segment pages in the cache pool will rapidly increase, and the elimination rate of the rollback segment pages is increased, so the retention time of the rollback segment needs to be reduced. When the proportion of the rollback segment pages is rapidly decreased, the elimination rate of the rollback segment pages is decreased, and the retention time of the rollback segment is less than the configured value, the retention time of the rollback segment can be appropriately increased. That is, in the scenario of large business pressure, the retention time of the rollback segment is real-time reduced through the change of the proportion of the rollback segment pages in the cache pool, so that the system can reuse the hot pages of the rollback segment as much as possible, less new pages are applied to increase the pressure of the cache pool, and the business performance is ensured not to be sharply fluctuated due to the frequent elimination and replacement of the cache pool.

[0026] Undo rollback (i.e., undo rollback) is a mechanism in a database management system (DBMS) that is used to undo operations in a database. Its main functions include:

[0027] ‌Rollback operation‌: When a transaction fails or a user needs to undo some operations, the data can be restored to the state before the transaction execution through the information in the Undo log;

[0028] ‌Implement read consistency: In Multi-Version Concurrency Control (MVCC), Undo logs are used to provide old versions of data, ensuring that read operations can see consistent data states;

[0029] ‌System recovery: After a system failure or unexpected downtime, Undo logs can be used to restore data to a state before the failure, ensuring data integrity and consistency.

[0030] Among them, the rollback segment page (i.e. Undo segment page) is used to store Undo logs.

[0031] The embodiment of the application provides a cache pool load optimization method, comprising:

[0032] Obtain the storage information of the space occupied by the rollback segment page in the cache pool changing over time, and the page eviction information of the rollback segment page in the cache pool;

[0033] According to the storage information, determine the adjustment mode of the retention time of the rollback segment page, adjust the current retention time according to the adjustment mode and the page eviction information, and obtain the adjusted retention time;

[0034] According to the adjusted retention time, process the rollback segment page to realize load optimization of the cache pool.

[0035] By adjusting the retention time of the rollback segment page, the rollback segment page in the cache pool is processed in time, so that the overloading condition caused by too many rollback segment pages in the cache pool due to too long retention time is avoided, the working abnormity of the cache pool is effectively avoided, and the stability of the cache pool is improved.

[0036] As shown in Figure 1 The cache pool load optimization method provided by the embodiment one of the application comprises the following steps:

[0037] Step S101, obtain the storage information of the space occupied by the rollback segment page in the cache pool changing over time, and the page eviction information of the rollback segment page in the cache pool.

[0038] Among them, by monitoring the space occupied by the rollback segment page in the cache pool, for example, monitoring the storage memory of the rollback segment page, the information formed by the storage memory changing over time is the storage information. Further, if expressed in terms of space ratio, the total memory of the cache pool can be compared with the storage memory, and the ratio of the occupied space can be obtained.

[0039] The page elimination can refer to deleting or the like of the rollback segment page in the cache pool, so that the rollback segment page is blanked or covered by new content. The page elimination information can include an elimination rate of the rollback segment page in a unit time or a preset time period. Specifically, the elimination rate can be obtained by monitoring the number of the eliminated rollback segment pages in a period of time.

[0040] In step S102, an adjustment mode of the retention time of the rollback segment page is determined according to the storage information. The current retention time is adjusted according to the adjustment mode and the page elimination information, to obtain an adjusted retention time.

[0041] The adjustment of the retention time of the rollback segment page can be repeated judgment in a certain time to dynamically adjust the retention time, or can be triggered by other trigger conditions.

[0042] In the process of triggering the adjustment of the retention time, the storage information is analyzed to determine whether the original retention time of the rollback segment page meets a preset condition, so as to decide whether to adjust the retention time.

[0043] For example, the analysis result of the storage information is that the rollback segment page increases rapidly or the rollback segment page decreases rapidly. The rapid increase of the rollback segment page can indicate that the current retention time of the rollback segment page is too long, which can cause the storage proportion of the rollback segment page in the cache pool to be too high, affecting the performance of the cache pool, and thus the retention time needs to be reduced to quickly eliminate the rollback segment page. The rapid decrease of the rollback segment page can indicate that the current retention time of the rollback segment page is too short, which can affect the version rollback performance of the database, and thus the retention time needs to be increased to slow down the elimination of the rollback segment page.

[0044] The adjustment mode can be adjustment or no adjustment. The adjustment represents that the retention time needs to be adjusted, and the no adjustment represents that the retention time does not need to be adjusted or the adjusted retention time is the original retention time.

[0045] Of course, the adjustment mode can also have other names, for example, an elimination rate adjustment strategy. The elimination rate adjustment strategy can represent the adjustment of the retention time, and the adjustment of the retention time is performed by calculating the elimination rate. Therefore, the above adjustment mode is not limited to adjustment or no adjustment, and can also include specific strategies.

[0046] The adjustment mode determines the specific adjustment strategy of the current retention time, and the adjusted retention time is determined in combination with the page elimination information. When the rollback segment pages in the cache pool increase rapidly, the current retention time is reduced. When the rollback segment pages in the cache pool decrease rapidly, the current retention time is increased.

[0047] Optionally, after the current retention time is adjusted according to the adjustment mode and the page elimination information to obtain an adjusted retention time, the method further comprises:

[0048] If the adjusted retention time exceeds the preset retention time upper and lower limits, the adjusted retention time is updated to the preset retention time upper and lower limits.

[0049] The preset retention time upper and lower limits are two values, i.e., an upper limit value and a lower limit value. The adjusted retention time exceeding the preset retention time upper and lower limits specifically includes two modes, i.e., when the retention time is reduced, the adjusted retention time cannot exceed the lower limit value, and when the retention time is increased, the adjusted retention time cannot exceed the upper limit value.

[0050] The limitation can control the adjustment of the retention time between the reasonable upper limit value and the lower limit value, avoiding the situation that the retention time cannot be quickly adjusted back to the reasonable range, which leads to the abnormal performance of the cache pool, for example, when the retention time is very small, the rollback performance cannot be met in the face of the rollback segment pages that need to be retained for a long time, and when the retention time is very large, the retention time cannot be quickly reduced in the face of the rapidly increasing rollback segment pages in the cache pool.

[0051] In step S103, the rollback segment pages are processed according to the adjusted retention time to achieve the load optimization of the cache pool.

[0052] The adjusted retention time is set in the cache pool, and the retention time of the rollback segment pages is monitored. The rollback segment pages are processed by comparing the retained time of a rollback segment page with the adjusted retention time, thereby achieving the load optimization of the cache pool.

[0053] The processing of the rollback segment pages in the cache pool, such as elimination, retention, etc., can affect the storage quantity of the rollback segment pages in the cache pool, i.e., the load of the cache pool.

[0054] Optionally, the processing of the rollback segment pages according to the adjusted retention time comprises:

[0055] The retained time of each rollback segment page in the cache pool is monitored.

[0056] After detecting the adjusted retention time, for any rollback segment page, if the retained time of the rollback segment page exceeds the adjusted retention time, the rollback segment page is eliminated from the cache pool.

[0057] Specifically, once the retention time for any rollback segment page reaches the adjusted retention time, that rollback segment page can be evicted from the cache pool, thereby reducing the load on the cache pool and improving the cache pool's storage capacity for the data pages required by the task.

[0058] This application embodiment obtains storage information on the space occupied by rollback segment pages in the cache pool over time, as well as page eviction information of rollback segment pages in the cache pool. Based on the storage information, it determines the adjustment method for the retention time of rollback segment pages. According to the adjustment method and page eviction information, it adjusts the current retention time to obtain the adjusted retention time. Based on the adjusted retention time, it processes the rollback segment pages to optimize the load on the cache pool. By adjusting the retention time of rollback segment pages, it controls the overload caused by rollback segment pages in the cache pool, thereby preventing cache pool malfunctions and improving cache pool stability.

[0059] like Figure 2 As shown, this is a cache pool load optimization method provided in Embodiment 2 of this application. The adjustment method for determining the retention time of rollback segment pages based on the storage information in step S102 can include the following steps:

[0060] Step S201: Based on the storage information, determine the current page percentage growth rate or current page percentage decrease rate of the space occupied by the rollback segment pages in the cache pool under the current time window, and the previous page percentage growth rate or previous page percentage decrease rate of the space occupied by the rollback segment pages in the cache pool under the previous time window.

[0061] A time window is pre-configured, which can be adjusted according to needs. It can be assumed that the stored information is decomposed according to the duration of the time window. The current time window can be used as a time window for querying backward for a preset duration at the current time. That is, the current time is the last moment of the current time window. Of course, the last moment of the previous time window is the moment before the first moment of the current time window, and the first moment of the previous time window is the moment corresponding to the preset duration for querying backward from the last moment of the previous time window.

[0062] The storage information reveals the percentage of rollback segments in the cache pool at each moment within the current time window. Analyzing changes in this percentage allows us to determine the rate of increase or decrease in the current page percentage. The rate of increase indicates an increase in the current page percentage, while the rate of decrease indicates a decrease. This data (both the rate of increase and decrease) can be saved for future use when adjusting the retention time in the next time window.

[0063] Of course, the previous page ratio growth rate or the previous page ratio reduction rate of the previous time window also needs to be obtained, and the previous page ratio growth rate and the previous page ratio reduction rate can be obtained when the retention time is adjusted last time (i.e., at the last moment of the previous time window).

[0064] In step S202, if the current page ratio growth rate exceeds the previous page ratio growth rate, or the current page ratio reduction rate exceeds the previous page ratio reduction rate, it is determined that the adjustment mode of the retention time of the rollback segment page is the first adjustment strategy.

[0065] In the formula, if the page ratio of the rollback segment page in the current time window increases and the growth rate exceeds the previous value, the adaptive ratio of the retention time of the rollback segment page is started to be calculated. If the page ratio of the rollback segment page in the current adaptive time window decreases and the reduction rate exceeds the previous value, the adaptive ratio of the retention time of the rollback segment page is started to be calculated.

[0066] The first adjustment strategy can be adjustment, which indicates that the retention time needs to be adjusted. The first adjustment strategy can also include the means of adjustment, for example, reducing or increasing the retention time according to a preset value, or proportionally increasing or proportionally reducing the retention time.

[0067] Optionally, after determining the current page ratio growth rate or the current page ratio reduction rate of the space occupied by the rollback segment page in the cache pool in the current time window and the previous page ratio growth rate or the previous page ratio reduction rate of the space occupied by the rollback segment page in the cache pool in the last time window according to the storage information, the method further includes:

[0068] If the current page ratio growth rate does not exceed the previous page ratio growth rate, or the current page ratio reduction rate does not exceed the previous page ratio reduction rate, it is determined that the adjustment mode of the retention time of the rollback segment page is the second adjustment strategy.

[0069] In the formula, the second adjustment strategy can be no adjustment or adjusting the retention time to the current retention time.

[0070] In the embodiments of the present application, the growth rate or the reduction rate of the rollback segment page is analyzed, the growth rate or the reduction rate of the current time window is compared with the growth rate or the reduction rate of the previous time window, and the adjustment strategy is determined. For example, if the growth rate or the reduction rate of the current time window does not exceed the growth rate or the reduction rate of the previous time window, the mode of not adjusting the retention time can be used, and otherwise the retention time needs to be adjusted to be lower or higher, so that the adjustment mode of the retention time is accurately adapted, and the accuracy of the cache pool load optimization is improved.

[0071] As Figure 3Fig. 3 is a flow diagram of a method for optimizing cache pool load according to an embodiment of the present application. If the adjustment mode is the eviction rate adjustment strategy, the step S102 of adjusting the current retention time according to the adjustment mode and the page eviction information comprises the following steps.

[0072] In step S301, the current eviction rate of the rollback segment page in the current time window and the previous eviction rate of the rollback segment page in the previous time window are determined from the page eviction information according to the eviction rate adjustment strategy.

[0073] In step S302, the adjustment ratio is determined according to the current eviction rate and the previous eviction rate, and the current retention time is adjusted according to the adjustment ratio to obtain the adjusted retention time.

[0074] The eviction rate adjustment strategy requires determining the eviction rate of the rollback segment page from the page eviction information, so as to determine the adjustment ratio according to the eviction rate to adjust the current retention time.

[0075] Optionally, the step of determining the adjustment ratio according to the current eviction rate and the previous eviction rate, and adjusting the current retention time according to the adjustment ratio to obtain the adjusted retention time comprises:

[0076] The previous eviction rate is compared with the current eviction rate to obtain a ratio, and the ratio is determined as the adjustment ratio.

[0077] The current retention time is obtained, and the current retention time is multiplied by the adjustment ratio to obtain a multiplication result as the adjusted retention time.

[0078] The adjustment ratio is calculated as the previous eviction rate / current eviction rate, and the new rollback segment retention time is adjusted as the current retention time*adjustment ratio.

[0079] The ratio of the previous eviction rate to the current eviction rate is used as the adjustment ratio, which can accurately adjust the retention time to obtain an accurate and effective adjustment result.

[0080] Optionally, before the step of comparing the previous eviction rate with the current eviction rate to obtain a ratio, and determining the ratio as the adjustment ratio, the method further comprises:

[0081] The size relationship between the current eviction rate and the previous eviction rate is detected.

[0082] If the current elimination rate is greater than the previous elimination rate when the page ratio of the rollback segment page increases, or the current elimination rate is less than the previous elimination rate when the page ratio of the rollback segment page decreases, the previous elimination rate is compared with the current elimination rate to obtain a ratio, and it is determined that the ratio is an adjustment ratio.

[0083] If the elimination rate of the rollback segment page in the current time window exceeds the previous value when the page ratio of the rollback segment page increases, the calculation of the adjustment ratio is started, and if the elimination rate is less than the previous value, the retention time of the rollback segment is unchanged.

[0084] If the elimination rate of the rollback segment page in the current time window is lower than the previous value when the page ratio of the rollback segment page decreases, the calculation of the adjustment ratio is started, and if the elimination rate is greater than the previous value, the retention time of the rollback segment is unchanged.

[0085] First, it is assumed that the rollback segment adaptive background thread counts the page ratio of the rollback segment in the cache pool and the elimination rate of the rollback segment page every 100 ms. The page ratio of the rollback segment in the cache pool p0 is counted at T0, the page ratio of the rollback segment in the cache pool p1 is counted at T1 after 100 ms, and the page ratio of the rollback segment p2 is counted at T2 after 100 ms. If p2> p1, and the growth rate of the rollback segment page from T1 to T2 (p2-p1) / 100 ms is greater than the growth rate of the rollback segment page from T0 to T1 (p1-p0) / 100 ms.

[0086] Secondly, the elimination pressure of the rollback segment in the cache pool is evaluated. If the elimination rate of the rollback segment page from T1 to T2 ratio2 exceeds the elimination rate of the rollback segment page from T0 to T1 ratio1, the new rollback segment retention time is calculated as the current rollback segment retention time * (ratio1 / ratio2).

[0087] At this time, the new rollback segment retention time is adjusted downward according to the ratio of the elimination rates of the last two adaptive time windows. The system can reuse more committed transaction rollback segment pages, improve the probability of rollback segment hot page reuse, and avoid applying more rollback segment pages to increase the pressure of the cache pool.

[0088] If the page ratio of the rollback segment in the cache pool starts to decrease and the elimination rate of the rollback segment page decreases after a period of time, a larger new rollback segment retention time is obtained through proportional calculation until the rollback segment retention time is restored to the configuration value.

[0089] The embodiment of the application adopts a background thread to monitor the page proportion of the rollback segment of the cache pool in real time, and the elimination rate of the page of the rollback segment. The index can reflect the pressure of the current rollback segment retention time on the cache pool, so that when the business pressure increases sharply, the rollback segment retention time is adjusted in time through negative feedback, and more hot pages of the rollback segment are reused to relieve the pressure of the cache pool.

[0090] The embodiment of the application also provides a cache pool load optimization device 40, which refers to Figure 4 , and comprises:

[0091] An information acquisition module 410 is configured to acquire storage information of the occupied space of the page of the rollback segment in the cache pool changing with time and page elimination information of the page of the rollback segment in the cache pool.

[0092] A time adjustment module 420 is configured to determine an adjustment mode of the retention time of the page of the rollback segment according to the storage information, and adjust the current retention time according to the adjustment mode and the page elimination information to obtain an adjusted retention time.

[0093] A load optimization module 430 is configured to process the page of the rollback segment according to the adjusted retention time to realize load optimization of the cache pool.

[0094] Optionally, the time adjustment module 420 comprises:

[0095] A page proportion analysis unit is configured to determine, according to the storage information, a current page proportion increasing rate or a current page proportion decreasing rate of the occupied space of the page of the rollback segment in the cache pool in a current time window and a previous page proportion increasing rate or a previous page proportion decreasing rate of the occupied space of the page of the rollback segment in the cache pool in a previous time window.

[0096] A first adjustment strategy unit is configured to determine that the adjustment mode of the retention time of the page of the rollback segment is a first adjustment strategy if the current page proportion increasing rate exceeds the previous page proportion increasing rate or the current page proportion decreasing rate exceeds the previous page proportion decreasing rate.

[0097] Optionally, the time adjustment module 420 further comprises:

[0098] a second adjustment strategy unit, configured to determine, according to the storage information, a current page proportion increase rate or a current page proportion decrease rate of the space occupied by the rollback segment pages in the cache pool in a current time window, and a previous page proportion increase rate or a previous page proportion decrease rate of the space occupied by the rollback segment pages in the cache pool in a previous time window, and determine, if the current page proportion increase rate does not exceed the previous page proportion increase rate or the current page proportion decrease rate does not exceed the previous page proportion decrease rate, an adjustment manner of the retention time of the rollback segment pages as a second adjustment strategy.

[0099] Optionally, if the adjustment manner is the elimination rate adjustment strategy, the time adjustment module 420 comprises:

[0100] an elimination rate obtaining unit, configured to determine, according to the elimination rate adjustment strategy, a current elimination rate of the rollback segment pages in the current time window and a previous elimination rate of the rollback segment pages in the previous time window from the page elimination information;

[0101] a retention time adjusting unit, configured to determine an adjustment ratio according to the current elimination rate and the previous elimination rate, and adjust the current retention time according to the adjustment ratio to obtain an adjusted retention time.

[0102] Optionally, the retention time adjusting unit comprises:

[0103] an adjustment ratio sub-unit, configured to compare the previous elimination rate with the current elimination rate to obtain a ratio value, and determine the ratio value as the adjustment ratio;

[0104] a retention time adjusting sub-unit, configured to obtain the current retention time, multiply the current retention time by the adjustment ratio to obtain a multiplication result as the adjusted retention time.

[0105] Optionally, the retention time adjusting unit further comprises:

[0106] an elimination rate comparison sub-unit, configured to detect a size relationship between the current elimination rate and the previous elimination rate before the comparison of the previous elimination rate with the current elimination rate to obtain the ratio value and the determination of the ratio value as the adjustment ratio;

[0107] an execution determination sub-unit, configured to perform the comparison of the previous elimination rate with the current elimination rate to obtain the ratio value and the determination of the ratio value as the adjustment ratio if the current elimination rate is greater than the previous elimination rate when the page proportion of the rollback segment pages increases or the current elimination rate is less than the previous elimination rate when the page proportion of the rollback segment pages decreases.

[0108] Optionally, the load optimization module 430 comprises:

[0109] a retention time detection module, configured to monitor a retained time of each rollback segment page in the cache pool;

[0110] a load optimization unit, configured to, after detecting the adjusted retention time, eliminate any rollback segment page from the cache pool if the retained time of the rollback segment page exceeds the adjusted retention time.

[0111] It should be noted that the information interaction and execution process between the above modules are based on the same concept as the method embodiments of the present application, and the specific functions and technical effects brought by the same can be referred to the method embodiments part, which will not be repeated here.

[0112] The present application also provides an electronic device 50, please refer to Figure 5 , comprising a memory 510 and a processor 520, wherein the memory 510 is used to store computer programs; the processor 520 is used to execute the programs stored in the memory 510, and realize the cache pool load optimization method introduced in any embodiment of the present application.

[0113] The present application also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the cache pool load optimization method introduced in any embodiment of the present application.

[0114] In the present application, a plurality of refers to two or more than two.

[0115] In the present application, unless otherwise explicitly limited, the terms "mounting", "connecting", "connecting" should be understood broadly, for example, it can be fixed connection, or detachable connection, or integral connection; it can be mechanical connection, or electrical connection; it can be directly connected, or indirectly connected through intermediate medium, or the communication between two elements. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.

[0116] The terms "first", "second", "third", "fourth" and the like (if any) in the present application are used to distinguish similar objects, and do not necessarily describe a specific order or sequence.

[0117] In the present application, the term "and / or" is only a description of the association between the associated objects, which means that there may be three kinds of relationships, for example, A and / or B, which can represent the existence of A alone, the existence of A and B, and the existence of B alone. In addition, the character " / " in the present application generally represents an "or" relationship between the front and rear associated objects.

[0118] If not otherwise specified, all steps of the application can be performed in any order. For example, the method comprises steps A and B, meaning that the method can comprise steps A and B performed in sequence, or steps B and A performed in sequence. For example, the method can further comprise step C, meaning that step C can be added to the method in any order, for example, the method can comprise steps A, B and C, or steps A, C and B, or steps C, A and B, etc.

[0119] The above description is only the preferred embodiment of the present application, and is not intended to limit the present application. Any modification, equivalent replacement and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for cache pool load optimization, the method comprising: The method comprises the following steps: acquiring storage information of space occupied by rollback segment pages in a cache pool changing over time and page eviction information of the rollback segment pages in the cache pool; determining an adjustment mode of a retention time of the rollback segment pages according to the storage information, adjusting the current retention time according to the adjustment mode and the page eviction information to obtain an adjusted retention time; processing the rollback segment pages according to the adjusted retention time to realize load optimization of the cache pool; if the adjustment mode is a discard rate adjustment strategy, the step of adjusting the current retention time according to the adjustment mode and the page eviction information to obtain the adjusted retention time comprises the following steps: determining a current discard rate of the rollback segment pages in a current time window and a previous discard rate of the rollback segment pages in a previous time window from the page eviction information according to the discard rate adjustment strategy; determining an adjustment ratio according to the current discard rate and the previous discard rate, and adjusting the current retention time according to the adjustment ratio to obtain the adjusted retention time; the step of determining the adjustment ratio according to the current discard rate and the previous discard rate, and adjusting the current retention time according to the adjustment ratio to obtain the adjusted retention time comprises the following steps: comparing the previous discard rate with the current discard rate to obtain a ratio, and determining the ratio as the adjustment ratio; acquiring the current retention time, multiplying the current retention time by the adjustment ratio to obtain a multiplication result as the adjusted retention time.

2. The cache pool load optimization method of claim 1, wherein, the step of determining the adjustment mode of the retention time of the rollback segment pages according to the storage information comprises the following steps: determining a current page proportion increase rate or a current page proportion decrease rate of the space occupied by the rollback segment pages in the cache pool in the current time window and a previous page proportion increase rate or a previous page proportion decrease rate of the space occupied by the rollback segment pages in the cache pool in a previous time window according to the storage information; if the current page proportion increase rate exceeds the previous page proportion increase rate or the current page proportion decrease rate exceeds the previous page proportion decrease rate, determining that the adjustment mode of the retention time of the rollback segment pages is a first adjustment strategy.

3. The cache pool load optimization method of claim 2, wherein, after determining the current page proportion increase rate or the current page proportion decrease rate of the space occupied by the rollback segment pages in the cache pool in the current time window and the previous page proportion increase rate or the previous page proportion decrease rate of the space occupied by the rollback segment pages in the cache pool in the previous time window according to the storage information, the method further comprises the following steps: if the current page proportion increase rate does not exceed the previous page proportion increase rate or the current page proportion decrease rate does not exceed the previous page proportion decrease rate, determining that the adjustment mode of the retention time of the rollback segment pages is a second adjustment strategy.

4. The cache pool load optimization method of claim 1, wherein, before comparing the previous discard rate with the current discard rate to obtain a ratio and determining the ratio as the adjustment ratio, the method further comprises the following step: detecting a size relationship between the current discard rate and the previous discard rate. If the current eviction rate is greater than the previous eviction rate when the page proportion of the rollback segment page increases, or the current eviction rate is less than the previous eviction rate when the page proportion of the rollback segment page decreases, the previous eviction rate is compared with the current eviction rate to obtain a ratio, and the ratio is determined as an adjustment ratio.

5. The cache pool load optimization method of any of claims 1 to 4, wherein, The processing of the rollback segment page according to the adjusted retention time comprises: monitoring the retained time of each rollback segment page in the cache pool; after detecting the adjusted retention time, for any rollback segment page, if the retained time of the rollback segment page exceeds the adjusted retention time, the rollback segment page is evicted from the cache pool.

6. A cache pool load optimization apparatus, characterized by, comprise: an information acquisition module, configured to acquire storage information of space occupied by a rollback segment page in the cache pool changing over time, and page eviction information of the rollback segment page in the cache pool; a time adjustment module, configured to determine an adjustment mode of the retention time of the rollback segment page according to the storage information, adjust the current retention time according to the adjustment mode and the page eviction information to obtain an adjusted retention time; a load optimization module, configured to process the rollback segment page according to the adjusted retention time to realize load optimization of the cache pool; if the adjustment mode is an eviction rate adjustment strategy, the time adjustment module comprises: an eviction rate acquisition unit, configured to determine, according to the eviction rate adjustment strategy, a current eviction rate of the rollback segment page in a current time window and a previous eviction rate of the rollback segment page in a previous time window from the page eviction information; a retention time adjustment unit, configured to determine an adjustment ratio according to the current eviction rate and the previous eviction rate, and adjust the current retention time according to the adjustment ratio to obtain an adjusted retention time; the retention time adjustment unit comprises: an adjustment ratio subunit, configured to compare the previous eviction rate with the current eviction rate to obtain a ratio, and determine the ratio as the adjustment ratio; a retention time adjustment subunit, configured to acquire the current retention time, multiply the current retention time by the adjustment ratio to obtain a multiplication result as the adjusted retention time.

7. An electronic device, comprising: comprise a processor and a memory, wherein the memory is configured to store a computer program; the processor is configured to execute the program stored on the memory to implement the cache pool load optimization method in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer program is stored in the computer readable storage medium, and the computer program is executed by the processor to implement the cache pool load optimization method in any one of claims 1-5. The computer program is stored in the computer readable storage medium, and the computer program is executed by the processor to implement the cache pool load optimization method in any one of claims 1-5.

Citation Information

Patent Citations

  • Caching method and system for eliminated data perception in hybrid memory environment

    CN105975402A

  • Method for eliminating and maintaining hotspot data in distributed cache system

    CN120470036A