Multi-level cache expiration time processing method and system based on springCache for e-commerce platform

By using Java enumeration classes and custom parsers to manage the expiration time of the first-level cache and the second-level cache respectively on the e-commerce platform, the problem of being unable to independently set the expiration time in the existing technology is solved, and the cache efficiency and management convenience are improved. performance, reducing maintenance costs.

CN117909255BActive Publication Date: 2024-10-11SHANGHAI BAIQIU E-COMMERCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311664600.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-06
Publication Date
2024-10-11
Estimated Expiration
2043-12-06

AI Technical Summary

Technical Problem

Existing technology cannot set the expiration time for the first-level cache and the second-level cache respectively on the e-commerce platform, resulting in complex cache management and low performance, and managing the expiration time through configuration files will lead to a bloated system and difficult maintenance.

Method used

Use the enum enumeration class in Java to manage the expiration time of the cache through TtlEnum, find the corresponding members in CacheNameTtlEnum according to the properties of cacheName and bind them, and set the first-level cache and second-level cache when receiving the access request through a custom parser. The cache expiration time.

Benefits of technology

It achieves flexible management of the expiration time of the first-level cache and the second-level cache, reduces project maintenance costs, improves cache efficiency, meets J2Cache specifications, and avoids the need for developers to add additional annotations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117909255B_ABST
    Figure CN117909255B_ABST
Patent Text Reader

Abstract

The present invention discloses a multi-level cache expiration time processing method based on springCache of an e-commerce platform, comprising the following steps: configuring the expiration time of the first-level cache and the second-level cache respectively based on springCache, configuring limited expiration time options through the enum enumeration class in java, wherein each option has a corresponding relationship with cacheName, thereby realizing the binding of cacheName and the expiration time; searching for members with the same parameters in CacheNameTtlEnum according to the attributes of cacheName and binding; after receiving an access request, parsing the attributes of the cache data accessed by the target in the access request based on a preset custom parser, and setting the first-level cache expiration time and the second-level cache expiration time when the parsing result meets the preset conditions; creating a cache instance and setting the expiration time. The present invention can set the first-level cache and the second-level cache time respectively, thereby realizing the refined control of the cache of the e-commerce platform.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of cache management, and in particular to a multi-level cache expiration time processing method and system based on springCache for an e-commerce platform. Background Art

[0002] In cache management, different data will have different TTL (Time To live) strategies. In Redis, different TTL times can be set for different keys. However, general Java memory cache frameworks (such as Ehcache, Caffeine, Guava Cache, etc.) cannot set different TTLs for each key, because this will be very complicated to manage, and the performance is extremely poor when checking whether the cached data is invalid. Therefore, general memory cache frameworks will manage a group of cache data with the same TTL strategy together. Therefore, it is necessary to bind businesses with the same expiration time to specific regions. Web applications based on the spring framework running on the Java 8 platform, the underlying framework is a cache framework based on SpringCache, usually using Caffeine as the first-level cache and Redis as a centralized second-level cache.

[0003] SpringCache is a general cache framework that supports the JSR107 specification. Developers only need to replace the cache source to achieve the effect of using different caches through the springCache framework. However, if you want to use SpringCache to operate Caffeine and Redis at the same time, you will encounter a problem: the Redis cache granularity is inconsistent with the Caffeine cache granularity. The cache expiration time of Redis is that each key has a separate expiration time, while the minimum granularity of Caffeine is a Cache instance. A Cache instance is actually a collection, and each element in the collection is a key. So in terms of granularity, Caffeine is coarser, so when setting the cache expiration time, you can only compromise with Caffeine and set the expiration time for only one Cache instance.

[0004] In the prior art, an additional annotation is added by custom annotation to set the cache expiration time, and the expiration time can be flexibly configured. However, if the expiration time needs to be specified by the developer, it will be easy to be messy and error-prone if there are too many functions.

[0005] In the prior art, limited regions and corresponding expiration times are placed in the configuration file according to the description in the document. However, the expiration time of the second-level cache is exactly the same as that of the first-level cache. Therefore, unless a machine is powered off, the service is suspended or restarted, the second-level cache will not be used in many cases. The meaning of the second-level cache is lost.

[0006] Someone in gitee also pointed out that J2Cache cannot set different expiration times for different caches. However, the official answer is: defining the validity period of cached data in the program will make the cache uncontrollable. Once there is a problem with the data, there is no way to find it. Therefore, the validity period of all caches in J2Cache must be preset in the configuration of the first-level cache before use. This answer only explains that the expiration time of the cache needs to be pre-configured to prevent problems such as the above-mentioned flexible definition of expiration time causing confusion, but it does not answer why the expiration time of the first-level cache and the second-level cache cannot be set separately.

[0007] In summary, the prior art has the following problems:

[0008] 1. Based on the binding of region and expiration time, it is not possible to support setting expiration time for first-level cache and second-level cache separately;

[0009] 2. Managing all cache expiration times through configuration files will make the original system-level configuration files too bloated.

[0010] In the specific application scenario of e-commerce platforms, due to the wide variety of products, the image cache is much larger than ordinary services, and the access requests and data concurrency are large. This puts higher requirements on cache management, that is, how to obtain higher access efficiency when the access requests and data concurrency are large. This is related to the user experience of the e-commerce platform. Summary of the invention

[0011] To solve the above problems, the purpose of the present invention is to provide a multi-level cache expiration time processing method and system based on springCache for an e-commerce platform, which can set the expiration time of the first-level cache and the second-level cache respectively, and manage the expiration time of the cache through TtlEnum, thereby improving the flexibility of the system and the convenience of maintenance.

[0012] To achieve the above-mentioned purpose, the technical solution of the present invention is: a multi-level cache expiration time processing method based on springCache for an e-commerce platform, comprising the following steps: configuring the expiration time for the first-level cache and the second-level cache respectively based on springCache, configuring limited expiration time options through the enum enumeration class in java, wherein each option corresponds to cacheName, thereby realizing the binding of cacheName and the expiration time; searching for members with the same parameters in CacheNameTtlEnum according to the attributes of cacheName and binding them; after receiving an access request, parsing the attributes of the target accessed cache data in the access request based on a preset custom parser, and setting the first-level cache expiration time and the second-level cache expiration time when the parsing result meets the preset conditions; creating a cache instance and setting the expiration time.

[0013] Preferably, the method of searching for members with the same parameters in CacheNameTtlEnum and binding them according to the attributes of cacheName includes: finding the member of CacheNameTtlEnum corresponding to cacheName through cacheName, and obtaining TtlEnum therein; finding the member whose cacheName attribute is the same as the incoming cacheName parameter from CacheNameTtlEnum through the findByName command, thereby obtaining the constraint that the cached cacheName must use the cacheName attribute existing in CacheNameTtlEnum.

[0014] Preferably, the method for parsing the attributes of the target accessed cache data in the access request based on a preset custom parser includes: parsing the cache annotation, creating a RedisCaffeineCache, and obtaining the corresponding expiration time based on the cacheName; determining whether the first-level cache expiration time is less than the second-level cache expiration time, and if so, setting the first-level cache expiration time and the second-level cache expiration time.

[0015] Preferably, parsing the properties of the target accessed cache data in the access request based on a preset custom parser also includes: using members in the constant class as the annotation's cacheName when using annotations; specifying the value of value for the native springCache cache annotation; when using the springCache annotation, cacheName must use members in the maintained constant class, and when the framework parses the cache annotation, the defined cacheExpireResolver parser is used, and the cacheName on the annotation is used to find the member corresponding to the CacheNameTtlEnum. Once found, it will verify whether the cache time meets the constraints.

[0016] Preferably, if the cacheName attribute on the springCache annotation is also filled with the options in the CacheNameConstant constant class, and then when parsing the annotation, the options in the constant class can be mapped to the cacheName attribute of an option in CacheNameTtlEnum, then the expiration time constraint can also be implemented.

[0017] Preferably, the method further comprises: pre-specifying the cache annotation as cacheName, and the developer only needs to select a specific annotation without specifying cacheName.

[0018] Preferably, the method further includes: both the expiration time of caffeine and the creation of an instance need to be performed after RedisCaffeineCache is created and cacheExpireResolver parses the annotation.

[0019] Based on the same concept, the present invention also provides an e-commerce platform multi-level cache expiration time processing system based on springCache, including: a binding module, which is used to configure the expiration time for the first-level cache and the second-level cache respectively based on springCache, and configure limited expiration time options through the enum enumeration class in java, wherein each option has a corresponding relationship with cacheName, thereby realizing the binding of cacheName and the expiration time; a query module, which is used to search for members with the same parameters in CacheNameTtlEnum according to the attributes of cacheName and bind them; a parsing module, which is used to parse the attributes of the target accessed cache data in the access request based on a preset custom parser after receiving an access request, and set the first-level cache expiration time and the second-level cache expiration time when the parsing result meets the preset conditions; a construction module, which is used to create a cache instance and set the expiration time.

[0020] Based on the same concept, the present invention also provides a computer device, including: a memory, the memory is used to store a processing program; a processor, when the processor executes the processing program, it implements any of the above-mentioned multi-level cache expiration time processing methods based on springCache for e-commerce platforms.

[0021] Based on the same concept, the present invention also provides a readable storage medium, on which a processing program is stored. When the processing program is executed by a processor, any of the above-mentioned multi-level cache expiration time processing methods based on springCache for an e-commerce platform is implemented.

[0022] Due to the adoption of the above technical solution, the present invention has the following advantages and positive effects compared with the prior art:

[0023] 1. The technical solution of the present invention can meet the three specifications of J2Cache, can configure the first-level and second-level cache expiration times respectively, does not require additional annotations from developers, and can constrain the time relationship between the first-level and second-level cache expiration times. The limited expiration time options are managed through the enum enumeration class in Java, replacing the original management method based on configuration files. Each option corresponds to a cacheName / region and a TtlEnum, which enables convenient management of the first-level cache and second-level cache expiration times, saves implementation in later changes, and reduces the maintenance cost of the project. For e-commerce platforms with high browsing volume and high data volume, the technical solution of this embodiment can achieve a significant improvement in cache efficiency, thereby helping to improve customer satisfaction.

[0024] 2. In the technical solution of the present invention, springCache does not constrain cacheName in use, so if the cacheName attribute on the springCache annotation also fills in the options in the CacheNameConstant constant class, the binding constraint of the expiration time can also be achieved through the solution of this embodiment.

[0025] 3. The technical solution of the present invention changes the creation timing of the first-level cache. The original framework creates the first-level and second-level cache sources together when creating the RedisCaffeineCache cache. RedisCaffeineCache is a combination of two cache sources, redis and caffeine. When it is created, the local caffeine will be instantiated, and the expiration time of caffeine can only be set when it is instantiated. In the original framework, caffeine obtains the expiration time through the configuration file, and we have managed the expiration time through TtlEnum. The expiration time has not been parsed when creating RedisCaffeineCache. Therefore, the expiration time of caffeine and the creation of the instance need to be performed after the RedisCaffeineCache is created and the cacheExpireResolver parses the annotation. So compared with the original RedisCaffeineCache, we have delayed the creation of the caffeine cache. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The specific embodiments of the present invention are further described in detail below with reference to the accompanying drawings, wherein:

[0027] Figure 1It is a flow chart of the multi-level cache expiration time processing method based on springCache of the e-commerce platform of the present invention;

[0028] Figure 2 This is the constraint and verification process of the parser of the present invention. DETAILED DESCRIPTION

[0029] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. The advantages and features of the present invention will become more apparent from the following description and claims. It should be noted that the drawings are all in a very simplified form and use non-precise ratios, which are only used to conveniently and clearly assist in explaining the purpose of the embodiments of the present invention.

[0030] It should be noted that all directional indications in the embodiments of the present invention (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0031] First embodiment

[0032] like Figure 1 As shown, a flowchart of a multi-level cache expiration time processing method based on springCache of an e-commerce platform is shown, including the following steps:

[0033] S100: Based on springCache, the expiration time is configured for the first-level cache and the second-level cache respectively, and the limited expiration time options are configured through the enumeration class in Java, where each option corresponds to the cacheName, thereby realizing the binding of the cacheName and the expiration time;

[0034] S200: according to the attribute of cacheName, find a member with the same parameters in CacheNameTtlEnum and bind it;

[0035] S300: after receiving the access request, the attributes of the cache data to be accessed in the access request are parsed based on a preset custom parser, and when the parsing result meets the preset conditions, the first-level cache expiration time and the second-level cache expiration time are set;

[0036] S400: Create a cache instance and set an expiration time.

[0037] In the prior art, setting up a cache requires several steps, and changing the expiration time requires changing it everywhere where it is used. However, this application can meet the three specifications of J2Cache, can configure the expiration time of the first and second level caches respectively, does not require developers to make additional annotations, and can constrain the time relationship between the expiration time of the first and second level caches. The enum enumeration class in Java is used to manage limited expiration time options, replacing the original management method based on configuration files. Each option corresponds to a cacheName, which is a region, and also corresponds to a TtlEnum. TtlEnum maintains the corresponding relationship between the expiration time of the first level cache and the second level cache. Convenient management of the expiration time of the first level cache and the second level cache is achieved, and the cost of project maintenance can be reduced in later changes. For e-commerce platforms with high browsing volume and high data volume, the technical solution of this embodiment can achieve a significant improvement in cache efficiency, thereby helping to improve customer satisfaction.

[0038] For example, if we define a SHORT_TIME, it means a 3-second first-level cache and a 6-second second-level cache. Such caches are all in a region called SHORT_TIME. Of course, the specific value and time unit are defined by the business. The CacheNameConstant class is where we manage regions. According to the J2Cache specification, regions are limited, and limited means that there must be a place to maintain and manage them. This class is that "place".

[0039] Step S100 is to bind region / cacheName to the expiration time. However, the enumeration class only maintains the available options, and springCache does not constrain cacheName in use. Therefore, it is necessary to verify that any cached cacheName can only use pre-maintained options. In addition, the expiration time of the first-level and second-level caches must also meet certain relationships.

[0040] See also Figure 2 Step S200 searches for members with the same parameters in CacheNameTtlEnum according to the attributes of cacheName and binds them, including: finding the member of CacheNameTtlEnum corresponding to cacheName through cacheName, and obtaining TtlEnum therein; finding the member whose cacheName attribute is the same as the passed-in cacheName parameter from CacheNameTtlEnum through the findByName command, thereby obtaining the constraint that the cacheName of the cache must use the cacheName attribute existing in CacheNameTtlEnum.

[0041] Thus, the three-party binding of region, CacheNameConstant constant class, and CacheNameTtlEnum expiration option is completed. Later, TtlEnum can be used to know whether the relationship between the configured first-level and second-level caches meets our requirements. In this embodiment, it is only checked that the first-level cache expiration time cannot be greater than the second-level cache expiration time. Of course, other attributes / conditions can also be checked according to specific scenarios.

[0042] Preferably, the method for parsing the attributes of the target accessed cache data in the access request based on a preset custom parser includes: parsing the cache annotation, creating a RedisCaffeineCache, and obtaining the corresponding expiration time based on the cacheName; determining whether the first-level cache expiration time is less than the second-level cache expiration time, and if so, setting the first-level cache expiration time and the second-level cache expiration time.

[0043] Preferably, parsing the properties of the target accessed cache data in the access request based on a preset custom parser also includes: using members in the constant class as the annotation's cacheName when using annotations; specifying the value of value for the native springCache cache annotation; when using the springCache annotation, cacheName must use members in the maintained constant class, and when the framework parses the cache annotation, the defined cacheExpireResolver parser is used, and the cacheName on the annotation is used to find the member corresponding to the CacheNameTtlEnum. Once found, it will verify whether the cache time meets the constraints.

[0044] To describe the overall process, when we use the springCache annotation, cacheName should use the member in the constant class we maintain. When the framework parses the cache annotation, it will use the cacheExpireResolver parser we defined, and use the cacheName on the annotation to find the member corresponding to CacheNameTtlEnum. If it is not found, it will not run. If it is found, it will check whether the cache time meets the constraint conditions.

[0045] Preferably, if the cacheName attribute on the springCache annotation is also filled with the options in the CacheNameConstant constant class, and then when parsing the annotation, the options in the constant class can be mapped to the cacheName attribute of an option in CacheNameTtlEnum, then the expiration time constraint can also be implemented.

[0046] SpringCache does not constrain cacheName in use, so if the cacheName attribute on the springCache annotation also fills in the options in the CacheNameConstant constant class, the binding constraint of the expiration time can also be achieved through the solution of this embodiment.

[0047] Preferably, the method further comprises: pre-specifying the cache annotation as cacheName, and the developer only needs to select a specific annotation without specifying cacheName.

[0048] This embodiment combines native annotations and pre-specifies a simplified operation of cacheName.

[0049] Preferably, the method further includes: the expiration time of caffeine and the creation of an instance need to be performed after RedisCaffeineCache is created and cacheExpireResolver parses the annotation. In order to support the setting of cache time separately, we changed the creation time of the first-level cache. The original framework created the first-level and second-level cache sources together when creating the RedisCaffeineCache cache. RedisCaffeineCache is a combination of two cache sources, redis and caffeine. When it is created, the local caffeine will be instantiated, and the expiration time of caffeine can only be set when it is instantiated. In the original framework, caffeine obtains the expiration time through the configuration file, and we have managed the expiration time through TtlEnum. The expiration time has not been parsed when RedisCaffeineCache is created. Therefore, the expiration time of caffeine and the creation of an instance need to be performed after RedisCaffeineCache is created and cacheExpireResolver parses the annotation. So compared with the original RedisCaffeineCache, we have delayed the creation time of the caffeine cache.

[0050] Second embodiment

[0051] Based on the same concept, the present invention also provides an e-commerce platform multi-level cache expiration time processing system based on springCache, including: a binding module, which is used to configure the expiration time for the first-level cache and the second-level cache respectively based on springCache, and configure limited expiration time options through the enum enumeration class in java, wherein each option has a corresponding relationship with cacheName, thereby realizing the binding of cacheName and the expiration time; a query module, which is used to search for members with the same parameters in CacheNameTtlEnum according to the attributes of cacheName and bind them; a parsing module, which is used to parse the attributes of the target accessed cache data in the access request based on a preset custom parser after receiving an access request, and set the first-level cache expiration time and the second-level cache expiration time when the parsing result meets the preset conditions; a construction module, which is used to create a cache instance and set the expiration time.

[0052] In the prior art, setting up a cache requires several steps, and changing the expiration time requires changing it everywhere where it is used. However, this application can meet the three specifications of J2Cache, can configure the expiration time of the first and second level caches respectively, does not require developers to make additional annotations, and can constrain the time relationship between the expiration time of the first and second level caches. The enum enumeration class in Java is used to manage limited expiration time options, replacing the original management method based on configuration files. Each option corresponds to a cacheName, which is a region, and also corresponds to a TtlEnum. TtlEnum maintains the corresponding relationship between the expiration time of the first level cache and the second level cache. Convenient management of the expiration time of the first level cache and the second level cache is achieved, and the cost of project maintenance can be reduced in later changes. For e-commerce platforms with high browsing volume and high data volume, the technical solution of this embodiment can achieve a significant improvement in cache efficiency, thereby helping to improve customer satisfaction.

[0053] Based on the same inventive concept, the present invention also provides a computer device, including: a memory, the memory is used to store a processing program; a processor, when the processor executes the processing program, it implements any one of the multi-level cache expiration time processing methods of the e-commerce platform based on springCache.

[0054] Based on the same inventive concept, the present invention also provides a readable storage medium, on which a processing program is stored. When the processing program is executed by a processor, any one of the multi-level cache expiration time processing methods based on springCache for an e-commerce platform is implemented.

[0055] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.

[0056] The embodiments of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above embodiments. Even if various changes are made to the present invention, if these changes fall within the scope of the claims of the present invention and their equivalents, they still fall within the protection scope of the present invention.

Claims

1. A multi-level cache expiration time processing method based on springCache for an e-commerce platform, characterized in that: The following steps are involved: Based on springCache, the expiration time is configured for the first-level cache and the second-level cache respectively, and the limited expiration time options are configured through the enumeration class in java, where each option corresponds to the cacheName, thereby realizing the binding of the cacheName and the expiration time; According to the cacheName attribute, find the member with the same parameters in CacheNameTtlEnum and bind it; After receiving the access request, the attributes of the cache data to be accessed by the target in the access request are parsed based on the preset custom parser, and when the parsing result meets the preset conditions, the first-level cache expiration time and the second-level cache expiration time are set; wherein, the parsing of the attributes of the cache data to be accessed by the target in the access request based on the preset custom parser further includes: using members in the constant class as the cacheName of the annotation when using the annotation; specifying the value of the cache annotation of the native springCache; when using the springCache annotation, the cacheName must use members in the maintained constant class, and when the framework parses the cache annotation, the defined cacheExpireResolver parser is used, and the cacheName on the annotation is used to find the member corresponding to the CacheNameTtlEnum. After finding it, it will verify whether the cache time meets the constraint conditions; Create a cache instance and set the expiration time. The expiration time of caffeine and the creation of the instance need to be performed after RedisCaffeineCache is created and cacheExpireResolver parses the annotation.

2. According to claim 1, the multi-level cache expiration time processing method based on springCache of the e-commerce platform is characterized in that: Methods for finding members with the same parameters in CacheNameTtlEnum and binding them according to the cacheName attribute include: Find the member of CacheNameTtlEnum corresponding to cacheName through cacheName, and obtain TtlEnum; The findByName command is used to find the member whose cacheName attribute is the same as the passed-in cacheName parameter from CacheNameTtlEnum, thereby obtaining the constraint that the cacheName of the cache must use the cacheName attribute existing in CacheNameTtlEnum.

3. According to claim 1, the multi-level cache expiration time processing method based on springCache of the e-commerce platform is characterized in that: The method for parsing the attributes of the cache data to be accessed by the target in the access request based on the preset custom parser includes: Parse cache annotations, create RedisCaffeineCache, and obtain the corresponding expiration time based on cacheName; Determine whether the first-level cache expiration time is less than the second-level cache expiration time. If so, set the first-level cache expiration time and the second-level cache expiration time.

4. According to claim 1, the multi-level cache expiration time processing method based on springCache of the e-commerce platform is characterized in that: If the cacheName attribute on the springCache annotation is also filled with the options in the CacheNameConstant constant class, and then when parsing the annotation, the options in the constant class can be mapped to the cacheName attribute of an option in CacheNameTtlEnum, then the expiration time constraint can also be implemented.

5. According to claim 1, the multi-level cache expiration time processing method based on springCache of the e-commerce platform is characterized in that: The method further includes: pre-specifying a cache annotation as cacheName, so that the developer only needs to select a specific annotation without specifying cacheName.

6. A multi-level cache expiration time processing system based on springCache for an e-commerce platform, characterized in that: include: The binding module is used to configure the expiration time for the first-level cache and the second-level cache respectively based on springCache. The limited expiration time options are configured through the enumeration class in java, where each option corresponds to the cacheName, thereby realizing the binding of the cacheName and the expiration time; The query module is used to find members with the same parameters in CacheNameTtlEnum according to the attributes of cacheName and bind them; A parsing module is used to parse the properties of the cache data to be accessed by the target in the access request based on a preset custom parser after receiving the access request, and set the first-level cache expiration time and the second-level cache expiration time when the parsing result meets the preset conditions; wherein, the parsing of the properties of the cache data to be accessed by the target in the access request based on the preset custom parser further includes: using members in the constant class as the cacheName of the annotation when using the annotation; specifying the value of the cache annotation of the native springCache; when using the springCache annotation, the cacheName must use members in the maintained constant class, and when the framework parses the cache annotation, the defined cacheExpireResolver parser is used, and the cacheName on the annotation is used to find the member corresponding to the CacheNameTtlEnum. After finding it, it will verify whether the cache time meets the constraint conditions; Build a module to create a cache instance and set the expiration time. The expiration time of caffeine and the creation of the instance need to be performed after RedisCaffeineCache is created and cacheExpireResolver parses the annotation.

7. A computer device, characterized in that: include: A memory, the memory being used to store a processing program; A processor, wherein when executing the processing program, the processor implements the multi-level cache expiration time processing method based on springCache for an e-commerce platform as described in any one of claims 1 to 5.

8. A readable storage medium, characterized in that: The readable storage medium stores a processing program, and when the processing program is executed by the processor, the multi-level cache expiration time processing method based on springCache of the e-commerce platform as described in any one of claims 1 to 5 is implemented.