Local cache refreshing method and device, electronic equipment and storage medium
By introducing cache synchronization SDK, cache cluster and distributed configuration center into the business application cluster, and using the hot spot detection mechanism to refresh the local cache, the problem of difficult to guarantee real-time, reliability and consistency of cached data in the existing technology is solved, and high-performance service application system response is achieved.
Patent Information
- Application Number
- CN202411768550.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-28
AI Technical Summary
In multi-consumer business scenarios, in order to ensure the real-time, reliability and consistency of cached data, it is difficult for the existing technology to effectively refresh local cached data, resulting in system response delay and performance degradation.
By introducing cache synchronization SDK, cache cluster and distributed configuration center into the business application cluster, the local cache is refreshed using the hot spot detection mechanism. The specific steps include responding to the access request of the business application, uploading the access event, analyzing the access data to generate a hotspot key list, and broadcasting and updating the hotspot key list to all cache synchronization SDKs.
Through real-time refresh of local caches, the real-time, reliability and consistency of cached data is ensured, thereby improving the response speed and performance of business application systems.
Smart Images

Figure CN119728779A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cache technology, and more specifically, to a local cache refresh method, device, electronic device and storage medium. Background Art
[0002] Caching is a key technology to achieve fast system response. It is used to use high-speed memory to store data information for future use. It can improve the system response time and reduce latency. From the client or browser to the network, from the network to the application server and even the database, by applying caching technology at all levels, the performance of the entire application system can be greatly improved. The use of caching technology can effectively reduce the system response time, shorten the network transmission time and application delay time, thereby improving the system throughput and increasing the system concurrency.
[0003] For business scenarios where multiple consumers obtain data from the source system database, in order to improve the system performance of the consumer application and reduce the database pressure of the source system, a distributed cache is usually introduced between the source system and the consumer application. In order to ensure the real-time, reliability and consistency of the cached data and enable the business application system to run and respond at a high speed, the cached data needs to be refreshed. Summary of the invention
[0004] In view of this, the present application provides a local cache refresh method, device, electronic device and storage medium for refreshing the local cache based on hotspot detection to ensure the real-time, reliability and consistency of cached data.
[0005] In order to achieve the above objectives, the proposed solution is as follows:
[0006] A local cache refresh method is applied to a business application cluster, wherein the business application cluster includes at least one cache synchronization SDK, a cache cluster, and a distributed configuration center for coordinating and controlling the cache synchronization SDK and the cache cluster. The local cache refresh method includes the following steps:
[0007] In response to the business application's access request to the key value, the cache synchronization SDK returns the data corresponding to the key value to the business application based on the access request, and uploads the business application's access event to the key value to the cache cluster, where the data is local cache data or remote data;
[0008] Receive the access events uploaded by the cache synchronization SDK, analyze and calculate the access data of different business applications based on a series of the access events, and obtain a hot key list, wherein the hot key list includes at least one hot key value;
[0009] The hot key list is sent to all the cache synchronization SDKs in a broadcasting manner, so that the cache synchronization SDKs update their existing hot key lists.
[0010] Optionally, the response to the business application's access request to the key value causes the cache synchronization SDK to return data corresponding to the key value to the business application based on the access request, and uploads the business application's access event to the key value to the cache cluster, wherein the data is local cache data or remote data, including the steps of:
[0011] Search from the existing hotspot key list based on the key value;
[0012] If the corresponding hot key value can be found, search from the local cache based on the key value and return the found data to the business application;
[0013] If the corresponding hot key value cannot be found, the remote cache cluster is accessed based on the key value, and the accessed data is returned to the business application.
[0014] Optionally, the response to the business application's access request to the key value causes the cache synchronization SDK to return data corresponding to the key value to the business application based on the access request, and uploads the business application's access event to the key value to the cache cluster, wherein the data is local cache data or remote data, further comprising the steps of:
[0015] When the business application performs a write, delete or invalidation operation on the locally cached data, invalidation processing is performed on the specific key value corresponding to the written, deleted or invalidated data.
[0016] Optionally, when the business application performs a write, delete or invalidation operation on the locally cached data, performing invalidation processing on a specific key value corresponding to the data being written, deleted or invalidated includes the steps of:
[0017] Delete the local cache data corresponding to the specific key value;
[0018] And push the key value invalidation event of the specific key value invalidation to the cache cluster;
[0019] The cache cluster pushes the specific key value to all other cache synchronization SDKs based on the key value expiration event, so that all other cache synchronization SDKs clear the local cache data corresponding to the specific key value.
[0020] Optionally, the cache cluster SDK includes an SDK interface, a hotspot module and a communication module.
[0021] A local cache refresh device is applied to a business application cluster, wherein the business application cluster includes at least one cache synchronization SDK, a cache cluster, and a distributed configuration center for coordinating and controlling the cache synchronization SDK and the cache cluster, wherein the local cache refresh device includes:
[0022] The access control module is configured to respond to the access request of the business application to the key value, so that the cache synchronization SDK returns the data corresponding to the key value to the business application based on the access request, and uploads the access event of the business application to the key value to the cache cluster, where the data is local cache data or remote data;
[0023] A data processing module is configured to receive access events uploaded by the cache synchronization SDK, analyze and calculate access data of different business applications based on a series of the access events, and obtain a hot key list, wherein the hot key list includes at least one hot key value;
[0024] The list sending module is configured to send the hot key list to all the cache synchronization SDKs in a broadcasting manner, so that the cache synchronization SDKs update their existing hot key lists.
[0025] Optionally, the access control module includes:
[0026] A key value searching unit, configured to search from the existing hotspot key list based on the key value;
[0027] A first search unit is configured to search from a local cache based on the key value if a corresponding hot key value can be found, and return the found data to the business application;
[0028] The second search unit is configured to access the remote cache cluster based on the key value if the corresponding hot key value cannot be found, and return the accessed data to the business application.
[0029] Optionally, the access control module further includes:
[0030] The invalidation processing unit is configured to perform invalidation processing on a specific key value corresponding to the data being written, deleted or invalidated when the business application writes, deletes or invalidates the data in the local cache.
[0031] An electronic device is applied to a business application cluster, the electronic device comprising at least one processor and a memory connected to the processor, wherein:
[0032] The memory is used to store computer programs or instructions;
[0033] The processor is used to execute the computer program or instruction so that the electronic device implements the local cache refresh method as described above.
[0034] A computer-readable storage medium is applied to an electronic device, wherein the storage medium carries one or more computer programs, and the one or more computer programs can be executed by the electronic device, so that the electronic device implements the local cache refresh method as described above.
[0035] It can be seen from the above technical scheme that the present application discloses a local cache refresh method, device, electronic device and storage medium, the method and device are applied to a business application cluster, the business application cluster includes at least one cache synchronization SDK, a cache cluster and a distributed configuration center for coordinating and controlling the cache synchronization SDK and the cache cluster, the local cache refresh method and device specifically respond to the business application's access request to the key value, so that the cache synchronization SDK returns the data corresponding to the key value to the business application based on the access request, and uploads the business application's access event to the key value to the cache cluster, the data is local cache data or remote data; receives the access event uploaded by the cache synchronization SDK, analyzes and calculates the access data of different business applications based on a series of access events, obtains a hotspot key list, and the hotspot key list includes at least one hotspot key value; sends the hotspot key list to all cache synchronization SDKs by broadcasting, so that the cache synchronization SDK updates its existing hotspot key list for update. In this scheme, the real-time, reliability and consistency of the cached data are guaranteed by refreshing the local cache, so that the business application system can run and respond at high speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 A system architecture diagram of a business application cluster according to an embodiment of the present application;
[0038] Figure 2 A flowchart of a local cache refresh method according to an embodiment of the present application;
[0039] Figure 3 A block diagram of a local cache refresh device according to an embodiment of the present application;
[0040] Figure 4 A block diagram of a local cache refresh device according to an embodiment of the present application;
[0041] Figure 5 This is a working diagram of a local cache refresh device according to an embodiment of the present application;
[0042] Figure 6 A block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0044] The solution provided in this application is applied to a business application cluster, which includes a cache cluster, a distributed configuration center, and at least one cache synchronization SDK. Figure 1 shown.
[0045] The cache cluster SDK is used to provide local caching capabilities for hot data for various business applications, interact with the cache cluster server, and read the key value of invalid data from the distributed configuration center for data synchronization. The cache cluster SDK includes the SDK interface, hotspot module, and communication module. The main function of the SDK interface is to obtain key values and key value invalidation. The main function of the hotspot module is hotspot maintenance and local cache maintenance. The main function of the communication module is key value access reporting, key value invalidation reporting, hotspot discovery monitoring, and hotspot invalidation monitoring.
[0046] During the startup and operation of the cache cluster SDK, it will read necessary configuration information from the distributed configuration center, such as the key initialization list, startup configuration, cache cluster address information, etc.
[0047] The cache cluster provides data reading and writing services for various business applications, receives cache access data reported by the cache cluster SDK, performs hotspot detection, and pushes the key of the hotspot data to various business applications through the distributed configuration center. The main functions of the cache cluster include hotspot detection, hotspot push, hotspot data collection, parameter encapsulation, and parameter push.
[0048] During the startup and operation of the cache cluster, the required configuration information will be read from the distributed configuration center, such as business application information, hotspot threshold configuration information, blacklist and whitelist information, etc.
[0049] The distributed configuration center provides the overall "cluster push" and "unified configuration" capabilities and is a basic component of the system.
[0050] The solution proposed in this application is to use the cache cluster SDK locally for hot data with high usage frequency, so that business applications can directly read and write, thereby improving data access speed; for non-hot data with low usage frequency, the cache cluster module at the remote end of the application is stored, and data is read and written with the data source, providing cache data hot spot detection and other capabilities. Cluster push and unified configuration are performed between the cache cluster SDK module and the cache cluster module through the distributed configuration center.
[0051] Figure 2 This is a flowchart of a local cache refresh method according to an embodiment of the present application.
[0052] like Figure 2 As shown, the local cache refresh method provided in this embodiment is applied to the above business application cluster to refresh the data in the local cache to avoid wasting system resources. The refresh method specifically includes the following steps:
[0053] S1. Respond to the business application's access request to the key value, enable the cache synchronization SDK to return the data corresponding to the key value to the business application based on the access request, and upload the business application's access event to the key value to the cache cluster.
[0054] That is, when a business application sends an access request for a key value, based on the request, the cache synchronization SDK returns the data corresponding to the key value to the business application that issued the request. The data is local cache data or remote data. The specific process includes the following:
[0055] When a key value sent by a business application is received, a search is performed from the existing hot key list based on the key value.
[0056] If the corresponding hot key value can be found, it will be searched from the local cache based on the key value and the found data will be given to the business application;
[0057] If the corresponding hot key value cannot be found, the remote cache cluster is accessed based on the key value, and the accessed data is returned to the business application.
[0058] In addition, the following is also included:
[0059] When a business application writes, deletes, or invalidates data in the local cache, invalidation processing is performed on the specific key value corresponding to the data being written, deleted, or invalidated. The process of implementing the processing is as follows:
[0060] The local cache data corresponding to the specific key value is deleted; and the key value invalidation event of the specific key value is pushed to the cache cluster; based on the key value invalidation event, the cache cluster pushes the specific key value to all other cache synchronization SDKs, so that other cache synchronization SDKs clear the local cache data corresponding to the specific key value, so as to achieve the final consistency of the cluster data.
[0061] S2. Receive access events uploaded by the cache synchronization SDK, analyze and calculate access data of different business applications based on a series of access events, and obtain a hotspot key list. The hotspot key list must include at least one hotspot key value.
[0062] Specifically, statistical analysis is performed on the access data to determine whether it is a hot key value based on the probability and quantity of the key value. The so-called hot key value refers to a key value that is repeatedly accessed by business applications, indicating that the corresponding data is repeatedly called by business applications. After statistical analysis, the key value corresponding to the repeatedly called local cache data is determined as the hot key value, and all hot key values are summarized into a list, namely the hot key list. Obviously, the hot key list includes at least one hot key value.
[0063] S3. Broadcast the hotspot key list to all cache synchronization SDKs so that the cache synchronization SDKs can update their existing hotspot key lists.
[0064] In this way, all other cache synchronization SDKs can locally cache the data corresponding to the hot key list, that is, transfer the data in the library into the local cache, so that the system can obtain the corresponding data with extremely high efficiency when accessing it.
[0065] It can be seen from the above technical scheme that this embodiment provides a local cache refresh method, which is applied to a business application cluster, and the business application cluster includes at least one cache synchronization SDK, a cache cluster and a distributed configuration center for coordinating and controlling the cache synchronization SDK and the cache cluster. The local cache refresh method specifically responds to the business application's access request to the key value, so that the cache synchronization SDK returns the data corresponding to the key value to the business application based on the access request, and uploads the business application's access event to the key value to the cache cluster, and the data is local cache data or remote data; receives the access event uploaded by the cache synchronization SDK, analyzes and calculates the access data of different business applications based on a series of access events, and obtains a hot key list, and the hot key list includes at least one hot key value; sends the hot key list to all cache synchronization SDKs by broadcasting, so that the cache synchronization SDK updates its existing hot key list for update. In this scheme, the real-time, reliability and consistency of the cached data are guaranteed by refreshing the local cache, so that the business application system can run and respond at high speed.
[0066] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0067] Although operations are depicted in a particular order, this should not be understood as requiring that the operations be performed in the particular order shown or in a sequential order.Multitasking and parallel processing may be advantageous under certain circumstances.
[0068] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0069] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as C or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer.
[0070] Figure 3 A block diagram of a local cache refresh device according to an embodiment of the present application.
[0071] like Figure 3 As shown, the local cache refresh device provided in this embodiment is applied to the above business application cluster to refresh the data in the local cache to avoid waste of system resources. The refresh device specifically includes an access control module 10, a data processing module 20 and a list sending module 30.
[0072] The access control module is used to respond to business application access requests to key values, enable the cache synchronization SDK to return data corresponding to the key value to the business application based on the access request, and upload the business application's access event to the key value to the cache cluster.
[0073] That is, when a business application sends an access request for a key value, based on the request, the cache synchronization SDK returns the data corresponding to the key value to the business application that issued the request. The data is local cache data or remote data. Figure 4 As shown, the module specifically includes a key value search unit 11, a first search unit 12 and a second search unit 13.
[0074] The key value search unit is used to search from an existing hotspot key list based on the key value when receiving the key value sent by the business application.
[0075] The first search unit is used for searching from the local cache based on the key value if the key value search unit can find the corresponding hot key value, and providing the found data to the business application;
[0076] The second search unit is used to access the remote cache cluster based on the key value if the key value search unit cannot find the corresponding hot key value, and return the accessed data to the business application.
[0077] In addition, the access control module also includes an invalidation processing unit 14 .
[0078] The invalidation processing unit is used to perform invalidation processing on the specific key value corresponding to the data being written, deleted or invalidated when the business application writes, deletes or invalidates the data in the local cache. The process of implementing the processing is as follows:
[0079] The local cache data corresponding to the specific key value is deleted; and the key value invalidation event of the specific key value is pushed to the cache cluster; based on the key value invalidation event, the cache cluster pushes the specific key value to all other cache synchronization SDKs, so that other cache synchronization SDKs clear the local cache data corresponding to the specific key value, so as to achieve the final consistency of the cluster data.
[0080] The data processing module is used to receive access events uploaded by the cache synchronization SDK, analyze and calculate the access data of different business applications based on a series of access events, and obtain a hot key list. The hot key list must include at least one hot key value.
[0081] Specifically, statistical analysis is performed on the access data to determine whether it is a hot key value based on the probability and quantity of the key value. The so-called hot key value refers to a key value that is repeatedly accessed by business applications, indicating that the corresponding data is repeatedly called by business applications. After statistical analysis, the key value corresponding to the repeatedly called local cache data is determined as the hot key value, and all hot key values are summarized into a list, namely the hot key list. Obviously, the hot key list includes at least one hot key value.
[0082] The list sending module is used to broadcast the hot key list to all cache synchronization SDKs, so that the cache synchronization SDK can update its existing hot key list.
[0083] In this way, all other cache synchronization SDKs can locally cache the data corresponding to the hot key list, that is, transfer the data in the library into the local cache, so that the system can obtain the corresponding data with extremely high efficiency when accessing it.
[0084] The local cache refresh device is based on Figure 5 The specific details in implement the refresh processing of local cache data.
[0085] It can be seen from the above technical scheme that this embodiment provides a local cache refresh device, which is applied to a business application cluster, and the business application cluster includes at least one cache synchronization SDK, a cache cluster and a distributed configuration center for coordinating and controlling the cache synchronization SDK and the cache cluster. The local cache refresh device specifically responds to the business application's access request to the key value, so that the cache synchronization SDK returns the data corresponding to the key value to the business application based on the access request, and uploads the business application's access event to the key value to the cache cluster, and the data is local cache data or remote data; receives the access event uploaded by the cache synchronization SDK, analyzes and calculates the access data of different business applications based on a series of access events, and obtains a hot key list, and the hot key list includes at least one hot key value; sends the hot key list to all cache synchronization SDKs by broadcasting, so that the cache synchronization SDK updates its existing hot key list for update. In this scheme, the real-time, reliability and consistency of the cached data are guaranteed by refreshing the local cache, so that the business application system can run and respond at high speed.
[0086] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
[0087] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0088] Figure 6 A block diagram of an electronic device according to an embodiment of the present application.
[0089] Reference below Figure 6 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. The electronic device is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0090] The electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory ROM 602 or a program loaded from an input device 606 into a random access memory RAM 603. In the RAM, various programs and data required for the operation of the electronic device are also stored. The processing device, ROM, and RAM are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0091] Typically, the following devices may be connected to the I / O interface: input devices including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 608 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 609. The communication device 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various devices, it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have alternatively.
[0092] The present application also provides an embodiment of a computer-readable storage medium.
[0093] The computer-readable storage medium is applied to an electronic device and carries one or more computer programs. When the one or more computer programs are executed by the electronic device, the electronic device responds to the business application's access request to the key value, and the cache synchronization SDK returns the data corresponding to the key value to the business application based on the access request, and uploads the business application's access event to the key value to the cache cluster, where the data is local cache data or remote data; receives the access event uploaded by the cache synchronization SDK, analyzes and calculates the access data of different business applications based on a series of access events, and obtains a hotspot key list, which includes at least one hotspot key value; and sends the hotspot key list to all cache synchronization SDKs via broadcasting, so that the cache synchronization SDK updates its existing hotspot key list. In this solution, the real-time, reliability and consistency of the cached data are guaranteed by refreshing the local cache, so that the business application system can run and respond at high speed.
[0094] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0095] In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0096] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0097] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0098] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0099] The technical solution provided by the present invention is introduced in detail above. Specific examples are used in this article to illustrate the principle and implementation mode of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation mode and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A local cache refresh method, applied to a business application cluster, wherein the business application cluster includes at least one cache synchronization SDK, a cache cluster, and a distributed configuration center for coordinating and controlling the cache synchronization SDK and the cache cluster, characterized in that: The local cache refresh method comprises the steps of: In response to the business application's access request to the key value, the cache synchronization SDK returns the data corresponding to the key value to the business application based on the access request, and uploads the business application's access event to the key value to the cache cluster, where the data is local cache data or remote data; Receive the access events uploaded by the cache synchronization SDK, analyze and calculate the access data of different business applications based on a series of the access events, and obtain a hot key list, wherein the hot key list includes at least one hot key value; The hot key list is sent to all the cache synchronization SDKs in a broadcasting manner, so that the cache synchronization SDKs update their existing hot key lists.
2. The local cache refresh method according to claim 1, characterized in that: The response to the business application's access request to the key value causes the cache synchronization SDK to return data corresponding to the key value to the business application based on the access request, and uploads the business application's access event to the key value to the cache cluster, wherein the data is local cache data or remote data, including the steps of: Search from the existing hotspot key list based on the key value; If the corresponding hot key value can be found, search from the local cache based on the key value and return the found data to the business application; If the corresponding hot key value cannot be found, the remote cache cluster is accessed based on the key value, and the accessed data is returned to the business application.
3. The local cache refresh method according to claim 2, characterized in that: The response to the business application's access request to the key value causes the cache synchronization SDK to return the data corresponding to the key value to the business application based on the access request, and uploads the access event of the business application to the key value to the cache cluster, wherein the data is local cache data or remote data, and further includes the steps of: When the business application performs a write, delete or invalidation operation on the locally cached data, invalidation processing is performed on the specific key value corresponding to the written, deleted or invalidated data.
4. The local cache refresh method according to claim 3, characterized in that: When the business application performs a write, delete or invalidation operation on the locally cached data, invalidation processing is performed on a specific key value corresponding to the data being written, deleted or invalidated, including the steps of: Delete the local cache data corresponding to the specific key value; And push the key value invalidation event of the specific key value invalidation to the cache cluster; The cache cluster pushes the specific key value to all other cache synchronization SDKs based on the key value expiration event, so that all other cache synchronization SDKs clear the local cache data corresponding to the specific key value.
5. The local cache refresh method according to claim 1, characterized in that: The cache cluster SDK includes an SDK interface, a hotspot module and a communication module.
6. A local cache refresh device, applied to a business application cluster, wherein the business application cluster includes at least one cache synchronization SDK, a cache cluster, and a distributed configuration center for coordinating and controlling the cache synchronization SDK and the cache cluster, characterized in that: The local cache refreshing device comprises: The access control module is configured to respond to the access request of the business application to the key value, so that the cache synchronization SDK returns the data corresponding to the key value to the business application based on the access request, and uploads the access event of the business application to the key value to the cache cluster, where the data is local cache data or remote data; A data processing module is configured to receive access events uploaded by the cache synchronization SDK, analyze and calculate access data of different business applications based on a series of the access events, and obtain a hot key list, wherein the hot key list includes at least one hot key value; The list sending module is configured to send the hot key list to all the cache synchronization SDKs in a broadcasting manner, so that the cache synchronization SDKs update their existing hot key lists.
7. The local cache refresh device according to claim 6, characterized in that: The access control module comprises: A key value search unit, configured to search from the existing hotspot key list based on the key value; A first search unit is configured to search from a local cache based on the key value if a corresponding hot key value can be found, and return the found data to the business application; The second search unit is configured to access the remote cache cluster based on the key value if the corresponding hot key value cannot be found, and return the accessed data to the business application.
8. The local cache refresh device according to claim 7, characterized in that: The access control module also includes: The invalidation processing unit is configured to perform invalidation processing on a specific key value corresponding to the data being written, deleted or invalidated when the business application writes, deletes or invalidates the data in the local cache.
9. An electronic device, applied to a business application cluster, characterized in that: The electronic device comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs or instructions; The processor is used to execute the computer program or instruction so that the electronic device implements the local cache refresh method according to any one of claims 1 to 5.
10. A computer-readable storage medium, applied to an electronic device, characterized in that: The storage medium carries one or more computer programs, and the one or more computer programs can be executed by the electronic device, so that the electronic device implements the local cache refresh method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Data acquisition method based on local cache and distributed cache and application server
CN112100537A
Hotspot detection method and device, detection server, hot spot detection system and medium
CN113742555A
Data query method and device, computer equipment, readable storage medium and program product
CN118503264A
Data acquisition method based on local cache and distributed cache, and application server
WO2022022105A1