Cache update methods, apparatus, devices, and storage media

By working together with the cache update server and the coordination service components, the problem of untimely cache updates in a distributed environment is solved, real-time updates and consistency of cached data are achieved, and system performance is improved.

CN117171179BActive Publication Date: 2026-04-03CHINA MERCHANTS BANK
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-06
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

In a distributed environment, it is difficult to update the cache of multiple application instances in real time, which leads to inconsistent cache data and performance degradation.

Method used

The cache update server loads cache update data into the cache database and uses coordination service components such as ZooKeeper to notify each application instance to update the cache in real time, ensuring data consistency and timeliness.

Benefits of technology

It enables real-time updates of application instance caches in a distributed environment, improving data timeliness and accuracy, reducing network traffic and resource waste, and enhancing overall efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117171179B_ABST
    Figure CN117171179B_ABST
Patent Text Reader

Abstract

This application discloses a cache update method, apparatus, device, and storage medium, belonging to the field of computer technology. This application receives a cache update request, retrieves cache update data from a data source based on the request, loads the cache update data into a cache database, and calls a coordination service component to send cache update notifications to each application instance. This enables each application instance to retrieve the corresponding cache update data from the cache database and update its cache according to the update data, achieving real-time cache updates for multiple business applications in a distributed environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a cache update method, apparatus, device, and storage medium. Background Technology

[0002] With the rapid development of information technology, business applications based on distributed systems and microservice architectures are becoming increasingly common. Caching technology, due to its ability to accelerate data access, improve application performance, and reduce the burden on backend services, has become a core element in building efficient distributed systems.

[0003] However, in related technologies, cache update schemes typically involve updating the relevant data in the database and then fetching the latest cached data when the caches of each business application instance expire and become invalid. When dealing with cache updates for multiple business application instances in a distributed environment, there is a problem that the cache cannot be updated in real time. Summary of the Invention

[0004] The main purpose of this application is to provide a cache update method, apparatus, device, and storage medium, which aims to solve the problem that cache is difficult to update in real time when multiple service application instances in a distributed environment perform cache updates.

[0005] To achieve the above objectives, this application provides a cache update method applied to a cache update server, the method comprising:

[0006] Receive cache update requests;

[0007] Based on the cache update request, retrieve cache update data from the data source and load the cache update data into the cache database;

[0008] The coordination service component is invoked to send cache update notifications to each application instance, so that each application instance can retrieve the corresponding cache update data from the cache database and update the cache according to the cache update data.

[0009] Optionally, the first cache configuration information is generated in the coordination service component; the first cache configuration information includes the correspondence between application instances and cache update data, as well as the cache version information of the cache update data;

[0010] The coordination service component is invoked to send cache update notifications to each application instance, so that each application instance can obtain the corresponding latest cache update data from the cache database according to the first cache configuration information, and update the cache according to the latest cache update data.

[0011] Optionally, if the coordination service component cannot be invoked, a second cache configuration information is generated, which contains the correspondence between cache update data and each application instance;

[0012] Send the second cache configuration information to each application instance so that each application instance can retrieve all corresponding cache update data from the cache database according to the second cache configuration information.

[0013] Optionally, the coordination service component is the ZooKeeper component.

[0014] Secondly, to achieve the above objectives, this application provides a cache update method, applied to an application instance, the method comprising:

[0015] Receive cache update notifications from the coordination service component; cache update notifications are generated by the cache update server invoking the coordination service component based on the cache update request.

[0016] Based on the cache update notification, the corresponding cache update data is retrieved from the cache database, and the cache is updated based on the cache update data. The cache update data is retrieved from the data source and loaded into the cache database by the cache update server based on the cache update request.

[0017] Optionally, if cache update notifications cannot be obtained from the coordination service component, then all corresponding cache update data can be obtained from the cache database according to a preset data retrieval period.

[0018] Optionally, if data cannot be obtained from the cache database, the fallback interface of the cache update server is connected, and all corresponding cache update data is obtained from the local memory of the cache update server according to the preset data retrieval cycle; the corresponding cache update data in the local memory is obtained from the data source by the EHcache component.

[0019] Thirdly, to achieve the above objectives, this application also provides a cache update server, comprising:

[0020] The processor, memory, and cache updater stored in memory, wherein the cache updater is executed by the processor to implement the steps of the cache update method applied to the cache update server.

[0021] Fourthly, to achieve the above objectives, this application also provides a business application device, including:

[0022] The processor, memory, and cache updater stored in memory, wherein the cache updater is executed by the processor to implement the cache update method applied to the application instance.

[0023] This application provides a cache update method, apparatus, device, and storage medium that utilizes a coordination service component to notify application instances of data updates in real time. Each application instance obtains cache update data based on the cache update notification and updates its local cache accordingly, achieving real-time cache updates for application instances in a distributed environment. Attached Figure Description

[0024] Figure 1 This is a schematic diagram of the structure of the equipment in this application;

[0025] Figure 2 This is a flowchart illustrating the first embodiment of the method of this application.

[0026] Figure 3 This is a flowchart illustrating the second embodiment of the method of this application;

[0027] Figure 4 This is a flowchart illustrating the third embodiment of the method of this application;

[0028] Figure 5 This is an application scenario diagram for Method Example 1 of this application.

[0029] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0030] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.

[0031] Since the relevant cache update schemes usually involve updating the relevant data in the database and then fetching the latest cached data when the caches of each business application instance expire and become invalid, there is a problem that the caches of each business application are difficult to update in real time.

[0032] This application proposes a solution whereby the cache update server first loads the relevant cache update data into the cache database, and then calls the coordination service component to notify each business application instance in real time. This enables each business application instance to retrieve the cache update data from the cache database in real time based on the cache update notification, and update its local cache based on the cache update data, effectively solving the problem of business application cache being difficult to update in real time.

[0033] The following embodiments of this application will describe the cache update method, apparatus, device, and storage medium used in the technical implementation of this application:

[0034] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of the cache update server or business application device of the hardware operating environment involved in the embodiments of this application.

[0035] like Figure 1As shown, the device may include: a processor 1001, such as a CPU; a user interface 1003; a memory 1005; and a communication bus 1002. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a voice pickup module, such as a microphone array; optionally, the user interface 1003 may also be a display screen or an input unit such as a keyboard. The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0036] It is understood that the device may also include a network interface 1004, which may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). Optionally, the device may also include RF (Radio Frequency) circuitry, sensors, audio circuitry, a Wi-Fi module, etc.

[0037] Those skilled in the art will understand that Figure 1 The device structure shown does not constitute a limitation on the device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0038] Based on, but not limited to, the hardware structure of the aforementioned device, this application provides a first embodiment of a cache update method. (Refer to...) Figure 2 , Figure 2 A flowchart illustrating the first embodiment of the cache update method of this application is shown.

[0039] It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.

[0040] In this embodiment, the cache update method includes:

[0041] Step S100: The cache update server receives the cache update request.

[0042] In this step, the cache update request can be a request sent by the front-end server after the user completes the database configuration. The user's database configuration can specifically involve setting the number or location of databases.

[0043] In step S200, based on the cache update request, the cache update server obtains cache update data from the data source and loads the cache update data into the cache database.

[0044] In this step, the data source is the database that stores the cached data, which can be a MySQL database, an Oracle database, etc. The cache database can be a Redis (Remote DIctionary Server) database, and the cache update data can be the parameters of the table in the database.

[0045] Specifically, after receiving a cache update request, the cache update server connects to the data source to retrieve the cache update data, and then loads the cache update data into the cache database. For example, after receiving a cache update request, the cache update server retrieves the data table whose parameters have changed from the Oracle database, and loads the retrieved data table, i.e., the cache update data, into the Redis database.

[0046] This step retrieves cache update data from the data source and loads it into the cache database, ensuring that the cached data in the cache database is the latest cached data and avoiding issues such as expired cached data or inconsistencies with the updated cached data.

[0047] In step S300, the cache update server calls the coordination service component to send cache update notifications to each application instance.

[0048] In this step, the coordination service component can be the ZooKeeper component, and the application instance can be a business application instance in a microservice architecture. Specifically, after the cache update server loads the cache update data into the cache database, it calls the ZooKeeper component to generate a cache update notification and sends it to each application instance.

[0049] Cache update notifications are implemented using the ZooKeeper component, ensuring that cache update notifications are delivered in real time in a distributed environment. This guarantees that all application instances receive timely and accurate data update information. By proactively notifying each application instance to update the cache, the problem of untimely cache updates caused by passive cache invalidation in traditional caches is avoided, thus improving the timeliness and accuracy of data.

[0050] In step S400, each application instance receives a cache update notification from the coordination service component.

[0051] In this step, each application instance can simultaneously receive cache update notifications from the ZooKeeper component, eliminating the need for polling and thus reducing unnecessary network traffic and resource waste.

[0052] In step S500, each application instance retrieves the latest cache update data from the cache database according to the cache update notification, and updates the cache based on the cache update data.

[0053] Specifically, after receiving a cache update notification, each application instance retrieves the cache update data required by the Redis database and completes the cache update based on the cache update data (such as adding cache update data to the local cache or replacing local cache data with cache update data).

[0054] Application instances update their associated cached data based on cache update notifications, avoiding global cache updates and improving overall efficiency. Application instances retrieve cache update data through the cache database instead of querying the database directly, reducing network overhead for database queries, improving data retrieval speed, and avoiding database pressure caused by high concurrency in extreme cases.

[0055] In this embodiment, the cache update server first loads the relevant cache update data into the cache database, and then calls the coordination service component to notify each application instance in real time. This allows each application instance to retrieve the cache update data from the cache database in real time based on the cache update notification, and update its local cache based on the cache update data, effectively solving the problem of application instance cache being difficult to update in real time.

[0056] Furthermore, as an example, refer to Figure 3 This application provides a second embodiment of a cache update method.

[0057] In this embodiment, the method includes:

[0058] Step S100: The cache update server receives the cache update request.

[0059] Step S310: The cache update server generates the first cache configuration information in the coordination service component.

[0060] The first cache configuration information includes the correspondence between application instances and cache update data, as well as the cache version information of the cache update data.

[0061] In step S320, the cache update server calls the coordination service component to send cache update notifications to each application instance.

[0062] In step S330, each application instance retrieves the latest cache update data from the cache database based on the first cache configuration information, and updates the cache based on the latest cache update data.

[0063] In this embodiment, the cache version information is the version number of the cache update data, which can be a sequence of numbers greater than 0. The correspondence between application instances and cache update data can be stored in a relational table in the database in the form of "cache update data name - application name". After the cache update server obtains these correspondences between application instances and cache update data, it generates the first cache configuration information in the ZooKeeper component. It's easy to understand that there are generally multiple cache update data sets, each with a different cache update data name. For example, for better understanding, the first cache configuration information can be represented as a collection of multiple strings in the form of "version number - cache update data name - application name". Understandably, the Zookeeper component may contain historical cache configuration information, which can be represented in the form of "historical version number - cache update data name - application name". Therefore, if the cache update data name in the mapping relationship between the application instance and the cache update data obtained by the cache update server exists in the historical cache configuration information, the historical version number corresponding to each existing cache update data name in the historical cache configuration information is incremented by 1. If the cache update data name does not exist in the historical cache configuration information, the mapping relationship between the cache update data and the application instance is added to the historical cache configuration information, and an initial version number is added to it to complete the generation of the first cache configuration information.

[0064] Specifically, after receiving a cache update request, the cache update server retrieves the mapping between application instances and cache update data from the database, and generates the first cache configuration information based on this mapping. It's easy to understand that the ZooKeeper component may contain historical cache configuration information before receiving the cache update request. Therefore, the first cache configuration information can be generated as follows: if the historical cache configuration information contains a cache update data name that is the same as the string retrieved from the database by the cache update data server, the version number of the historical cache configuration information containing the same cache update data name can be incremented by 1 (in the above embodiment, the version number can be a sequence of numbers greater than 1). If no cache update data name exists, an initial version number is added to the string corresponding to the cache update data name, thereby generating the first cache configuration information.

[0065] Specifically, after receiving a cache update request, the cache update server generates the first cache configuration information in the ZooKeeper component. Then, it calls the ZooKeeper component to generate a cache update notification and sends it to each application instance (it can be understood that the ZooKeeper component can send cache update notifications to all application instances; preferably, it can also send cache update notifications to application instances that need to update their cache based on the first cache configuration information). Upon receiving the cache update notification, each application instance accesses the ZooKeeper component to obtain the first cache configuration information, compares it with its local cache configuration information, updates its local cache configuration information based on the version number difference, and retrieves the corresponding cache update data from the Redis database that has a version number greater than the local cache configuration information. Specifically, to ensure that in extreme cases (such as network fluctuations) the ZooKeeper component's notification is not successfully sent to each application instance, each application instance can also periodically access the ZooKeeper component to obtain the first cache configuration information according to a preset time period.

[0066] This embodiment achieves real-time and accurate distributed cache updates by maintaining cache configuration information, utilizing the difference between the version numbers of cache update data and local cache data, and using the ZooKeeper component as a central coordination tool.

[0067] Furthermore, as an example, refer to Figure 4 This application provides a third embodiment of a cache update method, based on the above. Figure 3 The embodiment shown, after step S320, further includes:

[0068] In step S600, if the coordination service component cannot be invoked, the cache update server generates second cache configuration information, which includes the correspondence between cache update data and each application instance.

[0069] In step S700, the cache update server sends the second cache configuration information to each application instance so that each application instance can obtain all corresponding cache update data from the cache database according to the second cache configuration information.

[0070] Step S800: If each application instance cannot obtain cache update notification from the coordination service component, then each application instance obtains all corresponding cache update data from the cache database according to the preset data acquisition cycle.

[0071] In step S900, if each application instance cannot obtain data from the cache database, each application instance connects to the fallback interface of the cache update server and obtains all corresponding cache update data from the local memory of the cache update server according to the preset data acquisition cycle. All corresponding cache update data in the local memory is obtained by the EHcache component from the data source.

[0072] This embodiment discloses a cache update method when the coordination service component fails or even the cache database fails. It is easy to understand that when the ZooKeeper component is unavailable, each application instance cannot receive cache update notifications, nor can it update local cache configuration information according to version number differences.

[0073] Specifically, when the cache update server is unable to call the ZooKeeper component, it generates second cache configuration information and sends it to each application instance. Each application instance then updates its local cache configuration information based on the second cache configuration information.

[0074] When the ZooKeeper component is unavailable, and cache update notifications cannot be received, each application instance will periodically retrieve corresponding cache update data from the cache database according to a preset time period. Since version number comparison cannot be performed to obtain the difference between the local cache configuration information and the second cache configuration information, the retrieved cache update data will be all cache update data corresponding to the second cache configuration information. Specifically, the cache update server can add an abnormal version number to the second cache configuration information. Generally, since the version numbers maintained in the ZooKeeper component are a sequence of numbers greater than 1, the abnormal version number can be set to a sequence of numbers less than 1. When the ZooKeeper component performs a normal version number comparison, because the abnormal version number is a sequence of numbers less than 1, while the version numbers maintained in ZooKeeper are a sequence of numbers greater than 1, each application instance will not repeatedly retrieve previously retrieved cache update data after comparing the version numbers; that is, it will retrieve the cache update data based on the second cache configuration information.

[0075] Under certain circumstances, application instances may be unable to retrieve cached data from the cache database. In this case, the application instances will periodically retrieve all corresponding cached update data from the cache update server's local memory through the cache update server's fallback interface, according to a preset time period. The cache update server will then call the EHcache component to access the parameters of the update server's local memory, retrieve the corresponding cached data, and return it to each application instance. If cached data is missing from local memory, the EHcache component will be called to retrieve the missing cached data from the data source and store it in local memory. Understandably, to ensure that the cached data retrieved from local memory is valid, an expiration time can be set for the cached data in local memory. When an application instance connects to the fallback interface to retrieve data, the EHcache component will determine whether the data in the application's memory has expired. If it has expired, the cached data will be retrieved again from the data source.

[0076] This embodiment solves the problem of synchronizing cache update data when the ZooKeeper component is unavailable by periodically obtaining cache update data according to the second cache configuration information. By adding a backend fallback data acquisition interface, it achieves a degradation effect where application instances can still update the cache normally when the cache database is unavailable, ensuring the stability of each application instance and the consistency of data.

[0077] To enable those skilled in the art to better understand the scope of protection of the claims of this application, specific implementation examples in specific application scenarios are used to explain and illustrate the technical solutions described in the claims of this application. It should be understood that the following examples are only used to explain this application and are not intended to limit the scope of protection of the claims of this application.

[0078] It is easy to understand, of course, that although a logical order is shown in this embodiment, in some cases the steps shown or described may be performed in a different order than that shown here.

[0079] like Figure 5 As shown, Example 1 is a specific application scenario of this application:

[0080] In this example, cache update data is stored in a cache table, which is stored in a source database. There can be multiple source databases (configurable by the user). A configuration repository stores the mapping between cache tables and application instances. That is, the configuration parameters define the mapping between cache tables and application instances; therefore, the configuration parameters contain the name of the application instance and the name of the cache table.

[0081] Once the database configuration is complete, the front-end data update page sends a cache update request to the cache update server. The cache update server, based on the request, loads the cached data table from the source database into the Redis database, completing the cache data update in the Redis database. Subsequently, it reads the latest configuration parameters from the configuration information repository into the ZooKeeper component and updates the version number in the ZooKeeper component according to the latest configuration parameters. Specifically, if the table name of the cached data table already exists in the ZooKeeper component, the version number of that table name is incremented by 1; otherwise, the table name is added, and an initial version number greater than 0 is assigned to it.

[0082] The ZooKeeper component is invoked to send cache update notifications to each application instance. After receiving the cache update notification, each application instance retrieves the latest configuration parameter version number from the ZooKeeper component, compares it with the version number of each configuration parameter stored locally, obtains the table name of the cache data table with different version numbers, retrieves the corresponding cache update data from the Redis database based on the table name, and updates the local cache.

[0083] It's worth noting that this example provides two levels of cache update notification. The first level, based on a single cache table, notifies all application instances using that table when it's updated, prompting them to update their corresponding cache data. This level is suitable when parameter tables are shared by multiple applications. The second level, based on a single application instance, notifies that application when its parameters need updating, updating all cache data it uses. This level is suitable for full updates to a single application instance, allowing for a one-time update of all cache data for that application.

[0084] In this example, the caching component used by each application instance to store cached data includes a first-level cache and a second-level cache maintained based on the LRU algorithm. The cached data obtained by each application instance is stored in the first-level cache. When the cached data is accessed for the first time, it is loaded into the second-level cache. When the same cached data is accessed again, the second-level cache will be searched first. Since the second-level cache stores less data and the LRU algorithm always keeps the most recently accessed cached data in the second-level cache, it ensures that the most frequently accessed cached data is stored in the limited cache space, making the cache retrieval efficiency higher.

[0085] When the ZooKeeper component cannot be invoked, the cache update server adds an abnormal version number, such as -1, to the configuration parameters obtained from the configuration information repository and sends it to each application instance. Since the version number cannot be obtained from the ZooKeeper component for comparison, each application instance retrieves all corresponding cache data tables from the Redis database based on the configuration parameters containing the abnormal version number.

[0086] When a cached data table cannot be retrieved from the Redis database, each application instance connects to the fallback interface of the cache update server to retrieve the corresponding cached data table from the cache update server's memory. In this case, the cache update server calls the EHcache component to retrieve the cached data table from memory and return it to the corresponding application instance. If the table does not exist in memory, or if the cached data table has expired, the table is retrieved from the source database, loaded into memory, and then retrieved from memory and returned to the corresponding application instance.

[0087] Furthermore, embodiments of this application also propose a computer storage medium storing a cache update program. When the cache update program is executed by a processor, it implements the steps of the cache update method described above. Therefore, it will not be repeated here. Additionally, the beneficial effects of using the same method will not be repeated here either. For technical details not disclosed in the computer-readable storage medium embodiments of this application, please refer to the description of the method embodiments of this application. As an example, program instructions can be deployed to execute on a single computing device, or on multiple computing devices located at one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.

[0088] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0089] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided in this application, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0090] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.

[0091] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A cache update method, characterized in that, Applied to a cache update server, the method includes: Receive cache update requests; Based on the cache update request, cache update data is obtained from the data source and loaded into the cache database; The coordination service component is invoked to send cache update notifications to each application instance, so that each application instance can obtain the corresponding cache update data from the cache database and update the cache according to the cache update data. The process of invoking the coordination service component to send cache update notifications to each application instance includes: When the historical cache configuration information contains a cache update data name that is the same as the string obtained from the cache database, the version number of the historical cache configuration information containing the same cache update data name is incremented by 1. If the cache update data name does not exist, an initial version number is added to the string corresponding to the cache update data name to generate first cache configuration information; the first cache configuration information includes the correspondence between the application instance and the cache update data, as well as the cache version information of the cache update data; The coordination service component is invoked to send cache update notifications to each application instance, so that each application instance can obtain the corresponding latest cache update data from the cache database according to the first cache configuration information, and update the cache according to the latest cache update data.

2. The cache update method according to claim 1, characterized in that, After the method calls the coordination service component to send cache update notifications to each application instance, the method further includes: If the coordination service component cannot be invoked, a second cache configuration information is generated, which includes the correspondence between the cache update data and each application instance. Send the second cache configuration information to each of the application instances so that each of the application instances can obtain all the corresponding cache update data from the cache database according to the second cache configuration information.

3. The cache update method according to any one of claims 1-2, characterized in that, The coordination service component is the ZooKeeper component.

4. A cache update method, characterized in that, Applied to an application instance, the method includes: Receive cache update notification from the coordination service component; the cache update notification is generated by the cache update server invoking the coordination service component based on the cache update request. According to the cache update notification, the latest cache update data is obtained from the cache database, and the cache is updated according to the latest cache update data; the cache update data is obtained from the data source by the cache update server according to the cache update request and then loaded into the cache database. Receiving cache update notifications from the coordination service component includes: If a cache update notification cannot be received from the coordination service component, then all corresponding cache update data is obtained from the cache database according to the preset data acquisition cycle. The cache update data is all cache update data corresponding to the second cache configuration information, and the cache update server adds an abnormal version number to the second cache configuration information. The abnormal version number is set to a number sequence less than 1.

5. The cache update method according to claim 4, characterized in that, After retrieving all the corresponding cache update data from the cache database, the method further includes: If data cannot be obtained from the cache database, the fallback interface of the cache update server is connected, and all corresponding cache update data is obtained from the local memory of the cache update server according to the preset data acquisition cycle; the corresponding cache update data in the local memory is obtained from the data source by the EHcache component.

6. A cache update server, characterized in that, include: A processor, a memory, and a cache updater stored in the memory, the cache updater being executed by the processor to implement the steps of the cache update method as described in any one of claims 1-3.

7. A business application device, characterized in that, include: A processor, a memory, and a cache updater stored in the memory, the cache updater being executed by the processor to implement the steps of the cache update method as described in any one of claims 4-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a cache update program, which, when executed by a processor, implements the cache update method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data persistence method, device and system based on Ehcache

    CN105843892A

  • Cache refreshing method, device and system

    CN113190570A