Data caching method and device, equipment and storage medium

A data caching and caching technology, applied in the computer field, can solve the problems of instantaneous increase in database access, data loss, cache invalidation, etc., to improve user experience, prevent loss, and improve efficiency.

CN114553960AInactive Publication Date: 2022-05-27四川万网鑫成信息科技有限公司
2 Cites 5 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Publication Date
2022-05-27
Estimated Expiration
Not applicable · inactive patent

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The invention discloses a data caching method and device, equipment and a storage medium, and relates to the technical field of computers, and the method comprises the steps that a data acquisition request initiated by a target client for target data is acquired, after the data acquisition request reaches a gateway, the gateway judges whether a first-level cache located in a local memory hits the target data or not according to a target caching rule, and if yes, the first-level cache in the local memory hits the target data; if the target data is hit, obtaining the target data from the first-level cache and returning the target data to the target client, if the target data is not hit, judging whether the target data exists in a second-level cache of the preset cache middleware or not, and if the target data exists in the second-level cache, obtaining the target data from the second-level cache and returning the target data to the target client, and if not, obtaining the target data from the service system and returning the target data to the target client. According to the method, network transmission and I / O operation of a disk are reduced in a multi-level cache mode, the client request efficiency, the CPU resource utilization rate and the query frequency processed by the system in unit time are improved, and meanwhile cache data can be prevented from being lost.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The present application relates to the field of computer technologies, and in particular, to a data caching method, apparatus, device, and storage medium. Background technique

[0002] In the traditional architecture, the request initiated by the client will directly reach the database of the server, and the database will respond to the client after finding the data. Under this architecture, there will be response time timeout and excessive server resource occupation due to too long links, thus affecting the throughput and stability of the system.

[0003] At present, in order to improve the data access speed and program performance, the cache mechanism is usually used to preload the data in the database into the memory, and then it is completed in the memory when accessing the data, thereby reducing the access to the database and solving the problem. In high concurrency scenarios, the database can easily become a performance bottleneck. However, the...

Examples

Embodiment Construction

[0039] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0040] The embodiment of the present application discloses a data caching method, which is applied to a server. See figure 1 As shown, the method includes:

[0041] Step S11: Acquire a data acquisition request initiated by the target client for the target data.

[0042] In this embodiment, it is first necessary to acquire a data acquisition request initiated by a target client (Client) corresponding to the server for the target data whe...