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

Pending Publication Date: 2019-05-24
FUJIAN TIANQUAN EDUCATION TECH LTD
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, due to the cache exception, loading to the cache also fails at this time. At this time, there is a problem that the cache service will s

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Cache penetration method and a terminal
  • Cache penetration method and a terminal

Examples

Experimental program
Comparison scheme
Effect test

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...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a cache penetration method and a terminal. The method comprises the steps of obtaining data according to a data request; judging whether the cache service is available or not;if not, directly accessing a database to obtain data corresponding to the data request, the use of the cache service is shielded; According to the method and the device, if the cache service is foundto be unavailable, the acquired data cannot be loaded to the cache service after the corresponding data is acquired from the database, so that the cache service can be reasonably called, the meaningless operation when the cache service is unavailable is avoided, the resource utilization rate and efficiency are improved, and the user experience is improved.

Description

technical field [0001] The present invention relates to the technical field of cache penetration, in particular to a cache penetration method and terminal. Background technique [0002] Caching technology is a common method used to improve the performance of programs. Many websites use caching technology to improve their own performance. In general systems, caching servers such as redis or memcache are usually used as the caching layer, and are implemented in the form of clusters or single nodes. To provide caching services, corresponding code needs to be added in the business system to support caching services. Generally, the interface service queries a certain cache in advance. If the cache does not exist, it queries the database and loads the data into the cache. At this time, no matter whether the cache software used is a single point or a cluster mode, there will be downtime, power failure, and network failure. The cache is unavailable due to various situations such as...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F16/2455
Inventor 刘德建林伟郭玉湖
Owner FUJIAN TIANQUAN EDUCATION TECH LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products