CN112699148A - Method, device and equipment for refreshing cache and storage medium - Google Patents

Method, device and equipment for refreshing cache and storage medium Download PDF

Info

Publication number
CN112699148A
CN112699148A CN202011624951.8A CN202011624951A CN112699148A CN 112699148 A CN112699148 A CN 112699148A CN 202011624951 A CN202011624951 A CN 202011624951A CN 112699148 A CN112699148 A CN 112699148A
Authority
CN
China
Prior art keywords
cache
contents
cache object
updating
refreshing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011624951.8A
Other languages
Chinese (zh)
Inventor
柏云鹏
潘超杰
陈羽琪
李映超
徐文峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN202011624951.8A priority Critical patent/CN112699148A/en
Publication of CN112699148A publication Critical patent/CN112699148A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries

Abstract

The application discloses a method, a device, equipment and a storage medium for refreshing cache, and belongs to the technical field of computers. The method comprises the following steps: receiving a refresh instruction aiming at a first cache object in the cache device, wherein the refresh instruction indicates to update cache content in the first cache object; responding to the refreshing instruction, determining a second cache object in the cache device, wherein the second cache object and the first cache object are isolated from each other and have a data dependency relationship; and updating the cache contents in the first cache object and the second cache object. The method refreshes the cache content in the first cache object and the cache content in the second cache object with data dependency relationship, refreshes the cache object on the cache device from the content level, and ensures the accuracy of other cache objects with data dependency relationship after one cache object is refreshed.

Description

Method, device and equipment for refreshing cache and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for refreshing a cache.
Background
With the popularization of the internet, the content information is more and more complex, the number of users and the access amount are more and more, and the number of requests that can be accepted by a database per second is limited, so in order to improve the data throughput, a cache, which is a memory providing high-speed access, is introduced.
Generally, cache objects in a cache are managed in an isolation manner, and a cache manager performs independent refresh control on each cache object, for example, a cache object a and a cache object B existing in the cache, and the cache manager performs refresh on the cache object a and the cache object B, respectively.
However, if the cache objects have dependency relationships, the cache objects are managed in an isolation mode, one cache object is refreshed, and other cache objects having dependency relationships are not refreshed, so that the other cache objects are inaccurate; for example, the cache object a has the operational variables of the cache object B cached therein, the operational variables are changed after the cache object a is independently refreshed, and the cache object B is still obtained by the operational variables before the refresh, so that the cache object B has an error at this time.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a storage medium for refreshing cache, which refresh cache contents in a first cache object and also refresh cache contents in a second cache object with a data dependency relationship, and refresh management is performed on the cache objects on the cache equipment from a content level, so that the accuracy of other cache objects with data dependency relationship after one cache object is refreshed is ensured. The technical scheme is as follows:
according to an aspect of the present application, there is provided a method of refreshing a cache, the method comprising:
receiving a refresh instruction aiming at a first cache object in a cache device, wherein the refresh instruction indicates to update cache content in the first cache object;
responding to the refreshing instruction, and determining a second cache object in the cache device, wherein the second cache object and the first cache object are isolated from cache and have a data dependency relationship;
and updating the cache contents in the first cache object and the second cache object.
According to another aspect of the present application, there is provided an apparatus for refreshing a cache, the apparatus including:
the cache device comprises a receiving module, a refreshing module and a processing module, wherein the receiving module is used for receiving a refreshing instruction aiming at a first cache object in the cache device, and the refreshing instruction indicates that the cache content in the first cache object is updated;
a determining module, configured to determine, in response to the refresh instruction, a second cache object in the cache device, where the second cache object and the first cache object are isolated from each other and have a data dependency relationship;
and the updating module is used for updating the cache contents in the first cache object and the second cache object.
According to another aspect of the present application, there is provided a computer device comprising: a processor and a memory, said memory storing a computer program that is loaded and executed by said processor to implement the method of refreshing a cache as described in the previous aspect.
According to another aspect of the present application, there is provided a computer readable storage medium having stored therein a computer program, the computer program being loaded and executed by a processor to implement the method of refreshing a cache according to the above aspect.
According to another aspect of the present application, a computer program product is provided, the computer program product comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to cause the computer device to execute the method for refreshing the cache according to the above aspect.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
in the refreshing process of the isolation cache, after a refreshing instruction for a first cache object in the cache device is received, a second cache object having a data dependency relationship with the first cache object is determined, and then the content hierarchy updating is performed on the first cache object and the second cache object and the cache object, that is, while the cache content of the first cache object is refreshed, the cache content of the second cache object having the data dependency relationship with the first cache object is refreshed, so that the accuracy of the second cache object having the data dependency relationship with the first cache object after the first cache object is refreshed is ensured, and the problem that the cache content in the second cache object is inaccurate due to the fact that only the first cache object is refreshed is avoided.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart illustrating a caching method for caching objects according to an exemplary embodiment of the present application;
FIG. 2 is a schematic diagram illustrating a topology of a cache object provided by an exemplary embodiment of the present application;
FIG. 3 illustrates a schematic diagram of a circular dependency provided by an exemplary embodiment of the present application;
FIG. 4 is a flow chart illustrating a method for refreshing a cache according to an exemplary embodiment of the present application;
FIG. 5 is a flow chart illustrating a method for refreshing a cache according to another exemplary embodiment of the present application;
FIG. 6 is a block diagram illustrating an apparatus for refreshing a cache according to an exemplary embodiment of the present application;
fig. 7 shows a schematic structural diagram of a computer device provided in an exemplary embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Reference will first be made to several terms referred to in this application:
a cache device, i.e., a cache (cache), is a memory having a high access speed, and can realize high-speed data exchange. In a broad sense, any structure between two kinds of hardware/software with a large speed difference for coordinating the data transmission speed difference between the two kinds of hardware/software can be called as a cache. Illustratively, when a Central Processing Unit (CPU) wants to read a piece of data, it first looks up from the CPU cache, and reads and sends to the CPU for Processing immediately if found; if the data is not found, the data is read from the memory with relatively low speed and sent to the CPU for processing, and the data block where the data is located is called into the cache, so that the whole data can be read from the cache later without calling the memory. The cache objects cached on the cache device may include various types of data, for example, data such as models, features, operators, and the like.
Data dependence is an interactive relationship between data and is a semantic embodiment, for example, the data dependence may include function dependence and multivalue dependence; wherein the functional dependence can be interpreted as: when one attribute set determines another attribute set, the other attribute set is called to be dependent on the attribute set; multivalued dependencies can be interpreted as: some attribute values have indirect relationships although they have no direct relationship, and the relationship having indirect relationship but no direct relationship is called multi-value dependency. In the function dependence, whether the X and the Y have the function dependence relationship or not only needs to consider two groups of attributes of the X and the Y, but also has no relation with other attributes; in the multi-value dependency, whether X and Y have multi-value dependency needs to be also considered as attribute Z.
The Cache can be applied to any scene with data exchange. For example, in a database system, data in a database may be cached in a cache, and when data is queried in the database system, the data is first queried from the cache. For another example, data required for application running on the terminal may be cached in the CPU cache, and when the CPU needs a certain data, the data is first obtained from the CPU cache.
Generally, cache refresh management generally adopts isolation-mode refresh management, and independent refresh control is implemented between cache objects, however, because interdependence relationships exist between cache objects in a cascade cache scene (also existing data dependency relationships), if the isolation-mode refresh management is continuously used, the problem that basic data in each cache object are different and cache is inconsistent occurs, and therefore, the cache refresh method is provided by the application to solve the technical problem.
Fig. 1 is a flowchart illustrating a caching method for caching objects according to an exemplary embodiment of the present application, where the method is applied to a computer device, and the method includes:
step 101, start.
Step 102, cache registration is performed in the system starting stage.
In the system starting stage, the computer equipment performs cache registration on data needing to be cached, registers the data needing to be cached in a cache manager, and performs unified management by the cache manager.
That is, the computer device registers the data to be cached through the cache manager in response to a start instruction of the system, and obtains at least two cache objects. Illustratively, the computer device reads data from an external storage device of the cache device, and registers the data in the cache manager to obtain at least two cache objects; for example, the external storage device may be a database or a memory.
Illustratively, taking a database system as an example, in a starting stage of the database system, data stored in the database is registered in a cache manager, and at least two cache objects which are registered are obtained.
Step 103, calculating a dependent path through the cache manager.
The data dependency relationship exists between at least two cache objects; the computer device calls a cache manager, the cache manager calculates a dependent path based on the data dependency relationship between the at least two cache objects, and then generates at least one topological structure of the at least two cache objects based on the dependent path.
For example, as shown in fig. 2, 15 cache objects are registered in the cache manager, the cache manager calculates 9 dependent paths of the 15 cache objects, and 5 topologies are generated from the 9 dependent paths. The cache objects are abstracted into cache nodes for caching in the topology structure. Illustratively, the topology includes a mesh topology, for example, a topology where the cache node 6 is located; a tree topology structure exists in the topology structures, for example, the topology structure where the cache node 0 is located; a ring topology structure exists in the topology structure, for example, a ring dependency relationship, also called a circular dependency relationship, exists among the cache node 3, the cache node 4, and the cache node 5, where the cache node 1 is located. Illustratively, the root node 12 is a cache object at the lowest level (i.e., the beginning of the dependency path) in the dependency relationship.
For example, a ring-forming dependency relationship is described, as shown in fig. 3, the dependency relationship between the model cache 21 and the feature cache 22 is that model calculation includes features, the dependency relationship between the feature cache 22 and the operator cache 23 is a feature derivative call operator, and the dependency relationship between the operator cache 23 and the model cache 21 is an operator nested model scene, that is, the model cache 21 depends on the operator cache 23, the feature cache 22 depends on the model cache 21, and the operator cache 23 depends on the model cache 21, so that an annular dependency is formed by the three.
And step 104, ending.
In summary, the cache object caching method provided in this embodiment caches the cache object in a topological manner, and the cache object with a dependency relationship can be quickly found in the cache refreshing process, so that the cache refreshing method provided in this application is implemented, and the cache refreshing efficiency can also be improved.
Fig. 4 is a flowchart illustrating a method for refreshing a cache according to an exemplary embodiment of the present application, where the method is applied to a computer device, and the method includes:
step 201, a refresh instruction for a first cache object in a cache device is received.
The computer device receives a refresh instruction aiming at a first cache object in the cache device, wherein the refresh instruction indicates to update cache contents in the first cache object. For example, the refresh instruction is triggered by a user operation on the computer device, for example, the computer device receives a data refresh operation on the input device, and triggers a refresh instruction for a first cache object in the cache device; alternatively, the refresh command is automatically triggered periodically on the computer device.
Step 202, in response to the refresh command, determining a second cache object in the cache device, where the second cache object and the first cache object are isolated from each other and have a data dependency relationship.
Illustratively, a cache manager of the computer device is provided with a corresponding relationship between a first cache object and a second cache object, and the cache manager queries the second cache object having a direct or indirect dependency relationship with the first cache object based on the corresponding relationship.
Illustratively, referring to the alternative embodiment shown in fig. 1, the cache manager abstracts the cache objects into cache nodes, and constructs a topology structure based on the cache nodes; optionally, the terminal determines a first cache node of the first cache object in response to the refresh instruction; determining a second cache node which is located in the same topological structure as the first cache node, wherein a second cache object is cached on the second cache node; the topological structure is constructed based on data dependency relations among the cache objects.
For example, for the determination of the second cache node, the reachability analysis algorithm is invoked by the cache manager to calculate the dependent path of the first cache node on the topology structure, and the second cache node is determined by other cache nodes on the dependent path of the first cache node.
For example, as shown in fig. 2, the cache node 1 is refreshed, the cache manager may call a reachability analysis algorithm to determine the cache node 2, the cache node 3, the cache node 4, and the cache node 5 from the topology structure, a direct dependency relationship exists between the cache node 2 and the cache node 1, and an indirect dependency relationship exists between the cache node 1 and the cache node 3, the cache node 4, and the cache node 5; the cache node 6 is refreshed, the cache manager can call a reachability analysis algorithm to determine the cache node 7, the cache node 8 and the cache node 9 from the topological structure, a direct dependency relationship exists between the cache node 7 and the cache node 6, and an indirect dependency relationship exists between the cache node 6 and the cache node 8 and the cache node 9.
And step 203, updating the cache contents in the first cache object and the second cache object.
And the computer equipment updates the cache contents in the first cache object and the second cache object on the cache equipment based on the cache updating contents of the first cache object.
Illustratively, the computer device updates, by the cache manager, part or all of the cache contents of the first cache object based on the cache update contents of the first cache object, and updates the cache contents in the second cache object, which have a data dependency relationship with the cache update contents.
In summary, in the method for refreshing the cache provided in this embodiment, in the refresh process of the isolation cache, after a refresh instruction for a first cache object in the cache device is received, a second cache object having a data dependency relationship with the first cache object is determined, and then the content hierarchy of the first cache object and the second cache object is updated, that is, the cache content of the first cache object is refreshed while the cache content of the second cache object having a data dependency relationship with the first cache object is refreshed, so that the accuracy of the second cache object having a data dependency relationship with the first cache object after the first cache object is refreshed is ensured, and the problem that the cache content in the second cache object is inaccurate due to the fact that only the first cache object is refreshed is avoided.
In some embodiments, when there is a circular dependency relationship between cache objects, to avoid a problem of a cascaded cache circular refresh, a computer device directly obtains data from an external storage device corresponding to a cache to perform an overall update on first cache data and second cache data, as shown in fig. 5, which shows a flowchart of a method for refreshing a cache according to another exemplary embodiment of the present application, where the method is applied to a computer device, and the method includes:
step 301, a refresh instruction for a first cache object in a cache device is received.
Step 302, in response to the refresh command, determines a first cache node of the first cache object.
Step 303, determining a second cache node located in the same topology as the first cache node, where a second cache object is cached on the second cache node, and the topology is constructed based on a data dependency relationship between the cache objects.
Please refer to steps 201 to 202 in the embodiment shown in fig. 4 for steps 301 to 303, which are not described herein again.
And step 304, when the ring topology structure does not exist in the topology structure, replacing the original cache content in the first cache object with cache updating content, and updating the cache content which has a data dependency relationship with the original cache content in the second cache object.
Optionally, the ring topology comprises at least one of: a first ring topology structure formed between the first cache node and the second cache node; a second ring topology formed between at least two second cache nodes.
When the topology structure does not have the first ring topology structure or the second ring topology structure, the computer device determines that a loop dependency relationship does not exist between the first cache object and the second cache object, and a loop dependency relationship does not exist between at least two cache objects.
When no circular dependency relationship exists on the dependency path where the first cache node is located, the computer device replaces the original cache content in the first cache object with cache updating content, and updates the cache content in the second cache object, which has a data dependency relationship with the original cache content. And the original cache content is the content corresponding to the cache updating content in the first cache object before refreshing.
Illustratively, each cache node in the topology of the cascaded caches has an updated priority, wherein the root node has the highest priority, and the priorities of the cache nodes are sequentially reduced in a direction away from the root node; in the process of updating the first cache object and the second cache object, the first cache object is defined as a root node, cache contents are updated from the first cache node, and the cache contents on the second cache node, which have data dependency relationship with the original cache contents, are sequentially updated according to the priority order.
Step 305, when the topology structure has a ring topology structure, reading all the contents corresponding to the first cache object and the second cache object from the external storage device of the cache device, and replacing and updating the cache contents of the first cache object and the second cache object based on all the contents.
When a first ring-shaped topological structure exists in the topological structure, the computer equipment determines that a cyclic dependency relationship exists between the first cache object and part of the second cache objects, or the cyclic dependency relationship exists between the first cache object and all the second cache objects; the computer device determines that a circular dependency exists between at least two second cache objects when a second ring topology exists in the topology.
When at least one of the first ring topology structure and the second ring topology structure exists on the dependency path where the first cache node is located, the computer device reads all contents corresponding to the first cache object from an external storage device of the cache device, performs overall replacement updating on the cache contents of the first cache object based on all contents corresponding to the first cache object, reads all contents corresponding to the second cache object from the external storage device, and performs overall replacement updating on the cache contents of the second cache object based on all contents corresponding to the second cache object.
Illustratively, the entire contents of the first cache object and the second cache object may also be obtained from the persistent layer. The persistent layer is generally referred to as a data access layer, and the function of the persistent layer is mainly responsible for accessing the database.
In summary, the method for refreshing the cache provided in this embodiment adopts different refreshing means for the cascade caches with and without the cyclic dependency relationship, and for the cascade caches without the cyclic dependency relationship, the cache contents in the cache objects are refreshed, so that the refreshing of the first cache object and the second cache object can be completed quickly.
Fig. 6 is a block diagram illustrating an apparatus for refreshing a cache according to an exemplary embodiment of the present application, which may be implemented as part of or all of a terminal or a server by software, hardware, or a combination of the two, and includes:
a receiving module 401, configured to receive a refresh instruction for a first cache object in a cache device, where the refresh instruction indicates to update cache content in the first cache object;
a determining module 402, configured to determine, in response to the refresh instruction, a second cache object in the cache device, where the second cache object and the first cache object are isolated from a cache and have a data dependency relationship;
an updating module 403, configured to update cache contents in the first cache object and the second cache object.
In some embodiments, the determining module 402 is configured to:
determining a first cache node of the first cache object in response to the refresh instruction;
determining a second cache node which is located in the same topological structure as the first cache node, wherein the second cache node caches the second cache object; wherein the topology is constructed based on data dependencies between cache objects.
In some embodiments, the update module 403 is configured to:
updating the cache contents in the first cache object and the second cache object on the cache device based on the cache updating contents of the first cache object.
In some embodiments, the update module 403 is configured to:
replacing original cache contents in the first cache object with the cache updating contents when the topological structure does not have a ring topological structure;
updating the cache content of the second cache object, which has the data dependency relationship with the original cache content;
wherein the original cache content is a content corresponding to the cache update content in the first cache object before the refresh.
In some embodiments, the update module 403 is configured to:
when a ring topology structure exists in the topology structure, respectively reading all contents corresponding to the first cache object and the second cache object from an external storage device of the cache device, wherein the all contents include contents updated based on the cache update contents;
and respectively replacing and updating the cache contents of the first cache object and the second cache object based on the whole contents.
In some embodiments, the ring topology comprises at least one of:
a first ring topology formed between the first cache node and the second cache node;
a second ring topology formed between at least two of the second cache nodes.
In some embodiments, the apparatus further comprises: a registration module 404, a calculation module 405, and a generation module 406;
the registering module 404 is configured to register, in response to a system start instruction, data to be cached through the cache manager to obtain at least two cache objects;
the calculating module 405 is configured to calculate a dependency path based on a data dependency relationship between the at least two cache objects;
the generating module 406 is configured to generate at least one topology corresponding to the at least two cache objects based on the dependency path.
In summary, in the apparatus for refreshing a cache provided in this embodiment, in the refresh process of an isolation cache, after a refresh instruction for a first cache object in a cache device is received, a second cache object having a data dependency relationship with the first cache object is determined, and then content hierarchy update is performed on the first cache object and the second and cache objects, that is, while the cache content of the first cache object is refreshed, the cache content of the second cache object having a data dependency relationship with the first cache object is also refreshed, so that accuracy of the second cache object having a data dependency relationship with the first cache object after the first cache object is refreshed is ensured, and a problem that the cache content in the second cache object is inaccurate due to the fact that only the first cache object is refreshed is avoided.
Fig. 7 shows a schematic structural diagram of a computer device provided in an exemplary embodiment of the present application. The computer device may be a device which performs the method of refreshing a cache as provided herein, and the computer device may be a terminal or a server. Specifically, the method comprises the following steps:
the computer apparatus 500 includes a Central Processing Unit (CPU) 501, a system Memory 504 including a Random Access Memory (RAM) 502 and a Read Only Memory (ROM) 503, and a system bus 505 connecting the system Memory 504 and the Central Processing Unit 501. The computer device 500 also includes a basic Input/Output System (I/O System)506, which facilitates information transfer between various devices within the computer, and a mass storage device 507, which stores an operating System 513, application programs 514, and other program modules 515.
The basic input/output system 506 comprises a display 508 for displaying information and an input device 509, such as a mouse, keyboard, etc., for user input of information. Wherein a display 508 and an input device 509 are connected to the central processing unit 501 through an input output controller 510 connected to the system bus 505. The basic input/output system 506 may also include an input/output controller 510 for receiving and processing input from a number of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, input-output controller 510 also provides output to a display screen, a printer, or other type of output device.
The mass storage device 507 is connected to the central processing unit 501 through a mass storage controller (not shown) connected to the system bus 505. The mass storage device 507 and its associated computer-readable media provide non-volatile storage for the computer device 500. That is, mass storage device 507 may include a computer-readable medium (not shown) such as a hard disk or Compact disk Read Only Memory (CD-ROM) drive.
Computer-readable media may include computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), flash Memory or other Solid State Memory technology, CD-ROM, Digital Versatile Disks (DVD), or Solid State Drives (SSD), other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage, or other magnetic storage devices. The Random Access Memory may include a resistive Random Access Memory (ReRAM) and a Dynamic Random Access Memory (DRAM). Of course, those skilled in the art will appreciate that computer storage media is not limited to the foregoing. The system memory 504 and mass storage device 507 described above may be collectively referred to as memory.
According to various embodiments of the present application, the computer device 500 may also operate as a remote computer connected to a network through a network, such as the Internet. That is, the computer device 500 may be connected to the network 512 through the network interface unit 511 connected to the system bus 505, or may be connected to other types of networks or remote computer systems (not shown) using the network interface unit 511. The computer device 500 may also communicate via NFC (not shown).
The memory further includes one or more programs, and the one or more programs are stored in the memory and configured to be executed by the CPU.
In an alternative embodiment, a computer device is provided that includes a processor and a memory having at least one instruction, at least one program, set of codes, or set of instructions stored therein, which is loaded and executed by the processor to implement the method of flushing a cache as described above.
In an alternative embodiment, a computer readable storage medium is provided having stored therein at least one instruction, at least one program, set of codes, or set of instructions that is loaded and executed by a processor to implement the method of flushing a cache as described above.
Optionally, the computer-readable storage medium may include: a Read Only Memory (ROM), a Random Access Memory (RAM), a Solid State Drive (SSD), or an optical disc. The Random Access Memory may include a resistive Random Access Memory (ReRAM) and a Dynamic Random Access Memory (DRAM). The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The present application further provides a computer-readable storage medium, in which at least one instruction, at least one program, a code set, or a set of instructions is stored, and the at least one instruction, the at least one program, the code set, or the set of instructions is loaded and executed by a processor to implement the method for refreshing a cache provided by the above-mentioned method embodiments.
The present application also provides a computer program product comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and executes the computer instructions, so that the computer device executes the method for refreshing the cache as described above.
It should be understood that reference to "a plurality" herein means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. A method for refreshing a cache, the method comprising:
receiving a refresh instruction aiming at a first cache object in a cache device, wherein the refresh instruction indicates to update cache content in the first cache object;
responding to the refreshing instruction, and determining a second cache object in the cache device, wherein the second cache object and the first cache object are isolated from cache and have a data dependency relationship;
and updating the cache contents in the first cache object and the second cache object.
2. The method of claim 1, wherein said determining a second cache object in the cache device in response to the flush instruction comprises:
determining a first cache node of the first cache object in response to the refresh instruction;
determining a second cache node which is located in the same topological structure as the first cache node, wherein the second cache node caches the second cache object; wherein the topology is constructed based on data dependencies between cache objects.
3. The method of claim 2, wherein the updating the cache contents of the first cache object and the second cache object comprises:
updating the cache contents in the first cache object and the second cache object on the cache device based on the cache updating contents of the first cache object.
4. The method according to claim 3, wherein the updating the cache contents in the first cache object and the second cache object on the cache device based on the cache update contents of the first cache object comprises:
replacing original cache contents in the first cache object with the cache updating contents when the topological structure does not have a ring topological structure;
updating the cache content of the second cache object, which has the data dependency relationship with the original cache content;
wherein the original cache content is a content corresponding to the cache update content in the first cache object before the refresh.
5. The method according to claim 3, wherein the updating the cache contents in the first cache object and the second cache object on the cache device based on the cache update contents of the first cache object comprises:
when a ring topology structure exists in the topology structure, respectively reading all contents corresponding to the first cache object and the second cache object from an external storage device of the cache device, wherein the all contents include contents updated based on the cache update contents;
and respectively replacing and updating the cache contents of the first cache object and the second cache object based on the whole contents.
6. The method according to claim 4 or 5, wherein the ring topology comprises at least one of:
a first ring topology formed between the first cache node and the second cache node;
a second ring topology formed between at least two of the second cache nodes.
7. The method of any of claims 1 to 3, wherein prior to receiving the flush instruction for the first cache object in the cache device, further comprising:
responding to a starting instruction of the system, registering data to be cached through a cache manager to obtain at least two cache objects;
calculating a dependent path based on the data dependency relationship between the at least two cache objects;
and generating at least one topological structure corresponding to the at least two cache objects based on the dependent path.
8. An apparatus for refreshing a cache, the apparatus comprising:
the cache device comprises a receiving module, a refreshing module and a processing module, wherein the receiving module is used for receiving a refreshing instruction aiming at a first cache object in the cache device, and the refreshing instruction indicates that the cache content in the first cache object is updated;
a determining module, configured to determine, in response to the refresh instruction, a second cache object in the cache device, where the second cache object and the first cache object are isolated from each other and have a data dependency relationship;
and the updating module is used for updating the cache contents in the first cache object and the second cache object.
9. A computer device, characterized in that the computer device comprises: a processor and a memory, the memory storing a computer program that is loaded and executed by the processor to implement the method of refreshing a cache according to any of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored, which is loaded and executed by a processor to implement a method of refreshing a cache according to any one of claims 1 to 7.
CN202011624951.8A 2020-12-31 2020-12-31 Method, device and equipment for refreshing cache and storage medium Pending CN112699148A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011624951.8A CN112699148A (en) 2020-12-31 2020-12-31 Method, device and equipment for refreshing cache and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011624951.8A CN112699148A (en) 2020-12-31 2020-12-31 Method, device and equipment for refreshing cache and storage medium

Publications (1)

Publication Number Publication Date
CN112699148A true CN112699148A (en) 2021-04-23

Family

ID=75513140

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011624951.8A Pending CN112699148A (en) 2020-12-31 2020-12-31 Method, device and equipment for refreshing cache and storage medium

Country Status (1)

Country Link
CN (1) CN112699148A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115878666A (en) * 2022-10-31 2023-03-31 四川川大智胜系统集成有限公司 Management method, system, electronic device and medium for cache dependency relationship

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115878666A (en) * 2022-10-31 2023-03-31 四川川大智胜系统集成有限公司 Management method, system, electronic device and medium for cache dependency relationship
CN115878666B (en) * 2022-10-31 2023-09-12 四川川大智胜系统集成有限公司 Management method, system, electronic equipment and medium for cache dependency relationship

Similar Documents

Publication Publication Date Title
US11567662B2 (en) Storage system interface
US10911369B2 (en) Processing event data using dynamic data server nodes
US20110320394A1 (en) Creation and Revision of Network Object Graph Topology for a Network Performance Management System
US10997062B1 (en) System and method for implementing an automated regression testing module
CN111708755A (en) Data migration method, device, system, electronic equipment and readable storage medium
US20230206083A1 (en) Optimizing gradient boosting feature selection
WO2023066182A1 (en) File processing method and apparatus, device, and storage medium
CN112699148A (en) Method, device and equipment for refreshing cache and storage medium
US11429311B1 (en) Method and system for managing requests in a distributed system
CN112000971B (en) File permission recording method, system and related device
CN113656001A (en) Platform component development method and device, computer equipment and storage medium
US20230124100A1 (en) Low-Latency Data Management And Query Processing Cross-Optimizations
WO2019179252A1 (en) Sample playback data access method and device
CN112988278B (en) Meta file modification method and device of resource file, electronic equipment and storage medium
CN115292313A (en) Pseudo-column implementation method and device, electronic equipment and storage medium
CN111176715B (en) Information calling method and server
CN113110846A (en) Method and device for acquiring environment variable
CN110968267A (en) Data management method, device, server and system
CN111078263A (en) Hot deployment method, system, server and storage medium based on Drools rule engine
CN117435558B (en) Metadata management method, computing device and storage medium
US11816088B2 (en) Method and system for managing cross data source data access requests
CN113950145B (en) Data processing method and device
CN117251500B (en) Dynamic read-write separation method for database
US20230122781A1 (en) Low-Latency Buffer Storage Of Static Datasets For Query Operation Optimization
CN116775204A (en) Probe updating method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination