A method and system for optimizing cache management
By integrating the SDK toolkit into the cache nodes and generating a tree structure, the problem of difficulty in displaying data consistency and update status in multi-level cache systems is solved, enabling intuitive cache management and efficient data synchronization.
Patent Information
- Application Number
- CN202410357926.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-27
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2044-03-27
AI Technical Summary
In existing multi-level caching systems, there is a lack of effective ways to ensure data consistency and intuitively display cache update status. External personnel cannot know the cache level, number of nodes, and update status.
By integrating the SDK toolkit into the cache nodes, registration requests are automatically initiated, long-lived communication is established, a tree structure is generated to display and manage the cache nodes, information update notifications are received, and data is synchronized and displayed.
It enables intuitive management and efficient updating of cache nodes, clearly displaying cache levels and node status, thus improving the accuracy and efficiency of cache management.
Smart Images

Figure CN118312536B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method and system for optimizing cache management. Background Technology
[0002] In modern internet systems, to improve data retrieval efficiency, data is typically retrieved from databases and cached in memory. Subsequent data retrievals are then directly read from the cached memory, further enhancing efficiency. However, memory resources are limited, so external caching systems like Redis and Memcached are commonly used for unified data storage. To further improve efficiency, multi-level caching is employed, combining databases, external caches (level 1 cache), and local caches (level 2 cache). This approach further improves data retrieval efficiency. However, ensuring data consistency across multiple caching levels raises a challenge. Currently, there is no suitable method or user-defined interface for this. Typically, this is handled automatically by the program, and external personnel have no way of knowing the exact number of caching levels, the number of nodes in each level, or whether each cache level has been updated. Summary of the Invention
[0003] The technical problem to be solved by this invention is to provide a method and system for optimizing cache management, which can provide a more intuitive and efficient display of cache update status and cache management.
[0004] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0005] A method for optimizing cache management includes the following steps:
[0006] S1. Receive the registration requests from each cache node and establish long-term communication links with each cache node;
[0007] S2. Arrange the node information of the registered cache nodes according to the cache hierarchy to generate a tree structure;
[0008] S3. The cache nodes are cached, displayed, and managed using the tree structure.
[0009] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows:
[0010] A cache management optimization system includes a multi-level cache management server and several cache nodes. The multi-level cache management server includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps:
[0011] S1. Receive the registration requests from each cache node and establish long-term communication links with each cache node;
[0012] S2. Arrange the node information of the registered cache nodes according to the cache hierarchy to generate a tree structure;
[0013] S3. The cache nodes are cached, displayed, and managed using the tree structure.
[0014] The beneficial effects of the present invention are as follows: The cache management optimization method and system of the present invention registers cache nodes and generates a tree structure according to the cache hierarchy, with each cache level representing a layer of tree height, and each cache node in each cache level representing a tree node, and performs cache recording, display and management of each cache node based on the tree structure, which is more intuitive and efficient. Attached Figure Description
[0015] Figure 1 This is a flowchart illustrating a cache management optimization method according to an embodiment of the present invention;
[0016] Figure 2 This is a structural example diagram of a cache management optimization system according to an embodiment of the present invention;
[0017] Label Explanation:
[0018] 1. A cache management optimization system; 2. A multi-level cache management server; 3. A cache node; 4. A processor; 5. A memory. Detailed Implementation
[0019] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0020] Please refer to Figure 1 A method for optimizing cache management, comprising the following steps:
[0021] S1. Receive the registration requests from each cache node and establish long-term communication links with each cache node;
[0022] S2. Arrange the node information of the registered cache nodes according to the cache hierarchy to generate a tree structure;
[0023] S3. The cache nodes are cached, displayed, and managed using the tree structure.
[0024] As can be seen from the above description, the beneficial effects of the present invention are as follows: The cache management optimization method and system of the present invention registers cache nodes and generates a tree structure according to the cache hierarchy, with each cache level representing a layer of tree height, and each cache node in each cache level representing a tree node, and performs cache recording, display and management of each cache node based on the tree structure, which is more intuitive and efficient.
[0025] Furthermore, each of the aforementioned cache nodes is pre-integrated with an SDK toolkit;
[0026] The registration request is automatically initiated by the cache node at startup based on the SDK toolkit.
[0027] As described above, by integrating a pre-defined SDK toolkit into the cache node, the cache node automatically initiates a registration request upon startup.
[0028] Furthermore, the registration request includes the IP address, port, and instance name of the cache node;
[0029] The specific steps in step S1 for establishing long-lived communication with each of the cache nodes are as follows:
[0030] Establish long-lived communication links with each cache node based on its IP address and port.
[0031] As described above, the registration request includes the IP address and port of the cache node, thus enabling the establishment of a long-lived connection with the cache node based on the IP address and port.
[0032] Further, step S3 includes the following steps:
[0033] Receive information update notifications and update the cached data to each of the cache nodes according to the information update notifications;
[0034] The system receives feedback information from each of the cache nodes regarding data updates, determines the data update status of each cache node based on the feedback information, and displays the results through the tree structure.
[0035] As described above, when the data source information is updated, the cache information needs to be updated synchronously. Data updates are initiated to each cache node, and the update status is displayed through a tree structure to intuitively show the cache update status.
[0036] Furthermore, step S3 also includes the following steps:
[0037] Based on the data update status of each cache node, a new data update can be initiated for the cache node that failed to update, or a data update can be triggered for a specified cache node based on the user's click action.
[0038] As described above, when a cache node fails to update its cached data, the system can initiate a new update of the cached data for that node, either proactively or by a user's click.
[0039] Please refer to Figure 2 A cache management optimization system includes a multi-level cache management server and several cache nodes. The multi-level cache management server includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps:
[0040] S1. Receive the registration requests from each cache node and establish long-term communication links with each cache node;
[0041] S2. Arrange the node information of the registered cache nodes according to the cache hierarchy to generate a tree structure;
[0042] S3. The cache nodes are cached, displayed, and managed using the tree structure.
[0043] As can be seen from the above description, the beneficial effects of the present invention are as follows: The cache management optimization method and system of the present invention registers cache nodes and generates a tree structure according to the cache hierarchy, with each cache level representing a layer of tree height, and each cache node in each cache level representing a tree node, and performs cache recording, display and management of each cache node based on the tree structure, which is more intuitive and efficient.
[0044] Furthermore, each of the aforementioned cache nodes is pre-integrated with an SDK toolkit;
[0045] The registration request is automatically initiated by the cache node at startup based on the SDK toolkit.
[0046] As described above, by integrating a pre-defined SDK toolkit into the cache node, the cache node automatically initiates a registration request upon startup.
[0047] Furthermore, the registration request includes the IP address, port, and instance name of the cache node;
[0048] The specific steps in step S1 for establishing long-lived communication with each of the cache nodes are as follows:
[0049] Establish long-lived communication links with each cache node based on its IP address and port.
[0050] As described above, the registration request includes the IP address and port of the cache node, thus enabling the establishment of a long-lived connection with the cache node based on the IP address and port.
[0051] Further, step S3 includes the following steps:
[0052] Receive information update notifications and update the cached data to each of the cache nodes according to the information update notifications;
[0053] The system receives feedback information from each of the cache nodes regarding data updates, determines the data update status of each cache node based on the feedback information, and displays the results through the tree structure.
[0054] As described above, when the data source information is updated, the cache information needs to be updated synchronously. Data updates are initiated to each cache node, and the update status is displayed through a tree structure to intuitively show the cache update status.
[0055] Furthermore, step S3 also includes the following steps:
[0056] Based on the data update status of each cache node, a new data update can be initiated for the cache node that failed to update, or a data update can be triggered for a specified cache node based on the user's click action.
[0057] As described above, when a cache node fails to update its cached data, the system can initiate a new update of the cached data for that node, either proactively or by a user's click.
[0058] The present invention provides a method and system for optimizing cache management, applicable to the display and management of cache update status in multi-level caching scenarios.
[0059] Please refer to Figure 1 Embodiment 1 of the present invention is as follows:
[0060] A method for optimizing cache management includes the following steps:
[0061] S1. Receive the registration requests from each cache node and establish long-term communication links with each cache node;
[0062] Each of the aforementioned cache nodes has an SDK toolkit pre-integrated.
[0063] The registration request is automatically initiated by the cache node at startup based on the SDK toolkit;
[0064] The registration request includes the IP address, port, and instance name of the cache node;
[0065] The specific steps in step S1 for establishing long-lived communication with each of the cache nodes are as follows:
[0066] Establish long-lived communication links with each cache node based on its IP address and port.
[0067] In this embodiment, an SDK toolkit is provided, which all projects (cached nodes) implementing cache storage need to integrate. A multi-level cache management project (multi-level cache management server) exists. After each cache project integrates the SDK package, it automatically registers its instance information with the multi-level cache project upon startup. This registration information includes IP address, port, and instance name. After successful registration, each cache project establishes a long-lived connection with the multi-level cache management project for message communication. Simultaneously, a registration list is generated within the multi-level cache management project.
[0068] S2. Arrange the node information of the registered cache nodes according to the cache hierarchy to generate a tree structure.
[0069] In this embodiment, the multi-level cache management project orchestrates nodes based on the instance information of the registered cache projects. Specifically, the multi-level cache management project can automatically orchestrate a tree structure based on the configuration information of the multi-level cache, that is, set the parent ID information of the nodes, and finally orchestrate a whole tree structure, where each level of cache represents one layer of tree height, and each cache node in each level of cache represents a tree node.
[0070] At the same time, administrators can also arrange them through the backend interface.
[0071] S3. The cache nodes are cached, displayed, and managed using the tree structure.
[0072] Step S3 includes the following steps:
[0073] Receive information update notifications and update the cached data to each of the cache nodes according to the information update notifications;
[0074] Receive feedback information from each of the cache nodes regarding data updates, determine the data update status of each cache node based on the feedback information, and display it through the tree structure;
[0075] Step S3 also includes the following steps:
[0076] Based on the data update status of each cache node, a new data update can be initiated for the cache node that failed to update, or a data update can be triggered for a specified cache node based on the user's click action.
[0077] When data source information is updated and cache information needs to be updated synchronously, in the old solution, the data source needed to notify each cache node to update the cache separately.
[0078] In this embodiment, the data source only needs to notify the multi-level cache management project, which then notifies each cache node via an established long-lived connection. Each cache node, after updating its own cache, will notify the multi-level cache management project that its own data update is complete.
[0079] Therefore, a multi-level cache management system can clearly determine the data update status of each cache node and display it in a tree structure, intuitively showing which nodes have not yet updated their cached data or whose updates have failed. Furthermore, the tree structure of the multi-level cache management system allows users to manually click on nodes whose caches have not been updated, or to automatically trigger the cache update operation on those nodes again.
[0080] This method allows for a clear and intuitive display of data across various cache levels and nodes. It also enables a direct view of which nodes have been updated and allows for automatic or manual updates of the cache for any node, multiple nodes, or nodes at a specific level, thereby improving the accuracy of multi-level caching.
[0081] Please refer to Figure 2 Embodiment two of the present invention is as follows:
[0082] A cache management optimization system 1 includes a multi-level cache management server 2 and several cache nodes 3. The multi-level cache management server 2 includes a processor 4, a memory 5, and a computer program stored in the memory 5 and executable on the processor 4. When the processor 4 executes the computer program, it implements the steps in the cache management optimization method described in Embodiment 1 above.
[0083] In summary, the cache management optimization method and system provided by this invention registers cache nodes and generates a tree structure according to the cache hierarchy, with each cache level representing a layer of tree height, and each cache node in each cache level representing a tree node. Based on this tree structure, the cache nodes are recorded, displayed and managed, which is more intuitive and efficient.
[0084] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for cache management optimization, the method comprising: The method comprises the steps of: S1, receiving a registration request of each cache node, and establishing long link communication with each cache node; S2, arranging node information of the registered cache nodes according to a cache level, and generating a tree structure; S3, recording, displaying and managing each cache node through the tree structure; The registration request comprises an IP address, a port and an instance name of the cache node; In step S1, the long link communication with each cache node is specifically as follows: The long link communication is established with each cache node according to the IP address and the port of each cache node; Step S3 comprises the steps of: receiving an information update notification, updating cached data of each cache node according to the information update notification; receiving feedback information of data update of each cache node, determining data update of each cache node based on the feedback information, and displaying the data update through the tree structure; Step S3 further comprises the steps of: based on the data update of each cache node, reinitiating data update of the cache node that fails to update, or triggering data update of the specified cache node according to a click action of a user.
2. The method of cache management optimization of claim 1, wherein, Each cache node is pre-integrated with an SDK tool package; The registration request is automatically initiated by the cache node based on the SDK tool package when starting.
3. A system for cache management optimization, comprising a multi-level cache management server and a plurality of cache nodes, the multi-level cache management server comprising a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein, The processor executes the computer program to implement the following steps: S1, receiving a registration request of each cache node, and establishing long link communication with each cache node; S2, arranging node information of the registered cache nodes according to a cache level, and generating a tree structure; S3, recording, displaying and managing each cache node through the tree structure; The registration request comprises an IP address, a port and an instance name of the cache node; In step S1, the long link communication with each cache node is specifically as follows: The long link communication is established with each cache node according to the IP address and the port of each cache node; Step S3 comprises the steps of: receiving an information update notification, updating cached data of each cache node according to the information update notification; receiving feedback information of data update of each cache node, determining data update of each cache node based on the feedback information, and displaying the data update through the tree structure; Step S3 further comprises the steps of: based on the data update of each cache node, reinitiating data update of the cache node that fails to update, or triggering data update of the specified cache node according to a click action of a user.
4. The system for cache management optimization of claim 3, wherein, Each cache node is pre-integrated with an SDK tool package; The registration request is automatically initiated by the cache node based on the SDK tool package when starting.
Citation Information
Patent Citations
Data caching method and system
CN106570017A
Menu system with authority control
CN114282183A