Method and device for caching data
A technology of data cache and cache pool, which is applied in the direction of electronic digital data processing, memory system, memory address/allocation/relocation, etc., and can solve problems that affect system performance, cannot be changed by the client, and poor compatibility, etc.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0026] Embodiment 1 of the present application proposes a data caching method here, such as figure 1 As shown, the specific process is as follows:
[0027] Step 101 , record the number of hits of elements already stored in the cache pool being accessed, and record each time a new element is added to the cache pool.
[0028] Wherein, each element stored in the buffer pool corresponds to it with a unique identifier. The number of hits refers to the number of times the user terminal accesses the elements stored in the buffer pool. Every time an element stored in the buffer pool is accessed, the number of hits recorded for the element that should be accessed increases by 1. Since the elements stored in the buffer pool are constantly updated dynamically, the judgment of newly added elements can be judged according to the time when the element is added to the buffer pool, and the element with the latest update time can be determined as the newly added element to the buffer pool. F...
Embodiment 2
[0053] Correspondingly, in order to implement the data caching method described in the first embodiment above, the second embodiment of the present application proposes a data caching device, such as Figure 4 shown, including:
[0054] The importance information maintenance unit 401 is configured to maintain importance information for each element in the cache pool according to each new element added to the cache pool and the number of hits for elements already added to the cache pool.
[0055] Specifically, the above-mentioned importance information maintenance unit 401 is specifically configured to set a default value as the importance information of the newly added element when a new element is added to the cache pool, and remove the new element from the cache pool. The importance information maintained by each element other than the added element is updated to the original importance information minus a first preset value; and when an element in the buffer pool is hit by ...
Embodiment 3
[0063] Furthermore, Embodiment 3 of the present application takes the process of a user terminal accessing a website as an example to further elaborate the data caching method proposed in the embodiment of the present application. Such as Figure 5 As shown, the specific process is as follows:
[0064] Step 501, record the number of hits of elements already stored in the cache pool being accessed, and record the situation of each new element added to the cache pool, according to the recorded situation of each newly added element in the cache pool and the elements already added to the cache pool The number of hits accessed, maintaining importance information separately for each element in the buffer pool. Assume that there are currently five elements K1...K5 stored in the buffer pool, and the importance information corresponding to the five elements is W1...W5.
[0065] Step 502: Receive an access request from the user terminal, and include data information that the user term...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 