A method, device, equipment and storage medium for back-to-source detection of monitoring cache failure

By monitoring cache and database read operations, dynamically identifying interfaces without a return source and sending prompt information, the problem of automatic recovery in the event of cache failure in high-concurrency scenarios is solved, improving the system's stability and rapid response capabilities.

CN119512879BActive Publication Date: 2025-09-23GUANGZHOU PINWEI SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411736960.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-09-23
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

In high-concurrency scenarios, the lack of automatic identification and rapid recovery mechanisms in the event of cache failures leads to system performance degradation or interruption, especially for non-origin interfaces and frequently called interfaces.

Method used

By monitoring cache read operations and database read operations, using cache read operation monitoring algorithms and database read operation monitoring algorithms, dynamically monitoring the call chain, identifying non-source return interfaces and sending prompt information to the management terminal, the ability to quickly detect cache failures can be achieved.

Benefits of technology

Automatically identify interfaces without back-to-source functionality, quickly detect cache failures and improve system stability during cache failures, reducing the risk of performance degradation and interruptions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512879B_ABST
    Figure CN119512879B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and storage medium for detecting a back-to-source of a monitoring cache failure. The method includes: dynamically monitoring the read operation of the cache of its call chain through the target interface, after simulating the return of the read cache operation to indicate that it does not exist, determining the result of returning the cache read operation monitoring algorithm based on the expected return value of the cache read operation monitoring algorithm, and recording it in the call chain as a cache key, and dynamically monitoring the database read operation. If there is a cache key in the call chain, the target table is parsed and recorded. When the call chain of the interface ends monitoring, all recorded data is obtained. If there is a non-empty cache key and the table in the database does not exist, a prompt message indicating that the target interface has no back-to-source is sent. It can be seen that by monitoring the read operation of the cache and the read operation of the database, the interface without a back-to-source interface can be automatically identified, and whether the cache has the ability to recover quickly when a failure occurs can be quickly detected, thereby improving the stability of the application when a cache failure occurs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cache technology, and more specifically, to a method, apparatus, device, and storage medium for back-to-source detection of cache failure monitoring. Background Art

[0002] Caching is widely used in high-concurrency scenarios. It can effectively improve system response speed and performance, and reduce database pressure. However, there is a key problem with caching.

[0003] Whether the system can quickly recover from a cache failure remains an unknown. Cache stability is crucial for high-concurrency applications. If a cache failure fails and cannot be quickly recovered, it can lead to a sharp decline in system performance or even service interruption.

[0004] Currently, while cache failures can be manually troubleshooted and resolved, there's a lack of a mechanism for automatic identification and rapid response. For example, cache failures in non-origin interfaces and frequently called interfaces can have a greater impact on the system, but there's currently a lack of effective means to automatically identify these critical interfaces and encourage R&D personnel to focus on and optimize them.

[0005] In summary, in high-concurrency scenarios, there is an urgent need for a method that can automatically identify key interfaces and quickly promote optimization when cache failure occurs, so as to improve the stability of applications when cache failure occurs. Summary of the Invention

[0006] In view of the above problems, the present application provides a method, apparatus, device and storage medium for back-to-source detection of cache failures to improve the stability of applications when cache failures occur.

[0007] In order to achieve the above objectives, the following specific plans are proposed:

[0008] A method for detecting a back-to-origin failure of a monitoring cache includes:

[0009] Using the cache read operation monitoring algorithm, the cache read operation of its call chain is dynamically monitored through the target interface;

[0010] After simulating the read operation of the cache and returning that it does not exist, determining to return a result of the cache read operation monitoring algorithm according to an expected return value of the cache read operation monitoring algorithm;

[0011] Using the result of the cache read operation monitoring algorithm as a cache key, recording it in the call chain;

[0012] Using a database read operation monitoring algorithm, dynamically monitor the read operation of the database of its call chain through the target interface, and when monitoring that a read operation is performed on the target table in the database, determine whether the cache key exists in the call chain;

[0013] If so, parse and record the target table to the call chain;

[0014] When the call chain of the target interface ends monitoring, all recorded data in the call chain are obtained;

[0015] If there is a non-empty cache key in the record data and the table does not exist in the database, a prompt message indicating that the target interface has no return source is sent to the management terminal.

[0016] Optionally, determining to return a result of the cache read operation monitoring algorithm according to an expected return value of the cache read operation monitoring algorithm includes:

[0017] If the expected return value of the cache read operation monitoring algorithm is an integer, the result returned by the cache read operation monitoring algorithm is 0;

[0018] If the expected return value of the cache read operation monitoring algorithm is not an integer, the result returned to the cache read operation monitoring algorithm is empty.

[0019] Optionally, after the call chain of the target interface ends monitoring, all recorded data in the call chain is obtained, including:

[0020] After the call chain of the target interface ends monitoring, it is determined whether there is record data in the call chain. If so, all record data in the call chain are acquired.

[0021] Optionally, the cache read operation monitoring algorithm includes one or more of the redis.clients.jedis.Connection.sendCommand algorithm, the getBulkReply algorithm, the getMultiBulkReply algorithm, and the getIntegerReply algorithm.

[0022] A back-to-source detection device for monitoring cache failures, comprising:

[0023] A cache read operation monitoring unit is used to dynamically monitor the cache read operations of its call chain through the target interface using a cache read operation monitoring algorithm;

[0024] a cache monitoring return unit, configured to determine, after simulating a return indicating that the cache read operation does not exist, to return a result of the cache read operation monitoring algorithm according to an expected return value of the cache read operation monitoring algorithm;

[0025] A cache key recording unit, configured to use the result of the cache read operation monitoring algorithm as a cache key and record it in the call chain;

[0026] a cache key existence determination unit, configured to dynamically monitor the read operation of the database of its call chain through the target interface using a database read operation monitoring algorithm, and upon monitoring that a read operation is being performed on the target table in the database, determine whether the cache key exists in the call chain, and if so, execute the parsing recording unit;

[0027] The parsing and recording unit is used to parse and record the target table to the call chain;

[0028] A record data acquisition unit, configured to acquire all record data in the call chain after the call chain of the target interface ends monitoring;

[0029] The prompt information sending unit is used to send a prompt information that the target interface has no return source to the management terminal if there is a non-empty cache key in the record data and the table in the database does not exist.

[0030] Optionally, the cache monitoring return unit includes:

[0031] a shaping result returning unit, configured to return the result of the cache read operation monitoring algorithm as 0 if the expected return value of the cache read operation monitoring algorithm is shaping;

[0032] The non-integer result returning unit is used to return the result of the cache read operation monitoring algorithm as null if the expected return value of the cache read operation monitoring algorithm is not an integer.

[0033] Optionally, the record data acquisition unit includes:

[0034] The record data acquisition subunit is used to determine whether there is record data in the call chain after the call chain of the target interface ends monitoring, and if so, obtain all record data in the call chain.

[0035] Optionally, the cache read operation monitoring algorithm includes one or more of the redis.clients.jedis.Connection.sendCommand algorithm, the getBulkReply algorithm, the getMultiBulkReply algorithm, and the getIntegerReply algorithm.

[0036] A back-to-source detection device for monitoring cache failures, comprising a memory and a processor;

[0037] The memory is used to store programs;

[0038] The processor is configured to execute the program to implement the various steps of the method for detecting a back-to-source fault in a snoop cache as described above.

[0039] A storage medium stores a computer program thereon, which, when executed by a processor, implements the various steps of the above-mentioned method for detecting a back-to-source fault in a snoop cache.

[0040] By means of the above technical solution, the present application utilizes a cache read operation monitoring algorithm to dynamically monitor the read operation of the cache of its call chain through the target interface. After simulating the return of the read cache operation to be non-existent, the result of the cache read operation monitoring algorithm is determined according to the expected return value of the cache read operation monitoring algorithm. The result of the cache read operation monitoring algorithm is used as the cache key and recorded in the call chain. The database read operation monitoring algorithm is used to dynamically monitor the read operation of the database of its call chain through the target interface. When the read operation is monitored to be executed on the target table in the database, if there is a cache key in the call chain, the target table is parsed and recorded in the call chain. When the call chain of the interface ends the monitoring, all the recorded data in the call chain are obtained. If there is a non-empty cache key in the recorded data and the table in the database does not exist, a prompt message indicating that the target interface has no return source is sent to the management terminal. It can be seen that by monitoring the read operation of the cache and the read operation of the database, the interface without return source is automatically identified, and whether the cache has the ability to recover quickly when a failure occurs is quickly detected, thereby improving the stability of the application when the cache fails. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present application. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:

[0042] Figure 1 A schematic diagram of a process for implementing back-to-source detection of a snoop cache failure provided in an embodiment of the present application;

[0043] Figure 2 A schematic diagram of the structure of a device for implementing back-to-source detection of a snoop cache failure provided in an embodiment of the present application;

[0044] Figure 3 A schematic diagram of the structure of a device for implementing back-to-source detection of monitoring cache failures provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0046] The present application solution can be implemented based on a terminal with data processing capabilities, which can be applied to a computer, server, cloud, etc.

[0047] Next, combine Figure 1 The method for detecting a snoop cache failure back to the source in the present application may include the following steps:

[0048] Step S110: Utilize the cache read operation monitoring algorithm to dynamically monitor the cache read operation of its call chain through the target interface.

[0049] Specifically, the jvm-sandbox plug-in can be used to dynamically monitor the read cache operation of the call chain of the target interface through the target interface.

[0050] Among them, the algorithm used to monitor the read cache operation can be a cache read operation monitoring algorithm, which can specifically include the redis.clients.jedis.Connection.sendCommand algorithm, the getBulkReply algorithm, the getMultiBulkReply algorithm, the getIntegerReply algorithm, and other algorithms.

[0051] Step S120 : After simulating the return of the cache read operation as non-existent, determine to return the result of the cache read operation monitoring algorithm according to the expected return value of the cache read operation monitoring algorithm.

[0052] Specifically, the cache operation mock can be returned as non-existent, and then the expected return value of the cache read operation monitoring algorithm can be obtained. If the expected return value is an integer, it can indicate that the cache has failed, and if the expected return value is not an integer, it can indicate that the cache has not failed.

[0053] Step S130: Use the result of the cache read operation monitoring algorithm as a cache key and record it in the call chain.

[0054] Among them, the cache key corresponds to the result returned by the monitoring algorithm. The result returned by the monitoring algorithm can be empty, so the content corresponding to the cache key is empty. Then, when the cache key with empty content is recorded in the call chain, the recorded cache key content is empty.

[0055] Step S140: monitor the database read operation and determine whether there is a cache key in the call chain. If so, execute step S150.

[0056] Specifically, a database read operation monitoring algorithm can be used to dynamically monitor the read operations of the database of its call chain through the target interface, and when it is monitored that the target table in the database is subjected to a read operation, it is determined whether the cache key exists in the call chain. If so, step S150 is executed.

[0057] The algorithm for monitoring the read operation of the database may be a database read operation monitoring algorithm, and specifically may include the org.apache.ibatis.mapping.MappedStatement.getBoundSql algorithm.

[0058] It's understandable that by monitoring database read operations, we can analyze whether the application has the ability to quickly recover from cache failures. If we can monitor read operations on database tables, it means that the database read operation list is not empty, which indicates that the application has the ability to quickly recover from cache failures.

[0059] Furthermore, if the cache key does not exist in the call chain, there may be a problem in the process of dynamically monitoring the cache read operation, and the process may return to step S110 to continue dynamically monitoring the cache read operation.

[0060] Step S150: parse and record the target table to the call chain.

[0061] It is understandable that when it is monitored that a read operation is performed on the target table in the database and a cache key already exists in the call chain, the table name of the target table can be parsed and recorded in the call chain.

[0062] Step S160: After the call chain of the target interface ends monitoring, all recorded data in the call chain is obtained.

[0063] Specifically, all the record data in the call chain can be obtained by returning the result from the target interface after the call chain of the target interface ends.

[0064] Furthermore, after all recorded data are obtained, they can be transmitted to the mission analysis center for analysis of cache and database operation details.

[0065] Step S170: If there is a non-empty cache key in the recorded data and the table does not exist in the database, a prompt message indicating that the target interface has no return source is sent to the management terminal.

[0066] It is understandable that a non-empty cache key may indicate a cache failure, and the absence of a table in the database may indicate that the database read operation is empty. In this case, the target interface may have no return source. At this time, a prompt message indicating that the target interface has no return source can be sent to the management terminal for the relevant person in charge to confirm and rectify.

[0067] The present embodiment provides a method for detecting cache failures by monitoring the source of the cache. The method utilizes a cache read operation monitoring algorithm to dynamically monitor the cache read operations of its call chain through the target interface. After simulating the cache read operation to return to non-existence, the method determines the result of the cache read operation monitoring algorithm based on the expected return value of the cache read operation monitoring algorithm. The result of the cache read operation monitoring algorithm is used as the cache key and recorded in the call chain. The method utilizes a database read operation monitoring algorithm to dynamically monitor the database read operations of its call chain through the target interface. When a read operation is detected on the target table in the database, if the cache key exists in the call chain, the target table is parsed and recorded in the call chain. After the interface call chain ends monitoring, all recorded data in the call chain is obtained. If the recorded data contains a non-empty cache key and the table does not exist in the database, a prompt message indicating that the target interface has no source of return is sent to the management terminal. Thus, by monitoring cache read operations and database read operations, the non-source of the interface is automatically identified, and whether the cache has the ability to recover quickly when a failure occurs is quickly detected, thereby improving the stability of the application in the event of a cache failure.

[0068] In some embodiments of the present application, the process of determining and returning the result of the cache read operation monitoring algorithm based on the expected return value of the cache read operation monitoring algorithm mentioned in the above embodiment is introduced. This process may include the following two cases:

[0069] First, if the expected return value of the cache read operation monitoring algorithm is an integer, the result returned by the cache read operation monitoring algorithm is 0.

[0070] It is understood that the return value expected by the cache read operation monitoring algorithm is an integer, which can indicate a cache failure in the call chain of the target interface. In addition to 0, other values ​​can also be used to indicate a cache failure in the call chain of the target interface.

[0071] Second, if the expected return value of the cache read operation monitoring algorithm is not an integer, the result returned to the cache read operation monitoring algorithm is empty.

[0072] It is understandable that if the return result of the cache read operation monitoring algorithm is empty, it may indicate that the application cache may not be faulty.

[0073] The method for detecting cache failures by returning to the source provided in this embodiment returns the result of the cache read operation monitoring algorithm as 0 when the expected return value of the cache read operation monitoring algorithm is an integer. Furthermore, when the expected return value of the cache read operation monitoring algorithm is not an integer, the result of the cache read operation monitoring algorithm is returned as null. This serves as an indicator of whether a cache failure has occurred, thereby facilitating analysis in subsequent task analysis and enabling better parameter identification.

[0074] In some embodiments of the present application, the above step S160, when the call chain of the target interface ends monitoring, the process of obtaining all recorded data in the call chain is further described. The process may include:

[0075] S1. After the call chain of the target interface ends monitoring, it is determined whether there is recorded data in the call chain. If so, S2 is executed.

[0076] Specifically, if no data is recorded in the call chain, there may be a problem in the cache dynamic monitoring process or the database dynamic monitoring process, so it is possible to return to step S110 to re-dynamically monitor the cache read operation.

[0077] S2. Obtain all recorded data in the call chain.

[0078] The following describes an apparatus for implementing back-to-source detection of a snoop cache failure provided in an embodiment of the present application. The apparatus for implementing back-to-source detection of a snoop cache failure described below and the method for implementing back-to-source detection of a snoop cache failure described above can refer to each other.

[0079] See also Figure 2 , Figure 2 A schematic diagram of the structure of a device for implementing back-to-source detection of a snoop cache failure disclosed in an embodiment of the present application.

[0080] like Figure 2 As shown, the device may include:

[0081] The cache read operation monitoring unit 11 is used to dynamically monitor the cache read operation of its call chain through the target interface using the cache read operation monitoring algorithm;

[0082] A cache monitoring return unit 12 is configured to determine, after simulating the return of the cache read operation as non-existent, the result of returning the cache read operation monitoring algorithm according to the expected return value of the cache read operation monitoring algorithm;

[0083] A cache key recording unit 13 is configured to use the result of the cache read operation monitoring algorithm as a cache key and record it in the call chain;

[0084] A cache key existence determination unit 14 is configured to dynamically monitor the read operation of the database of its call chain through the target interface using a database read operation monitoring algorithm, and when a read operation is detected on the target table in the database, determine whether the cache key exists in the call chain, and if so, execute the parsing and recording unit 15;

[0085] The parsing and recording unit 15 is used to parse and record the target table to the call chain;

[0086] The record data acquisition unit 16 is used to acquire all the record data in the call chain after the call chain of the target interface ends monitoring;

[0087] The prompt information sending unit 17 is configured to send a prompt information indicating that the target interface has no return source to the management terminal if a non-empty cache key exists in the record data and the table does not exist in the database.

[0088] Optionally, the cache monitoring return unit includes:

[0089] a shaping result returning unit, configured to return the result of the cache read operation monitoring algorithm as 0 if the expected return value of the cache read operation monitoring algorithm is shaping;

[0090] The non-integer result returning unit is used to return the result of the cache read operation monitoring algorithm as null if the expected return value of the cache read operation monitoring algorithm is not an integer.

[0091] Optionally, the record data acquisition unit includes:

[0092] The record data acquisition subunit is used to determine whether there is record data in the call chain after the call chain of the target interface ends monitoring, and if so, obtain all record data in the call chain.

[0093] Optionally, the cache read operation monitoring algorithm includes one or more of the redis.clients.jedis.Connection.sendCommand algorithm, the getBulkReply algorithm, the getMultiBulkReply algorithm, and the getIntegerReply algorithm.

[0094] The apparatus for monitoring cache failure back-to-source detection provided in the embodiment of the present application can be applied to devices for monitoring cache failure back-to-source detection, such as terminals: mobile phones, computers, etc. Optionally, Figure 3 The hardware structure diagram of the device for back-to-source detection of cache failure is shown. Figure 3,The hardware structure of the device for back-to-source detection of monitoring cache failure may include: at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4;

[0095] In the embodiment of the present application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 communicate with each other through the communication bus 4;

[0096] The processor 1 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention;

[0097] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory;

[0098] The memory stores a program, and the processor can call the program stored in the memory, wherein the program is used to:

[0099] Using the cache read operation monitoring algorithm, the cache read operation of its call chain is dynamically monitored through the target interface;

[0100] After simulating the read operation of the cache and returning that it does not exist, determining to return a result of the cache read operation monitoring algorithm according to an expected return value of the cache read operation monitoring algorithm;

[0101] Using the result of the cache read operation monitoring algorithm as a cache key, recording it in the call chain;

[0102] Using a database read operation monitoring algorithm, dynamically monitor the read operation of the database of its call chain through the target interface, and when monitoring that a read operation is performed on the target table in the database, determine whether the cache key exists in the call chain;

[0103] If so, parse and record the target table to the call chain;

[0104] When the call chain of the target interface ends monitoring, all recorded data in the call chain are obtained;

[0105] If there is a non-empty cache key in the record data and the table does not exist in the database, a prompt message indicating that the target interface has no return source is sent to the management terminal.

[0106] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0107] An embodiment of the present application further provides a storage medium, which may store a program suitable for execution by a processor, wherein the program is used to:

[0108] Using the cache read operation monitoring algorithm, the cache read operation of its call chain is dynamically monitored through the target interface;

[0109] After simulating the read operation of the cache and returning that it does not exist, determining to return a result of the cache read operation monitoring algorithm according to an expected return value of the cache read operation monitoring algorithm;

[0110] Using the result of the cache read operation monitoring algorithm as a cache key, recording it in the call chain;

[0111] Using a database read operation monitoring algorithm, dynamically monitor the read operation of the database of its call chain through the target interface, and when monitoring that a read operation is performed on the target table in the database, determine whether the cache key exists in the call chain;

[0112] If so, parse and record the target table to the call chain;

[0113] When the call chain of the target interface ends monitoring, all recorded data in the call chain are obtained;

[0114] If there is a non-empty cache key in the record data and the table does not exist in the database, a prompt message indicating that the target interface has no return source is sent to the management terminal.

[0115] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0116] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0117] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referenced to each other.

[0118] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for detecting a back-to-source fault in a monitoring cache, characterized in that: include: Using the cache read operation monitoring algorithm, the cache read operation of its call chain is dynamically monitored through the target interface; After simulating the read operation of the cache and returning that it does not exist, determining to return a result of the cache read operation monitoring algorithm according to an expected return value of the cache read operation monitoring algorithm; Using the result of the cache read operation monitoring algorithm as a cache key, recording it in the call chain; Using a database read operation monitoring algorithm, dynamically monitor the read operation of the database of its call chain through the target interface, and when monitoring that a read operation is performed on the target table in the database, determine whether the cache key exists in the call chain; If so, parse and record the target table to the call chain; When the call chain of the target interface ends monitoring, all recorded data in the call chain are obtained; If there is a non-empty cache key in the record data and the table does not exist in the database, a prompt message indicating that the target interface has no return source is sent to the management terminal.

2. The method according to claim 1, characterized in that Determining, based on an expected return value of the cache read operation monitoring algorithm, to return a result of the cache read operation monitoring algorithm includes: If the expected return value of the cache read operation monitoring algorithm is an integer, the result returned by the cache read operation monitoring algorithm is 0; If the expected return value of the cache read operation monitoring algorithm is not an integer, the result returned to the cache read operation monitoring algorithm is empty.

3. The method according to claim 1, characterized in that When the call chain of the target interface ends monitoring, all recorded data in the call chain is obtained, including: After the call chain of the target interface ends monitoring, it is determined whether there is record data in the call chain. If so, all record data in the call chain are acquired.

4. The method according to any one of claims 1 to 3, characterized in that The cache read operation monitoring algorithm includes one or more of the redis.clients.jedis.Connection.sendCommand algorithm, the getBulkReply algorithm, the getMultiBulkReply algorithm, and the getIntegerReply algorithm.

5. A device for detecting back-to-source faults in a monitoring cache, characterized in that: include: A cache read operation monitoring unit is used to dynamically monitor the cache read operations of its call chain through the target interface using a cache read operation monitoring algorithm; a cache monitoring return unit, configured to determine, after simulating a return indicating that the cache read operation does not exist, to return a result of the cache read operation monitoring algorithm according to an expected return value of the cache read operation monitoring algorithm; A cache key recording unit, configured to use the result of the cache read operation monitoring algorithm as a cache key and record it in the call chain; a cache key existence determination unit, configured to dynamically monitor the read operation of the database of its call chain through the target interface using a database read operation monitoring algorithm, and upon monitoring that a read operation is being performed on the target table in the database, determine whether the cache key exists in the call chain, and if so, execute the parsing recording unit; The parsing and recording unit is used to parse and record the target table to the call chain; A record data acquisition unit, configured to acquire all record data in the call chain after the call chain of the target interface ends monitoring; The prompt information sending unit is used to send a prompt information that the target interface has no return source to the management terminal if there is a non-empty cache key in the record data and the table in the database does not exist.

6. The device according to claim 5, characterized in that The cache monitoring and returning unit includes: a shaping result returning unit, configured to return the result of the cache read operation monitoring algorithm as 0 if the expected return value of the cache read operation monitoring algorithm is shaping; The non-integer result returning unit is used to return the result of the cache read operation monitoring algorithm as null if the expected return value of the cache read operation monitoring algorithm is not an integer.

7. The device according to claim 5, characterized in that The record data acquisition unit includes: The record data acquisition subunit is used to determine whether there is record data in the call chain after the call chain of the target interface ends monitoring, and if so, obtain all record data in the call chain.

8. The device according to any one of claims 5 to 7, characterized in that: The cache read operation monitoring algorithm includes one or more of the redis.clients.jedis.Connection.sendCommand algorithm, the getBulkReply algorithm, the getMultiBulkReply algorithm, and the getIntegerReply algorithm.

9. A back-to-source detection device for monitoring cache failures, characterized in that: including memory and processor; The memory is used to store programs; The processor is configured to execute the program to implement the steps of the method for detecting a snoop cache failure back to the source according to any one of claims 1 to 4.

10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the method for detecting a snoop cache failure back to the source according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Data preparation method in test and system provided with the same

    CN102981947A

  • Cache comparison method and device

    CN110096296A