Cache management method, device, equipment, system, storage medium and program product

By adopting a multi-level cache architecture in computer systems, including distributed cluster network cache and local cache, the problems of low cache hit rate and insufficient resource utilization in complex scenarios are solved, and more efficient cache resource utilization and system performance improvement are achieved.

CN119988250APending Publication Date: 2025-05-13BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510199010.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-21
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

When traditional cache management faces scenarios with high computing complexity, the cache hit rate is low and resource utilization is insufficient, resulting in the inability to efficiently allocate and utilize the cache space, which reduces system performance.

Method used

The multi-level cache architecture is adopted, including distributed cluster network cache and local cache. By obtaining the cache request of the terminal device, the corresponding cache data is called from the multi-level cache based on the data type to load, thereby achieving the maximum utilization of cache resources.

Benefits of technology

It improves the overall efficiency of cache, enhances system performance, and can handle highly concurrent data access requests more efficiently, avoids single point of bottlenecks, and improves system throughput.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119988250A_ABST
    Figure CN119988250A_ABST
Patent Text Reader

Abstract

The invention provides a cache management method, device, equipment and system, a storage medium and a program product, and relates to the technical field of computer data processing. The method comprises the following steps: acquiring a first cache request sent by terminal equipment, wherein the first cache request comprises a data type of cache data requested to be called; based on the data type, corresponding cache data are called from a multi-level cache for loading, the multi-level cache comprises a distributed cluster network cache and at least one level of local cache, and the distributed cluster network cache is deployed in a distributed cache cluster composed of terminal equipment and at least one piece of equipment in communication connection with the terminal equipment. According to the embodiment of the invention, through a multi-level cache architecture, caches are arranged at multiple levels, so that cache resources can be utilized to the maximum extent, resource waste is avoided, and the overall performance is improved. In combination with distributed cache, high-concurrency data access requests can be processed more efficiently, and the throughput of the system is improved by dispersing the requests to a plurality of cache nodes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, specifically to the field of computer data processing technology, and in particular to a cache management method, device, equipment, system, storage medium and program product. Background Art

[0002] Cache management plays a vital role in the operation of computer systems. However, traditional cache management exposes many problems when facing some scenarios with high computational complexity. For example, in big data analysis scenarios, massive amounts of data need to be processed, and the calculation process involves complex algorithms and frequent data reading operations. In this case, the cache hit rate of traditional cache management is low, and it is impossible to efficiently allocate limited cache space to the most needed parts.

[0003] In addition, insufficient resource utilization is also a common problem in traditional cache management. Due to the relatively fixed management strategy and the lack of sufficient flexibility and dynamic adjustment capabilities, cache resources often cannot be optimally allocated and utilized. In some cases, part of the cache space may be idle, while another part may overflow or frequently replace data due to overload, which not only reduces the overall efficiency of the cache, but may also have a negative impact on system performance. Summary of the invention

[0004] The embodiments of the present disclosure provide a cache management method, apparatus, device, system, storage medium, and program product.

[0005] In a first aspect, an embodiment of the present disclosure proposes a cache management method, including: obtaining a first cache request sent by a terminal device, the first cache request including a data type of cache data requested to be called; based on the data type, calling corresponding cache data from a multi-level cache for loading, the multi-level cache including a distributed cluster network cache and at least one level of local cache, the distributed cluster network cache being deployed in a distributed cache cluster consisting of a terminal device and at least one device communicatively connected to the terminal device.

[0006] In the second aspect, an embodiment of the present disclosure proposes a cache management device, including: a cache request acquisition module, configured to obtain a first cache request sent by a terminal device, the first cache request containing the data type of the cache data requested to be called; a data loading module, configured to call the corresponding cache data from a multi-level cache for loading based on the data type, the multi-level cache including a distributed cluster network cache and at least one level of local cache, the distributed cluster network cache being deployed in a distributed cache cluster consisting of a terminal device and at least one device communicatively connected to the terminal device.

[0007] In a third aspect, an embodiment of the present disclosure provides a cache management system, which includes: a cache management device and a first terminal device, the first terminal device is configured to send a first cache request based on a user operation, the first cache request including the data type of the cache data requested to be called; the cache management device is configured to obtain the first cache request, and based on the data type, call the corresponding cache data from a multi-level cache for loading, the multi-level cache including a distributed cluster network cache and at least one level of local cache, the distributed cluster network cache being deployed in a distributed cache cluster consisting of a terminal device and at least one device communicatively connected to the terminal device.

[0008] In a fourth aspect, an embodiment of the present disclosure provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can implement the cache management method described in any implementation method in the first aspect when executing.

[0009] In a fifth aspect, an embodiment of the present disclosure provides a non-transitory computer-readable storage medium storing computer instructions, which are used to enable a computer to implement the cache management method described in any implementation method of the first aspect when executed.

[0010] In a sixth aspect, an embodiment of the present disclosure provides a computer program product comprising a computer program, which, when executed by a processor, can implement the cache management method described in any implementation manner in the first aspect.

[0011] The cache management method, device, equipment, system, storage medium and program product of the disclosed embodiments can maximize the use of cache resources, avoid resource waste and improve overall performance by setting cache at multiple levels through a multi-level cache architecture. In addition, combined with distributed cache, it can more efficiently process high-concurrency data access requests, and avoid single-point bottlenecks and improve system throughput by distributing requests to multiple cache nodes.

[0012] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Other features, objects and advantages of the present disclosure will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0014] Figure 1 is an exemplary system architecture in which the present disclosure may be applied;

[0015] Figure 2 A flowchart of a cache management method provided by an embodiment of the present disclosure;

[0016] Figure 3 A flowchart of another cache management method provided by an embodiment of the present disclosure;

[0017] Figure 4 A flowchart of another cache management method provided by an embodiment of the present disclosure;

[0018] Figure 5 A schematic diagram of a multi-level cache structure provided by an embodiment of the present disclosure;

[0019] Figure 6 A flowchart of another cache management method provided by an embodiment of the present disclosure;

[0020] Figure 7 A flowchart of another cache management method provided by an embodiment of the present disclosure;

[0021] Fig. 8A A schematic diagram of the structure of a cache management system provided by an embodiment of the present disclosure;

[0022] Figure 8B A schematic diagram of the structure of another cache management system provided by an embodiment of the present disclosure;

[0023] Fig. 9 A schematic diagram of a flow chart of a cache management method in an application scenario provided by an embodiment of the present disclosure;

[0024] Fig.10 A structural block diagram of a cache management device provided by an embodiment of the present disclosure;

[0025] Fig.11 A schematic diagram of the structure of an electronic device suitable for executing a cache management method provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0026] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description. It should be noted that the embodiments in the present disclosure and the features in the embodiments may be combined with each other without conflict.

[0027] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0028] Figure 1 An exemplary system architecture 100 is shown to which embodiments of the cache management method, apparatus, device, system, storage medium, and program product of the present disclosure can be applied.

[0029] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0030] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Terminal devices 101, 102, 103 and server 105 can be installed with various applications for realizing information communication between the two, such as smart IoT applications, instant messaging applications, etc.

[0031] Terminal devices 101, 102, 103 and server 105 can be hardware or software. When terminal devices 101, 102, 103 are hardware, they can be various electronic devices with display screens, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, etc.; when terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above, which can be implemented as multiple software or software modules, or as a single software or software module, and no specific limitation is made here. When server 105 is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server; when the server is software, it can be implemented as multiple software or software modules, or as a single software or software module, and no specific limitation is made here.

[0032] The server 105 can provide various services through various built-in applications. In addition, the data and information involved in various applications can be obtained from the terminal devices 101, 102, 103 through the network 104, or can be pre-stored in the server 105 in various ways. Therefore, when the server 105 detects that the data has been stored locally, it can choose to directly obtain the data from the local. In this case, the exemplary system architecture 100 may also not include the terminal devices 101, 102, 103 and the network 104.

[0033] Since providing services based on applications may require more computing resources and stronger computing power, the cache management methods provided in the subsequent embodiments of the present disclosure are generally performed by the server 105 with stronger computing power and more computing resources, and accordingly, the cache management device is generally also set in the server 105. However, it should also be pointed out that when the terminal devices 101, 102, and 103 also have computing power and computing resources that meet the requirements, the terminal devices 101, 102, and 103 can also complete the above-mentioned various operations that are handed over to the server 105 through various applications installed thereon, and then output the same results as the server 105. In particular, when there are multiple terminal devices with different computing powers at the same time, but the corresponding application determines that the terminal device has stronger computing power and more remaining computing resources, the terminal device can be allowed to perform the above-mentioned operations, thereby appropriately reducing the computing pressure of the server 105. Accordingly, the cache management device can also be set in the terminal devices 101, 102, and 103. In this case, the exemplary system architecture 100 may also not include the server 105 and the network 104.

[0034] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0035] Please refer to Figure 2 , Figure 2 A flowchart of a cache management method provided by an embodiment of the present disclosure, wherein process 200 includes the following steps:

[0036] Step 201: Obtain a first cache request sent by a terminal device, where the first cache request includes the data type of the cache data requested to be called.

[0037] This step is intended to be performed by the execution subject of the cache management method (such as Figure 1The server 105 shown in the figure obtains the first cache request sent by the terminal device. The first cache request can be triggered by a variety of situations: it can be an operation input by the user through a terminal device (such as a mobile device such as a mobile phone, a tablet, a terminal device such as a computer), for example, clicking on an application (App) presented on the mobile phone interface to open the application; it can be an operation such as a user entering a URL link in a computer browser to open the corresponding web page; it can also be when the application is restarted, the application will check the cache at startup to quickly restore the state of the last use or load commonly used data. For example, after the video playback application is restarted, the most recent playback records, video lists and other information may be loaded from the cache. After the map application is restarted, the previously viewed map area may be loaded from the cache. In addition, the first cache request may include the data type of the cache data requested to be called. In combination with the above examples, it can be seen that the data type may include: image resources, video resources, file resources, audio resources, etc.

[0038] Step 202: Based on the data type, call the corresponding cache data from the multi-level cache for loading, the multi-level cache includes a distributed cluster network cache and at least one level of local cache, the distributed cluster network cache is deployed in a distributed cache cluster consisting of a terminal device and at least one device that is communicatively connected to the terminal device.

[0039] This step is intended to call the corresponding cache data from the multi-level cache for loading by the above-mentioned execution subject according to the data type of the cache data contained in the first cache request obtained. In the embodiment of the present disclosure, the cache data is stored in a multi-level cache architecture, which includes at least one level of local cache and a distributed cluster network cache, wherein the local cache refers to a mechanism for storing data on a local device (such as a computer, server or mobile device, etc.). This storage method is intended to improve data access speed, reduce the number of accesses to remote data sources (such as databases, network servers, etc.), and provide continuity of data access when the network is delayed or interrupted. The distributed cluster network cache is deployed in a distributed cache cluster composed of the terminal device and at least one other device connected to the terminal device. In the embodiment of the present disclosure, each device in the distributed cache cluster can be connected by wireless communication, and the wireless communication method may include near field communication (such as NFC (Near Field Communication)), short-range communication (such as Bluetooth communication, WiFi communication, etc.), etc.

[0040] The cache management method provided by the embodiment of the present disclosure can maximize the use of cache resources, avoid resource waste, and improve overall performance through a multi-level cache architecture and cache settings at multiple levels. In addition, combined with distributed cache, it can more efficiently handle high-concurrency data access requests, and by distributing requests to multiple cache nodes, avoid single-point bottlenecks and improve system throughput.

[0041] Please refer to Figure 3 , Figure 3 A flowchart of another cache management method provided in an embodiment of the present disclosure, namely, for Figure 2 Step 202 in the process 200 shown provides a specific implementation method, and the other steps in the process 200 are not adjusted. The specific implementation method provided by the embodiment of the present disclosure is replaced by step 202 to obtain a new complete embodiment. The process 300 includes the following steps:

[0042] Step 301: Synchronize data on the terminal device based on the cached data in the distributed cache cluster and the cached data requested by the first cache request to determine incremental cache data.

[0043] In the disclosed embodiment, the process of synchronizing data for each device in the distributed cache cluster mainly adopts an incremental update synchronization strategy. Accordingly, the execution subject can synchronize data for the terminal device based on the cached data in the distributed cache cluster and the cached data requested by the first cache request to determine the content of the incremental cached data of the cached data requested by this cache request. For example, the data related to file A has been cached in the distributed cache cluster. When the cache request initiated by the user through the terminal device contains the content of file A and file B, the execution subject can determine that the incremental cached data is the relevant data of file B based on the content of both.

[0044] Step 302: Send the incremental cache data to the terminal device for loading.

[0045] After determining the incremental cache data for the first cache request, the execution subject may send the incremental cache data to the terminal device for loading, so that the terminal device can complete the generation and display of the data content for the first cache request. Exemplarily, the execution subject may obtain the corresponding incremental cache data through a backend data source such as a database, a server, a file system, etc., but the embodiments of the present disclosure are not limited thereto.

[0046] In this embodiment, an incremental data synchronization strategy is adopted to synchronize data for devices in a distributed cache cluster, which can significantly reduce the amount of data transmitted. Moreover, since the amount of data transmitted is greatly reduced, incremental synchronization can complete the synchronization process faster, which can save a lot of time and data processing resources, thereby improving the efficiency of the synchronization operation.

[0047] In some optional implementations of the embodiments of the present disclosure, the execution subject may also send the incremental cache data to other devices in the distributed cache cluster for caching for subsequent direct calls. Exemplarily, for other devices, the user may perform input operations on other devices (such as clicking on an application, entering a link address in a browser, clicking a file icon, etc.). Based on the input operation, the other device generates a second cache request accordingly, and the execution subject obtains the second cache request. When it is determined that the second cache data requested by the second cache request contains the incremental cache data that has been cached in the other device before, the execution subject may directly call the incremental cache data in the other device for loading. Compared with the process of obtaining the incremental cache data from other data sources for loading, it can significantly reduce the communication, data transmission and other processes, thereby improving the efficiency of data processing and loading in other cache nodes in the distributed cache cluster.

[0048] In the embodiments of the present disclosure, another main purpose of using a distributed cache cluster to deploy a distributed cluster network cache is to achieve load balancing, ensuring that the cached data is reasonably cached on each device in the distributed cache cluster to avoid the problem of excessive data flow load on a single device. In some optional implementations of the embodiments of the present disclosure, a consistent hashing algorithm can be used to cache incremental cache data to other devices in the distributed cache cluster, so that the incremental cache data is relatively evenly distributed among the devices in the cluster. The consistent hashing algorithm maps the entire hash value space into a virtual ring, and the entire space is organized in a clockwise direction. The consistent hashing algorithm only needs to relocate a small part of the data in the ring space for the addition or removal of nodes, and has good fault tolerance and scalability.

[0049] In some optional implementations of the disclosed embodiments, the incremental cache data can also be stored in other devices in the distributed cache cluster based on at least one of the computing power and the remaining storage space of other devices in the cluster as a basis for allocation. For example, for scenarios with high requirements for read and write speeds, only the impact of computing power can be considered, and relatively more incremental cache data can be allocated to devices with higher computing power for storage; for scenarios with low requirements for read and write speeds, only the impact of remaining storage space can be considered, and the storage ratio of incremental cache data can be allocated based on the proportional relationship of the remaining storage space of each device. Considering the impact of computing power and remaining storage space at the same time is a more balanced allocation method, and the capacity for storing incremental cache data can be allocated to each device based on the proportion of computing power and remaining storage space.

[0050] In some optional implementations of the embodiments of the present disclosure, the devices in the distributed cache cluster can be registered and updated according to actual conditions. For example, when the terminal device sends the first cache request, if the distributed cache cluster does not yet include the terminal device, the execution entity can register the terminal device to the first distributed cache cluster that does not include the terminal device based on the first cache request, so that the terminal device joins the first distributed cache cluster to form the distributed cache cluster, wherein the first distributed cache cluster includes at least one device that can communicate with the terminal device. Accordingly, the communication connection described in the embodiments of the present disclosure may include near field communication (such as NFC (Near Field Communication)), short-range communication (such as Bluetooth communication, WiFi communication, etc.), etc.

[0051] Accordingly, the execution subject can update the cluster device list of the distributed cache cluster, update the terminal device to the cluster device list, and update the distributed cluster network cache node. In actual applications, the execution subject can also regularly scan the devices connected to the distributed cache cluster through Bluetooth, WiFi-Direct (a technology that allows devices in a wireless network to connect to each other without a wireless router), etc., to further update the cluster device list.

[0052] Please refer to Figure 4 , Figure 4 A flowchart of another cache management method provided in an embodiment of the present disclosure, namely, for Figure 2 Step 202 in the process 200 shown provides a specific implementation method, and the other steps in the process 200 are not adjusted. The specific implementation method provided by the embodiment of the present disclosure is replaced by step 202 to obtain a new complete embodiment. Step 202 is a process of calling corresponding cache data from a multi-level cache for loading based on the data type, which mainly includes:

[0053] Step 401: Determine whether the data type contains data required for the application to run.

[0054] In the disclosed embodiment, the first cache request may be a cache request triggered by a user clicking on an application on a mobile phone. In response to the click operation, the feedback that the mobile phone system needs to give is to open the application and present the homepage content of the application. At this time, the execution subject can determine whether the data type contained in the first cache request contains the data required for the operation of the corresponding application. For example, whether the data type contains the image resources, sound resources, text resources, etc. required for the homepage of the application.

[0055] Step 402: If the data type contains data required for the application program to run, cache data corresponding to the data type is called from the distributed cluster network cache for loading.

[0056] When the execution subject determines that the data type of the cache data requested by the first cache request contains the data required for the application to run, the corresponding cache data can be called from the distributed cluster network cache for loading. In the disclosed embodiment, the data related to the running of the application is mainly cached in the distributed cluster network cache in the multi-level cache, so that the execution subject can call the corresponding cache data from the distributed cluster network cache for loading by the terminal device, and through the distributed cache method of the distributed cluster network cache, the cache data can be evenly stored in each device in the distributed cache cluster, which can avoid the problem of excessive data flow load on a single device.

[0057] In some optional implementations of the embodiments of the present disclosure, the multi-level cache may include a four-level cache structure, such as Figure 5 As shown, the four-level cache structure mainly includes:

[0058] Level 1 cache: kernel cache, which is mainly used to store system operations and data to improve the read and write performance of the file system. It is mainly used to store data with a high access frequency (compared to other caches, this data should be the hottest data with the highest access frequency), provides the fastest access speed, can be updated in real time, and is immediately loaded into memory when the user is using the application.

[0059] Second level cache: read-write buffer, that is, a piece of memory allocated to the cache management process, mainly used to optimize read-write performance and reduce direct access to backend storage. The buffer size can be controlled by the buffer-size parameter. Reasonable setting of the buffer size can effectively improve the stability and efficiency of the system.

[0060] Level 3 cache: Local storage cache, mainly used to provide large-capacity storage space to store infrequently accessed data. Store data locally on the device (such as hard disk, memory or other storage media) for quick access and reuse.

[0061] Level 4 cache: Distributed cluster network cache, which sets the cache on multiple devices, breaking through the performance and storage space limits of a single node.

[0062] Correspondingly, step 202, based on the data type, calls the corresponding cache data from the multi-level cache for loading, mainly including: calling the cache data with the highest access frequency from the kernel cache for loading; calling the cache data generated by the read and write operations from the read and write buffer for loading; calling the persistent cache data from the local storage cache for loading.

[0063] In some optional implementations of the embodiments of the present disclosure, the execution subject may also perform corresponding processing on the cache data in the multi-level cache according to the corresponding cache processing instruction initiated by the user. Figure 6 , Figure 6 A flowchart of another cache management method provided by an embodiment of the present disclosure, wherein process 600 includes the following steps:

[0064] Step 601: Obtain a first cache request sent by a terminal device, where the first cache request includes the data type of the cache data requested to be called.

[0065] Step 602: Based on the data type, corresponding cache data is called from the multi-level cache for loading.

[0066] The above steps 601-602 are similar to Figure 2 Steps 201-202 shown are consistent, and for the same contents, please refer to the corresponding parts of the previous embodiment, which will not be repeated here.

[0067] Step 603: Obtain a cache clearing instruction initiated by the user, which includes the cache level and data type to be cleared.

[0068] Step 604: Based on the cache level and data type to be cleared, clear the corresponding cache data in the multi-level cache.

[0069] In the embodiments of the present disclosure, the cache management method executed by the execution subject can, on the one hand, be used by the execution subject to actively call and load cache data according to the content involved in the operation initiated by the user (such as starting an application, browsing a web page, etc.), and on the other hand, can also manage and allocate the cache according to the corresponding instructions given by the user. For example, the user sets an instruction to clear the cache through the terminal device, which can include the cache level and data type to be cleared. After obtaining the cache clearing instruction, the execution subject can clear the corresponding cache data according to the cache level and data type indicated by the instruction. In actual applications, users can also set a specific time to clear the cache to configure a scheduled task to instruct the execution subject to clear the cache at the corresponding time.

[0070] Please refer to Figure 7 , Figure 7 A flowchart of another cache management method provided by an embodiment of the present disclosure, wherein process 700 includes the following steps:

[0071] Step 701: Obtain a first cache request sent by a terminal device, where the first cache request includes the data type of the cache data requested to be called.

[0072] Step 702: Based on the data type, corresponding cache data is called from the multi-level cache for loading.

[0073] The above steps 701-702 are similar to Figure 2 Steps 201-202 shown are consistent, and for the same contents, please refer to the corresponding parts of the previous embodiment, which will not be repeated here.

[0074] Step 703: Obtain a cache synchronization instruction initiated by the user.

[0075] Step 704: Based on the cache synchronization instruction, synchronize data among the devices in the distributed cache cluster.

[0076] In the embodiments of the present disclosure, the cache management method executed by the execution subject can, on the one hand, be used by the execution subject to actively synchronize cache data according to the content involved in the operation initiated by the user (such as starting an application, browsing a web page, etc.), and on the other hand, can also synchronize cache data according to the corresponding instructions given by the user. For example, the user sets a cache synchronization instruction through a terminal device, which may include the data type and device to be synchronized. After the execution subject obtains the cache synchronization instruction, it can synchronize the cache data of the corresponding device in the distributed cache cluster according to the data type and device indicated by the instruction. If the user does not set a specific data type and device, the execution subject will synchronize the data in each device in the distributed cache cluster by default. In actual applications, users can also set a specific time for data synchronization to configure a scheduled task to instruct the execution subject to synchronize data at the corresponding time.

[0077] Please refer to Fig. 8A , Fig. 8A A schematic diagram of the structure of a cache management system provided for an embodiment of the present disclosure, wherein the cache management system 800 mainly includes: a cache management device 801 and a first terminal device 802. The first terminal device 802 is configured to send a first cache request based on a user operation, and the first cache request includes the data type of the cache data requested to be called. The cache management device 801 is configured to obtain the first cache request, and based on the data type, call the corresponding cache data from a multi-level cache for loading, the multi-level cache includes a distributed cluster network cache and at least one level of local cache, and the distributed cluster network cache is deployed in a distributed cache cluster consisting of the terminal device and at least one device that is communicatively connected to the terminal device.

[0078] In the embodiment of the present disclosure, the specific processing of the cache management device 801 and the first terminal device 802 and the technical effects thereof can be referred to in Figure 2 The relevant descriptions of steps 201 - 202 in the corresponding embodiment are not repeated here.

[0079] In some optional implementations of the embodiments of the present disclosure, such as Figure 8B As shown, the cache management system 800 may also include a second terminal device 803. The cache management device 801 is further configured to synchronize data with the terminal device based on the cached data of the distributed cache cluster and the cache data requested to be called by the first cache request, determine the incremental cache data, and send the incremental cache data to the second terminal device 803 for caching. The second terminal device 803 is configured to send a second cache request based on the user's operation, and the second cache request includes the requested second cache data. The cache management device 801 is further configured to obtain the second cache request, and in response to the second cache data including the incremental cache data, call the incremental cache data in the second terminal device 803 for loading.

[0080] In the embodiment of the present disclosure, the cache management device 801 can synchronize data between the first terminal device 802 and the second terminal device 803 by calling the synchronization component configured therein, can communicate with the first terminal device 802 and the second terminal device 803 respectively through the communication interface layer configured therein, and can store cache data respectively through the storage component configured therein. In addition, in the embodiment of the present disclosure, the setting of the cache management device 801 is not limited. The cache management device 801 can be set in the cache management system 800 as a separate device, or can be directly configured in the first terminal device 802 or the second terminal device 803 if the computing power, resources, etc. of the first terminal device 802 or the second terminal device 803 allow.

[0081] In the embodiment of the present disclosure, the specific processing of the cache management device 801 and the second terminal device 803 and the technical effects thereof can be referred to in Figure 3 The relevant descriptions of steps 301 - 302 in the corresponding embodiment are not repeated here.

[0082] To deepen understanding, the present disclosure also provides a specific implementation solution in combination with a specific application scenario, see Fig. 9 shown.

[0083] The user operates on the mobile phone 91 and clicks on an application to start the application.

[0084] The mobile phone 91 receives the user's operation instruction and initiates a cache request.

[0085] The distributed cache management device 92 receives the cache request, registers the mobile phone 91 in the distributed cache cluster, and updates the cluster device list of the distributed cache cluster. The mobile phone 91 is synchronized based on the cached data and the cache data requested by the cache request to determine the incremental cache data. The incremental cache data is sent to the mobile phone 91.

[0086] The mobile phone 91 receives the incremental cache data and loads it to complete the startup of the application and display the homepage content after the application is started to the user.

[0087] In addition, the incremental cache data determined by the distributed cache management device 92 can also be sent to another device 93 in the distributed cache cluster for storage. When the user or other users operate the device 93 and click on the same application, the distributed cache management device 92 receives the cache request, registers the device 93 with the distributed cache cluster, and updates the cluster device list of the distributed cache cluster. Data synchronization is performed on the device 93 based on the cached data and the cache data requested to be called by the cache request. If the device 93 determines that the incremental cache data is consistent with the incremental cache data cached in the device 93 based on the data synchronization request, there is no need to transfer data anymore, and the cached incremental cache data is directly called for loading.

[0088] Further references Fig.10 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a cache management device. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0089] like Fig.10 As shown, the cache management device 1000 of the embodiment of the present disclosure may include: a cache request acquisition module 1001 and a data loading module 1002. The cache request acquisition module 1001 is configured to acquire a first cache request sent by a terminal device, and the first cache request includes the data type of the cache data requested to be called. The data loading module 1002 is configured to call the corresponding cache data from the multi-level cache for loading based on the data type. The multi-level cache includes a distributed cluster network cache and at least one level of local cache. The distributed cluster network cache is deployed in a distributed cache cluster composed of a terminal device and at least one device that is communicatively connected to the terminal device.

[0090] In the embodiment of the present disclosure, the specific processing of the cache request acquisition module 1001 and the data loading module 1002 and the technical effects thereof can be referred to in the respective Figure 2 The relevant descriptions of steps 201 - 203 in the corresponding embodiment are not repeated here.

[0091] The embodiment of the present disclosure exists as a device embodiment corresponding to the above method embodiment. The cache management device provided by the embodiment of the present disclosure can maximize the use of cache resources, avoid resource waste, and improve overall performance through a multi-level cache architecture and cache at multiple levels. In addition, combined with distributed cache, it can more efficiently process high-concurrency data access requests, and by distributing requests to multiple cache nodes, avoid single-point bottlenecks and improve system throughput.

[0092] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the cache management method described in any of the above embodiments can be implemented when the at least one processor executes.

[0093] According to an embodiment of the present disclosure, the present disclosure further provides a readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to implement the cache management method described in any of the above embodiments when executed.

[0094] According to an embodiment of the present disclosure, the present disclosure further provides a computer program product, which can implement the cache management method described in any of the above embodiments when executed by a processor.

[0095] Fig.11 A schematic block diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0096] like Fig.11As shown, the device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1102 or a computer program loaded from a storage unit 1108 into a random access memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the device 1100 can also be stored. The computing unit 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.

[0097] A number of components in the device 1100 are connected to the I / O interface 1105, including: an input unit 1106, such as a keyboard, a mouse, etc.; an output unit 1107, such as various types of displays, speakers, etc.; a storage unit 1108, such as a disk, an optical disk, etc.; and a communication unit 1109, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1109 allows the device 1100 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0098] The computing unit 1101 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1101 performs the various methods and processes described above, such as the cache management method. For example, in some embodiments, the cache management method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 1108. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1100 via the ROM 1102 and / or the communication unit 1109. When the computer program is loaded into the RAM 1103 and executed by the computing unit 1101, one or more steps of the cache management method described above may be performed. Alternatively, in other embodiments, the computing unit 1101 may be configured to perform the cache management method in any other appropriate manner (e.g., by means of firmware).

[0099] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0100] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0101] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 foregoing.

[0102] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0103] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0104] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.

[0105] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0106] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A cache management method, comprising: Acquire a first cache request sent by a terminal device, where the first cache request includes a data type of cache data requested to be called; Based on the data type, corresponding cache data is called from a multi-level cache for loading, wherein the multi-level cache includes a distributed cluster network cache and at least one level of local cache, and the distributed cluster network cache is deployed in a distributed cache cluster consisting of the terminal device and at least one device that is communicatively connected to the terminal device.

2. The cache management method according to claim 1, wherein: Based on the data type, calling corresponding cache data from the multi-level cache for loading includes: Synchronize data on the terminal device based on the cached data of the distributed cache cluster and the cached data requested to be called by the first cache request, and determine incremental cache data; The incremental cache data is sent to the terminal device for loading.

3. The cache management method according to claim 2, further comprising: The incremental cache data is sent to other devices in the distributed cache cluster for caching.

4. The cache management method according to claim 3, wherein: The sending the incremental cache data to other devices in the distributed cache cluster for caching includes: The incremental cache data is cached to other devices in the distributed cache cluster using a consistent hashing algorithm.

5. The cache management method according to claim 3, wherein: The sending the incremental cache data to other devices in the distributed cache cluster for caching includes: Based on the computing power and / or remaining storage space of other devices in the distributed cache cluster, the incremental cache data is stored in the other devices respectively.

6. The cache management method according to claim 3, further comprising: Obtaining a second cache request sent by the other device, where the second cache request includes the second cache data requested to be called; In response to the second cache data including the incremental cache data, the incremental cache data is called in the other device for loading.

7. The cache management method according to claim 1, wherein: Based on the data type, calling corresponding cache data from the multi-level cache for loading includes: In response to the data type containing data required for running the application, cache data corresponding to the data type is called from the distributed cluster network cache for loading.

8. The cache management method according to claim 7, wherein: The multi-level cache is a four-level cache structure, including the distributed cluster network cache and the three-level local cache, the local cache includes: kernel cache, read-write buffer and local storage cache, Based on the data type, calling corresponding cache data from the multi-level cache for loading includes: Calling the cache data with the highest access frequency from the kernel cache for loading; Calling the cache data generated by the read and write operations from the read and write buffer to load; The persistent cache data is called from the local storage cache for loading.

9. The cache management method according to claim 1, further comprising: Based on the first cache request, the terminal device is registered with a first distributed cache cluster to form the distributed cache cluster, wherein the first distributed cache cluster includes at least one device that can be communicatively connected with the terminal device.

10. The cache management method according to claim 9, further comprising: The cluster device list of the distributed cache cluster is updated based on the registered terminal device.

11. The cache management method according to claim 1, further comprising: In response to a cache processing instruction initiated by a user, the cache data in the multi-level cache is processed accordingly.

12. The cache management method according to claim 11, wherein: The step of performing corresponding processing on cache data in the multi-level cache in response to a cache processing instruction initiated by a user includes: Obtaining a cache clearing instruction initiated by a user, wherein the cache clearing instruction includes a cache level and a data type to be cleared; Based on the cache level and data type to be cleared, corresponding cache data in the multi-level cache is cleared.

13. The cache management method according to claim 11, wherein: The step of performing corresponding processing on cache data in the multi-level cache in response to a cache processing instruction initiated by a user includes: Get the cache synchronization instruction initiated by the user; Based on the cache synchronization instruction, data of each device in the distributed cache cluster is synchronized.

14. A cache management device, comprising: A cache request acquisition module is configured to acquire a first cache request sent by a terminal device, wherein the first cache request includes a data type of the cache data requested to be called; The data loading module is configured to call corresponding cache data from a multi-level cache for loading based on the data type, wherein the multi-level cache includes a distributed cluster network cache and at least one level of local cache, and the distributed cluster network cache is deployed in a distributed cache cluster consisting of the terminal device and at least one device communicatively connected to the terminal device.

15. A cache management system, comprising: A cache management device and a first terminal device, The first terminal device is configured to send a first cache request based on a user operation, wherein the first cache request includes a data type of the cache data requested to be called; The cache management device is configured to obtain the first cache request and, based on the data type, call corresponding cache data from a multi-level cache for loading. The multi-level cache includes a distributed cluster network cache and at least one level of local cache. The distributed cluster network cache is deployed in a distributed cache cluster consisting of the terminal device and at least one device that is communicatively connected to the terminal device.

16. The cache management system according to claim 15, further comprising: The second terminal device, The cache management device is further configured to synchronize data on the terminal device based on the cached data of the distributed cache cluster and the cached data requested to be called by the first cache request, determine incremental cache data, and send the incremental cache data to the second terminal device for caching; The second terminal device is configured to send a second cache request based on a user operation, wherein the second cache request includes the requested second cache data; The cache management device is further configured to obtain the second cache request, and in response to the second cache data containing the incremental cache data, call the incremental cache data in the second terminal device for loading.

17. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the cache management method according to any one of claims 1 to 13.

18. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the cache management method according to any one of claims 1 to 13.

19. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the cache management method according to any one of claims 1 to 13 are implemented.

Citation Information

Cited By

  • Multi-level caching method based on distributed storage and related equipment

    CN121009121A