Cache configuration optimization method and device, equipment, medium and product
By classifying the access flow characteristics and capacity sensitivity characteristics of the application and optimizing the cache configuration parameters, the problem that the cache configuration design in the existing technology cannot obtain optimal results is solved, and the execution performance and system stability of the application are improved. .
Patent Information
- Application Number
- CN202410701443.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-08-27
AI Technical Summary
When the existing cache configuration design relies on the simulator, the optimal result of the cache configuration cannot be obtained, which affects the execution performance of the application.
By classifying applications according to their access flow characteristics and capacity sensitivity characteristics, cache configuration parameters, including cache capacity, replacement strategy, and prefetch strategy, are optimized and dynamically adjusted to suit the needs of different types of applications.
It achieves the rationality and flexibility of cache configuration, improves program execution performance, improves cache utilization efficiency, reduces system energy consumption, and enhances system stability.
Smart Images

Figure CN118550702A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer technology, and in particular relates to a cache configuration optimization method, device, equipment, medium and product. Background Art
[0002] Cache refers to a memory that can exchange data at high speed. It exchanges data with the CPU before the memory. Cache configuration is an important part of the design for multi-core ARM processors. Multi-core ARM processors are equipped with three levels of cache, including the first level cache (L1 Cache), the second level cache (L2 Cache) and the last level shared cache (LL Cache); different applications use cache differently, and applications cannot directly consider how to store cache data in the cache, but rather consider memory allocation in the main memory; when the data space in the main memory is opened up, the operating system will automatically cache the memory to the cache according to the address mapping relationship, so the memory allocation behavior of the application in the main memory will directly affect the cache behavior of the data in the cache; among them, some applications require a large memory space, and they will need to allocate more cache groups to be mapped to the cache. If the cache capacity is small, it will result in less cacheable data, and the application will frequently access the main memory, affecting the program execution performance; while some programs require very little memory space, and the cache data that needs to be allocated when mapped to the cache is also very small, so changes in the cache capacity have almost no effect on the execution of the program; in addition, because some applications have poor temporal locality and spatial locality in accessing data, the cached data is frequently swapped in and out, which greatly affects the execution performance of the program.
[0003] At present, in order to determine the optimal configuration of the cache, the number of cache misses of the application can be directly measured through the simulator, and then the cache configuration parameters can be continuously changed to achieve the purpose of reducing the number of misses; however, the existing cache configuration design that relies on the simulator often cannot obtain the optimal result of the cache configuration. Summary of the invention
[0004] In view of the technical problems existing in the prior art, the present invention provides a cache configuration optimization method, device, equipment, medium and product to solve the technical problem that the optimal result of cache configuration cannot be obtained when the existing cache configuration design relies on a simulator.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is:
[0006] The present invention provides a cache configuration optimization method, comprising:
[0007] According to the streaming characteristics of application cache access and the characteristics of application cache capacity sensitivity, the application is classified to obtain the classification results of the cache access behavior of the application;
[0008] According to the classification result of the cache access behavior of the application program and in combination with the memory access characteristics of the application program, the configuration parameters of the cache are optimized, so as to obtain the cache configuration optimization result.
[0009] Furthermore, the streaming characteristics of the application accessing the cache are used to determine whether the cache access form of the application is a streaming application; wherein the streaming characteristics of the application accessing the cache are specifically: for the second cache whose capacity is greater than the streaming application threshold, the increase or decrease in the miss rate of the application.
[0010] Furthermore, the characteristic of the application's sensitivity to cache capacity is used to determine whether the cache access form of the application is a sensitive application; wherein the characteristic of the application's sensitivity to cache capacity is specifically: the average cache capacity gain of the application.
[0011] Furthermore, the average cache capacity gain of the application is specifically:
[0012]
[0013] in, is the average cache capacity gain of the application; n is the maximum number of capacity increases; p i is the miss rate of the second cache after the i-th capacity increase; p i+1 is the miss rate of the second cache after the i+1th capacity increase; c i is the capacity value of the second cache after the i-1th capacity increase; c i+1 is the capacity value of the second cache after the i+1th capacity increase; ε1 is the gain random error.
[0014] Furthermore, the cache access behavior classification results of the application include sensitive-friendly applications, sensitive-streaming applications, intensive-friendly applications, and intensive-streaming applications.
[0015] Furthermore, the configuration parameters of the cache include cache capacity, replacement strategy and pre-fetch strategy.
[0016] The present invention also provides a cache configuration optimization device, comprising:
[0017] An application classification module is used to classify applications according to the streaming characteristics of application access to cache and the characteristics of application sensitivity to cache capacity, and obtain the classification results of cache access behavior of applications;
[0018] The optimization module is used to optimize the cache configuration parameters according to the cache access behavior classification result of the application program and the memory access characteristics of the application program, so as to obtain the cache configuration optimization result.
[0019] The present invention also provides a computer device, characterized in that it comprises:
[0020] a processor suitable for executing a computer program;
[0021] A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by the processor, the cache configuration optimization method is executed.
[0022] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and is characterized in that the cache configuration optimization method is implemented when the computer program is executed by a processor.
[0023] The present invention also provides a computer program product, characterized in that the computer program product includes a computer program, and when the computer program is executed by a processor, the cache configuration optimization method is implemented.
[0024] Compared with the prior art, the present invention has the following beneficial effects:
[0025] The cache configuration optimization method provided by the present invention utilizes the streaming characteristics of the application program accessing the cache and the characteristics of the application program's sensitivity to the cache capacity to classify the cache access behavior of the application program, and can accurately obtain the cache usage pattern of the application program; based on the classification results of the cache access behavior of the application program and the memory access characteristics, the cache configuration parameters are optimized, and different cache configuration parameters can be configured for different types of applications, thereby achieving flexible and effective use of limited cache resources, ensuring the rationality of the cache configuration, and effectively guaranteeing the execution performance of the program; secondly, by continuously monitoring and analyzing the cache access behavior and memory access characteristics of the application program, the cache configuration parameters can be dynamically adjusted to meet the ever-changing needs; in addition, the present invention can manage the cache more simply and efficiently, and has the advantages of improving cache utilization efficiency, optimizing system performance, reducing system energy consumption, improving the flexibility of resource allocation, and enhancing system stability. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 This is a flowchart of the cache configuration optimization method described in Example 1;
[0027] Figure 2 It is a structural block diagram of the cache configuration optimization device described in Example 2;
[0028] Figure 3This is a structural block diagram of the computer device described in Example 3. DETAILED DESCRIPTION
[0029] In order to make the technical problems, technical solutions and beneficial effects solved by the present invention more clearly understood, the present invention is further described in detail in the following specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0030] Example 1
[0031] As attached Figure 1 The present embodiment 1 provides a cache configuration optimization method, comprising the following steps:
[0032] Step 1. Classify the applications according to the streaming characteristics of the applications accessing the cache and the characteristics of the applications' sensitivity to the cache capacity, and obtain the cache access behavior classification results of the applications; wherein the cache access behavior classification results of the applications include Sensitive Friendly (SF) applications, Sensitive Streaming (SS) applications, Intensive Friendly (IF) applications and Intensive Streaming (IS) applications.
[0033] It should be noted that Sensitive Friendly (SF) application is used to characterize an application that has a very small second cache miss rate when the cache is small, rarely accesses the second cache or requires a very small second cache space, and as the second cache capacity increases, the miss rate of the application on the second cache will drop rapidly and approach 0.
[0034] Sensitive Streaming (SS) applications are used to characterize applications that are very sensitive to the capacity of the second cache. When the initial capacity of the second cache is very small, the cache miss rate is high. As the capacity of the second cache increases, the miss rate decreases, but the rate of decrease is slower than that of the SF type. When the cache capacity reaches a large value, the overall miss rate is still high.
[0035] Intensive Friendly (IF) applications are used to characterize applications that are less sensitive to the capacity of the second cache than sensitive friendly applications. The miss rate of the second cache decreases more slowly with the increase of capacity, and the final miss rate is close to 0.
[0036] Intensive Streaming (IS) is used to characterize that the application is insensitive to the capacity of the second cache. Due to the intensive and streaming characteristics of memory access, the locality of data access is poor; therefore, cache jitter may occur, and the hit rate of the second cache fluctuates with the increase of capacity.
[0037] Specifically, the process of classifying applications is as follows:
[0038] Step 11: Calculate the cache capacity gain p of the application g and the average cache capacity gain of the application The cache capacity gain of the application is:
[0039]
[0040] Among them, p g is the cache capacity gain of the application; Δp miss is the difference in miss rate before and after the second cache capacity gain; Δc is the capacity difference before and after the second cache capacity gain; p i-1 is the miss rate of the second cache after the i-1th capacity increase; p i is the miss rate of the second cache after the i-th capacity increase; c i is the capacity value of the second cache after the i-1th capacity increase; c i-1 is the capacity value of the second cache after the i-th capacity increase.
[0041] Average cache capacity gain for the application for:
[0042]
[0043] in, is the average cache capacity gain of the application; n is the maximum number of capacity increases; p i is the miss rate of the second cache after the i-th capacity increase; p i+1 is the miss rate of the second cache after the i+1th capacity increase; c i is the capacity value of the second cache after the i-1th capacity increase; c i+1 is the capacity value of the second cache after the i+1th capacity increase; ε1 is the gain random error.
[0044] Step 12: The average cache capacity gain of the application and the preset cache gain threshold p th For comparison; if the average cache capacity gain of the application Greater than the preset cache gain threshold p th,Right now If yes, jump to step 13; otherwise, jump to step 15.
[0045] Step 13: Increase the cache capacity of the application by p g Compared with the preset gain random error ε2; if a cache capacity gain p of an application g Less than the preset gain random error ε2, that is, p g <ε2, the cache access behavior classification result of the application is a sensitive flow type application; otherwise, jump to step 14.
[0046] Step 14: If the capacity value C is greater than the preset streaming application capacity threshold C th The cache capacity gain p of all second caches c Both are greater than the cache miss rate threshold p s , that is, if for C>C th All second caches have p c >p s , then the cache access behavior classification result of the application is a sensitive flow type application; otherwise, the cache access behavior classification result of the application is a sensitive friendly application.
[0047] Step 15: Increase the cache capacity of the application by p g Compared with the preset gain random error ε2; if a cache capacity gain p of an application g Less than the preset gain random error ε2, that is, p g <ε2, the cache access behavior classification result of the application is a dense flow type application; otherwise, jump to step 16.
[0048] Step 16: If the capacity value C is greater than the preset streaming application capacity threshold C th The cache capacity gain p of all second caches c Both are greater than the cache miss rate threshold p s , that is, if for C>C th All second caches have p c >p s , the cache access behavior classification result of the application is a dense flow type application; otherwise, the cache access behavior classification result of the application is a dense flow type friendly application.
[0049] In this embodiment 1, the specific implementation pseudo code of classifying the application programs to obtain the classification results of the cache access behaviors of the application programs is shown in Table 1 below.
[0050] Table 1 Pseudo-code implementation of classifying applications to obtain the classification results of cache access behavior of applications
[0051]
[0052]
[0053] Step 2: According to the classification result of the cache access behavior of the application program and in combination with the memory access characteristics of the application program, the cache configuration parameters are optimized to obtain the cache optimization result; preferably, the cache configuration parameters include cache capacity, replacement strategy and prefetch strategy.
[0054] Among them, the process of optimizing the configuration parameters of the cache is specifically as follows: according to the classification results of the cache access behavior and memory access characteristics of the application, the capacity of each level of cache is adjusted; for the application with frequent reading, the cache space is increased to improve the hit rate; secondly, according to the classification results of the cache access behavior of the application, the cache replacement strategy is selected; wherein the cache replacement strategy includes least recently used (LRU) or least frequently used (LFU); for the application with continuous or predictable access pattern, the pre-fetch technology is set to load the data that may be accessed into the cache in advance.
[0055] It should be noted that there are many characteristics when applications access the cache, and different applications have different sensitivities to the cache capacity. For example, some applications have a small working set and the amount of cached data in the cache is also small. At this time, further increasing the cache capacity has little effect on the cache hit rate of the application. Therefore, this type of application is insensitive to the cache capacity. However, some applications have a large working set and cannot meet the cache requirements when the cache capacity is small, which will cause a large number of cache misses. When the cache capacity is further increased, the cache miss rate of the application decreases significantly and eventually stabilizes at a very low level. This type of application is sensitive to the cache capacity. In addition, different applications can be divided into streaming applications and non-streaming applications according to the locality of read and write data. Among them, streaming applications refer to applications with poor data locality, and the data that has been accessed is difficult to be accessed again, and its cache miss rate is high; while non-streaming applications refer to applications with good data locality, and the data that has been accessed will be accessed again soon, and its cache miss rate is low.
[0056] In this embodiment 1, based on the streaming characteristics of the application's access to the cache and the application's sensitivity to the cache's capacity, the application's cache access behavior can be divided into sensitive-friendly applications, sensitive streaming applications, dense-friendly applications, and dense streaming applications; wherein, the streaming characteristics of the application's access to the cache are used to determine whether the application's cache access form is a streaming application; wherein, the streaming characteristics of the application's access to the cache are specifically: for the second cache whose capacity is greater than the streaming application threshold, the increase or decrease in the application's miss rate; the application's sensitivity to the cache's capacity is used to determine whether the application's cache access form is a sensitive application.
[0057] The sensitivity to cache capacity is measured by the rate of change of the application's miss rate for the second cache as the capacity increases. Definition: Cache Capacity Gain is the rate of change of the cache miss rate after each 1MB capacity gain, which can be expressed as:
[0058]
[0059] Among them, p g is the cache capacity gain of the application; Δp miss is the difference in miss rate before and after the second cache capacity gain; Δc is the capacity difference before and after the second cache capacity gain; p i-1 is the miss rate of the second cache after the i-1th capacity increase; p i is the miss rate of the second cache after the i-th capacity increase; c i is the capacity value of the second cache after the i-1th capacity increase; c i-1 is the capacity value of the second cache after the i-th capacity increase.
[0060] Among them, the cache capacity gain of the application represents the ratio of the difference in miss rate before and after the cache capacity is increased to the capacity difference, that is, the average change in cache miss rate per unit capacity gain; when the cache capacity gain is greater than 0, it indicates a positive gain, indicating that the increase in cache capacity has a positive effect on reducing the miss rate; when the cache capacity gain is less than 0, it indicates a negative gain, indicating that the increase in cache capacity cannot reduce the miss rate, but will increase the miss rate.
[0061] When the capacity of the second cache is increased by a factor of 2 from the lowest cache 128KB to 128MB, the average cache capacity gain of the application can be expressed as:
[0062]
[0063] in, is the average cache capacity gain of the application; n is the maximum number of capacity increases; pi is the miss rate of the second cache after the i-th capacity increase; p i+1 is the miss rate of the second cache after the i+1th capacity increase; c i is the capacity value of the second cache after the i-1th capacity increase; c i+1 is the capacity value of the second cache after the i+1th capacity increase; ε1 is the gain random error.
[0064] The average cache capacity gain is used to reflect the sensitivity of an application to the capacity of the second cache. The larger the cache capacity gain, the better the effect of improving the cache miss rate by increasing the cache capacity, and vice versa. In the application classification of this embodiment 1, the cache capacity gain threshold p is used to th To determine whether an application is a sensitive application, that is, if the average cache capacity gain of the application The application is a sensitive application, otherwise it is an intensive application.
[0065] The streaming characteristics of an application are mainly derived from the locality of data access. For example, if the locality of data access is not good, the recently accessed data will be difficult to access again, resulting in a high cache miss rate. Even if the cache capacity is increased, the actual cache miss rate is unlikely to improve. In this case, the application is considered to have streaming characteristics. If the locality of data access is good, the cache miss rate of the application itself will be relatively low, and the miss rate can be significantly reduced by increasing the cache capacity. In this case, the application is considered to not have streaming characteristics.
[0066] In this embodiment 1, whether an application has streaming characteristics is mainly determined by whether the cache miss rate of the application changes smoothly with the capacity, and whether it is difficult to change after increasing to a certain capacity; in addition, since some applications may have cache jitter, the miss rate increases after increasing the cache capacity, that is, the cache capacity gain is a negative value and fluctuates, such applications are generally streaming applications.
[0067] Specifically, in order to determine whether an application is a streaming application, the following determination method is defined: if an application increases its miss rate after increasing the second cache capacity, the application is a streaming application; otherwise, the streaming application threshold C th As the boundary, it is determined that when the capacity of the second cache C>C th After that, is the miss rate of the application greater than the cache miss rate threshold P? s ; If yes, it is a streaming application; otherwise, it is a non-streaming application.
[0068] It should be noted that, considering that the actual measured cache miss rate may have errors, the gain random error ε1 and the gain random error ε2 are corrected; among them, the gain random error ε1 is used to correct the average cache capacity gain, that is, the judgment condition p of the average cache capacity gain is i -p i+1 ≠0 is changed to p i -p i+1 <ε1; the random error ε2 of the gain is used to correct the comparison between the cache capacity gain and 0; in addition, considering that the actual cache capacity is generally up to 32MB, the judgment condition of the second cache capacity C>C th Modified to C th <C≤32MB。
[0069] It should be noted that the streaming application threshold C th , cache miss rate threshold p s and cache gain threshold p th It can directly affect the classification effect of the classification algorithm. Therefore, the streaming application threshold C th , cache miss rate threshold p s and cache gain threshold p th The selection needs to be set comprehensively based on the application type and memory access characteristics.
[0070] The cache configuration optimization method described in this embodiment 1 uses the miss rate of the application's access to the cache as a basic indicator, and utilizes the streaming characteristics of the application's access to the cache and the application's sensitivity to the cache's capacity to classify the application's cache access behavior, and can accurately obtain the application's cache usage pattern; based on the classification results and memory access characteristics of the application's cache access behavior, the cache configuration parameters are optimized, which can meet the requirements of configuring different cache configuration parameters for different types of applications, achieve flexible and effective use of limited cache resources, ensure the rationality of the cache configuration, and effectively guarantee the execution performance of the program.
[0071] Example 2
[0072] Next, the cache configuration optimization device provided in this embodiment 2 is described.
[0073] As attached Figure 2As shown, this embodiment 2 provides a cache configuration optimization device, including: an application classification module and an optimization module; the application classification module is used to classify applications according to the streaming characteristics of application access to the cache and the capacity sensitivity characteristics of the application to the cache, and obtain the cache access behavior classification results of the application; the optimization module is used to optimize the cache configuration parameters according to the cache access behavior classification results of the application and the memory access characteristics of the application, that is, to obtain the cache configuration optimization results.
[0074] Specifically, the application classification module includes a calculation unit, a first judgment unit, a second judgment unit, a third judgment unit, a fourth judgment unit and a fifth judgment unit.
[0075] Computational unit, used to calculate the cache capacity gain p of the application g and the average cache capacity gain of the application The cache capacity gain of the application is:
[0076]
[0077] Among them, p g is the cache capacity gain of the application; Δp miss is the difference in miss rate before and after the second cache capacity gain; Δc is the capacity difference before and after the second cache capacity gain; p i-1 is the miss rate of the second cache after the i-1th capacity increase; p i is the miss rate of the second cache after the i-th capacity increase; c i is the capacity value of the second cache after the i-1th capacity increase; c i-1 is the capacity value of the second cache after the i-th capacity increase.
[0078] Average cache capacity gain for the application for:
[0079]
[0080] in, is the average cache capacity gain of the application; n is the maximum number of capacity increases; p i is the miss rate of the second cache after the i-th capacity increase; p i+1 is the miss rate of the second cache after the i+1th capacity increase; c i is the capacity value of the second cache after the i-1th capacity increase; c i+1 is the capacity value of the second cache after the i+1th capacity increase; ε1 is the gain random error.
[0081] The first judgment unit is used to determine the average cache capacity gain of the application program. and the preset cache gain threshold p th For comparison; if the average cache capacity gain of the application Greater than the preset cache gain threshold p th ,Right now If yes, it jumps to the second judgment unit; otherwise, it jumps to the fourth judgment unit.
[0082] The second judgment unit is used to increase the cache capacity gain p of the application program g Compared with the preset gain random error ε2; if a cache capacity gain p of an application g Less than the preset gain random error ε2, that is, p g <ε2, the cache access behavior classification result of the application is a sensitive flow type application; otherwise, jump to the third judgment unit.
[0083] The third judgment unit is used to determine whether the capacity value C is greater than the preset streaming application capacity threshold C. th The cache capacity gain p of all second caches c Both are greater than the cache miss rate threshold p s , that is, if for C>C th All second caches have p c >p s , then the cache access behavior classification result of the application is a sensitive flow type application; otherwise, the cache access behavior classification result of the application is a sensitive friendly application.
[0084] The fourth determining unit is used to increase the cache capacity gain p of the application program g Compared with the preset gain random error ε2; if a cache capacity gain p of an application g Less than the preset gain random error ε2, that is, p g <ε2, the cache access behavior classification result of the application is a dense flow type application; otherwise, jump to step 16.
[0085] The fifth judgment unit is used to judge that the capacity value C is greater than the preset streaming application capacity threshold C th The cache capacity gain p of all second caches c Both are greater than the cache miss rate threshold p s , that is, if for C>C th All second caches have p c >p s , the cache access behavior classification result of the application is a dense flow type application; otherwise, the cache access behavior classification result of the application is a dense flow type friendly application.
[0086] Example 3
[0087] Next, the cache configuration optimization device provided in this embodiment 3 is described.
[0088] As attached Figure 3 As shown, this embodiment 3 provides a computer device, including: a memory for storing a computer program; and a processor for implementing the steps of a cache configuration optimization method when executing the computer program.
[0089] The processor implements the steps of the above-mentioned cache configuration optimization method when executing the computer program, for example: classifying the applications according to the streaming characteristics of the applications accessing the cache and the characteristics of the applications' sensitivity to the cache capacity, and obtaining the classification results of the cache access behaviors of the applications; optimizing the cache configuration parameters according to the classification results of the cache access behaviors of the applications in combination with the memory access characteristics of the applications, and obtaining the cache optimization results.
[0090] Alternatively, when the processor executes the computer program, it implements the functions of each module in the above-mentioned cache configuration optimization device, for example: an application classification module, which is used to classify applications according to the streaming characteristics of application access to the cache and the capacity sensitivity characteristics of the application to the cache, and obtain the cache access behavior classification results of the application; an optimization module, which is used to optimize the cache configuration parameters according to the cache access behavior classification results of the application and the memory access characteristics of the application, so as to obtain the cache configuration optimization results.
[0091] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing preset functions, and the instruction segments are used to describe the execution process of the computer program in the computer device.
[0092] For example, the computer program can be divided into an application classification module and an optimization module, and the specific functions of each module are as follows: an application classification module is used to classify applications according to the streaming characteristics of application access to the cache and the capacity sensitivity characteristics of the application to the cache, and obtain the cache access behavior classification results of the application; an optimization module is used to optimize the cache configuration parameters according to the cache access behavior classification results of the application and the memory access characteristics of the application, that is, to obtain the cache configuration optimization results.
[0093] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, and a cloud server. The computer device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the above are examples of computer devices and do not constitute a limitation on computer devices. The computer device may include more components than the above, or a combination of certain components, or different components. For example, the computer device may also include input and output devices, network access devices, buses, etc.
[0094] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the computer device, and uses various interfaces and lines to connect various parts of the entire computer device.
[0095] The memory may be used to store the computer programs and / or modules, and the processor implements various functions of the computer device by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory.
[0096] The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (SmartMediaCard, SMC), a secure digital (SecureDigital, SD) card, a flash card (FlashCard), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0097] Example 4
[0098] This embodiment 4 also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the cache configuration optimization method are implemented.
[0099] If the module / unit integrated in the cache configuration optimization device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
[0100] Based on this understanding, the present invention implements all or part of the processes in the above cache configuration optimization method, and can also be completed by instructing related hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above cache configuration optimization method can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or preset intermediate form, etc.
[0101] The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc.
[0102] It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electrical carrier signals and telecommunication signals.
[0103] Example 5
[0104] This embodiment 5 provides a computer program product, which includes a computer program, which is stored in a computer-readable storage medium; a processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device can perform the attached Figure 1 The method in the corresponding embodiment 1 will not be described in detail here.
[0105] It should be noted that a person skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods.
[0106] The above embodiment is only one of the implementation methods that can realize the technical solution of the present invention. The scope of protection claimed by the present invention is not limited only to this embodiment, but also includes changes, replacements and other implementation methods that can be easily thought of by any technician familiar with the technical field within the technical scope disclosed by the present invention.
Claims
1. A cache configuration optimization method, characterized in that: include: According to the streaming characteristics of application access to cache and the characteristics of application sensitivity to cache capacity, the application is classified to obtain the classification results of the cache access behavior of the application; According to the classification result of the cache access behavior of the application program and in combination with the memory access characteristics of the application program, the configuration parameters of the cache are optimized to obtain the cache optimization result.
2. A cache configuration optimization method according to claim 1, characterized in that: The streaming characteristics of the application accessing the cache are used to determine whether the cache access form of the application is a streaming application; wherein the streaming characteristics of the application accessing the cache are specifically: for the second cache whose capacity is greater than the streaming application threshold, the increase or decrease of the application's miss rate.
3. A cache configuration optimization method according to claim 1, characterized in that: The characteristic of the sensitivity of the application to cache capacity is used to determine whether the cache access form of the application is a sensitive application; wherein the characteristic of the sensitivity of the application to cache capacity is specifically: the average cache capacity gain of the application.
4. A cache configuration optimization method according to claim 3, characterized in that: The average cache capacity gain for the application is: in, is the average cache capacity gain of the application; n is the maximum number of capacity increases; p i is the miss rate of the second cache after the i-th capacity increase; p i+1 is the miss rate of the second cache after the i+1th capacity increase; c i is the capacity value of the second cache after the i-1th capacity increase; c i+1 is the capacity value of the second cache after the i+1th capacity increase; ε1 is the gain random error.
5. A cache configuration optimization method according to claim 1, characterized in that: The cache access behavior classification results of the application include sensitive-friendly applications, sensitive-streaming applications, dense-friendly applications, and dense-streaming applications.
6. A cache configuration optimization method according to claim 1, characterized in that: The configuration parameters of the cache include cache capacity, replacement strategy and pre-fetch strategy.
7. A cache configuration optimization device, characterized in that: include: An application classification module is used to classify applications according to the streaming characteristics of application access to cache and the characteristics of application sensitivity to cache capacity, and obtain the classification results of cache access behavior of applications; The optimization module is used to optimize the cache configuration parameters according to the cache access behavior classification result of the application program and the memory access characteristics of the application program, so as to obtain the cache configuration optimization result.
8. A computer device, characterized in that: include: a processor suitable for executing a computer program; A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by the processor, the cache configuration optimization method according to any one of claims 1 to 6 is executed.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the cache configuration optimization method according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the cache configuration optimization method according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Distributed cache optimization method and device, storage medium and product
CN119357078A
Data access method, data access management system, storage medium and electronic equipment
CN119828960A
