Cache monitoring method, system and device, storage medium and computer program product
By using keywords in cache and data sources for data reading and consistency comparison, the consistency problem between cached data and source data is solved, and precise monitoring of cached data and the availability of business services is achieved.
Patent Information
- Application Number
- CN202410593287.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-13
- Publication Date
- 2025-02-11
AI Technical Summary
The prior art is difficult to effectively solve the problem of consistency between cached data and source data, especially when the data structure difference between source data and cached data exists, resulting in the inability to directly perform consistency comparison or direct comparison.
Through sampling, determine keywords related to the target business, use these keywords to read the corresponding cache data in the cache and read the corresponding source data in the data source, and perform consistency comparison to output consistency comparison results.
Feasibility monitoring and precise monitoring of cached data are realized, and the availability of cached data is improved, thereby further improving the availability of business services.
Smart Images

Figure CN119415348A_ABST
Abstract
Description
Background Art
[0002] Data cache technology is used to store and access data quickly, reliably, and efficiently. It is a storage unit between traditional memory and processor, which temporarily stores some data like a buffer. When a certain data needs to be read, it will first check whether the data already exists in the cache. If so, it can be read directly from the cache, thus reducing the time and cost of reading data from the disk or network.
[0003] How to maintain the consistency between cached data and source data is a topic that the industry generally considers.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] In view of the problems in the prior art, the purpose of the present invention is to provide a cache monitoring method, system, device, storage medium and computer program product, which overcome the difficulties of the prior art and can improve the efficiency and accuracy of cache monitoring.
[0006] The present disclosure provides a cache monitoring method, which includes:
[0007] Sampling keywords related to your target business;
[0008] Read the corresponding cache data in the current cache according to the keyword, and read the corresponding source data in the data source according to the keyword;
[0009] Perform consistency comparison between source data and cached data, and output consistency comparison results.
[0010] In an optional embodiment, reading corresponding source data in a data source according to a keyword includes:
[0011] Read the corresponding source data from multiple data sources based on the keyword.
[0012] In an optional embodiment, the cache monitoring method further includes:
[0013] Before sampling and determining keywords related to the target service, the cache data changes in the cache are monitored, and when a cache data change signal is received, in response to the cache data change signal, keywords related to the target service are sampled and derived from the changed cache data.
[0014] In an optional embodiment, the cache monitoring method further includes:
[0015] Before the source data is compared with the cached data for consistency, a custom consistency comparison script is remotely called to use the consistency comparison script to compare the source data with the cached data for consistency and output the consistency comparison result.
[0016] In an optional embodiment, remotely calling a custom consistency comparison script includes:
[0017] The corresponding business node is determined according to the target business type corresponding to the keyword, so as to remotely call the customized consistency comparison script from the business node.
[0018] In an optional embodiment, remotely calling a custom consistency comparison script includes:
[0019] The corresponding consistency comparison script is determined according to the cache identifier of the current cache, so as to remotely call the custom consistency comparison script.
[0020] In an optional embodiment, the cache monitoring method further includes:
[0021] Before remotely calling the custom consistency comparison script, pre-check the custom consistency comparison script to determine whether there is an abnormality in the custom consistency comparison script, and remotely call the custom consistency comparison script when there is no abnormality in the custom consistency comparison script.
[0022] In an optional embodiment, the cache monitoring method further includes:
[0023] Before reading the corresponding cache data in the current cache according to the keyword, first read the source data according to the keyword and modify the source data;
[0024] After the source data is modified, the cache data is read according to the keyword to achieve consistency comparison between the modified source data and the cache data.
[0025] In an optional embodiment, the cache monitoring method further includes:
[0026] When the consistency comparison result reaches the inconsistent set condition, an alarm is output.
[0027] The present disclosure also provides a cache monitoring system, which includes:
[0028] Sampling module, sampling and determining keywords related to the target business;
[0029] The reading module reads the corresponding cache data in the current cache according to the keyword, and reads the corresponding source data in the data source according to the keyword;
[0030] The consistency comparison module compares the source data with the cached data and outputs the consistency comparison result.
[0031] An embodiment of the present invention further provides an electronic device, including:
[0032] processor;
[0033] a memory in which executable instructions for the processor are stored;
[0034] Wherein, the processor is configured to perform the steps of the above cache monitoring method by executing executable instructions.
[0035] An embodiment of the present invention further provides a computer-readable storage medium for storing a program, which implements the steps of the above cache monitoring method when executed.
[0036] An embodiment of the present invention further provides a computer program product, which includes one or more computer-readable storage media, on which computer program instructions are stored. When the computer program instructions are executed by a computer, the steps of the cache monitoring method of any of the above embodiments are executed.
[0037] The cache monitoring method, system, device, storage medium and computer program product of the present invention sample and determine keywords related to the target business, read the corresponding cache data in the cache according to the keywords, and read the corresponding source data in the data source, compare the source data with the cache data, and determine the consistency of the cache data with the source data according to the comparison result. The sampled derived keywords are part of the full amount of keywords in the cache, which are related to the target business. Reading cache data and source data based on keywords can solve the problem of being unable to directly perform data consistency comparison or errors caused by direct comparison due to the difference between the data structure of the source data and the cache data, thereby realizing feasibility monitoring and accurate monitoring of the cache, improving the availability of cache data, and further improving the availability of business services. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Other features, objectives and advantages of the present invention will become more apparent from a reading of the detailed description of non-limiting embodiments made with reference to the following accompanying drawings.
[0039] Figure 1 One of the flowcharts of the cache monitoring method according to an embodiment of the present disclosure is shown.
[0040] Figure 2 A structural diagram of a cache monitoring system according to an embodiment of the present disclosure is shown.
[0041] Figure 3 The second flowchart of the cache monitoring method according to the embodiment of the present disclosure is shown.
[0042] Figure 4 The third flowchart showing the cache monitoring method of the embodiment of the present disclosure.
[0043] Figure 5 A fourth flowchart showing the cache monitoring method of an embodiment of the present disclosure.
[0044] Figure 6 A module diagram showing a cache monitoring system according to an embodiment of the present disclosure.
[0045] Figure 7 is a schematic diagram of the structure of the electronic device of the present invention. and
[0046] Figure 8 It is a schematic diagram of the structure of a computer-readable storage medium according to an embodiment of the present invention. DETAILED DESCRIPTION
[0047] To make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.
[0048] The accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware forwarding modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0049] In addition, the processes shown in the drawings are only exemplary and do not necessarily include all the steps. For example, some steps may be decomposed, some steps may be combined or partially combined, and the actual execution order may be changed according to the actual situation.
[0050] In actual business scenarios, when using data caching technology, the consistency of cached data determines its availability, and the availability of cached data directly affects the availability of corresponding business services to a certain extent. If the cached data is inconsistent with the source data, it means that there is an anomaly in the cached data, then the business service using the cached data will deviate, causing the business service to be unavailable.
[0051] In related technologies, cached data is closely related to business scenarios, and exhibits characteristics such as diversified structures and multiple data sources. For example, for a certain business scenario, cached data may come from multiple data sources, so that the cached data may correspond to multiple data sources. As the business iterates, when caching, the source data from different data sources may be integrated to improve the availability of cached data. At this time, the data structure of the cached data may change relative to the source data, which makes it impossible to directly compare the cached data with the source data for consistency. If a forced comparison is performed, there will inevitably be errors.
[0052] In response to this problem, the disclosed embodiment proposes an improved cache monitoring method, which determines keywords related to the business through sampling, uses these keywords to read the corresponding cache data in the cache and reads the corresponding source data in the data source and performs consistency comparison. Among them, by sampling out keywords related to the business, using the same keywords to extract the corresponding cache data and source data, and then performing consistency comparison, this can solve the problem of being unable to directly perform data consistency comparison due to the difference between the data structure of the source data and the cache data, or the error caused by direct comparison, thereby realizing feasibility monitoring and accurate monitoring of the cache, improving the availability of cache data, and further improving the availability of business services.
[0053] Figure 1 A flow chart of a cache monitoring method provided by an embodiment of the present disclosure is shown. The execution subject of the method may be a cache monitoring system other than a cache, such as Figure 1 As shown, the cache monitoring method may include but is not limited to the following steps:
[0054] Step 110: Sampling and determining keywords related to the target business;
[0055] Step 120: Read the corresponding cache data in the current cache according to the keyword, and read the corresponding source data in the data source;
[0056] Step 130: Perform consistency comparison between the source data and the cached data, and output the consistency comparison result.
[0057] The sampled keywords are part of the full keywords in the cache and are related to the target business. Reading cache data and source data based on keywords can solve the problem of being unable to directly compare data consistency or errors caused by direct comparison due to differences in the data structure between the source data and the cache data, thereby enabling feasibility monitoring and accurate monitoring of the cache, improving the availability of cache data, and further improving the availability of business services.
[0058] In the disclosed embodiment, the keyword is related to the target business, wherein the target business corresponds to a specific business scenario. For example, in a hotel business scenario, the keyword may include a hotel ID, address, hotel room type, etc., which are not limited here.
[0059] When executing step 110, keywords can be randomly derived from the data source or cache to implement keyword sampling. In the data source and cache, the data structure using the keyword may be different. In this case, the keyword can be used to read relevant data in the data source and cache in a targeted manner without being affected by the data structure difference.
[0060] In this case, keywords may be randomly exported from a data source or a cache periodically to periodically sample and determine keywords related to the target business.
[0061] In the embodiment of the present disclosure, it is also possible to monitor the cache data changes in the cache, and when receiving the cache data change signal, respond to the cache data change signal and derive the keyword from the changed cache data.
[0062] In this embodiment, the cache data change includes data aggregation, deletion or addition, etc., which are not limited here. When cache data aggregation occurs, a consistency comparison is performed with the source data in real time to verify the consistency of the cache data with the source data.
[0063] In the embodiments of the present disclosure, cached data may come from multiple data sources, so when using keywords to read source data, it includes reading corresponding source data from multiple data sources. Among them, the data source can be a relational database, a Service database, or a Redis database, and the source data can be read according to the corresponding type of data source.
[0064] In some other implementations, the data source also runs a custom configuration data reading interface and related reading rules and other parameters, and the corresponding parameters can be parsed according to the keywords to perform data reading.
[0065] In the implementation of the present disclosure, the cache type includes Redis and / or MemCache.
[0066] Figure 2 A flowchart showing a cache monitoring method according to another embodiment is shown as follows: Figure 2 As shown, the cache monitoring method includes but is not limited to the following steps:
[0067] Step 210: Sampling and determining keywords related to the target business;
[0068] Step 220: Read the corresponding cache data in the current cache according to the keyword, and read the corresponding source data in the data source;
[0069] Step 230: remotely call a custom consistency comparison script;
[0070] Step 240: Input the source data and cache data into a consistency comparison script, and output the consistency comparison script.
[0071] In the disclosed embodiment, the consistency comparison script is deployed remotely and does not occupy monitoring system resources, thereby enabling remote calling of the consistency comparison script.
[0072] In a further embodiment of the present disclosure, the consistency comparison script has a corresponding relationship with the business type, and this correspondence can be one-to-one or one-to-many. Then, the corresponding consistency comparison script can be called according to the business type reflected by the keyword to improve the availability and accuracy of the consistency comparison.
[0073] In the disclosed embodiment, the consistency comparison script may be stored on a business node of the corresponding business type. At this time, the corresponding business node may be determined according to the target business type reflected by the keyword to call the corresponding consistency comparison script from the business node.
[0074] In this case, each cache can support the setting of an independent consistency comparison script, in which the cache identifier corresponds to a specific business type, so that based on the correspondence between the cache identifier, business type and consistency comparison script, the cache data can be read more accurately and the consistency comparison script can be called to achieve accurate data comparison.
[0075] In an achievable manner, before actually calling the consistency comparison script, the consistency comparison script may be pre-checked to detect abnormal scripts in advance. Specifically, the strategy for predicting consistency comparison scripts includes the following steps:
[0076] First, extract test data, which may include positive sample data sets and negative sample data. Positive sample data may be a set of data that is consistent with the source data, while negative sample data is a set of data that is inconsistent with the source data.
[0077] Next, input the test data into the consistency comparison script to be tested;
[0078] If no comparison result is output, that is, the consistency comparison script cannot be run, then the script is confirmed to be abnormal;
[0079] If the comparison result is output, determine whether the comparison result is consistent with expectations. For example, for positive sample data, the expected output comparison result is consistent, while for negative sample data, the expected output comparison result is inconsistent;
[0080] If the comparison result does not meet expectations, the script is confirmed to be abnormal;
[0081] If the comparison result is as expected, the script is confirmed to be normal.
[0082] In the disclosed embodiment, the consistency comparison script is an editable script, which allows custom editing and configuration of corresponding comparison rules and other parameters. For example, each consistency comparison script is deployed on a corresponding business node, and the business node can edit the consistency comparison script on the node and configure the consistency comparison parameters.
[0083] In the disclosed embodiment, the consistency comparison script is a consistency comparison script based on the Groovy language. Groovy is a dynamic programming language based on the Java platform. It combines the features of languages such as Python, Ruby, and Smalltalk, and integrates seamlessly with Java. Groovy is a dynamic language that allows dynamic modification of code at runtime, so it can be easily edited, improving the dynamic editability of the consistency comparison script.
[0084] In an embodiment of the present disclosure, source data is compared with cache data, and consistency comparison between source data and cache data can be performed. In another embodiment, the following may also be included:
[0085] First, read the source data according to the keyword and modify the source data;
[0086] Then read the cache data according to the keyword;
[0087] Next, the read cache data is compared with the modified source data for consistency.
[0088] This implementation can be used to verify whether the cache synchronization mechanism is normal. Under normal circumstances, modifications to the source data will be synchronized to the cache, and the corresponding cache data will be synchronized and modified. Using this implementation, if the comparison result shows that the data is consistent, it indicates that the cache synchronization mechanism is normal, otherwise there is an abnormality.
[0089] The present disclosure also provides Figure 3 The cache monitoring method includes but is not limited to the following steps:
[0090] Step 310: Sampling and determining keywords related to the target business:
[0091] Step 320: Read the corresponding cache data in the current cache according to the keyword;
[0092] Step 330: Read corresponding source data in the data source according to the keyword;
[0093] Step 340: Determine whether there is a custom consistency comparison script;
[0094] Step 350: If it exists, call the consistency comparison script;
[0095] Step 360: If it does not exist, extract the platform script from the local monitoring platform;
[0096] Step 370: Use a consistency comparison script or a platform script to perform a consistency comparison between the source data and the cached data, and output the consistency comparison result.
[0097] This embodiment can dynamically select a customized consistency comparison script or a local platform script to ensure the feasibility of the solution. Among them, executing step 340 includes the absence of a consistency comparison script and the current consistency comparison script being abnormal, such as the above content, and the pre-check shows that the current consistency comparison script is abnormal and unavailable.
[0098] The present disclosure also provides Figure 4 The cache monitoring method includes but is not limited to the following steps:
[0099] Step 410: Sampling and determining keywords related to the target business, and reading source data from the data source according to the keywords:
[0100] Step 420: Determine whether there is a custom consistency comparison script;
[0101] Step 430: If a consistency comparison script exists, modify the source data based on the consistency comparison script;
[0102] Step 440: If there is no consistency comparison script, modify the source data based on a default rule, which may correspond to the platform script described above;
[0103] Step 450: Read cache data in the current cache according to the keyword, use the consistency comparison script or default rules used in step 430 or 440 to perform consistency comparison between the modified source data and the cache data, and output the consistency comparison result.
[0104] By using this implementation, a consistency comparison script is dynamically selected to verify whether there is an abnormality in the cache synchronization mechanism, thereby improving the comprehensiveness and feasibility of the consistency comparison.
[0105] The present disclosure also provides Figure 5 The cache monitoring method includes but is not limited to the following steps:
[0106] Step 510: Sampling and determining keywords related to the target business;
[0107] Step 520: Read the corresponding cache data in the current cache according to the keyword, and read the corresponding source data in the data source;
[0108] Step 530: remotely call a custom consistency comparison script;
[0109] Step 540: input the source data and cache data into a consistency comparison script, and output the consistency comparison result;
[0110] Step 550: When the consistency comparison result reaches the inconsistent setting condition, an alarm is output.
[0111] In this embodiment, the alarm is used to remind relevant personnel to start manual inspection of the cache to eliminate abnormal problems and avoid business errors. This embodiment can improve the efficiency of the business system.
[0112] Exemplarily, the inconsistency setting condition may include that the number or proportion of data inconsistencies exceeds a certain threshold, in which case an alarm is triggered to be output.
[0113] Figure 6 Schematic diagram of the structure of the cache monitoring system of the present invention. Figure 6 As shown, the cache monitoring system 600 of the present invention includes:
[0114] A sampling module 610, sampling and determining keywords related to the target business;
[0115] The reading module 620 reads the corresponding cache data in the current cache according to the keyword, and reads the corresponding source data in the data source according to the keyword;
[0116] The consistency comparison module 630 performs a consistency comparison between the source data and the cached data, and outputs a consistency comparison result.
[0117] In an optional implementation manner, reading corresponding source data in a data source according to the keyword includes:
[0118] Read the corresponding source data from multiple data sources based on the keyword.
[0119] In an optional embodiment, the sampling module 610 is further configured to:
[0120] Before sampling and determining keywords related to the target service, the cache data changes in the cache are monitored, and when a cache data change signal is received, in response to the cache data change signal, keywords related to the target service are sampled and derived from the changed cache data.
[0121] In an optional embodiment, the consistency comparison module 630 is further configured to:
[0122] Before the source data is compared with the cached data for consistency, a custom consistency comparison script is remotely called to use the consistency comparison script to compare the source data with the cached data for consistency and output the consistency comparison result.
[0123] In an optional embodiment, the consistency comparison module 630 is specifically used for:
[0124] The corresponding business node is determined according to the target business type corresponding to the keyword, so as to remotely call the customized consistency comparison script from the business node.
[0125] In an optional embodiment, the consistency comparison module 630 is further configured to:
[0126] The corresponding consistency comparison script is determined according to the cache identifier of the current cache, so as to remotely call the custom consistency comparison script.
[0127] In an optional embodiment, the consistency comparison module 630 is further configured to:
[0128] Before remotely calling the custom consistency comparison script, pre-check the custom consistency comparison script to determine whether there is an abnormality in the custom consistency comparison script, and remotely call the custom consistency comparison script when there is no abnormality in the custom consistency comparison script.
[0129] In an optional embodiment, the consistency comparison module 630 is further configured to:
[0130] Before reading the corresponding cache data in the current cache according to the keyword, first read the source data according to the keyword and modify the source data;
[0131] After the source data is modified, the cache data is read according to the keyword to achieve consistency comparison between the modified source data and the cache data.
[0132] In an optional embodiment, the consistency comparison module 630 is further configured to:
[0133] The disclosed embodiment provides a cache monitoring system, which determines keywords related to a target business through sampling, reads corresponding cache data in the cache according to the keywords, and reads corresponding source data in the data source, compares the source data with the cache data, and determines the consistency of the cache data with the source data according to the comparison result. The keywords derived by sampling are part of the full amount of keywords in the cache, which are related to the target business. Reading cache data and source data based on keywords can solve the problem of being unable to directly perform data consistency comparison or errors caused by direct comparison due to differences in the data structures of the source data and the cache data, thereby achieving feasibility monitoring and accurate monitoring of the cache, improving the availability of cache data, and further improving the availability of business services.
[0134] An embodiment of the present invention further provides an electronic device, comprising a processor and a memory, wherein executable instructions of the processor are stored, wherein the processor is configured to execute the steps of the cache monitoring method by executing the executable instructions.
[0135] As described above, the electronic device of the present invention determines the keywords related to the target business through sampling, reads the corresponding cache data in the cache according to the keywords, and reads the corresponding source data in the data source, compares the source data with the cache data, and determines the consistency of the cache data with the source data according to the comparison result. The keywords derived by sampling are part of the full amount of keywords in the cache, which are related to the target business. Reading cache data and source data based on keywords can solve the problem of being unable to directly perform data consistency comparison or errors caused by direct comparison due to the difference between the data structures of the source data and the cache data, thereby realizing feasibility monitoring and accurate monitoring of the cache, improving the availability of cache data, and further improving the availability of business services.
[0136] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as systems, methods or program products. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits", "modules" or "platforms".
[0137] Figure 7 Schematic diagram of the structure of the electronic device of the present invention. Figure 7 An electronic device 700 according to this embodiment of the present invention will be described. Figure 7 The electronic device 700 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0138] like Figure 7 As shown, the electronic device 700 is in the form of a general computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one storage unit 720, a bus 730 connecting different platform components (including the storage unit 720 and the processing unit 710), a display unit 740, etc.
[0139] The storage unit stores program codes, which can be executed by the processing unit 710, so that the processing unit 710 performs the steps according to various exemplary embodiments of the present invention described in the cache monitoring method section of this specification. For example, the processing unit 710 can perform the following steps: Figure 1-Figure 5 Any of the steps shown in the embodiment.
[0140] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 721 and / or a cache memory unit 722 , and may further include a read-only memory unit (ROM) 723 .
[0141] The storage unit 720 may also include a program / utility 724 having a set (at least one) of program modules 725, such program modules 725 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0142] Bus 730 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0143] The electronic device 700 may also communicate with one or more external devices 70 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 700, and / or communicate with any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 750. Furthermore, the electronic device 700 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 760. The network adapter 760 may communicate with other modules of the electronic device 700 via a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms, etc.
[0144] The embodiment of the present invention also provides a computer-readable storage medium for storing a program, and the steps of the cache monitoring method are implemented when the program is executed. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of various exemplary embodiments of the present invention described in the cache monitoring method section above in this specification.
[0145] As shown above, when the program of the computer-readable storage medium of this embodiment is executed, it determines the keywords related to the target business through sampling, reads the corresponding cache data in the cache according to the keywords, and reads the corresponding source data in the data source, compares the source data with the cache data, and determines the consistency of the cache data with the source data according to the comparison result. The keywords derived by sampling are part of the full amount of keywords in the cache, which are related to the target business. Reading cache data and source data based on keywords can solve the problem of being unable to directly perform data consistency comparison or errors caused by direct comparison due to the difference between the data structures of the source data and the cache data, thereby realizing feasibility monitoring and accurate monitoring of the cache, improving the availability of cache data, and further improving the availability of business services.
[0146] Figure 8 Schematic diagram of the structure of the computer-readable storage medium of the present invention. Figure 8 As shown, a computer program product 800 for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0147] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0148] Computer readable storage media may include data signals propagated in baseband or as part of a carrier wave, wherein readable program codes are carried. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program codes contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.
[0149] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0150] In summary, the cache monitoring method, system, device, storage medium and computer program product of the present invention determine the keywords related to the target business through sampling, read the corresponding cache data in the cache according to the keywords, and read the corresponding source data in the data source, compare the source data with the cache data, and determine the consistency of the cache data and the source data according to the comparison result. The keywords derived by sampling are part of the full amount of keywords in the cache, which are related to the target business. Reading cache data and source data based on keywords can solve the problem of being unable to directly perform data consistency comparison or errors caused by direct comparison due to the difference between the data structures of the source data and the cache data, thereby realizing feasibility monitoring and accurate monitoring of the cache, improving the availability of cache data, and further improving the availability of business services.
[0151] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.
Claims
1. A cache monitoring method, characterized in that: include: Sampling keywords related to your target business; Reading corresponding cache data in the current cache according to the keyword, and reading corresponding source data in the data source according to the keyword; Perform a consistency comparison between the source data and the cache data, and output a consistency comparison result.
2. The cache monitoring method according to claim 1, characterized in that: The reading corresponding source data from the data source according to the keyword includes: The corresponding source data is read from the multiple data sources according to the keyword.
3. The cache monitoring method according to claim 1, characterized in that: The cache monitoring method further includes: Before sampling and determining the keywords related to the target business, the cache data changes in the cache are monitored, and when a cache data change signal is received, the keywords related to the target business are sampled and derived from the changed cache data in response to the cache data change signal.
4. The cache monitoring method according to claim 1, characterized in that: The cache monitoring method further includes: Before performing a consistency comparison between the source data and the cache data, a user-defined consistency comparison script is remotely called to perform a consistency comparison between the source data and the cache data using the consistency comparison script, and a consistency comparison result is output.
5. The cache monitoring method according to claim 4, characterized in that: The remote call of the customized consistency comparison script includes: The corresponding service node is determined according to the target service type corresponding to the keyword, so as to remotely call the customized consistency comparison script from the service node.
6. The cache monitoring method according to claim 4, characterized in that: The remote call of the customized consistency comparison script includes: The corresponding consistency comparison script is determined according to the cache identifier of the current cache, so as to remotely call the customized consistency comparison script.
7. The cache monitoring method according to claim 4, characterized in that: The cache monitoring method further includes: Before remotely calling a custom consistency comparison script, the custom consistency comparison script is pre-checked to determine whether there is an abnormality in the custom consistency comparison script, and when there is no abnormality in the custom consistency comparison script, the custom consistency comparison script is remotely called.
8. The cache monitoring method according to claim 1, characterized in that: The cache monitoring method further includes: Before reading the corresponding cache data in the current cache according to the keyword, first read the source data according to the keyword and modify the source data; After the source data is modified, the cache data is read according to the keyword to perform consistency comparison between the modified source data and the cache data.
9. The cache monitoring method according to claim 1, characterized in that: The cache monitoring method further includes: When the consistency comparison result reaches an inconsistent set condition, an alarm is output.
10. 一 A cache monitoring system, characterized in that: include: Sampling module, sampling and determining keywords related to the target business; A reading module, reading corresponding cache data in the current cache according to the keyword, and reading corresponding source data in the data source according to the keyword; The consistency comparison module performs a consistency comparison between the source data and the cache data, and outputs a consistency comparison result.
11. An electronic device, characterized in that: include: processor; a memory storing executable instructions of the processor; The processor is configured to perform the steps of the cache monitoring method according to any one of claims 1 to 9 by executing the executable instructions.
12. A computer-readable storage medium for storing a program, characterized in that: When the program is executed, the steps of the cache monitoring method according to any one of claims 1 to 9 are implemented.
13. A computer program product comprising one or more computer-readable storage media, characterized in that: The computer-readable storage medium stores computer program instructions, which, when executed by a computer, execute the steps of the cache monitoring method according to any one of claims 1 to 9.