Cache penetration method and a terminal
A cache and terminal technology, applied in special data processing applications, instruments, electrical and digital data processing, etc., can solve problems such as failure, poor user experience, waste of resources, etc., to avoid meaningless operations, improve user experience, and increase resources. The effect of utilization and efficiency
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Example Embodiment
[0056] Example one
[0057] A method for buffer penetration, including the steps:
[0058] S1, receive the data request, determine whether the cache service is available, if not, execute S2;
[0059] Among them, the cache server is dynamically monitored through an independent asynchronous thread, and an identification of whether the cache service is available is set according to the monitoring result;
[0060] Specifically, periodically query the cache server, access the data of the preset field on the cache server, and determine whether the cache server can return the data of the preset field normally, if so, the access to the cache server is successful, and the preset The number of failures of is set to 0, and the identifier of the cache service is set to be available;
[0061] If not, that is, when waiting timeout occurs or the cache server is abnormal, etc., the preset field data cannot be returned normally, then the access to the cache server fails, the preset number of failures i...
Example Embodiment
[0071] Example two
[0072] Apply the method described in Embodiment 1 to the scenario of user login:
[0073] The server stores the token required for user login in the cache service and database;
[0074] S1. Receive the token request and judge whether the cache service is available, if not, execute S2;
[0075] When verifying the token, first query whether the corresponding token exists in the cache service, if not, then access the database;
[0076] Among them, the cache server is dynamically monitored through an independent asynchronous thread, and an identification of whether the cache service is available is set according to the monitoring result;
[0077] Specifically, query the cache server regularly, access the data of the preset field key on the cache server, and determine whether the cache server can return the data of the preset field key normally, if so, the access to the cache server is successful, and The preset number of failures is set to 0, and the identifier of the c...
Example Embodiment
[0085] Example three
[0086] Please refer to figure 2 , A cache penetrating terminal 1, including a memory 2, a processor 3, and a computer program stored on the memory 2 and running on the processor 3. The processor 3 implements the implementation when the computer program is executed The steps in Example 1.
[0087] In summary, the cache penetration method and terminal provided by the present invention dynamically monitor the cache server, and set the flag of whether the cache service is available according to the monitoring result. When acquiring data according to the data request, first The identification of whether the cache service is available determines whether the cache service is available. If not, the database is accessed to obtain the data corresponding to the data request, and the use of the cache service is shielded. After obtaining the corresponding data, the obtained data will no longer be loaded into the cache service; the independent asynchronous thread period...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap