Cache management method and apparatus, computing device, and storage medium
By introducing a unified cache access service, the complexity of managing cache components in distributed systems is solved, enabling seamless switching and unified governance of cache components, thereby improving system development efficiency and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-16
- Publication Date
- 2026-03-31
AI Technical Summary
In distributed systems, existing technologies struggle to effectively manage multiple programming languages and caching components, resulting in low system development efficiency, limited parallel processing capabilities, and negatively impacting user experience.
A unified cache access service is introduced to shield the details of specific cache component integration. Cache components are dynamically discovered through the unified cache access management platform, enabling seamless switching and providing unified governance and monitoring of cache components.
It reduced system development costs, improved system response speed, prevented cache avalanche and cache penetration, enhanced user experience, and enabled unified monitoring and analysis of cache services.
Smart Images

Figure CN114048409B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to computer technology, and in particular to a method, apparatus, computing device, and storage medium for unified cache management. Background Technology
[0002] With the rapid development of computer technology, especially the Internet and big data processing technology, various business scenarios for remote data access and processing are constantly being developed and applied, such as online shopping, warehouse management, news, and video services. These business scenarios all require a large amount of frequent data access, and the requirements for data access speed are becoming increasingly stringent.
[0003] Due to limitations in their storage mechanisms and access methods, primary storage devices in a system generally struggle to meet the demands of such frequent and high-speed data access. This problem becomes even more pronounced in distributed systems. For example, in an online shopping system based on a distributed architecture, product data might be stored across multiple primary storage devices in different locations, and users might be geographically dispersed across one or even multiple countries. The system might need to process tens of thousands of data requests from users in different regions every minute, and this level of data access could be continuous over a long period, often with many requests corresponding to the same product data. If each data request were to be fulfilled through a direct database query, the system's response time would be extremely slow, and its parallel processing capabilities would be severely limited. To overcome these issues, caching is typically used during system development and implementation to dynamically store frequently accessed data and improve application performance.
[0004] However, developing a caching system often presents certain challenges. On one hand, different systems, and even different devices or functions within the same system, require different programming languages. For each language, similar code or frameworks need to be written to interface with the caching components. On the other hand, caching systems, especially distributed caching systems, often employ multiple different caching components to implement their functionality, such as Redis, Memcached, Pika, and MongoDB. The combination of multiple caching components and different programming languages places a significant burden on system development. For example, a system using four programming languages and three caching components would require developing twelve different caching middleware clients. This greatly impacts development efficiency and increases the probability of problems during system debugging and operation. Summary of the Invention
[0005] To address the aforementioned issues, this invention proposes a unified cache access service or cache middleware concept that enables language independence (using HTTP interaction) during use, shields the details of specific cache component integration, and achieves seamless switching between specific cache components.
[0006] This invention provides a cache management method, wherein the cache includes one or more cache components, and the cache management method includes:
[0007] Receive a data request from a client, the data request containing a first combination of parameters;
[0008] Based on the first parameter combination, a request to retrieve cache instance metadata is sent to the cache access management platform;
[0009] Receive cache instance metadata returned by the cache access management platform in response to the cache instance metadata retrieval request, the cache instance metadata including cache component type information;
[0010] A cache request is constructed based on the cache instance metadata, and data is obtained from the one or more cache components based on the cache request.
[0011] Another aspect of the present invention provides a cache management device, comprising:
[0012] A data request receiving module is configured to receive a data request from a client, the data request containing a first combination of parameters;
[0013] The metadata retrieval request module is configured to send a cache instance metadata retrieval request to the cache access management platform based on the first parameter combination.
[0014] The metadata receiving module is configured to receive cache instance metadata returned by the cache access management platform in response to the cache instance metadata retrieval request, wherein the cache instance metadata includes cache component type information;
[0015] The cache request module is configured to construct a cache request based on the cache instance metadata and obtain data from the one or more cache components based on the cache request.
[0016] Specifically, the functions of the above modules can be implemented by one or more cache proxies included in the unified cache access service, and the one or more cache proxies are configured as follows:
[0017] Receive the data request from the client;
[0018] Send a request to the cache instance metadata access management platform;
[0019] Receive cache instance metadata returned by the cache access management platform in response to the cache instance metadata retrieval request; and
[0020] A cache request is constructed based on the cache instance metadata, and data is obtained from the one or more cache components based on the cache request.
[0021] In another aspect, the present invention provides a computing device, the computing device comprising:
[0022] Memory, used to store executable instructions for a computer; and
[0023] A processor is configured to run computer-executable instructions to execute the cache management method provided by the present invention.
[0024] In another aspect, the present invention provides a non-transitory computer-readable storage medium storing computer-executable instructions, which, when executed by a computer, cause the computer to perform the cache management method provided by the present invention.
[0025] Using the unified caching access service provided by this invention, the development team does not need to be aware of the specific usage details of the caching components, nor does it need to increase the cost of learning new caching components. Instead, it can easily use caching by handling HTTP requests and responses according to the technical system that the team is familiar with.
[0026] Furthermore, with the introduction of a unified cache access service, cache components will be dynamically discovered based on identifiers, shielding the details of cache components and unifying cache management. Specifically, the unified cache access service of this invention has the following advantages:
[0027] • Each application service component uses the cache through simple HTTP requests, without needing to concern itself with the details of the cache component;
[0028] • Achieve unified governance of all caching components to avoid cache avalanche and cache penetration, and promptly switch caching components when downstream caching components become unavailable, and degrade related caching components when necessary;
[0029] A unified access layer and unified reporting points enable the system to monitor the operational status of the caching service and provide a data foundation for big data analytics. Attached Figure Description
[0030] Figure 1 This is a schematic diagram of a distributed caching system architecture;
[0031] Figure 2 This is a flowchart of the cache management method of the present invention;
[0032] Figure 3 This is a schematic diagram of the cache management structure of the present invention, which is applicable to e-commerce application scenarios;
[0033] Figure 4This is a schematic diagram of the cache management system structure of the present invention;
[0034] Figure 5 This is a schematic diagram of the cache access method of the cache management system of the present invention. Detailed Implementation
[0035] To facilitate the reader's understanding of the principles and implementation methods of this invention, the invention is described in detail below with reference to the accompanying drawings and exemplary embodiments. However, those skilled in the art will understand that this invention is not limited to these exemplary embodiments. Based on the solutions provided by this invention, those skilled in the art can make several equivalent modifications without creative effort to achieve essentially the same technical objectives and effects.
[0036] The unified caching access method of this invention can be applied to various application scenarios that require fast data access through caching, including online shopping, warehouse management, news, and video services. The following mainly uses the online shopping, i.e., e-commerce scenario, to illustrate the principle and implementation method of this invention.
[0037] As illustrated in the exemplary embodiments of this application, the unified cache access method of the present invention is particularly suitable for distributed cache systems, but does not preclude the application of the present invention in other types of cache systems.
[0038] Figure 1 This illustrates a typical distributed caching system architecture. Such distributed caching systems are commonly used in e-commerce and other applications that require supporting a large number of users accessing data from multiple different geographical locations.
[0039] In a distributed caching system, data and files are often stored in databases on primary storage devices distributed across different regions. These primary storage devices include database servers and file servers. Corresponding to these primary storage devices, the system sets up cache devices distributed in different regions to store frequently used data or data recently accessed by applications. When an application receives a data request, it first queries the local cache for relevant data. If the local cache request is successful, the corresponding data is read from the local cache and returned to the user. If the local cache request is unsuccessful, the application needs to request the relevant data from the corresponding distributed cache server. Data requests to the distributed cache server generally need to be made through corresponding caching middleware developed for the caching components on the server. If the distributed cache request is successful, the relevant data is read from the corresponding distributed cache and returned to the user. If the distributed cache request is still unsuccessful, the application needs to request the relevant data from the corresponding primary storage device according to the configured origin interface, and then return the data to the user.
[0040] The development and use of such distributed caching systems often present certain challenges. On one hand, different systems, and even different devices or functions within the same system, require implementations in different programming languages. For each language, similarly logical code or framework needs to be written to interface with the caching components. On the other hand, these distributed caching systems often employ multiple different caching components to implement their functionality. This combination of multiple caching components and different programming languages places a significant burden on system development. Furthermore, the rapid iteration of computing technology and the explosive growth in data demands mean that caching systems may need to be upgraded on a short cycle, such as by adding new caching components as needed. This increase in demand and changes to the caching system may prevent existing cache management services from fully utilizing the additional data storage and processing capabilities gained from system upgrades, leading to unmet user needs and a negative impact on user experience.
[0041] In view of this, the present invention introduces a unified cache access service (UCS) into the existing cache management system to shield the details of specific cache component integration during development and use, thereby achieving the effect of seamlessly switching between specific cache components.
[0042] Figure 2 This is a schematic flowchart of the unified cache access service operation method of the present invention. Figure 2As shown, when the cache management system of the present invention is running, the unified cache access service first receives a data request containing a first parameter combination from the client (step S1). The data request can come directly from the client, or it can be a data request generated by the application service through processing of the client's instructions or requests. After receiving the data request, the unified cache access service can obtain the first parameter combination contained therein by parsing the data request. The parsing of the data request can also be performed by the application service. The first parameter combination can include the application identifier and the corresponding application submodule identifier corresponding to the data request, and uniquely corresponds to a set of cache instance metadata stored in the unified cache access management platform (UCP). Each set of cache instance metadata includes cache component type information to determine the cache component corresponding to the relevant data request. After obtaining the first parameter combination, the unified cache access service sends a cache instance metadata retrieval request to the unified cache access management platform according to the first parameter combination (step S2). The unified cache access management platform can respond to the cache instance metadata retrieval request, and select the corresponding cache instance metadata from its stored cache instance metadata according to the first parameter combination, and return it to the unified cache access service. After receiving the cache instance metadata returned by the unified cache access management platform (step S3), the unified cache access service constructs a cache request based on the cache instance metadata and obtains data from one or more cache components based on the cache request (step S4).
[0043] In practical applications, before the unified cache access service performs cache reading, the unified cache access service can send a registration declaration to the unified cache access management platform. This registration declaration includes the aforementioned first parameter combination, the origin server interface, and the cache component type information. If the retrieval of cache instance metadata fails, or if a cache request misses, the application service can retrieve relevant data from the origin server via the origin server interface. Before retrieving data from the origin server via the origin server interface, the cache management method of this invention can further include acquiring and using a distributed lock component to avoid concurrent origin server requests causing instantaneous high concurrency pressure on the origin server service, thereby preventing service avalanche.
[0044] Figure 3This illustration shows an example of the method of the present invention applied to an e-commerce scenario. In e-commerce scenarios, users often search for and place orders for products through an external request initiator, i.e., a client, such as an e-commerce website, a mobile terminal single-page website (e.g., an HTTP5-based webpage), or an e-commerce application app. After receiving a user's order request, the backend system needs to perform multiple functional processes, including risk control, network security control, user information query, order processing, and coupon application. Each functional process often needs to be completed through a corresponding subsystem or based on data within that subsystem. For example: the risk control subsystem needs to obtain data such as whether the user corresponding to the order is involved in black market activities, whether there is malicious behavior, or whether the user's ordering behavior is restricted; the network security control subsystem needs to obtain data such as whether the user corresponding to the order is a legitimate user requesting the order, and whether there are network attack risks; the user information query subsystem needs to obtain information such as whether the user corresponding to the order is logged in normally and the available balance of the account; the order subsystem needs to obtain data such as restrictions on repeated orders for the user corresponding to the order; and the coupon subsystem needs to obtain information such as the validity of the coupons corresponding to the order.
[0045] Each subsystem stores data in one or more main storage devices, with frequently used and recently accessed data cached by their respective caching components. If the application service directly queries these caching components, multiple different caching middlewares are required. Each middleware needs to be developed separately for its respective caching component, and depending on the application service's programming language, multiple versions of the middleware may need to be developed for each component in various programming languages for the application service to use. This results in a proportional increase in system development costs for the corresponding part, along with the number of caching middlewares and programming languages. It may also lead to underutilization of the system's data storage and processing capabilities, reduced system response speed, and a negative impact on the user's shopping experience.
[0046] To reduce system development costs and improve user experience, this invention introduces a cache middleware layer between application services and various cache components. Application services can selectively access the cache components of the corresponding subsystems for different processing tasks through the cache middleware layer, without relying on multiple different cache middleware.
[0047] The following combination Figure 4 The schematic diagram of the cache management system of the present invention illustrates the specific implementation of the cache intermediate layer.
[0048] The cache management system consists of a client, application services, and a backend data processing subsystem. In e-commerce applications, this client can be... Figure 3The diagram shows an e-commerce website, a mobile single-page website (e.g., an HTTP / 5-based webpage), or an e-commerce application (App) for product inquiry and order placement. This application service is a functional module or a combination of multiple functional modules that receive and process client requests. For example, in a specific embodiment, the application service could be a shopping cart checkout program. The background data processing subsystem includes a main storage database (not shown in the diagram), a data cache structure, and a query platform / reporting system / data analysis system.
[0049] The data caching structure includes multiple caching components, such as Redis clusters, Memcached, Pika, and other types of caching components. Each caching component is used to cache data from functional subsystems such as risk control, network security control, order processing, user information query, and coupon application. The correspondence between caching components and functional subsystems can be arbitrary; for example, a Redis cluster can be used to cache data from any one or more functional subsystems, and data from any functional subsystem can be cached in any one or more caching components.
[0050] The data caching structure access mechanism of this invention, namely the aforementioned cache middleware layer, includes a Unified Cache Access Service (UCS) and a Unified Cache Access Management Platform (UCP). The UCS receives requests from application services and, for each received request, retrieves corresponding data from the corresponding cache component and returns it to the application service. The UCS includes one or more cache proxies, each being an application service instance, which proxies cache requests from the application service. Based on the received cache request, the UCS queries the UCP and, based on the UCP's feedback, selects the corresponding cache component, reads the data from it, and returns it to the application service. The UCP manages the cache access service. Before an application service accesses the service, it registers the business registration declaration submitted by the application service to clarify the correspondence between various application request formats and cache components. It also responds to queries from the UCS with information about the cache component corresponding to the relevant request.
[0051] Before the application service can access the service and receive specific business requests from the client, it first sends a business registration declaration to the Unified Cache Access Management Platform (UCP). The registration declaration includes the business ID, prefix, origin server interface, and cache component type. The business ID is the identifier of the accessing application, the prefix is the identifier of the accessing application's submodule, the origin server interface is the accessing cache's origin server interface (used to retrieve data from the origin server when the cache is not found), and the cache component type is the specific cache component corresponding to the business request, such as Redis, Pika, or Memcached.
[0052] In a specific application example in an e-commerce scenario, the application service can send a registration declaration to the Unified Cache Access Management Platform (UCP) in the following format:
[0053] Business ID: cart
[0054] Prefix: order
[0055] Origin API: http: / / ***.***.**.***:**** / cart / order / get?orderid={}
[0056] Cache component type: Redis cluster
[0057] Among them, the business ID indicates that the business type of the data request is shopping cart checkout, the prefix indicates that the business request corresponds to the order module, the origin interface indicates the database query path that needs to retrieve relevant data from the system's main storage device when the cache query fails, and the cache component type indicates the cache component type corresponding to the request.
[0058] The content of the registration declaration is metadata. After receiving the registration declaration, the Unified Cache Access Management Platform (UCP) persists the declaration content into the storage component through the cache metadata management module, registering the business ID, prefix, origin interface, and cache component type.
[0059] The combination of business ID and prefix is globally unique within the Unified Cache Access Management Platform (UCP). This unique combination uniquely identifies the cache component and binds it to the corresponding origin server interface. For example: business ID: cart + prefix: order, indicating the order module in the shopping cart system; business ID: sales + prefix: TMS (transport management system), indicating the logistics module; business ID: DN + prefix: WMS (warehouse management system), indicating the warehouse module, and so on. The origin server interface and cache component type can be set according to the storage and cache address of the relevant data. Based on the cache component type declared, the corresponding cache component access functionality needs to be pre-configured in the Unified Cache Access Service (UCS) by setting up a cache proxy. For example, if the declared component type is Redis, Redis access functionality needs to be pre-configured in the Unified Cache Access Service (UCS).
[0060] After registration is complete, the client responds to the user's action by generating and sending a request in a predefined format to the application service. The application service parses the request sent by the client and sends the parsed request to the Unified Cache Access Service (UCS). The UCS then queries the Unified Cache Access Management Platform (UCP) to determine the corresponding caching component and retrieves the relevant data through that component. The specific operation process is as follows: Figure 5 As shown.
[0061] See you again Figure 4 Users search for and select products through a client application, such as an e-commerce website, a mobile single-page website (e.g., an HTTP / 5-based webpage), or an e-commerce app. They then add selected items to their shopping cart for later purchase along with other items in the cart, or choose to purchase the selected items directly. Upon receiving the user's checkout or purchase request, the client generates an HTTP order request and sends it to the application service. This order request can have the following format: / ucs?bizId=cart&prefix=order&key=20210101******.
[0062] like Figure 4 and Figure 5 As shown, after receiving an HTTP shopping cart order request from the client, the application service parses the request to determine the business ID, prefix, and key, and then forwards the parsed request to the Unified Cache Access Service (UCS). The client request parsing operation can also be performed by the Unified Cache Access Service (UCS). By introducing a caching middleware layer, this invention allows users to retrieve the corresponding cache simply by including the business ID, prefix, and key in the HTTP request parameters, without needing to understand the actual cache storage details. Figure 5 In the example shown, the business ID contained in the shopping cart order request is cart, the prefix is order, and the key is 20210101******.
[0063] After receiving a business request, the Unified Cache Access Service (UCS) retrieves metadata from the UCP based on the business ID and prefix parameter value. This metadata contains: business ID: cart; prefix: order; origin API: http: / / ***.***.**.***.**** / cart / order / get?orderId={}; cache component type: Redis cluster information. After retrieving the relevant metadata, the corresponding cache proxy within the UCS constructs a RedisGET request based on the metadata, cache component type, and Redis cluster information: key=cart:order:20210101******, to retrieve the cached data.
[0064] If the cache is not found during the cache retrieval steps described above, the application service needs to perform a cache lookup operation to retrieve the required data from the system's main storage device. This cache lookup operation can be initiated by the application service that initiated the cache query request, or by another application service responding to a cache miss event. Before the cache lookup operation, the Unified Cache Access Service (UCS) must acquire and use the distributed lock component "cart:order:20210101******" to prevent concurrent cache lookups from causing a sudden surge in concurrency pressure on the cache lookup service, which could lead to a service avalanche.
[0065] After acquiring the distributed lock in the above steps, the Unified Cache Access Service (UCS) constructs a back-to-origin request: http: / / ***.***.**.***.**** / cart / order / get?orderId=20210101******, so that the application service can obtain the required data from the corresponding main storage device and write the obtained data into the Redis cluster to improve the subsequent access speed of the data.
[0066] Another aspect of the present invention includes data analysis functionality based on caching services.
[0067] See still Figure 4After passing through the unified cache access service (UCS), the UCS can report cache and origin query information. This reported information, after being consumed, cleaned, and stored via a message queue, can be accessed by query platforms, reporting systems, or data analysis systems responsible for monitoring cache status. Big data analytics tools can then be used for statistical analysis, and reports can be generated to analyze cache hit rates, monitor origin interface response times, and monitor the working status of cache components. The message queue consumption module can be developed using Spark, Flink, or any other component designed for consuming message queues. Data storage can be done using Hive or any distributed storage component. Information reporting can be real-time after each query, scheduled, or triggered by pre-defined events. Big data analysis results can be generated into a unified data view by analysis tools for easy viewing by system administrators. Specific analysis, report creation, and data view generation operations can be performed by a third-party platform or by the UCP. As described above, this invention unifies the cache access layer and information reporting points, enabling the UCP to perform data analysis conveniently and promptly.
[0068] As described above, introducing a caching middleware layer offers several advantages. First, a unified caching access service can dynamically discover caching components based on identifiers, enabling the reading of cached data. This allows various systems to use the cache through simple HTTP requests, without needing to concern themselves with the details of the caching components, and automatically returning to the origin server when a cache miss occurs. Since caching components can be dynamically discovered by the unified access service, there's no need to pause service for upgrades. Second, it enables unified governance of all caching components, using distributed locks to limit concurrent origin server requests, preventing cache avalanches or cache penetration, and allowing for switching or even downgrading caching components when downstream caching components become unavailable. Third, introducing a caching middleware layer eliminates the need to repeatedly develop corresponding caching component clients for different caching components using different programming languages, reducing system development costs. Finally, unified data tracking and reporting facilitates monitoring the execution of the global rule engine.
[0069] Although this application describes the above exemplary methods as a series of steps or operations, it should be understood that the present invention is not limited to the order of the steps or operations shown herein. One or more of the above steps can be performed in different orders, and some steps can also be performed simultaneously with other steps. For example, multiple cache proxies under the Unified Cache Access Service (UCS) can be set up after the UCS completes its registration declaration in the UCP, or they can be set up in advance. Furthermore, it is not necessary to perform all the steps shown in this application when implementing the method of the present invention. Some of the operations can be performed in advance or during the implementation of the present invention. The steps of data tracking and data analysis are not necessary steps of the present invention and can be omitted where appropriate. The type of cache component is not limited to Redis, Memcached, Pika, or MongoDB, and can be any component that can be used for distributed caching.
[0070] According to another aspect of the present invention, a cache management apparatus is also provided, including a data request receiving module, a metadata retrieval request module, a metadata receiving module, and a cache request module. Each module can be implemented in the form of software code or in a combination of hardware and software. Specifically, the data request receiving module is configured to receive a data request from a client, the data request including a first parameter combination; the metadata retrieval request module is configured to send a cache instance metadata retrieval request to a cache access management platform based on the first parameter combination; the metadata receiving module is configured to receive cache instance metadata returned by the cache access management platform in response to the cache instance metadata retrieval request, the cache instance metadata including cache component type information; and the cache request module is configured to construct a cache request based on the cache instance metadata and obtain data from the one or more cache components based on the cache request.
[0071] Specifically, the functions of the above modules can be implemented by one or more cache proxies included in the Unified Cache Access Service (UCS). Each cache proxy is an application service instance used to proxy cache requests for the application service. The one or more cache proxies are configured to implement the functions of the above modules, namely, receiving the data request from the client, sending a cache instance metadata retrieval request to the cache access management platform, receiving the cache instance metadata returned by the cache access management platform in response to the cache instance metadata retrieval request, constructing a cache request based on the cache instance metadata, and obtaining data from the one or more cache components based on the cache request.
[0072] According to another aspect of the present invention, a computing device is also provided. The computing device may include one or more processors and a memory. The memory stores computer-executable instructions that, when executed by the processor, cause the computing device to perform any embodiment of the unified cache access method described above. The processor may be any suitable processing device, such as a microprocessor, microcontroller, integrated circuit, or other suitable processing device. The memory may include any suitable computing system or medium, including but not limited to non-transitory computer-readable media, random access memory (RAM), read-only memory (ROM), hard disk, flash memory, or other memory devices. The memory may store computer-executable instructions that can be executed by the processor to cause the computing device to perform any embodiment of the unified cache access method described above. The memory may also store data. In embodiments of the present invention, the processor may execute various modules included in the instructions to implement any embodiment of the unified cache access method described above.
[0073] According to another aspect of the present invention, a non-transitory computer-readable storage medium is also provided. The storage medium stores computer-executable instructions that, when executed by a computer, cause the computer to perform any embodiment of the above-described unified cache access method.
[0074] It should be understood that the term "module" refers to computer logic used to provide desired functionality. Therefore, a module can be implemented by hardware, dedicated circuitry, firmware, and / or software, and combinations thereof. In one embodiment, a module is a program code file stored on a storage device, loaded into memory, and executed by a processor, or it can be a computer program product (e.g., computer-executable instructions) stored in a tangible computer-readable storage medium such as RAM, a hard disk, or an optical or magnetic medium.
[0075] The foregoing has described some embodiments and features of the present invention. Those skilled in the art will understand that various changes or equivalent substitutions can be made to these features and embodiments without departing from the spirit and scope of the invention. Furthermore, under the teachings of the present invention, modifications can be made to these features and embodiments to adapt to specific circumstances without departing from the spirit and scope of the invention. Therefore, the present invention is not limited to the specific embodiments disclosed herein.
Claims
1. A cache management method, the cache comprising one or more cache components, characterized in that, The cache management method includes: The cache component, which is configured to access the cache access service, sends a registration declaration to the cache access management platform to uniquely identify the cache component and bind the corresponding origin interface. The registration declaration includes a first parameter combination, the origin interface, and the cache component type. The origin interface and the cache component type are configured based on the storage and cache addresses of the first parameter combination. Receive a data request generated by processing from a client application service, the data request containing a first combination of parameters; Based on the first parameter combination, a request to retrieve cache instance metadata is sent to the cache access management platform; The system receives cache instance metadata returned by the cache access management platform based on the unified cache access service according to the HTTP response to the cache instance metadata retrieval request. The cache instance metadata includes cache component type information. The first parameter combination includes a globally unique application identifier and a corresponding application submodule identifier for the data request, and uniquely corresponds to a set of cache instance metadata stored in the unified cache access management platform. Each set of cache instance metadata includes cache component type information to determine the cache component corresponding to the relevant data request. Based on the cache instance metadata, a cache request for the corresponding cache component is constructed, and data is obtained from one or more cache components by using the cache request via HTTP interaction through the unified cache access service based on the application service.
2. The method according to claim 1, comprising: If the request to retrieve data from one or more cache components fails, the data is retrieved from the origin server using the origin server retrieval interface.
3. The method according to claim 2, before retrieving data from the source according to the source interface, the method further includes acquiring and using a distributed lock component lock to avoid concurrent source retrieval.
4. The method according to claim 3, wherein before sending a cache instance metadata retrieval request to the cache access management platform based on the first parameter combination, the cache management method further includes: Parse the data request from the client to obtain the first parameter combination.
5. A cache management device, characterized by, The cache management device includes: The registration declaration module is configured as a cache component that sets access functions based on the cache access service. It sends a registration declaration to the cache access management platform to uniquely identify the cache component and bind the corresponding origin interface. The registration declaration includes a first parameter combination, the origin interface, and the cache component type. The origin interface and cache component type are set based on the storage and cache addresses of the first parameter combination. A data request receiving module is configured to receive a data request generated by processing from a client application service, wherein the data request includes a first parameter combination; The metadata retrieval request module is configured to send a cache instance metadata retrieval request to the cache access management platform based on the first parameter combination. a metadata receiving module configured to receive cache instance metadata returned by the cache access management platform based on a cache instance metadata retrieval request according to a unified cache access service in response to an HTTP request, the cache instance metadata including cache component type information, wherein a first parameter combination includes a globally unique application identifier corresponding to the data request and a corresponding application submodule identifier, and uniquely corresponds to a set of cache instance metadata stored in the unified cache access management platform; each set of cache instance metadata includes cache component type information for determining a cache component corresponding to a related data request; a cache request module configured to construct a cache request for a corresponding cache component according to the cache instance metadata, and use the cache request to obtain data from one or more cache components based on the application service using HTTP interaction through the unified cache access service.
6. The apparatus of claim 5, comprising one or more cache agents configured to: receive a data request generated by the processing from the client application service; issue a cache instance metadata retrieval request to a cache access management platform; receive cache instance metadata returned by the cache access management platform based on a cache instance metadata retrieval request according to a unified cache access service in response to an HTTP request; and construct a cache request for a corresponding cache component according to the cache instance metadata, and use the cache request to obtain data from the one or more cache components based on the application service using HTTP interaction through the unified cache access service.
7. A computing device comprising: a memory for storing computer executable instructions; and a processor for running the computer executable instructions to perform the method of any one of claims 1 to 4.
8. A non-transitory computer readable storage medium having stored thereon computer executable instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 4.
Citation Information
Patent Citations
Data caching method and device, data querying method and device, lazy caching system and storage medium
CN111767314A