A method and terminal for reading and writing cache
A cache, read and write technology, applied in the field of cache, can solve the problems of memory data read and write conflicts, thread stuck, data inaccuracy, etc., to achieve the effect of separation of read and write and relieve the pressure of read and write
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0065] Please refer to figure 1 and Figure 3-4 , a method for caching reads and writes, including steps:
[0066] S1. Set up read-only cache, read-write cache and normal cache;
[0067] Specifically, the data types stored in the local memory are divided into three types: read-only cache, read-write cache, and common cache, and the common cache is the real data storage cache;
[0068] The read-only cache, read-write cache and common cache are all stored in the memory in the data structure mode of MAP;
[0069] S21. In the read scenario, if no corresponding data is queried in the read-only cache, query the read-write cache; if no corresponding data is queried in the read-write cache, query the normal cache, and updating the read-only cache and the read-write cache respectively with the data queried by the common cache;
[0070] Specifically, the client requests the interface API to obtain relevant data information, that is, sends a data request;
[0071] S211, the interfac...
Embodiment 2
[0084] The difference between this embodiment and embodiment one is:
[0085] The regular polling of the read-write cache in the step S3 is specifically:
[0086] The read-write cache is periodically polled by an independent asynchronous thread.
[0087] Specifically, for example, by polling the read-write cache at intervals of 30 seconds by an independent asynchronous thread, the read-write cache can be monitored without affecting original business logic and occupying resources.
Embodiment 3
[0089] Please refer to figure 2 , a terminal 1 for buffering read and write, including a memory 2, a processor 3, and a computer program stored on the memory 2 and operable on the processor 3, when the processor 3 executes the computer program, it implements Steps in Example 1.
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


