CN117608794A - Multi-copy cache refreshing method, device, equipment and medium based on timing task - Google Patents

Multi-copy cache refreshing method, device, equipment and medium based on timing task Download PDF

Info

Publication number
CN117608794A
CN117608794A CN202311648561.8A CN202311648561A CN117608794A CN 117608794 A CN117608794 A CN 117608794A CN 202311648561 A CN202311648561 A CN 202311648561A CN 117608794 A CN117608794 A CN 117608794A
Authority
CN
China
Prior art keywords
target
copy
version
cache
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
CN202311648561.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.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202311648561.8A priority Critical patent/CN117608794A/en
Publication of CN117608794A publication Critical patent/CN117608794A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • G06F9/4887Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues involving deadlines, e.g. rate based, periodic
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a multi-copy cache refreshing method, device, equipment and medium based on a timing task. Acquiring at least one first target copy to be cached and refreshed when a first timing task is received in a non-emergency copy cache and refresh scene; acquiring a first target prefix, a first target date and a first target version in an application memory corresponding to each first target copy respectively; matching each first target prefix with a pre-constructed database cache cleaning naming rule table to obtain each matching result; and according to each matching result, carrying out cache refreshing processing on a first target date and a first target version in a first target copy corresponding to a first target prefix of the cache clearing naming rule table of the missed database. The method solves the problems of low efficiency and low accuracy caused by untimely refreshing of the copies in the micro-service, avoids the problem of low accuracy caused by too low copy version, and improves the accuracy and efficiency of multi-copy refreshing.

Description

Multi-copy cache refreshing method, device, equipment and medium based on timing task
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method, an apparatus, a device, and a medium for refreshing multiple copies of a cache based on a timing task.
Background
When the micro-services are deployed on the cloud, a plurality of copies are generally deployed in a plurality of Pod or containers for performance and load balancing, and the incoming transactions can be distributed to different copies for processing by combining with the load balancing server, so that the effect of balancing the load optimization performance is achieved.
The inventors have found that the following drawbacks exist in the prior art in the process of implementing the present invention: at present, the caching technology can improve the acquisition efficiency of programs for certain data with higher access frequency, so that the response rate of the micro-service as a whole to transactions is improved. But the cached data may expire in a business or technical sense, and the problems of low efficiency and low accuracy are caused by untimely refreshing of copies in the micro-service.
Disclosure of Invention
The invention provides a multi-copy cache refreshing method, device, equipment and medium based on a timing task, so as to improve the accuracy and efficiency of multi-copy refreshing.
According to one aspect of the invention, a multi-copy cache refreshing method based on a timing task is provided, wherein the method comprises the following steps:
in a non-emergency copy cache refreshing scene, when a first timing task is received, acquiring at least one first target copy to be cached and refreshed;
acquiring a first target prefix, a first target date and a first target version in an application memory corresponding to each first target copy respectively;
matching each first target prefix with a pre-constructed database cache cleaning naming rule table to obtain each matching result;
and according to each matching result, carrying out cache refreshing processing on a first target date and a first target version in a first target copy corresponding to a first target prefix of the database cache clearing naming rule table.
According to another aspect of the present invention, there is provided a multi-copy cache refreshing apparatus based on a timing task, including:
the first target copy acquisition module is used for acquiring at least one first target copy to be cached and refreshed when a first timing task is received in a non-emergency copy cache and refresh scene;
the first target prefix, the first target date and the first target version acquisition module are used for acquiring the first target prefix, the first target date and the first target version in the application memory corresponding to each first target copy respectively;
the matching result determining module is used for matching each first target prefix with a pre-constructed database cache cleaning naming rule table to obtain each matching result;
and the cache refreshing processing module is used for carrying out cache refreshing processing on a first target date and a first target version in a first target copy corresponding to a first target prefix of the database cache clearing naming rule table according to each matching result.
According to another aspect of the present invention, there is provided an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the multi-copy cache refreshing method based on timing tasks according to any embodiment of the present invention when executing the computer program.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to implement the multi-copy cache refresh method based on timing tasks according to any of the embodiments of the present invention when executed.
According to the technical scheme, in a non-emergency copy cache refreshing scene, when a first timing task is received, at least one first target copy to be cached and refreshed is obtained; acquiring a first target prefix, a first target date and a first target version in an application memory corresponding to each first target copy respectively; matching each first target prefix with a pre-constructed database cache cleaning naming rule table to obtain each matching result; and according to each matching result, carrying out cache refreshing processing on a first target date and a first target version in a first target copy corresponding to a first target prefix of the cache clearing naming rule table of the missed database. The method solves the problems of low efficiency and low accuracy caused by untimely refreshing of the copies in the micro-service, avoids the problem of low accuracy caused by too low copy version, and improves the accuracy and efficiency of multi-copy refreshing.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a multi-copy cache refreshing method based on timing tasks according to a first embodiment of the present invention;
fig. 2 is a schematic structural diagram of a multi-copy cache refreshing device based on a timing task according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to a third embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "target," "current," and the like in the description and claims of the present invention and the above-described drawings are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a multi-copy cache refreshing method based on a timing task according to an embodiment of the present invention, where the method may be performed by a multi-copy cache refreshing device based on a timing task, and the multi-copy cache refreshing device based on a timing task may be implemented in hardware and/or software.
Accordingly, as shown in fig. 1, the method includes:
s110, in a non-emergent copy cache refreshing scene, when a first timing task is received, at least one first target copy to be cached and refreshed is obtained.
The first timing task may be a timing task sent in a non-emergent copy cache refresh scenario.
In this embodiment, the first timing task needs to be received in real time. The transmission time threshold of the first timing task may be preset, for example, the triggering of the first timing task may be set to perform the task every 2 hours.
Further, assuming that the current received first timing task is eight am, the next received first timing task is ten am. Because the first timing task is sent out in the non-emergent copy cache refreshing scene, the time period of the timing task interval sending is longer.
Correspondingly, after receiving the first timing task, a plurality of first target copies to be cached and refreshed need to be acquired. In particular, the replica may be a program within multiple containers or Pod initiated by the microservice on the cloud cluster. Caching may refer to storing some data with higher access frequency in a memory in a program, so that the data does not need to be accessed again through calculation or database access.
S120, acquiring a first target prefix, a first target date and a first target version in the application memory corresponding to each first target copy respectively.
In this embodiment, after the first target copy is acquired, a first target prefix, a first target date, and a first target version corresponding to the first target copy also need to be acquired. Specifically, the first target prefix may be an identity number that indicates the first target copy. The first target date may be the last update date of the first target copy. The first target version may be descriptive version information describing the first target copy.
S130, matching each first target prefix with a pre-constructed database cache cleaning naming rule table to obtain each matching result.
The database cache cleaning naming rule table may be a copy name description information table for counting the copies to be cleaned, and each first target copy may be distinguished according to a first target prefix, or may determine whether the first target copy is to be cleaned or not through the first target prefix.
The matching result may be a description case describing whether the first target copy hits the database cache clean-up naming rule table.
In this embodiment, it is assumed that 5 first target copies (respectively: a first target copy 1, a first target copy 2, a first target copy 3, a first target copy 4, and a first target copy 5) to be cached and refreshed are obtained, and a matching result can be obtained by matching with the database cache cleaning naming rule table.
Specifically, in the assumed matching result, the first target copy 1, the first target copy 2 and the first target copy 3 miss the database cache and clear the naming rule table; the first target copy 4 and the first target copy 5 hit the database cache purge naming rule table.
And S140, according to each matching result, carrying out cache refreshing processing on a first target date and a first target version in a first target copy corresponding to a first target prefix of the database cache clearing naming rule table.
In the previous example, the cache refreshing process needs to be performed on the first target date and the first target version corresponding to the first target copy 1, the first target copy 2 and the first target copy 3 respectively. For example, the first target date may be modified to the current time; the first target version is modified to the current latest version number.
Optionally, after the matching the first target prefixes with the pre-built database cache clean-up naming rule table to obtain each matching result, the method further includes: and according to each matching result, carrying out clearing processing on the first target copy corresponding to the first target prefix hitting the database cache clearing naming rule table.
In the previous example, since the first target copy 4 and the first target copy 5 hit the database cache purge naming rule table, the purge processing is performed on the first target copy 4 and the first target copy 5. Therefore, the copy to be cleaned can be cleaned in time, the storage operation pressure of the processor is reduced, and the refreshing efficiency of the copy is improved.
Optionally, the method further comprises: in an emergency copy cache refreshing scene, when a second timing task is received, acquiring a database emergency refreshing demand table; acquiring at least one second target copy to be cached and refreshed currently, and a second target prefix, a second target date and a second target version which correspond to each second target copy respectively; according to each second target prefix, the second target date and the second target version, matching judgment is carried out on the second target prefix, the second target date and the second target version and the database emergency refreshing demand table, and a cache refreshing second target copy entry is determined; and carrying out cache refreshing processing on the second target copy according to the cache refreshing second target copy item.
The second timing task may be a timing task sent in an emergency copy cache refresh scenario.
Specifically, because the method is in the emergent copy cache refreshing scene, compared with the first timing task, the time interval of the second timing task is shorter. The transmission time threshold of the second timing task may be set in advance, for example, the triggering of the second timing task may be set to perform tasks every 10 minutes.
In this embodiment, when the second timing task is received, the database emergency refresh requirement table needs to be acquired. Specifically, the database emergency refresh requirement table comprises at least one of the following: an emergency refresh prefix, an emergency refresh date, and an emergency refresh new version. In detail, the emergency refresh prefix may be identity information describing different copies; the emergency refresh date may be the date each copy stores in the database emergency refresh requirements table; the emergency refresh version may be the version of each copy stored in the database emergency refresh requirements table.
Correspondingly, at least one second target copy to be cached and refreshed currently is obtained, and a second target prefix, a second target date and a second target version corresponding to each second target copy respectively are obtained. Illustratively, assume that 3 second target copies (second target copy 1, second target copy 2, and second target copy 3) are obtained. Assume that the second target prefix for the second target copy 1 is FB23001, the second target date is 2023, 5 months, 1 day, 8 hours, 10 minutes, and the second target version fb.23.1.0. The second target prefix for the second target copy 2 is FB23002, the second target date is 2023, 7, 5, 9 and 20 minutes, and the second target version fb.22.5.1. The second target prefix of the second target copy 3 is FB23003, the second target date is 2022, 5 months, 10 days, 12 hours, 40 minutes, and the second target version fb.23.2.12.
Furthermore, matching judgment is needed to be carried out with the database emergency refreshing demand table according to each second target prefix, second target date and second target version, so that a second target copy entry for cache refreshing can be determined. Correspondingly, the cache refreshing process can be performed on the second target copy according to the cache refreshing second target copy entry.
Optionally, the determining, according to each of the second target prefix, the second target date, and the second target version, the second target copy entry for cache refresh by performing matching judgment with the database emergency refresh requirement table includes: according to each second target prefix, matching with the emergency refreshing prefix, and determining at least one second target version to be judged by the date; judging whether a second target date corresponding to the second target version to be judged is consistent with the emergency refreshing date or not, if so, determining the second target version to be judged, and acquiring an emergency refreshing version in the database emergency refreshing demand table; and judging whether the second target version corresponding to the second target version is smaller than the emergency refreshing version or not according to the version to be refreshed, and if yes, determining that the second target copy item is cached and refreshed.
In this embodiment, it is assumed that the database emergency refresh requirement table includes the following information: emergency refresh demand 1: the emergency refresh prefix is FB23001, the emergency refresh date is 2023, 5, 1, 8 and 10 minutes, and the emergency refresh version is fb.23.1.0. Emergency refresh demand 2: the emergency refresh prefix is FB23002, the emergency refresh date is 2023, 7, 5, 9 and 20 minutes, and the emergency refresh version is fb.23.1.0. Emergency refresh demand 3: the emergency refresh prefix is FB23002, the emergency refresh date is 2022, 7, 5, 9 and 10 minutes, and the emergency refresh version is fb.23.1.0. Emergency refresh demand 4: the emergency refresh prefix is FB23004, the emergency refresh date is 2023, 8, 12, 23 minutes, and the emergency refresh version is fb.23.12.1.
Further, the second target prefix is required to be matched with the emergency refreshing prefix according to each second target prefix, and at least one second target version to be judged by the date is determined; it may be determined that the second target copy 1 and the second target copy 2 can be matched with the emergency refresh prefix, that is, it is determined that the second target version is the second target copy 1 and the second target copy 2 when the date is judged.
Correspondingly, whether the second target date corresponding to the second target copy 1 and the second target copy 2 is consistent with the emergency refresh date or not needs to be judged, it can be determined that the second target copy 1 is matched with the emergency refresh requirement 1, and if the second target copy 2 is matched with the emergency refresh requirement 2, it can be determined that the second target version is judged to be the second target copy 1 and the second target copy 2 by the version judgment, and the emergency refresh version in the emergency refresh requirement table of the database, namely FB.23.1.0 in the emergency refresh requirement 1 and FB.23.1.0 in the emergency refresh requirement 2, is obtained.
Further, whether the second target version corresponding to the second target version is smaller than the emergency refreshing version or not needs to be judged according to the version to be judged. It may be determined that fb.23.1.0 in the second target copy 1 is not less than fb.23.1.0 in the emergency refresh requirement 1. It may be determined that fb.22.5.1 in the second target copy 2 is less than fb.23.1.0 in the emergency refresh requirement 2.
Correspondingly, if the second target version is smaller than the emergency refresh version, determining that the second target copy entry is cached and refreshed, that is, determining that fb.22.5.1 in the second target copy 2 is smaller than fb.23.1.0 in the emergency refresh requirement 2, determining that the second target copy entry is cached and refreshed as the second target copy 2, and performing cache and refresh processing on the second target copy entry.
Optionally, after the determining whether the second target date corresponding to the second target version of the waiting date is consistent with the emergency refreshing date, the method further includes: if not, determining that the second target version judged by the current waiting date does not carry out cache refreshing processing, and skipping over the second target version judged by the current waiting date.
In the previous example, assuming that the dates of the second target copy 1 and the emergency refresh requirement 1 do not match, the cache refresh processing is not performed on the second target copy 1, and the second target copy 1 is skipped.
Optionally, after the determining whether the to-be-judged version determines whether the second target version corresponding to the second target version is smaller than the emergency refresh version, the method further includes: if not, determining that the second target version judged by the current version does not carry out cache refreshing processing, and skipping over the second target version judged by the current version.
In the previous example, if the second target version is not smaller than the emergency refresh version, determining that the second target version is judged to be the current version, and skipping over the second target version. That is, it may be determined that fb.23.1.0 in the second target copy 1 is not less than fb.23.1.0 in the emergency refresh requirement 1, the cache refresh process is not performed on the second target copy 1, and the second target copy 1 is skipped.
The advantages of this arrangement are that: the cache processing operation can be better performed, and the accuracy and the efficiency of multi-copy refreshing are improved.
According to the technical scheme, in a non-emergency copy cache refreshing scene, when a first timing task is received, at least one first target copy to be cached and refreshed is obtained; acquiring a first target prefix, a first target date and a first target version in an application memory corresponding to each first target copy respectively; matching each first target prefix with a pre-constructed database cache cleaning naming rule table to obtain each matching result; and according to each matching result, carrying out cache refreshing processing on a first target date and a first target version in a first target copy corresponding to a first target prefix of the cache clearing naming rule table of the missed database. The method solves the problems of low efficiency and low accuracy caused by untimely refreshing of the copies in the micro-service, avoids the problem of low accuracy caused by too low copy version, and improves the accuracy and efficiency of multi-copy refreshing.
Example two
Fig. 2 is a schematic structural diagram of a multi-copy cache refreshing device based on a timing task according to a second embodiment of the present invention. The multi-copy cache refreshing device based on the timing task provided by the embodiment of the invention can be realized through software and/or hardware, and can be configured in terminal equipment or a server to realize the multi-copy cache refreshing method based on the timing task. As shown in fig. 2, the apparatus includes: a first target copy acquisition module 210, a first target prefix, a first target date and first target version acquisition module 220, a match result determination module 230, and a cache flush processing module 240.
The first target copy obtaining module 210 is configured to obtain, in a non-emergency copy cache refresh scene, at least one first target copy to be cached and refreshed when receiving a first timing task;
a first target prefix, a first target date, and a first target version obtaining module 220, configured to obtain a first target prefix, a first target date, and a first target version in an application memory corresponding to each of the first target copies respectively;
the matching result determining module 230 is configured to match each of the first target prefixes with a pre-constructed database cache cleaning naming rule table, so as to obtain each matching result;
and the cache refreshing processing module 240 is configured to perform cache refreshing processing on a first target date and a first target version in a first target copy corresponding to a first target prefix of the database cache clearing naming rule table according to each matching result.
According to the technical scheme, in a non-emergency copy cache refreshing scene, when a first timing task is received, at least one first target copy to be cached and refreshed is obtained; acquiring a first target prefix, a first target date and a first target version in an application memory corresponding to each first target copy respectively; matching each first target prefix with a pre-constructed database cache cleaning naming rule table to obtain each matching result; and according to each matching result, carrying out cache refreshing processing on a first target date and a first target version in a first target copy corresponding to a first target prefix of the cache clearing naming rule table of the missed database. The method solves the problems of low efficiency and low accuracy caused by untimely refreshing of the copies in the micro-service, avoids the problem of low accuracy caused by too low copy version, and improves the accuracy and efficiency of multi-copy refreshing.
On the basis of the above embodiments, the cleaning processing module may be specifically configured to: and after each first target prefix is matched with a pre-constructed database cache clearing naming rule table to obtain each matching result, clearing the first target copy corresponding to the first target prefix hitting the database cache clearing naming rule table according to each matching result.
On the basis of the above embodiments, the method may further specifically include: the database emergency refreshing demand table acquisition module is used for acquiring the database emergency refreshing demand table when receiving the second timing task in the emergency copy cache refreshing scene; the second target copy acquisition module is used for acquiring at least one second target copy to be cached and refreshed currently, and a second target prefix, a second target date and a second target version which correspond to each second target copy respectively; the cache refreshing second target copy entry determining module is configured to perform matching judgment with the database emergency refreshing requirement table according to each second target prefix, the second target date and the second target version, so as to determine a cache refreshing second target copy entry; and the second target copy cache refreshing processing module is used for carrying out cache refreshing processing on the second target copy according to the cache refreshing second target copy entry.
On the basis of the above embodiments, the database emergency refresh requirement table includes at least one of the following: an emergency refresh prefix, an emergency refresh date, and an emergency refresh new version.
Based on the foregoing embodiments, the cache refresh second target copy entry determining module may be specifically configured to: according to each second target prefix, matching with the emergency refreshing prefix, and determining at least one second target version to be judged by the date; judging whether a second target date corresponding to the second target version to be judged is consistent with the emergency refreshing date or not, if so, determining the second target version to be judged, and acquiring an emergency refreshing version in the database emergency refreshing demand table; and judging whether the second target version corresponding to the second target version is smaller than the emergency refreshing version or not according to the version to be refreshed, and if yes, determining that the second target copy item is cached and refreshed.
Based on the foregoing embodiments, the cache refresh second target copy entry determining module may be further specifically configured to: and after judging whether the second target date corresponding to the second target version of the waiting date is consistent with the emergency refreshing date, if the second target date is not consistent with the emergency refreshing date, determining that the second target version of the current waiting date is not subjected to cache refreshing processing, and skipping over the second target version of the current waiting date.
Based on the foregoing embodiments, the cache refresh second target copy entry determining module may be further specifically configured to: and after judging whether the second target version corresponding to the second target version to be judged is smaller than the emergency refreshing version or not, if the second target version is not smaller than the emergency refreshing version, determining that the second target version to be judged does not carry out cache refreshing processing, and skipping over the second target version to be judged.
The multi-copy cache refreshing device based on the timing task provided by the embodiment of the invention can execute the multi-copy cache refreshing method based on the timing task provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example III
Fig. 3 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement a third embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 3, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may 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 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 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, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as a multi-copy cache refresh method based on timed tasks.
In some embodiments, the timed task based multi-copy cache refresh method may be implemented as a computer program tangibly embodied on a computer readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more of the steps of the timed task based multi-copy cache refresh method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform a timed task based multi-copy cache flushing method in any other suitable manner (e.g., by means of firmware).
The method comprises the following steps: in a non-emergency copy cache refreshing scene, when a first timing task is received, acquiring at least one first target copy to be cached and refreshed; acquiring a first target prefix, a first target date and a first target version in an application memory corresponding to each first target copy respectively; matching each first target prefix with a pre-constructed database cache cleaning naming rule table to obtain each matching result; and according to each matching result, carrying out cache refreshing processing on a first target date and a first target version in a first target copy corresponding to a first target prefix of the database cache clearing naming rule table.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out 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, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, 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, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.
Example IV
A fourth embodiment of the present invention also provides a method for performing a timed task based multi-copy cache refresh, the method comprising: in a non-emergency copy cache refreshing scene, when a first timing task is received, acquiring at least one first target copy to be cached and refreshed; acquiring a first target prefix, a first target date and a first target version in an application memory corresponding to each first target copy respectively; matching each first target prefix with a pre-constructed database cache cleaning naming rule table to obtain each matching result; and according to each matching result, carrying out cache refreshing processing on a first target date and a first target version in a first target copy corresponding to a first target prefix of the database cache clearing naming rule table.
Of course, the embodiment of the present invention provides a computer-readable storage medium, where the computer-executable instructions are not limited to the method operations described above, but may also perform the related operations in the multi-copy cache refresh method based on timing tasks provided in any embodiment of the present invention.
From the above description of embodiments, it will be clear to a person skilled in the art that the present invention may be implemented by means of software and necessary general purpose hardware, but of course also by means of hardware, although in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, etc., and include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments of the present invention.
It should be noted that, in the embodiment of the multi-copy cache refreshing device based on the timing task, each unit and module included are only divided according to the functional logic, but not limited to the above-mentioned division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present invention.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. The multi-copy cache refreshing method based on the timing task is characterized by comprising the following steps of:
in a non-emergency copy cache refreshing scene, when a first timing task is received, acquiring at least one first target copy to be cached and refreshed;
acquiring a first target prefix, a first target date and a first target version in an application memory corresponding to each first target copy respectively;
matching each first target prefix with a pre-constructed database cache cleaning naming rule table to obtain each matching result;
and according to each matching result, carrying out cache refreshing processing on a first target date and a first target version in a first target copy corresponding to a first target prefix of the database cache clearing naming rule table.
2. The method of claim 1, further comprising, after said matching each of said first target prefixes with a pre-built database cache clean-up naming convention table to obtain each match result:
and according to each matching result, carrying out clearing processing on the first target copy corresponding to the first target prefix hitting the database cache clearing naming rule table.
3. The method as recited in claim 1, further comprising:
in an emergency copy cache refreshing scene, when a second timing task is received, acquiring a database emergency refreshing demand table;
acquiring at least one second target copy to be cached and refreshed currently, and a second target prefix, a second target date and a second target version which correspond to each second target copy respectively;
according to each second target prefix, the second target date and the second target version, matching judgment is carried out on the second target prefix, the second target date and the second target version and the database emergency refreshing demand table, and a cache refreshing second target copy entry is determined;
and carrying out cache refreshing processing on the second target copy according to the cache refreshing second target copy item.
4. The method of claim 3, wherein the database emergency refresh requirement table comprises at least one of: an emergency refresh prefix, an emergency refresh date, and an emergency refresh new version.
5. The method of claim 4, wherein the determining a cache flush second target replica entry based on the matching determination with the database emergency flush requirement table based on each of the second target prefix, the second target date, and the second target version comprises:
according to each second target prefix, matching with the emergency refreshing prefix, and determining at least one second target version to be judged by the date;
judging whether a second target date corresponding to the second target version to be judged is consistent with the emergency refreshing date or not, if so, determining the second target version to be judged, and acquiring an emergency refreshing version in the database emergency refreshing demand table;
and judging whether the second target version corresponding to the second target version is smaller than the emergency refreshing version or not according to the version to be refreshed, and if yes, determining that the second target copy item is cached and refreshed.
6. The method of claim 5, further comprising, after said determining whether the second target date corresponding to the second target version of the pending date determination corresponds to the emergency refresh date:
if not, determining that the second target version judged by the current waiting date does not carry out cache refreshing processing, and skipping over the second target version judged by the current waiting date.
7. The method of claim 6, further comprising, after said determining whether the second target version corresponding to the second target version determined by the pending version is less than the emergency refresh version:
if not, determining that the second target version judged by the current version does not carry out cache refreshing processing, and skipping over the second target version judged by the current version.
8. A multi-copy cache refresh device based on timed tasks, comprising:
the first target copy acquisition module is used for acquiring at least one first target copy to be cached and refreshed when a first timing task is received in a non-emergency copy cache and refresh scene;
the first target prefix, the first target date and the first target version acquisition module are used for acquiring the first target prefix, the first target date and the first target version in the application memory corresponding to each first target copy respectively;
the matching result determining module is used for matching each first target prefix with a pre-constructed database cache cleaning naming rule table to obtain each matching result;
and the cache refreshing processing module is used for carrying out cache refreshing processing on a first target date and a first target version in a first target copy corresponding to a first target prefix of the database cache clearing naming rule table according to each matching result.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements a timed task based multi-copy cache refresh method according to any one of claims 1-7 when the computer program is executed by the processor.
10. A computer readable storage medium storing computer instructions for causing a processor to perform a timed task based multi-copy cache refresh method according to any one of claims 1-7.
CN202311648561.8A 2023-12-04 2023-12-04 Multi-copy cache refreshing method, device, equipment and medium based on timing task Pending CN117608794A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311648561.8A CN117608794A (en) 2023-12-04 2023-12-04 Multi-copy cache refreshing method, device, equipment and medium based on timing task

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311648561.8A CN117608794A (en) 2023-12-04 2023-12-04 Multi-copy cache refreshing method, device, equipment and medium based on timing task

Publications (1)

Publication Number Publication Date
CN117608794A true CN117608794A (en) 2024-02-27

Family

ID=89959584

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311648561.8A Pending CN117608794A (en) 2023-12-04 2023-12-04 Multi-copy cache refreshing method, device, equipment and medium based on timing task

Country Status (1)

Country Link
CN (1) CN117608794A (en)

Similar Documents

Publication Publication Date Title
CN116545905A (en) Service health detection method and device, electronic equipment and storage medium
CN114564149B (en) Data storage method, device, equipment and storage medium
CN116594563A (en) Distributed storage capacity expansion method and device, electronic equipment and storage medium
CN117608794A (en) Multi-copy cache refreshing method, device, equipment and medium based on timing task
CN115543416A (en) Configuration updating method and device, electronic equipment and storage medium
CN112883041B (en) Data updating method and device, electronic equipment and storage medium
CN115525666A (en) Real-time data updating method and device, electronic equipment and storage medium
CN114553894B (en) Data synchronization method, device, system and storage medium
CN113360736B (en) Internet data capturing method and device
CN116821046B (en) Automatic synchronization method, device, equipment and medium for data among heterogeneous units
CN114500438B (en) File sharing method and device, electronic equipment and storage medium
CN117453746A (en) Method, device, equipment and medium for data cycle screening
CN116302371A (en) Transaction visibility judging method, device, equipment and storage medium
CN115858104A (en) Method, device and equipment for acquiring snapshot of transaction commit sequence number and storage medium
CN117608944A (en) Method and device for calculating weight migration volume ratio, electronic equipment and storage medium
CN115525659A (en) Data query method and device, electronic equipment and storage medium
CN115168407A (en) Numerical value addressing method and device, electronic equipment and storage medium
CN116796085A (en) File processing method and device, electronic equipment and storage medium
CN117370397A (en) Database compatible method, device, equipment and storage medium
CN117827949A (en) Method and device for batch writing of data into database based on memory queue
CN117271667A (en) Data reading method and device, electronic equipment and storage medium
CN118069664A (en) Data warehouse-falling method and device
CN115408115A (en) Transaction starting time processing method, device, equipment and storage medium
CN117687992A (en) Data migration method, device, equipment and storage medium
CN117743467A (en) Agent node replacement 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