Method and device for timeout monitoring

LAP670AUndetermined Publication Date: 2025-08-08CHINA UNIONPAY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
LAP670
Authority / Receiving Office
LA · LA
Patent Type
Applications
Current Assignee / Owner
Priority Date
2016-12-26
Filing Date
2017-12-21
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

In the existing technology, timeout monitoring of requests requires a large amount of database resources. Especially in the case of high concurrency and large amounts of data, the resource consumption of the database is very serious.

Method used

Using a two-level cache mechanism, the server stores the key information of the request message (such as the sending time) in the first-level cache, and scans it according to the set frequency. Request messages that have not received a response are stored in the second-level cache, and the request message is judged through the message log. Whether to timeout avoids direct storage and calculation of the database.

Benefits of technology

Monitoring the response to request messages through cache reduces database resource consumption, reduces database pressure, and improves system processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0001_ABST
    Figure 00000000_0001_ABST
  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of data processing, and disclosed are a method and device for timeout monitoring, comprising: a server determining key information of a request message, the key information including a sending time of the request message; the server storing the key information to a first level cache; the server scanning the first level cache according to a set frequency, if the first level cache includes a first request message, storing the key information of the first request message into a second level cache, the first request message being a request message for which a reply message is not received; the server scanning the second level cache, and determining by means of a message log whether a reply message is received for a second request message in the second level cache, if not, the second request message times out, wherein the second request message is a request message in which the difference value between a sending time and a current time is greater than a time-out threshold value. The present invention solves the problem in the prior art wherein performing timeout monitoring on a request requires the consumption of a relatively large amount of database resources.
Need to check novelty before this filing date? Find Prior Art

Description

A method and device for timeout monitoring

[0001] This application claims priority to Chinese Patent Application No. 201611219406.4, filed on December 26, 2016, entitled "A Timeout Monitoring Method and Apparatus", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This invention relates to the field of data processing technology, and in particular to a timeout monitoring method and apparatus. Background Technology

[0003] In the internet, data requests are typically sent based on the Internet Protocol (IP) to retrieve data information. However, the current network environment is highly complex, and not every data request can retrieve the corresponding data information in a timely manner. Compared to synchronous requests, asynchronous requests are a communication method where the sender sends data and immediately sends the next data packet without waiting for a response from the receiver. In a transaction system, for asynchronous requests, after sending the request, it is necessary to monitor the return time of the other party's response; if a certain time is exceeded, the response to the request is considered timed out and invalid.

[0004] A common timeout monitoring method involves recording the request data and related timestamps in a database after a request is sent. Each request is monitored, and if no response is received within a specified time interval (i.e., the request's sending time plus the specified time interval is less than the current time), the request is considered to have timed out. This approach stores all request data in the database and requires checking each request individually for timeouts. This places significant pressure on the database, especially under high concurrency and large volumes of data, severely consuming database resources.

[0005] Summary of the Invention

[0006] This invention provides a timeout monitoring method and apparatus to solve the problem that monitoring request timeouts in the prior art requires a large amount of database resources.

[0007] The timeout monitoring method provided in this embodiment of the invention includes:

[0008] The server determines key information about the request message, including the time the request message was sent.

[0009] The server stores the key information in a first-level cache;

[0010] The server scans the first-level cache at a set frequency. If the first-level cache contains a first request message, the server stores the key information of the first request message in the second-level cache. The first request message is a request message for which no response message has been received.

[0011] The server scans the secondary cache and determines whether a response message has been received for the second request message in the secondary cache through the message log. If not, the server determines that the second request message has timed out. The second request message is a request message whose difference between the sending time and the current time is greater than the timeout threshold.

[0012] Optional, also includes:

[0013] If the server receives a response message, it searches for the corresponding request message in the first-level cache.

[0014] If a request message corresponding to the response message is found, the key information of the request message corresponding to the response message is marked as responded.

[0015] Optionally, the server stores the key information in a first-level cache, including:

[0016] The server determines the write time for storing the request message in the first-level cache;

[0017] The server stores the key information of the request message into the corresponding memory area based on the result of taking the remainder of N when the write time of the request message is used. The memory of the first-level cache is pre-divided into N memory areas, where the size of each memory area is the estimated number of transactions per unit time multiplied by the size of the key information data segment.

[0018] Optionally, the server scans the first-level cache at a set frequency, including:

[0019] The server creates N monitoring processes, each monitoring process corresponds to a memory region, and each monitoring process scans the corresponding memory region at the set frequency.

[0020] Optionally, the server scans the second-level cache and determines whether a response message has been received for the second request message in the second-level cache through message logs, including:

[0021] The secondary cache uses a linked list, and the key information of the first request message is stored in the linked list from the head of the list according to the sending time of the first request message;

[0022] The server sequentially queries the key information of the first request message in the linked list from the head of the list, and determines whether the difference between the sending time of the first request message and the current time is greater than the timeout threshold.

[0023] If yes, then the first request message is used as the second request message, and the message log of the second request message is used to determine whether the second request message has received a response message; if not, then the second request message is timed out.

[0024] An overtime monitoring device, comprising:

[0025] The writing module is used to determine key information of the request message, including the sending time of the request message;

[0026] The writing module is also used to store the key information into a first-level cache;

[0027] The first monitoring module is used to scan the first-level cache at a set frequency. If the first-level cache contains a first request message, the key information of the first request message is stored in the second-level cache. The first request message is a request message for which no response message has been received.

[0028] The second monitoring module is used to scan the secondary cache and determine whether the second request message in the secondary cache has received a response message through the message log. If not, it is determined that the second request message has timed out. The second request message is a request message in which the difference between the sending time and the current time is greater than the timeout threshold.

[0029] Optionally, the writing module is further configured to:

[0030] If a response message is received, the corresponding request message is searched in the first-level cache.

[0031] If a request message corresponding to the response message is found, the key information of the request message corresponding to the response message is marked as responded.

[0032] Optionally, the writing module is specifically used for:

[0033] Determine the write time for storing the request message in the first-level cache;

[0034] Based on the result of taking the remainder of the write time of the request message modulo N, the key information of the request message is stored in the corresponding memory area. The memory of the first-level cache is pre-divided into N memory areas, where the size of each memory area is the estimated number of transactions per unit time multiplied by the data segment size of the key information.

[0035] Optionally, the first monitoring module is specifically used for

[0036] The server creates N monitoring processes, each monitoring process corresponds to a memory region, and each monitoring process scans the corresponding memory region at the set frequency.

[0037] Optionally, the second monitoring module is specifically used for:

[0038] The secondary cache uses a linked list, and the key information of the first request message is stored in the linked list from the head of the list according to the sending time of the first request message;

[0039] The key information of the first request message in the linked list is queried sequentially from the head of the list to determine whether the difference between the sending time of the first request message and the current time is greater than the timeout threshold.

[0040] If yes, then the first request message is used as the second request message, and the message log of the second request message is used to determine whether the second request message has received a response message; if not, then the second request message is timed out.

[0041] This invention provides a computer-readable storage medium storing computer-executable instructions for causing a computer to perform any of the methods described above.

[0042] This invention provides a computing device, comprising:

[0043] Memory, used to store program instructions;

[0044] A processor is configured to invoke program instructions stored in the memory and execute the method described above according to the obtained program.

[0045] This invention provides a computer program product that, when run on a computer, causes the computer to execute any of the methods described above.

[0046] In this embodiment of the invention, after the server sends a request message, it stores the key information of the request message in a first-level cache. This key information includes the sending time of the request message. The server scans the first-level cache at a set frequency, and determines whether a response message has been received for each request message in the first-level cache based on the key information. Request messages that have not received a response message are designated as first request messages, and their key information is stored in a second-level cache. Since most request messages will respond with a response message within a very short time, only a small number of request messages in the first-level cache need to be designated as first request messages and stored in the second-level cache. Furthermore, the server scans the second-level cache, and based on the key information in the second-level cache, determines the difference between the sending time of the request message and the current time. If this difference is greater than a timeout threshold, the request message is designated as a second request message. The server then searches the message log of the second request message and determines whether a response message has been received based on the message log. If the second request message still has not received a response message, it is determined that the second request message has timed out. This embodiment of the invention stores the key information of the request message in a cache, monitoring the response status of request messages through the cache. This eliminates the need for database storage and calculation, alleviating the consumption of database resources and reducing the pressure on the database. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 is a flowchart of a timeout monitoring method according to an embodiment of the present invention;

[0049] Figure 2 shows a system architecture applicable to an embodiment of the present invention;

[0050] Figure 3 is a flowchart of the timeout monitoring method in a specific embodiment of the present invention;

[0051] Figure 4 is a schematic diagram of a timeout monitoring device according to an embodiment of the present invention;

[0052] Figure 5 is a schematic diagram of a computing device structure provided in an embodiment of the present invention. Detailed Implementation

[0053] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0054] This invention provides a timeout monitoring method, the process of which is shown in Figure 1. The method may include the following steps:

[0055] Step 101: The server determines the key information of the request message, including the sending time of the request message.

[0056] In the above steps, key information about the request message includes its sending time. The server stores the sending time in its cache and can use this time to calculate whether a request message for which no response has been received has exceeded the response time limit. Additionally, the key information also includes the primary key of the request message. In the distributed cache, relevant information about the request message can be quickly retrieved from the server using its primary key.

[0057] Step 102: The server stores the key information in the first-level cache.

[0058] Step 103: The server scans the first-level cache at a set frequency. If the first-level cache contains a first request message, the key information of the first request message is stored in the second-level cache. The first request message is a request message for which no response message has been received.

[0059] Step 104: The server scans the secondary cache and determines whether a response message has been received for the second request message in the secondary cache through the message log. If not, the server determines that the second request message has timed out. The second request message is a request message whose difference between the sending time and the current time is greater than the timeout threshold.

[0060] In this embodiment of the invention, after the server sends a request message, it stores the key information of the request message in a first-level cache. This key information includes the sending time of the request message. The server scans the first-level cache at a set frequency, and determines whether a response message has been received for each request message in the first-level cache based on the key information. Request messages that have not received a response message are designated as first request messages, and their key information is stored in a second-level cache. Since most request messages will respond with a response message within a very short time, only a small number of request messages in the first-level cache need to be designated as first request messages and stored in the second-level cache. Furthermore, the server scans the second-level cache, and based on the key information in the second-level cache, determines the difference between the sending time of the request message and the current time. If this difference is greater than a timeout threshold, the request message is designated as a second request message. The server then searches the message log of the second request message and determines whether a response message has been received based on the message log. If the second request message still has not received a response message, it is determined that the second request message has timed out. This embodiment of the invention stores the key information of the request message in a cache, monitoring the response status of request messages through the cache. This eliminates the need for database storage and calculation, alleviating the consumption of database resources and reducing the pressure on the database.

[0061] In this embodiment of the invention, to alleviate database pressure, the server establishes a two-level cache. The first-level cache, needing to store critical information from all issued request messages, requires a larger capacity than the second-level cache and is generally designed as shared memory. Furthermore, to improve efficiency, if the transaction volume is low, it can be designed as in-process memory data or memory mapping, depending on transaction volume and business needs. Memory mapping provides the ability to recover from power outages or short-term shutdowns, and the operating system can write to files while performing memory operations. Therefore, the second-level cache can also be shared memory, and when the transaction volume is low, the second request message can be stored directly in the in-process memory space, which can further improve efficiency.

[0062] For ease of monitoring, the first-level cache is divided into multiple memory regions, and step 102 above includes:

[0063] The server determines the write time for storing the request message in the first-level cache;

[0064] The server stores the key information of the request message into the corresponding memory area based on the result of taking the remainder of N when the write time of the request message is used. The memory of the first-level cache is pre-divided into N memory areas, where the size of each memory area is the estimated number of transactions per unit time multiplied by the size of the key information data segment.

[0065] Specifically, the L1 cache memory is pre-divided into N memory regions. For ease of calculation and classification, the value of N is generally determined based on a timeout threshold. Since the timeout threshold is typically tens of seconds, the value of N can also be tens. In this embodiment of the invention, the value of N is set to 60, meaning the L1 cache memory is divided into 60 memory regions. For ease of description, these 60 memory regions are numbered from 0 to 59.

[0066] After the request message is sent, the server adds the key information of the request message to a queue, waiting to be written to the first-level cache. When storing the key information in the first-level cache, the server calculates the remainder of the current write time divided by N, and stores the key information in the corresponding memory area based on the calculation result. For example, in this embodiment of the invention, N is 60, and the memory areas are numbered from 0 to 59. If the current write time for storing the key information in the first-level cache is 13 hours, 48 ​​minutes, and 34 seconds, the remainder of this write time divided by 60 seconds is 34. Therefore, the key information of the request message is stored in the memory area numbered 34.

[0067] To ensure sufficient memory capacity while maintaining server efficiency, in this embodiment of the invention, the server initializes the memory area of ​​the first-level cache. The initial size of a memory area is calculated by multiplying the estimated number of transactions per unit time by the size of the key information data segment. Since the key information data segment size is the same for each request message, the size of each memory area is the same within the same time period. For different time periods, the larger the number of transactions per unit time, the larger the initialized memory area. Because the size of the memory area is determined during initialization and based on the estimated peak number of transactions per unit time, this ensures sufficient storage space for key information. Furthermore, for different time periods, parameters can be adjusted to reallocate and re-allocate a sufficiently large memory area.

[0068] While storing critical information in the memory area, the server also scans each memory area at a certain frequency. To ensure efficiency and facilitate management, the server scans each memory area separately. Therefore, step 103 above, where the server scans the first-level cache at a set frequency, includes:

[0069] The server creates N monitoring processes, each monitoring process corresponds to a memory region, and each monitoring process scans the corresponding memory region at the set frequency.

[0070] In other words, corresponding to N memory regions, the server in this embodiment of the invention sets up N monitoring processes, each monitoring process corresponding to one memory region. Each monitoring process is responsible for scanning the memory region starting from the beginning of its corresponding memory region. According to big data statistics, generally speaking, more than 95% of request messages will receive a response message within 5 seconds, and nearly 99% of request messages will receive a response message within 2 seconds. Based on this, the scanning interval of the monitoring process for the memory region is generally set to 1 to 2 seconds, that is, the monitoring process scans the corresponding memory region once every 2 seconds. The server stores the received request messages from the beginning of the memory region into the corresponding memory region. The monitoring process scans the memory region starting from the beginning of the memory region. The monitoring process can set an end marker at the beginning of each scan, so that the monitoring process ends the scan when it reaches the first end marker in the memory region. Alternatively, the monitoring process can scan to the end of the corresponding memory region in each scan.

[0071] After the server stores the key information of the request message in a first-level cache, if a response message for the same request message is received, the server modifies the key information of the request message. This embodiment of the invention also includes:

[0072] If the server receives a response message, it searches for the corresponding request message in the first-level cache.

[0073] If a request message corresponding to the response message is found, the key information of the request message corresponding to the response message is marked as responded.

[0074] Specifically, during the scanning intervals, if the server receives a response message, it searches for the corresponding request message in the first-level cache. If the corresponding request message is found, the server marks the key information of that request message as responded. Thus, when the server scans the key information of a request message and determines that the request message has received a response, it does not perform any further processing on the request message. If the request message has not received a response, meaning the corresponding key information has not been marked as responded, the server treats the request message as a first request message and stores its key information in the second-level cache. After a scan is completed, the key information of the request message is deleted from the first-level cache.

[0075] For the second-level cache, since the critical information of the request message has already been monitored and filtered by the first-level cache, the critical information stored in the second-level cache is less than 5% of the total amount of critical information. Therefore, the second-level cache occupies very little memory and can be implemented using an in-process linked list. In this embodiment of the invention, the server scans the second-level cache and determines whether a response message has been received for the second request message in the second-level cache through message logs, including:

[0076] The secondary cache uses a linked list, and the key information of the first request message is stored in the linked list from the head of the list according to the sending time of the first request message;

[0077] The server sequentially queries the key information of the first request message in the linked list from the head of the list, and determines whether the difference between the sending time of the first request message and the current time is greater than the timeout threshold.

[0078] If yes, then the first request message is used as the second request message, and the message log of the second request message is used to determine whether the second request message has received a response message; if not, then the second request message is timed out.

[0079] In this embodiment of the invention, the key information of the first request messages is stored in the secondary cache sequentially from the head of the table according to the order of their sending time. Thus, the head of the secondary cache table contains the earliest sent first request message, and the tail contains the latest sent first request message. Unlike N monitoring processes scanning the primary cache, this embodiment uses only one monitoring process to scan the secondary cache. For ease of description, the N monitoring processes scanning the primary cache are referred to as the primary monitoring process, and the monitoring process scanning the secondary cache is referred to as the secondary monitoring process. The secondary monitoring process cyclically scans the secondary cache linked list, starting from the head of the list. It checks if the secondary cache linked list is empty. If empty, it waits for the next scan. If not empty, it starts with the first request message and, based on the key information stored in the secondary cache, determines if the difference between the sending time of the first request message and the current time is greater than the timeout threshold. If not, the secondary monitoring process moves to the second request message in the secondary cache for further analysis. If yes, meaning the difference between the sending time of the first request message and the current time is greater than the timeout threshold, the first request message is treated as the second request message. Its key information is used to query the corresponding message log. The message log of the second request message determines if it has received an acknowledgment message. If yes, the second request message has received an acknowledgment message and no timeout processing is applied. If no, meaning the second request message has not yet received an acknowledgment message, an external timeout processing service is called to apply timeout processing to the second request message. After that, regardless of whether the second request message receives a response message, the secondary monitoring process moves down to the second request message in the secondary cache for further analysis, until all request messages in the secondary cache have been analyzed.

[0080] Furthermore, in this embodiment of the invention, an anomaly detection device is also provided, responsible for capturing request messages issued during server failure or restart, enabling the server to reprocess request messages issued during this period. Alternatively, with manual intervention, the anomaly detection device can capture request messages from the database starting at a specified time point and invoke the server to reprocess them.

[0081] To better understand the present invention, the above process is described in detail below with specific embodiments. These specific embodiments include a message writing unit, a first-level cache, a first-level monitoring process, a second-level cache, and a second-level monitoring process, as shown in Figure 2. The message writing unit is responsible for obtaining key information from sent request messages and writing this key information into the first-level cache. The first-level cache includes 60 memory regions, numbered 0 to 59. There are also 60 first-level monitoring processes, each corresponding to one of the 60 memory regions in the first-level cache. These processes are responsible for monitoring their respective memory regions in the first-level cache and writing key information about unanswered messages into the second-level cache. The second-level monitoring process monitors the key information in the second-level cache. If a timeout threshold is exceeded, it checks the message log table to determine which request messages have not yet received an answer and calls an external timeout processing device to perform timeout processing on these request messages.

[0082] The steps of a specific embodiment are shown in Figure 3, including:

[0083] Step 301: The message writing unit obtains the key information of the request message, including the sending time of the request message.

[0084] Step 302: The message writing unit determines the write time to store the request message in the first-level cache, and stores the key information of the request message in the corresponding memory area based on the result of taking the remainder of the write time by 60 seconds.

[0085] Step 303: The message writing unit receives the response message, searches for the corresponding request message in the first-level cache, and if found, marks the key information of the request message as responded.

[0086] Step 304: The first-level monitoring process scans the corresponding memory area in the first-level cache at a set frequency. If no key information marked as having been responded to is found, it is treated as the first request message, and the key information of the first request message is stored in the second-level cache.

[0087] Step 305: The secondary monitoring process scans the memory area of ​​the secondary cache from the table header, and determines the first request message whose difference between the sending time and the current time is greater than the timeout threshold from the key information of the first request message, and uses it as the second request message.

[0088] Step 306: The secondary monitoring process searches the message log based on the key information of the second request message to determine that the second request message has not yet received a response message.

[0089] Step 307: The secondary monitoring process calls an external device to handle the timeout of the second request message.

[0090] It should be noted that the order in which the message writing unit, the first-level monitoring process, and the second-level monitoring process perform their operations in the above steps is not sequential. That is, while the message writing unit writes the key information of the request message into the first-level cache, the first-level monitoring process is also scanning the first-level cache at a set frequency, and at the same time, the second-level monitoring process is also periodically scanning the second-level cache. The step numbering above is only for the convenience of description.

[0091] Based on the same technical concept, embodiments of the present invention also provide a timeout monitoring device, as shown in FIG4, including:

[0092] The writing module 401 is used to determine key information of the request message, including the sending time of the request message;

[0093] The writing module 401 is also used to store the key information into a first-level cache;

[0094] The first monitoring module 402 is used to scan the first-level cache at a set frequency. If the first-level cache contains a first request message, the key information of the first request message is stored in the second-level cache. The first request message is a request message for which no response message has been received.

[0095] The second monitoring module 403 is used to scan the secondary cache and determine whether the second request message in the secondary cache has received a response message through the message log. If not, it is determined that the second request message has timed out. The second request message is a request message in which the difference between the sending time and the current time is greater than the timeout threshold.

[0096] The writing module 401 is further configured to:

[0097] If a response message is received, the corresponding request message is searched in the first-level cache.

[0098] If a request message corresponding to the response message is found, the key information of the request message corresponding to the response message is marked as responded.

[0099] The writing module 401 is specifically used for:

[0100] Determine the write time for storing the request message in the first-level cache;

[0101] Based on the result of taking the remainder of the write time of the request message modulo N, the key information of the request message is stored in the corresponding memory area. The memory of the first-level cache is pre-divided into N memory areas, where the size of each memory area is the estimated number of transactions per unit time multiplied by the data segment size of the key information.

[0102] The first monitoring module 402 is specifically used for

[0103] The server creates N monitoring processes, each monitoring process corresponds to a memory region, and each monitoring process scans the corresponding memory region at the set frequency.

[0104] The second monitoring module 403 is specifically used for:

[0105] The secondary cache uses a linked list, and the key information of the first request message is stored in the linked list from the head of the list according to the sending time of the first request message;

[0106] The key information of the first request message in the linked list is queried sequentially from the head of the list to determine whether the difference between the sending time of the first request message and the current time is greater than the timeout threshold.

[0107] If yes, then the first request message is used as the second request message, and the message log of the second request message is used to determine whether the second request message has received a response message; if not, then the second request message is timed out.

[0108] Based on the same technical concept, embodiments of the present invention also provide a computing device, which may specifically be a desktop computer, portable computer, smartphone, tablet computer, personal digital assistant (PDA), etc. Figure 5 shows a schematic diagram of a computing device structure provided by an embodiment of the present invention. This computing device may include a central processing unit (CPU) 501, a memory 502, an input device 503, an output device 504, etc. The input device 503 may include a keyboard, mouse, touchscreen, etc., and the output device 504 may include a display device, such as a liquid crystal display (LCD), a cathode ray tube (CRT), etc.

[0109] The memory 502 may include a read-only memory (ROM) and a random access memory (RAM), and provides the processor with program instructions and data stored in the memory. In this embodiment of the invention, the memory may be used to store a program for the method provided in any embodiment of the invention, and the processor executes the method disclosed in any of the above embodiments according to the obtained program instructions by calling the program instructions stored in the memory.

[0110] Based on the same technical concept, embodiments of the present invention also provide a computer-readable storage medium for storing computer program instructions for use in the above-described computing device, which includes a program for performing the methods disclosed in any of the above embodiments.

[0111] The computer storage medium can be any available medium or data storage device that a computer can access, including but not limited to magnetic storage (e.g., floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (e.g., CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (e.g., ROMs, EPROMs, EEPROMs, non-volatile memory (NAND flash), solid-state drives (SSDs)).

[0112] Based on the same technical concept, embodiments of the present invention also provide a computer program product that, when run on a computer, causes the computer to perform the methods disclosed in any of the above embodiments.

[0113] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or one or more blocks of the block diagrams.

[0114] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flowcharts and / or one or more block diagrams.

[0115] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable apparatus, provide steps for implementing the functions specified in one or more flowcharts and / or one or more block diagrams.

[0116] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the invention.

[0117] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A timeout monitoring method, characterized in that, include: The server determines key information about the request message, including the time the request message was sent. The server stores the key information in a first-level cache; The server scans the first-level cache at a set frequency. If the first-level cache contains a first request message, the server stores the key information of the first request message in the second-level cache. The first request message is a request message for which no response message has been received. The server scans the secondary cache and determines whether a response message has been received for the second request message in the secondary cache through the message log. If not, the server determines that the second request message has timed out. The second request message is a request message whose difference between the sending time and the current time is greater than the timeout threshold.

2. The method as described in claim 1, characterized in that, Also includes: If the server receives a response message, it searches for the corresponding request message in the first-level cache. If a request message corresponding to the response message is found, the key information of the request message corresponding to the response message is marked as responded.

3. The method as described in claim 1, characterized in that, The server stores the key information in a first-level cache, including: The server determines the write time for storing the request message in the first-level cache; The server stores the key information of the request message into the corresponding memory area based on the result of taking the remainder of N when the write time of the request message is used. The memory of the first-level cache is pre-divided into N memory areas, where the size of each memory area is the estimated number of transactions per unit time multiplied by the size of the key information data segment.

4. The method as described in claim 3, characterized in that, The server scans the first-level cache at a set frequency, including: The server creates N monitoring processes, each monitoring process corresponds to a memory region, and each monitoring process scans the corresponding memory region at the set frequency.

5. The method as described in claim 1, characterized in that, The server scans the second-level cache and determines, through message logs, whether a response message has been received for the second request message in the second-level cache, including: The secondary cache uses a linked list, and the key information of the first request message is stored in the linked list from the head of the list according to the sending time of the first request message; The server sequentially queries the key information of the first request message in the linked list from the head of the list, and determines whether the difference between the sending time of the first request message and the current time is greater than the timeout threshold. If yes, then the first request message is used as the second request message, and the message log of the second request message is used to determine whether the second request message has received a response message; if not, then the second request message is timed out.

6. A timeout monitoring device, characterized in that, include: The writing module is used to determine key information of the request message, including the sending time of the request message; The writing module is also used to store the key information into a first-level cache; The first monitoring module is used to scan the first-level cache at a set frequency. If the first-level cache contains a first request message, the key information of the first request message is stored in the second-level cache. The first request message is a request message for which no response message has been received. The second monitoring module is used to scan the secondary cache and determine whether the second request message in the secondary cache has received a response message through the message log. If not, it is determined that the second request message has timed out. The second request message is a request message in which the difference between the sending time and the current time is greater than the timeout threshold.

7. The apparatus as claimed in claim 6, characterized in that, The writing module is also used for: If a response message is received, the corresponding request message is searched in the first-level cache. If a request message corresponding to the response message is found, the key information of the request message corresponding to the response message is marked as responded.

8. The apparatus as claimed in claim 6, characterized in that, The writing module is specifically used for: Determine the write time for storing the request message in the first-level cache; Based on the result of taking the remainder of the write time of the request message modulo N, the key information of the request message is stored in the corresponding memory area. The memory of the first-level cache is pre-divided into N memory areas, where the size of each memory area is the estimated number of transactions per unit time multiplied by the data segment size of the key information.

9. The apparatus as claimed in claim 8, characterized in that, The first monitoring module is specifically used for The server creates N monitoring processes, each monitoring process corresponds to a memory region, and each monitoring process scans the corresponding memory region at the set frequency.

10. The apparatus as claimed in claim 6, characterized in that, The second monitoring module is specifically used for: The secondary cache uses a linked list, and the key information of the first request message is stored in the linked list from the head of the list according to the sending time of the first request message; The key information of the first request message in the linked list is queried sequentially from the head of the list to determine whether the difference between the sending time of the first request message and the current time is greater than the timeout threshold. If so, the first request message is used as the second request message, and the message log of the second request message is used to determine whether the second request message has received a response message. If not, then the second request message will time out.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing the computer to perform the method according to any one of claims 1 to 5.

12. A computing device, characterized in that, include: Memory, used to store program instructions; The processor is configured to call program instructions stored in the memory and execute them according to the obtained program. The method as described in any one of claims 1 to 5.

13. A computer program product, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 1 to 5.