Annotation-based local cache realization method, storage device and electronic device

A technology of local cache and implementation method, applied in memory systems, program control design, software engineering design, etc., can solve problems such as unfavorable maintenance and large amount of local cache development, and achieve the effect of reducing workload

CN107463378AInactive Publication Date: 2017-12-12SHENZHEN HIVE BOX TECHNOLOGY CO LTD
5 Cites 11 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Publication Date
2017-12-12
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 an annotation-based local cache realization method, a storage device and an electronic device. The method comprises the steps of A, when a Java class method is called, intercepting the Java class method; B, analyzing an annotation contained in the Java class method to generate a cache mark; and C, returning a realization result of the Java class method through a cache, or performing addition or deletion operation on the cache. If the realization result of one method needs to be locally cached, only the corresponding annotation needs to be configured in the method, and then the cache can be operated according to the annotation, so that the workload is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The present invention relates to the technical field of local caching, in particular to an annotation-based local caching implementation method, a storage device and an electronic device. Background technique

[0002] In the prior art, some data has a small amount of data but is accessed very frequently (such as some data dictionaries). For this scenario, it is necessary to download the data to the local cache of the application to improve the access efficiency of the system and reduce unnecessary Database access, this is because the database access occupies the database connection, and the network consumption is relatively large. The so-called local cache is relative to the network (including clusters, database access, etc.), but in the system, for each type of cache, a corresponding class must be written to handle cache operations, which undoubtedly increases the development workload. Adding cache judgment and access operations to the program also i...

Examples

Embodiment Construction

[0046] The present invention provides an annotation-based local cache implementation method, storage device and electronic device. In order to make the purpose, technical solution and effect of the present invention clearer and clearer, the present invention will be further described in detail below. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

[0047] see figure 1 , figure 1 It is a flow chart of a preferred embodiment of an annotation-based local cache implementation method of the present invention, as shown in the figure, which includes steps:

[0048] S1, when calling the Java class method, intercepting the Java class method;

[0049] S2. Analyzing the annotation contained in the Java class method to generate a cache flag;

[0050] S3. Return the implementation result of the Java class method through the cache, or create a cache or clear the cache.

[0051] In t...