Cache management method and device, distributed cluster, storage medium and program product

By obtaining cache management information in a distributed cluster and determining custom management rules, the problem of failures cannot be handled automatically in the existing technology is solved, efficient cache management and disaster recovery capabilities are achieved, and data stability and integrity are ensured.

CN119847740APending Publication Date: 2025-04-18INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411903036.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

Existing distributed clusters cannot distinguish the resource domain where the resources are located, resulting in failures that cannot be automated, affecting the stability and integrity of the data.

Method used

By obtaining cache management information, custom management rules for the target cache are determined based on resource identification, based on these rules, the resource domains corresponding to the main cache and backup cache are determined separately, and management instructions are executed in the corresponding resource domains. The resource domains of the main cache and backup cache are disbanded at the preset level.

Benefits of technology

It realizes efficient management of distributed cache, improves the disaster recovery capabilities of distributed clusters, and ensures the stability and integrity of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119847740A_ABST
    Figure CN119847740A_ABST
Patent Text Reader

Abstract

The invention discloses a cache management method and device, a distributed cluster, a storage medium and a program product. Relates to the field of distributed technologies, and the method comprises the steps that cache management information is acquired, the cache management information comprises a resource identifier and a management instruction of a target cache, and the target cache comprises a main cache and a backup cache; determining a user-defined management rule corresponding to the target cache according to the resource identifier; resource domains corresponding to the main cache and the backup cache are determined based on a self-defined management rule, management instructions are executed on the main cache and the backup cache in the corresponding resource domains in sequence, and the resource domains corresponding to the main cache and the resource domains corresponding to the backup cache are scattered according to a first preset level. According to the scheme provided by the invention, efficient management of the distributed cache can be realized, and resource domain positioning and isolation can be performed on the main cache and the standby cache at the same time, so that the disaster tolerance capability of a distributed cluster is improved, and the stability and integrity of data are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of distributed technology, and in particular to a cache management method, device, distributed cluster, storage medium and program product. Background Art

[0002] A distributed cluster is an architecture that connects multiple computing resources through a network to work together. It can improve the processing speed and efficiency of computing tasks and is widely used in financial Internet, cloud computing, and big data processing.

[0003] Most existing distributed clusters adopt containerized deployment mode during deployment. A container is a lightweight, executable software unit that packages code and all necessary runtime environments (such as libraries, system tools, code, etc.) together. Compared with traditional virtual machines, distributed clusters have higher performance, lighter resource management, and more flexible scheduling strategies. However, existing distributed clusters cannot distinguish the resource domains where resources are located, so they cannot automatically handle faults. Summary of the invention

[0004] The present invention provides a cache management method, device, distributed cluster, storage medium and program product, which can realize efficient management of distributed cache, and can locate and isolate the resource domain of primary and backup caches, thereby improving the disaster recovery capability of the distributed cluster and ensuring the stability and integrity of data.

[0005] According to one aspect of the present invention, a cache management method is provided, the method comprising: obtaining cache management information, wherein the cache management information comprises a resource identifier and management instructions of a target cache, the target cache comprising a primary cache and a backup cache; determining a custom management rule corresponding to the target cache according to the resource identifier; determining resource domains corresponding to the primary cache and the backup cache respectively based on the custom management rule, and executing management instructions on the primary cache and the backup cache in the corresponding resource domains in turn, wherein the resource domain corresponding to the primary cache and the resource domain corresponding to the backup cache are scattered according to a first preset level.

[0006] Optionally, according to the resource identifier, a custom management rule corresponding to the target cache is determined, including: according to the resource identifier, determining the custom resource type of the target cache; and determining a custom management rule having a mapping relationship with the custom resource type from a preset type and rule comparison table.

[0007] Optionally, management instructions are executed on the primary cache and the backup cache in the corresponding resource domains in turn, including: executing management instructions on the primary cache in the resource domain corresponding to the primary cache, and determining whether the resource domain functions normally after executing the management instructions; if the resource domain functions normally after executing the management instructions, executing management instructions on the backup cache in the resource domain corresponding to the backup cache; if the resource domain functions abnormally after executing the management instructions, revoking the management instructions and ending the cache management process.

[0008] Optionally, the management instruction includes at least one of a new cache instruction, a delete cache instruction, and an update cache instruction.

[0009] Optionally, the number of backup caches is at least one; when the number of backup caches is at least two, the resource domains corresponding to any two backup caches are scattered according to a second preset level, and the first preset level is greater than or equal to the second preset level; the resource domain includes a plurality of cache containers, and the cache containers are deployed on a mechanical hard disk and / or a solid state drive.

[0010] Optionally, after executing management instructions on the primary cache and the backup cache in the corresponding resource domains in sequence, the method further includes: obtaining fault information, wherein the fault information is used to indicate that at least one of the primary cache and the backup cache has failed; rebuilding the resource domain corresponding to the failed cache according to the fault information and custom management rules, and synchronizing the cache that has not failed to the rebuilt resource domain.

[0011] According to another aspect of the present invention, a cache management device is provided, including: a communication module, a rule determination module and a management module; the communication module is used to obtain cache management information, wherein the cache management information includes a resource identifier and management instructions of a target cache, and the target cache includes a primary cache and a backup cache; the rule determination module is used to determine a custom management rule corresponding to the target cache according to the resource identifier; the management module is used to determine the resource domains corresponding to the primary cache and the backup cache respectively based on the custom management rules, and execute management instructions on the primary cache and the backup cache in the corresponding resource domains in turn, wherein the resource domain corresponding to the primary cache and the resource domain corresponding to the backup cache are scattered according to a first preset level.

[0012] According to another aspect of the present invention, a distributed cluster is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the cache management method of any embodiment of the present invention.

[0013] According to another aspect of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the cache management method of any embodiment of the present invention when executed.

[0014] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the cache management method of any embodiment of the present invention is implemented.

[0015] The technical solution of the embodiment of the present invention obtains cache management information, and determines the custom management rules corresponding to the target cache according to the resource identifier of the target cache included in the cache management information; further determines the resource domains corresponding to the primary cache and the backup cache respectively based on the custom management rules, and executes management instructions on the primary cache and the backup cache in the corresponding resource domains in turn. Compared with the existing distributed cluster cache management scheme, on the one hand, since corresponding custom management rules are formulated for each type of cache, management instructions are responded to based on the custom management rules, thereby achieving efficient management of the entire life cycle of the cache. On the other hand, based on the custom management rules, the resource domains corresponding to the primary cache and the backup cache are respectively determined, and the resource domains corresponding to the primary cache and the resource domains corresponding to the backup cache are scattered according to the first preset level, which can achieve the resource domain positioning and isolation of the primary and backup caches, and provide a basis for subsequent disaster recovery, thereby improving the disaster recovery capability of the distributed cluster and ensuring the stability and integrity of the data.

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

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0018] Figure 1 It is a flow chart of a cache management method provided by an embodiment of the present invention;

[0019] Figure 2 is a flow chart of another cache management method provided by an embodiment of the present invention;

[0020] Figure 3 It is a structural diagram of a cache management device provided by an embodiment of the present invention;

[0021] Figure 4 It is a schematic diagram of the structure of a distributed cluster provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0022] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0023] It should be noted that the terms "first", "second", "target", "primary", "backup", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0024] Figure 1 This is a flow chart of a cache management method provided by an embodiment of the present invention. This embodiment is applicable to the case where a distributed cluster implements full life cycle management of a cache. The method can be executed by a cache management device, which can be implemented in the form of hardware and / or software. The cache management device can be configured in a distributed cluster (such as a controller of a distributed cluster). Figure 1 As shown, the method includes:

[0025] S110 , obtaining cache management information, wherein the cache management information includes a resource identifier and management instructions of a target cache, and the target cache includes a primary cache and a backup cache.

[0026] In the present invention, the target cache refers to a cache that needs to be managed. When there are multiple caches that need to be managed, that is, when there are multiple target caches, each cache can be used as a target cache and the cache management method provided by the present invention can be executed once.

[0027] The cache management information includes the resource identifier of the target cache and the management instruction. The resource identifier of the target cache is a unique identifier used to determine the cache information (such as the type of the target cache, the characteristics of the target cache, etc.), which can be a Uniform Resource Locator (URL), a cache ID, etc. The management instruction is an operation that needs to be performed on the target cache, which can include at least one of a new cache instruction, a cache deletion instruction, and a cache update instruction.

[0028] In one embodiment, the cache management information may be acquired by the cache management device passively or actively. Exemplarily, when the cache management information is acquired passively, the cache management device may receive the cache management information input by the user; when the cache management information is acquired actively, a timer may be set in the cache management device so as to execute a fixed management instruction on a fixed target cache at a fixed time.

[0029] The target cache includes the primary cache and the backup cache. The primary cache and the backup cache are two different cache strategies with different functions and purposes. Specifically, the primary cache is the cache that interacts directly with user requests, with the characteristics of fast access, high hit rate and real-time performance; while the backup cache stores a copy of the data in the primary cache as a supplement to the primary cache. When the primary cache is unavailable (such as due to failure, maintenance or overload), the backup cache can take over the request to ensure the continuity and high availability of the service, and provide a source of data recovery for the update or reconstruction of the primary cache data.

[0030] In the present invention, the number of backup caches may be one or more. When there are multiple backup caches, the multiple backup caches can also share the burden of the primary cache and reduce the delay of cross-region access.

[0031] S120: Determine the custom management rule corresponding to the target cache according to the resource identifier.

[0032] In order to improve resource management efficiency, the present invention formulates different custom management rules for different types of caches. Therefore, after obtaining cache management information, it is necessary to determine the custom management rules corresponding to the target cache according to the resource identifier of the target cache obtained by parsing.

[0033] In a possible implementation, the custom resource type of the target cache can be determined based on the resource identifier; then the custom resource type is dynamically analyzed in combination with the system status, the current status of the target cache, and user needs to generate custom management rules corresponding to the target cache.

[0034] In this implementation, since the custom management rules are dynamically generated, the custom management rules will be more accurate, but will require a certain amount of computing power accordingly.

[0035] In another possible implementation, a type and rule comparison table may be pre-configured in the cache management device, and the type and rule comparison table reflects the mapping relationship between custom resource types and custom resource types; after determining the custom resource type of the target cache according to the resource identifier, the custom management rules of the target cache that have a mapping relationship with the custom resource type of the target cache can be determined by querying the type and rule comparison table.

[0036] In this implementation, since the type and rule comparison table is pre-configured, the user-defined management rules can be quickly determined. Compared with the previous implementation, computing power is saved, cache management efficiency is improved, and it is also convenient for operation and maintenance personnel to maintain and modify the type and rule comparison table.

[0037] S130. Determine the resource domains corresponding to the primary cache and the backup cache respectively based on the custom management rules, and execute management instructions on the primary cache and the backup cache in the corresponding resource domains in turn, wherein the resource domain corresponding to the primary cache and the resource domain corresponding to the backup cache are scattered according to a first preset level.

[0038] The custom management rules of the target cache record various management-related information of the target cache throughout its life cycle, such as: the resource domain corresponding to the primary cache (including the resource domain address, resource domain name, interface information and disk information corresponding to the resource domain, etc.), the resource domain corresponding to the backup cache, rules for adding new caches, rules for deleting caches, and rules for updating caches.

[0039] After the custom management rules corresponding to the target cache are determined, the resource domains corresponding to the primary cache and the backup cache can be determined based on the custom management rules, and management instructions can be executed on the primary cache and the backup cache in the corresponding resource domains in turn.

[0040] For example, assuming that the resource domains corresponding to the primary cache are determined to be resource domain 1 and resource domain 2, and the resource domains corresponding to the backup cache are resource domain 3 and resource domain 4 based on the custom management rule, and the management instruction is a cache deletion instruction. Then, the primary cache can be deleted in resource domain 1 and resource domain 2 first, and then the backup cache can be deleted in resource domain 3 and resource domain 4.

[0041] In one embodiment, the resource domain corresponding to the primary cache and the resource domain corresponding to the backup cache are scattered according to a first preset level. The scattering of the resource domain corresponding to the primary cache and the resource domain corresponding to the backup cache means that the primary cache and the backup cache are dispersedly deployed to different resource domains, thereby reducing the risk of overall service interruption caused by local failures (such as hardware failures, network problems or natural disasters).

[0042] The first preset level refers to the level at which the resource domains corresponding to the primary cache and the resource domains corresponding to the backup cache are dispersed. For example, the first preset level is the city level, that is, the resource domains corresponding to the primary cache and the resource domains corresponding to the backup cache are dispersedly deployed in different cities.

[0043] The embodiment of the present invention provides a cache management method, including: obtaining cache management information, wherein the cache management information includes a resource identifier and a management instruction of a target cache, and the target cache includes a primary cache and a backup cache; determining a custom management rule corresponding to the target cache according to the resource identifier; determining the resource domains corresponding to the primary cache and the backup cache respectively based on the custom management rule, and executing the management instruction on the primary cache and the backup cache in the corresponding resource domains in turn, wherein the resource domain corresponding to the primary cache and the resource domain corresponding to the backup cache are scattered according to a first preset level. The technical solution of the embodiment of the present invention obtains cache management information, and determines the custom management rule corresponding to the target cache according to the resource identifier of the target cache included in the cache management information; further determines the resource domains corresponding to the primary cache and the backup cache respectively based on the custom management rule, and executes the management instruction on the primary cache and the backup cache in the corresponding resource domains in turn. Compared with the existing distributed cluster cache management solution, on the one hand, since corresponding custom management rules are formulated for each type of cache, and management instructions are responded to based on custom management rules, efficient management of the entire life cycle of the cache is achieved. On the other hand, based on custom management rules, the resource domains corresponding to the primary cache and the backup cache are respectively determined, and the resource domains corresponding to the primary cache and the backup cache are scattered according to the first preset level. This can achieve the resource domain positioning and isolation of the primary and backup caches, and provide a basis for subsequent disaster recovery, thereby improving the disaster recovery capability of the distributed cluster and ensuring the stability and integrity of the data.

[0044] Figure 2 FIG. 1 is a flow chart of another cache management method provided by an embodiment of the present invention. Based on the above embodiment, this embodiment provides a specific method for executing management instructions and a disaster recovery method. Figure 2 As shown, the method includes:

[0045] S210: Obtain cache management information, wherein the cache management information includes a resource identifier and management instructions of a target cache, and the target cache includes a primary cache and a backup cache.

[0046] A target cache is a cache that needs to be managed. The resource identifier of the target cache is a unique identifier used to determine cache information (such as the type of the target cache, the characteristics of the target cache, etc.), which can be a URL, cache ID, etc. A management instruction is an operation that needs to be performed on the target cache, and the management instruction includes at least one of a new cache instruction, a delete cache instruction, and an update cache instruction.

[0047] Exemplarily, assuming that the cache management information includes identifier 1 and a new cache instruction, and identifier 1 corresponds to target cache 1, it means that this cache management requires a cache addition operation on target cache 1. Similarly, assuming that the cache management information includes identifier 2 and a cache deletion instruction, and identifier 2 corresponds to target cache 2, it means that this cache management requires a cache deletion operation on target cache 2. Assuming that the cache management information includes identifier 3 and an update cache instruction, and identifier 3 corresponds to target cache 3, it means that this cache management requires a cache update operation on target cache 3.

[0048] In one embodiment, the cache management information can be acquired by the cache management device passively or actively. When the cache management information is acquired passively, the cache management device can receive the cache management information input by the user; when the cache management information is acquired actively, a timer can be set in the cache management device so as to execute a fixed management instruction on a fixed target cache at a fixed time.

[0049] The target cache includes a primary cache and a backup cache. The number of primary caches is usually one, and the number of backup caches can be one or more.

[0050] S220: Determine the custom resource type of the target cache according to the resource identifier.

[0051] A custom resource type is a file type or data format that is defined by the user / operation and maintenance personnel to manage and organize data more flexibly. One resource identifier corresponds to one custom resource type. The custom resource type of the target cache can be determined by the resource identifier of the target cache.

[0052] S230: Determine a custom management rule having a mapping relationship with the custom resource type from a preset type and rule comparison table.

[0053] The cache management device may be pre-configured with a type and rule comparison table, which reflects the mapping relationship between custom resource types and custom resource types. For example, Table 1 is an example of a type and rule comparison table.

[0054] Table 1 An example of a type and rule comparison table

[0055] Custom resource type 1 Custom management rules 1 Custom resource type 2 Custom management rules 2 Custom resource type 3 Custom management rules 3 …… …… Custom resource type Custom management rules

[0056] As shown in Table 1, there is a mapping relationship between a custom resource type and a custom management rule. The custom management rule records various management-related information of the target cache of the corresponding custom resource type in the entire life cycle, such as: the resource domain corresponding to the primary cache (including the resource domain address, resource domain name, interface information, parameter configuration and disk information corresponding to the resource domain, etc.), the resource domain corresponding to the backup cache, the rules for adding new caches, the rules for deleting caches, and the rules for updating caches.

[0057] After determining the custom resource type of the target cache according to the resource identifier, the custom management rules of the target cache that have a mapping relationship with the custom resource type of the target cache can be determined by querying the type and rule comparison table. This can not only realize the rapid determination of custom management rules, but also facilitate the operation and maintenance personnel to maintain and modify the type and rule comparison table.

[0058] S240: Determine resource domains corresponding to the primary cache and the backup cache respectively based on the custom management rule.

[0059] In one embodiment, the resource domain corresponding to the primary cache and the resource domain corresponding to the backup cache are scattered according to a first preset level. The scattering of the resource domain corresponding to the primary cache and the resource domain corresponding to the backup cache means that the primary cache and the backup cache are dispersedly deployed to different resource domains, thereby reducing the risk of overall service interruption caused by local failures (such as hardware failures, network problems or natural disasters).

[0060] Optionally, when the number of backup caches is at least two, the resource domains corresponding to any two backup caches are scattered according to the second preset level. In other words, any two backup caches are also deployed in different resource domains to further enhance the cache's risk resistance. And because there is more than one backup cache and they are deployed in different resource domains, the latency of cross-regional access can be reduced.

[0061] The first preset level refers to the level of scattering of the resource domain corresponding to the primary cache and the resource domain corresponding to the backup cache. The second preset level refers to the level of scattering of the resource domains corresponding to any two backup caches. Usually, the first preset level is greater than or equal to the second preset level.

[0062] The advantage of this setting is that it can achieve distribution levels between the primary cache and the backup cache, and between the backup caches, making the distribution of resource domains more flexible and more adaptable to various existing distributed cluster architectures.

[0063] For example, the first preset level is the city level, that is, the resource domains corresponding to the primary cache and the resource domains corresponding to the backup cache are distributed to different cities. The second preset level is the server level, that is, the resource domains corresponding to any two backup caches are distributed to different servers.

[0064] It should also be noted that the resource domain in the present invention includes several cache containers, which are deployed on mechanical hard disks and / or solid-state hard disks. Preferably, considering the cache's disk read and write efficiency and data sensitivity, the cache container can be deployed on a local solid-state hard disk.

[0065] S250, executing the management instruction on the primary cache in the resource domain corresponding to the primary cache, and determining whether the resource domain functions normally after executing the management instruction. If yes, executing S270; if no, executing S260.

[0066] After determining the resource domains corresponding to the primary cache and the backup cache, you can first execute the management instruction on the primary cache in the resource domain corresponding to the primary cache, and determine whether the resource domain functions normally after executing the management instruction. If the resource domain functions normally after executing the management instruction, it means that the management instruction will not cause a fault, and you can continue to execute the management instruction on the backup cache in the resource domain corresponding to the backup cache. If the resource domain functions abnormally after executing the management instruction, it means that the management instruction will cause a fault (i.e., invalid execution). In order to ensure system stability, you need to revoke the management instruction and end the cache management process.

[0067] S260: Cancel the management instruction and end the cache management process.

[0068] S270: Execute a management instruction on the backup cache in the resource domain corresponding to the backup cache.

[0069] It should be noted that, no matter whether S260 or S270 is executed, the consistency of the primary cache and the backup cache can be guaranteed.

[0070] S280: Obtain fault information, where the fault information is used to indicate that at least one of the primary cache and the backup cache fails.

[0071] S290: Rebuild the resource domain corresponding to the cache where the fault occurs according to the fault information and the custom management rule, and synchronize the cache that has not failed to the rebuilt resource domain.

[0072] It can be seen from steps S280-S290 that the present invention can not only automatically execute management instructions on the primary cache and the backup cache in the corresponding resource domain, but also realize automatic processing of faults to improve the emergency response capability of the system.

[0073] For example, based on the fault information, determine which of the primary cache and the backup cache has failed, then rebuild the resource domain corresponding to the failed cache based on the custom management rule, and synchronize the cache that has not failed to the rebuilt resource domain.

[0074] The embodiment of the present invention provides a cache management method, including: obtaining cache management information, wherein the cache management information includes a resource identifier and a management instruction of a target cache, and the target cache includes a primary cache and a backup cache; determining a custom management rule corresponding to the target cache according to the resource identifier; determining the resource domains corresponding to the primary cache and the backup cache respectively based on the custom management rule, and executing the management instruction on the primary cache and the backup cache in the corresponding resource domains in turn, wherein the resource domain corresponding to the primary cache and the resource domain corresponding to the backup cache are scattered according to a first preset level. The technical solution of the embodiment of the present invention obtains cache management information, and determines the custom management rule corresponding to the target cache according to the resource identifier of the target cache included in the cache management information; further determines the resource domains corresponding to the primary cache and the backup cache respectively based on the custom management rule, and executes the management instruction on the primary cache and the backup cache in the corresponding resource domains in turn. Compared with the existing distributed cluster cache management solution, on the one hand, since corresponding custom management rules are formulated for each type of cache, and management instructions are responded to based on custom management rules, efficient management of the entire life cycle of the cache is achieved. On the other hand, based on custom management rules, the resource domains corresponding to the primary cache and the backup cache are respectively determined, and the resource domains corresponding to the primary cache and the backup cache are scattered according to the first preset level. This can achieve the resource domain positioning and isolation of the primary and backup caches, and provide a basis for subsequent disaster recovery, thereby improving the disaster recovery capability of the distributed cluster and ensuring the stability and integrity of the data.

[0075] Figure 3 FIG. 1 is a schematic diagram of the structure of a cache management device provided by an embodiment of the present invention. Figure 3 As shown, the device includes: a communication module 301, a rule determination module 302 and a management module 303.

[0076] The communication module 301 is used to obtain cache management information, wherein the cache management information includes a resource identifier and management instructions of a target cache, and the target cache includes a primary cache and a backup cache;

[0077] A rule determination module 302, used to determine a custom management rule corresponding to a target cache according to a resource identifier;

[0078] The management module 303 is used to determine the resource domains corresponding to the primary cache and the backup cache respectively based on the custom management rules, and execute management instructions on the primary cache and the backup cache in the corresponding resource domains in turn, wherein the resource domains corresponding to the primary cache and the resource domains corresponding to the backup cache are scattered according to the first preset level.

[0079] Optionally, the rule determination module 302 is specifically configured to determine the custom resource type of the target cache according to the resource identifier; and determine the custom management rule having a mapping relationship with the custom resource type from a preset type and rule comparison table.

[0080] Optionally, the management module 303 is specifically used to execute management instructions on the primary cache in the resource domain corresponding to the primary cache, and determine whether the resource domain functions normally after executing the management instructions; if the resource domain functions normally after executing the management instructions, the management instructions are executed on the backup cache in the resource domain corresponding to the backup cache; if the resource domain functions abnormally after executing the management instructions, the management instructions are revoked and the cache management process is terminated.

[0081] Optionally, the management instruction includes at least one of a new cache instruction, a delete cache instruction, and an update cache instruction.

[0082] Optionally, the number of backup caches is at least one; when the number of backup caches is at least two, resource domains corresponding to any two backup caches are scattered according to a second preset level, and the first preset level is greater than or equal to the second preset level;

[0083] The resource domain includes several cache containers, which are deployed on mechanical hard disks and / or solid-state hard disks.

[0084] Optionally, the management module 303 is also used to obtain fault information, wherein the fault information is used to indicate that at least one of the primary cache and the backup cache has failed; based on the fault information and custom management rules, the resource domain corresponding to the failed cache is rebuilt, and the cache that has not failed is synchronized to the rebuilt resource domain.

[0085] The cache management device provided in the embodiment of the present invention can execute the cache management method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0086] Figure 4 FIG. 1 is a schematic diagram of a distributed cluster structure provided by an embodiment of the present invention. Figure 4As shown, the distributed cluster 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. Various programs and data required for the operation of the distributed cluster 10 can also be stored in the RAM 13. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0087] Multiple components in the distributed cluster 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the distributed cluster 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0088] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a cache management method.

[0089] In some embodiments, the cache management method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the distributed cluster 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the cache management method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the cache management method in any other appropriate manner (e.g., by means of firmware).

[0090] 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.

[0091] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program 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.

[0092] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. 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.

[0093] To provide interaction with a user, the systems and techniques described herein may be implemented on a distributed cluster 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 distributed cluster. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0094] The systems and techniques described herein may be implemented in a computing system that includes backend 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 frontend 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 backend components, middleware components, or frontend 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), a blockchain network, and the Internet.

[0095] A computing 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 client and server relationship 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 VPS services.

[0096] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the cache management method provided by any embodiment of the present invention.

[0097] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can 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 the case of a remote computer, the remote computer can 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 can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0098] 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 described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0099] The above specific implementations do not constitute a limitation on the protection scope of the present invention. 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 invention should be included in the protection scope of the present invention.

Claims

1. A cache management method, characterized in that: The method comprises: Acquire cache management information, wherein the cache management information includes a resource identifier and management instructions of a target cache, and the target cache includes a primary cache and a backup cache; Determining, according to the resource identifier, a custom management rule corresponding to the target cache; The resource domains corresponding to the primary cache and the backup cache are respectively determined based on the custom management rules, and the management instructions are executed on the primary cache and the backup cache in the corresponding resource domains in turn, wherein the resource domains corresponding to the primary cache and the resource domains corresponding to the backup cache are scattered according to a first preset level.

2. The cache management method according to claim 1, characterized in that: The step of determining the custom management rule corresponding to the target cache according to the resource identifier includes: Determining the custom resource type of the target cache according to the resource identifier; The custom management rule having a mapping relationship with the custom resource type is determined from a preset type and rule comparison table.

3. The cache management method according to claim 1, characterized in that: The executing the management instruction on the primary cache and the backup cache in the corresponding resource domains in sequence includes: Executing the management instruction on the primary cache in the resource domain corresponding to the primary cache, and determining whether the resource domain functions normally after executing the management instruction; If the resource domain functions normally after executing the management instruction, executing the management instruction on the backup cache in the resource domain corresponding to the backup cache; If the resource domain function is abnormal after executing the management instruction, the management instruction is revoked and the cache management process ends.

4. The cache management method according to claim 3, characterized in that: The management instruction includes at least one of a new cache instruction, a cache deletion instruction, and a cache update instruction.

5. The cache management method according to claim 1, characterized in that: The number of the backup caches is at least one; when the number of the backup caches is at least two, the resource domains corresponding to any two of the backup caches are scattered according to a second preset level, and the first preset level is greater than or equal to the second preset level; The resource domain includes a plurality of cache containers, and the cache containers are deployed on a mechanical hard disk and / or a solid state hard disk.

6. The cache management method according to claim 5, characterized in that: After executing the management instructions on the primary cache and the backup cache in the corresponding resource domains in sequence, the method further includes: Acquire fault information, wherein the fault information is used to indicate that at least one of the primary cache and the backup cache fails; According to the fault information and the user-defined management rule, the resource domain corresponding to the cache having the fault is rebuilt, and the cache having no fault is synchronized to the rebuilt resource domain.

7. A cache management device, characterized in that: include: Communication module, rule determination module and management module; The communication module is used to obtain cache management information, wherein the cache management information includes a resource identifier and a management instruction of a target cache, and the target cache includes a primary cache and a backup cache; The rule determination module is used to determine the custom management rule corresponding to the target cache according to the resource identifier; The management module is used to determine the resource domains corresponding to the primary cache and the backup cache respectively based on the custom management rules, and execute the management instructions on the primary cache and the backup cache in the corresponding resource domains in turn, wherein the resource domains corresponding to the primary cache and the resource domains corresponding to the backup cache are scattered according to a first preset level.

8. A distributed cluster, characterized in that: The distributed cluster includes: at least one processor; and a memory in communication with the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is 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 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the cache management method according to any one of claims 1 to 6 when executed.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the cache management method according to any one of claims 1 to 6.