Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

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 still be accessed normally after each cache exception and the data will be loaded to the cache service, wasting resources and poor user experience.

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

Embodiment 1

[0057] A cache penetration method, including steps:

[0058] S1. Receive the data request, judge 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 indication of whether the cache service is available is set according to the monitoring result;

[0060] Specifically, regularly query the cache server, access the data of the preset field on the cache server, and judge whether the cache server can normally return the data of the preset field, if so, then access the cache server successfully, and the preset The number of failures is set to 0, and the identifier of the cache service is set to be available;

[0061] If not, when waiting for timeout or abnormality of the cache server, etc. cannot return the preset field data normally, the access to the cache server fails, and the preset number of failures is increased by 1, and the continuous query cache is judge...

Embodiment 2

[0072] Apply the method described in Embodiment 1 to the scenario of user login:

[0073] The server saves the token required for user login in the cache service and database;

[0074] S1. Receive the token request, judge whether the cache service is available, if not, execute S2;

[0075] When verifying the token, first query whether there is a corresponding token in the cache service, and if not, access the database;

[0076] Among them, the cache server is dynamically monitored through an independent asynchronous thread, and an indication of whether the cache service is available is set according to the monitoring result;

[0077] Specifically, regularly query the cache server, access the data of the preset field key on the cache server, and judge whether the cache server can normally return the data of the preset field key, if so, then access the cache server successfully, and send The preset number of failures is set to 0, and the identifier of the cache service is set ...

Embodiment 3

[0086] Please refer to figure 2 , a cache penetration terminal 1, comprising a memory 2, a processor 3, and a computer program stored in the memory 2 and operable on the processor 3, the processor 3 implements the computer program when executing the computer program Steps in Example 1.

[0087] To sum up, the cache penetration method and terminal provided by the present invention dynamically monitor the cache server, and set whether the cache service is available or not according to the monitoring results. The identifier of whether the cache service is available determines whether the cache service is available. If not, access the database to obtain the data corresponding to the data request, and block the use of the cache service. That is, if the cache service is found to be unavailable, the database After the corresponding data is obtained, the obtained data will not be loaded into the cache service again; dynamic monitoring is realized by periodically querying the cache s...

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 Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products