CN109560976B - Message delay monitoring method and device - Google Patents

Message delay monitoring method and device Download PDF

Info

Publication number
CN109560976B
CN109560976B CN201710873078.8A CN201710873078A CN109560976B CN 109560976 B CN109560976 B CN 109560976B CN 201710873078 A CN201710873078 A CN 201710873078A CN 109560976 B CN109560976 B CN 109560976B
Authority
CN
China
Prior art keywords
message
delay
data structure
timer
message delay
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710873078.8A
Other languages
Chinese (zh)
Other versions
CN109560976A (en
Inventor
王昌坤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201710873078.8A priority Critical patent/CN109560976B/en
Publication of CN109560976A publication Critical patent/CN109560976A/en
Application granted granted Critical
Publication of CN109560976B publication Critical patent/CN109560976B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0852Delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0604Management of faults, events, alarms or notifications using filtering, e.g. reduction of information by using priority, element types, position or time
    • H04L41/0622Management of faults, events, alarms or notifications using filtering, e.g. reduction of information by using priority, element types, position or time based on time
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0631Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0681Configuration of triggering conditions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method and a device for monitoring message delay, which relate to the technical field of computers and mainly aim to reduce the complexity of program development of research personnel, and the main technical scheme of the invention is as follows: acquiring message delay time; setting a data structure of a timer to be a Boolean type data structure when the message delay time reaches a preset time threshold; starting a timer of a Boolean data structure, and judging whether the message delay time reaches a preset time interval or not through the timer of the Boolean data structure; if yes, message alarm information is sent to the monitoring system. The invention mainly monitors message delay.

Description

Message delay monitoring method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for monitoring message delay.
Background
In real-time system monitoring, message delay is often monitored, and there may be many situations, such as network failure, resulting in message not being sent and message sending being blocked. If it is normal that a small amount of message delay occurs, the short delay and the small amount are negligible; if a certain message delay is monitored, alarming information needs to be sent to operation and maintenance personnel immediately so that the operation and maintenance personnel can process the delayed message.
In the real-time monitoring system, the magnitude of the message is very large, so that the alarm information can be sent to the operation and maintenance personnel very frequently only according to the magnitude of the message, in the prior art, time limitation is added while the alarm information is sent, after the alarm information is sent to the operation and maintenance personnel for the first time, a timer is set, when the alarm information is sent to the operation and maintenance personnel for the second time, whether a preset time interval is reached is checked according to the timer, and if the time interval is reached, the alarm information is sent to the operation and maintenance personnel.
Although the frequency of sending alarm information to the operation and maintenance personnel can be controlled by setting the timer, the setting of the timer can correspondingly increase the complexity of program writing, and more timers need to be designed in an operation area, so that more judgment operations are added, and the complexity of program development of research personnel is increased.
Disclosure of Invention
In view of this, the present invention provides a method and an apparatus for monitoring message delay, and mainly aims to reduce the complexity of program development for developers.
In order to solve the above problems, the present invention mainly provides the following technical solutions:
in one aspect, an embodiment of the present invention provides a method for monitoring message delay, including:
acquiring message delay time;
starting a timer of a Boolean data structure when the message delay time reaches a preset time threshold;
judging whether the message delay time reaches a preset time interval or not through a timer of the Boolean data structure;
if yes, message alarm information is sent to the monitoring system.
Further, the time for delaying the acquisition message includes:
when a delay processing request is received, determining a delay type corresponding to message delay according to the delay processing request;
and obtaining the message delay time according to the delay types corresponding to different message delays.
Further, the obtaining of the message delay time according to the delay types corresponding to the different message delays includes:
when the delay type corresponding to the message delay is routing delay, a data packet is requested to a target IP address through a network management tool, and the message delay time is acquired;
and when the delay type corresponding to the message delay is queuing delay, acquiring the message delay time by calculating the difference between the sending time and the return time of the data packet.
Further, the determining, by the timer of the boolean data structure, whether the message delay time reaches a preset time interval includes:
initializing an attribute value corresponding to a timer of a Boolean data structure;
setting an attribute value corresponding to a timer for changing the Boolean data structure when a preset time interval is reached;
and judging whether the message delay time reaches a preset time interval or not by monitoring the attribute value corresponding to the timer of the Boolean data structure.
Further, if yes, the sending of the message alarm information to the monitoring system includes:
and if the attribute value corresponding to the timer of the Boolean data structure is changed, judging that the delay time of the message reaches a preset time interval, resetting the attribute value corresponding to the timer of the Boolean data structure, and sending message alarm information to a monitoring system.
In order to achieve the above object, according to another aspect of the present invention, there is provided a storage medium including a stored program, wherein when the program runs, a device on which the storage medium is located is controlled to execute the message delay monitoring method described above.
In order to achieve the above object, according to another aspect of the present invention, there is provided a processor for executing a program, wherein the program executes the message delay monitoring method described above.
On the other hand, an embodiment of the present invention further provides a device for monitoring message delay, including:
an acquisition unit configured to acquire a time when a message is delayed;
the setting unit is used for starting a timer of a Boolean data structure after the time of the message delay reaches a preset time threshold;
the judging unit is used for judging whether the message delay time reaches a preset time interval or not through a timer of the Boolean data structure;
and the sending unit is used for sending message alarm information to the monitoring system if the message delay time reaches a preset time interval.
Further, the acquisition unit includes:
the determining module is used for determining a delay type corresponding to message delay according to the delay processing request when the delay processing request is received;
and the acquisition module is used for acquiring the message delay time according to the delay types corresponding to different message delays.
Further, the obtaining module is specifically configured to, when the delay type corresponding to the message delay is a routing delay, request a data packet to a target IP address through a network management tool, and obtain a message delay time;
the obtaining module is specifically configured to obtain the message delay time by calculating a difference between the sending time and the return time of the data packet when the delay type corresponding to the message delay is a queuing delay.
Further, the judging unit includes:
the initialization module is used for initializing the attribute value corresponding to the timer of the Boolean data structure;
the setting module is used for setting an attribute value corresponding to a timer for changing the Boolean data structure when a preset time interval is reached;
and the judging module is used for judging whether the message delay time reaches a preset time interval or not by monitoring the attribute value corresponding to the timer of the Boolean data structure.
Further, the sending unit is specifically configured to, if the attribute value corresponding to the timer of the boolean data structure is changed, determine that the message delay time reaches a preset time interval, reset the attribute value corresponding to the timer of the boolean data structure, and send message alarm information to the monitoring system.
By the technical scheme, the technical scheme provided by the embodiment of the invention at least has the following advantages:
according to the monitoring method and device for message delay, the data structure of the timer is set to be the Boolean data structure, so that after the timer of the Boolean data structure is started, message alarm information is sent to the monitoring system through the timer of the Boolean data structure according to the preset time interval, research and development personnel do not need to design more timers in an operation area, and the complexity of program development of the research and development personnel is reduced. Compared with the method for monitoring message delay by a direct timer in the prior art, the embodiment of the invention sets the data structure of the timer to be the Boolean type data structure, only the attribute corresponding to the Boolean type data structure needs to be judged in the timing process, the compiling of most middle codes related to the business part is omitted, more timers do not need to be designed, and the development complexity is reduced.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart of a message delay monitoring method according to an embodiment of the present invention;
fig. 2 is a flowchart of another message delay monitoring method according to an embodiment of the present invention;
fig. 3 is a block diagram of a message delay monitoring apparatus according to an embodiment of the present invention;
fig. 4 is a block diagram of another message delay monitoring apparatus according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
The embodiment of the invention provides a message delay monitoring method, as shown in fig. 1, the method sets a data structure of a timer to be a boolean data structure, and further judges whether the message delay time reaches a preset time interval according to the timer of the boolean data structure, so as to reduce the complexity of program development of research and development personnel, and the following specific steps are provided for the embodiment of the invention:
101. the time of message delay is obtained.
For the embodiment of the present invention, the message delay is mainly used to mean that the message is delayed for a period of time before being delivered to the client after being sent to the server, for example, the message is delayed for 3 seconds, or the message is delayed for a period of time before being received by the server after the client sends the message to the server, so that the client and the server cannot receive the message in real time.
The message delay time may be a round trip time for a data packet to be sent from the user's computer to the web server and then immediately returned from the web server to the user's computer. In popular terms, it is the time taken for data to pass from the computer to the computer. It is normal for message delays to occur in real-time monitoring systems, which can be ignored for short message delays and for small numbers of delayed messages, but which require immediate notification to the operation and maintenance personnel for processing if the number of delayed messages is large.
The embodiment of the invention can monitor the processing condition of the message in the system in real time by acquiring the message delay time, so as to conveniently find the condition of large number of delay messages and immediately send alarm information, thereby processing the delayed message.
102. And starting a timer of the Boolean data structure when the message delay time reaches a preset time threshold.
Because the message delay time may affect the number of delay messages, the longer the message delay time is, the more the number of delay messages is indicated, and conversely, the shorter the message delay time is, the less the number of delay messages is indicated, the more the number of delay messages is, the message blocking is caused, when a certain order of magnitude is reached, corresponding operation and maintenance personnel need to be notified to process in time, because the order of magnitude of messages in the real-time monitoring system is very large, and if the operation and maintenance personnel are frequently notified, unnecessary trouble is caused.
It should be noted that, messages in the real-time monitoring system will increase continuously with the passage of time, and in order to ensure that the magnitude of the delay messages is maintained at a low level, in the embodiment of the present invention, a timer of a boolean data structure is started to set a time interval for sending a notification, where the timer of the boolean data structure is a data structure with true and false attributes, and further, in the process of determining the time interval, only the service logic of the data structure itself is needed, and the determination logic is not needed to be used, thereby reducing the complexity of development.
103. And judging whether the message delay time reaches a preset time interval or not through a timer of the Boolean type data structure.
It should be noted that the preset time interval is usually a time interval set after the notification is sent to the operation and maintenance staff for the first time, if the time of message delay reaches the preset time interval again, the number of delayed messages is accumulated to a certain magnitude, the operation and maintenance staff needs to be notified again to send and process the messages, and if the time of message delay does not reach the preset time interval, the number of delayed messages is not accumulated to a certain magnitude, and the operation and maintenance staff does not need to be notified.
104. If yes, message alarm information is sent to the monitoring system.
If the message delay time reaches the preset time interval, the number of the delay messages is excessive, and if the delay messages are not processed in time, excessive delay messages are easily accumulated, so that message blocking is caused.
In the message delay monitoring method provided by the embodiment of the invention, the data structure of the timer is set to be the Boolean data structure, so that after the timer of the Boolean data structure is started, message alarm information is sent to the monitoring system according to the preset time interval by the timer of the Boolean data structure, research and development personnel are not required to design more timers in an operation area, and the complexity of program development of the research and development personnel is reduced. Compared with the method for monitoring message delay by a direct timer in the prior art, the embodiment of the invention sets the data structure of the timer to be the Boolean type data structure, only the attribute corresponding to the Boolean type data structure needs to be judged in the timing process, the compiling of most middle codes related to the business part is omitted, more timers do not need to be designed, and the development complexity is reduced.
In order to describe the message delay monitoring method proposed by the present invention in more detail, in particular to a step of determining whether the message delay time reaches a preset time interval by using a timer of a boolean data structure, an embodiment of the present invention further provides another message delay monitoring method, as shown in fig. 2, where the method includes the specific steps of:
201. and when a delay processing request is received, determining a delay type corresponding to the message delay according to the delay processing request.
The delay processing request is a delay processing request sent to the other side when the server or the client cannot send the message in time, the delay processing request may be due to various reasons, such as routing delay caused by network failure, or queuing delay caused by poor network state, and the message delay time corresponding to different delay types is different, and further the delay type corresponding to the message delay is determined according to the delay processing request, so that the client or the server can process the message delay caused by different delay types.
202. And obtaining the message delay time according to the delay types corresponding to different message delays.
For the embodiment of the invention, because the speed is very high in the message transmission process, the propagation time of the messages in the physical medium is almost negligible, but the processing time for forwarding the data packets at the router is not negligible. If a large amount of routing is needed in the transmission process, routing delay is generated, and when the delay type corresponding to the message delay is routing delay, a network management tool needs to request a data packet to a target IP address, wherein the network management tool can be a tool for testing the network link state, such as an Internet detection packet, the target IP address is a current message receiver, the network connection state between the current sender and the receiver is tested by requesting the data packet to the target IP address, and then the receiver returns the data packet to the sender, wherein the data packet comprises the current network connection state information, and further obtains the message delay time according to the current network connection state.
For the embodiment of the invention, because the speed is very high in the message transmission process, if the network connection state between the sender and the receiver is not good, the messages can be accumulated in the message queue and cannot be sent in real time, at the moment, queuing delay can be generated, and when the delay type corresponding to the message delay is the queuing delay, the message delay time can be further obtained according to the difference by calculating the difference between the sending time and the return time of the data packet.
203. And initializing attribute values corresponding to the timers of the Boolean data structure.
The boolean data structure corresponds to true and false attribute values, and is generally used to execute a decision logic according to an attribute return value.
204. And setting an attribute value corresponding to a timer for changing the Boolean data structure when a preset time interval is reached.
It should be noted that the preset time interval is usually a time interval set after the notification is sent to the operation and maintenance personnel for the first time, the attribute value corresponding to the timer for changing the boolean data structure when the preset time interval is reached is set, and if the attribute value corresponding to the timer for starting the boolean data structure is true, the attribute value corresponding to the timer for changing the boolean data structure when the preset time interval is reached is set to be false, so that the operation and maintenance personnel is notified again to send the processing after the message delay time reaches the preset time interval again, so as to avoid accumulating excessive delay messages, and ensure the timeliness of message processing.
205. And judging whether the message delay time reaches a preset time interval or not by monitoring the attribute value corresponding to the timer of the Boolean data structure.
For the embodiment of the invention, whether the attribute value corresponding to the timer of the Boolean data structure is changed or not is monitored, so that whether the message delay reaches the preset time interval or not is judged, if the message delay reaches the preset time interval, the message delay time is judged to reach the preset time interval, the number of the delay messages is excessive, if the delay messages are not processed in time, the excessive delay messages are easily accumulated, so that the messages are blocked, if the message delay time is not changed, the message delay time is judged not to reach the preset time interval, the number of the delay messages is not accumulated to a certain magnitude, and operation and maintenance personnel are not required to be notified.
206. And if the attribute value corresponding to the timer of the Boolean data structure is changed, judging that the delay time of the message reaches a preset time interval, resetting the attribute value corresponding to the timer of the Boolean data structure, and sending message alarm information to a monitoring system.
For the embodiment of the present invention, specific application scenarios may include, but are not limited to, implementation manners that, when a server side is in a routing connection problem, a client receives a delay processing request sent by the server side, then determines a delay type corresponding to a message delay as a routing delay according to the delay processing request, further requests a network connection state from the server side through an internet probe packet, calculates a message delay time, initializes an attribute value corresponding to a timer of a boolean data structure to true, starts the timer of the boolean data structure, sets an attribute value corresponding to the timer of the boolean data structure to false, sets an attribute value corresponding to a change of the boolean data structure every 5 minutes to true, and determines that the message delay time reaches a preset time interval when it is monitored that the attribute value corresponding to the timer of the boolean data structure becomes true, and resetting the attribute value corresponding to the timer of the Boolean data structure to be true, and sending message alarm information to the monitoring system.
In another message delay monitoring method provided by the embodiment of the invention, the data structure of the timer is set to be the boolean data structure, so that after the timer of the boolean data structure is started, the timer of the boolean data structure is used for sending message alarm information to the monitoring system according to the preset time interval, and research and development personnel are not required to design more timers in an operation area, thereby reducing the complexity of program development of the research and development personnel. Compared with the method for monitoring message delay by a direct timer in the prior art, the embodiment of the invention sets the data structure of the timer to be the Boolean type data structure, only the attribute corresponding to the Boolean type data structure needs to be judged in the timing process, the compiling of most middle codes related to the business part is omitted, more timers do not need to be designed, and the development complexity is reduced.
In order to achieve the above object, according to another aspect of the present invention, an embodiment of the present invention further provides a storage medium, where the storage medium includes a stored program, where the apparatus on which the storage medium is located is controlled to execute the above monitoring method for message delay when the program runs.
In order to achieve the above object, according to another aspect of the present invention, an embodiment of the present invention further provides a processor, where the processor is configured to execute a program, where the program executes the method for monitoring message delay described above.
Further, as an implementation of the method shown in fig. 1 and fig. 2, another embodiment of the present invention further provides a message delay monitoring apparatus. The embodiment of the apparatus corresponds to the embodiment of the method, and for convenience of reading, details in the embodiment of the apparatus are not repeated one by one, but it should be clear that the apparatus in the embodiment can correspondingly implement all the contents in the embodiment of the method. The device can reduce the complexity of the development of the program of the research and development personnel, and specifically as shown in fig. 3, the device comprises:
an obtaining unit 31, which may be configured to obtain a message delay time;
a setting unit 32, configured to start a timer of a boolean data structure after the message delay time reaches a preset time threshold;
a judging unit 33, configured to judge, by a timer of the boolean data structure, whether a time for message delay reaches a preset time interval;
and the sending unit 34 may be configured to send message alarm information to the monitoring system if the message delay time reaches a preset time interval.
The embodiment of the invention provides a message delay monitoring device, which is characterized in that a data structure of a timer is set to be a Boolean data structure, so that message alarm information is sent to a monitoring system according to a preset time interval by the timer of the Boolean data structure after the timer of the Boolean data structure is started, research and development personnel are not required to design more timers in an operation area, and the complexity of program development of the research and development personnel is reduced. Compared with the method for monitoring message delay by a direct timer in the prior art, the embodiment of the invention sets the data structure of the timer to be the Boolean type data structure, only the attribute corresponding to the Boolean type data structure needs to be judged in the timing process, the compiling of most middle codes related to the business part is omitted, more timers do not need to be designed, and the development complexity is reduced.
Further, as shown in fig. 4, the acquiring unit 31 includes:
the determining module 311 may be configured to determine, when a delay processing request is received, a delay type corresponding to a message delay according to the delay processing request;
the obtaining module 312 may be configured to obtain the message delay time according to the delay types corresponding to different message delays.
Further, the obtaining module 312 may be specifically configured to, when the delay type corresponding to the message delay is a routing delay, request a data packet to a target IP address through a network management tool, and obtain a message delay time;
the obtaining module 312 may be further configured to, when the delay type corresponding to the message delay is a queuing delay, obtain the message delay time by calculating a difference between the sending time and the returning time of the data packet.
Further, the judging unit 33 includes:
the initialization module 331 may be configured to initialize an attribute value corresponding to a timer of the boolean data structure;
a setting module 332, configured to set an attribute value corresponding to a timer that changes the boolean data structure when a preset time interval is reached;
the determining module 333 may be configured to determine whether the message delay time reaches a preset time interval by monitoring an attribute value corresponding to the timer of the boolean data structure.
Further, the sending unit 34 may be specifically configured to, if the attribute value corresponding to the timer of the boolean data structure is changed, determine that the message delay time reaches a preset time interval, reset the attribute value corresponding to the timer of the boolean data structure, and send message alarm information to the monitoring system.
For another monitoring device for message delay provided in the embodiment of the present invention, the data structure of the timer is set to be the boolean data structure, so that after the timer of the boolean data structure is started, the timer of the boolean data structure is used to send message alarm information to the monitoring system according to the preset time interval, and therefore, research and development personnel are not required to design more timers in the operation area, thereby reducing the complexity of program development of the research and development personnel. Compared with the method for monitoring message delay by a direct timer in the prior art, the embodiment of the invention sets the data structure of the timer to be the Boolean type data structure, only the attribute corresponding to the Boolean type data structure needs to be judged in the timing process, the compiling of most middle codes related to the business part is omitted, more timers do not need to be designed, and the development complexity is reduced.
The message delay monitoring device comprises a processor and a memory, wherein the acquiring unit 31, the setting unit 32, the judging unit 33, the sending unit 34 and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more, and the complexity of program development of a developer is reduced by adjusting kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a storage medium, on which a program is stored, which, when executed by a processor, implements the message delay monitoring method.
The embodiment of the invention provides a processor, which is used for running a program, wherein the monitoring method for message delay is executed when the program runs.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps:
a method of monitoring message delay, comprising: acquiring message delay time; starting a timer of a Boolean data structure when the message delay time reaches a preset time threshold; judging whether the message delay time reaches a preset time interval or not through a timer of the Boolean data structure; if yes, message alarm information is sent to the monitoring system.
Further, the time for delaying the acquisition message includes: when a delay processing request is received, determining a delay type corresponding to message delay according to the delay processing request; and obtaining the message delay time according to the delay types corresponding to different message delays.
Further, the obtaining of the message delay time according to the delay types corresponding to the different message delays includes: when the delay type corresponding to the message delay is routing delay, a data packet is requested to a target IP address through a network management tool, and the message delay time is acquired; and when the delay type corresponding to the message delay is queuing delay, acquiring the message delay time by calculating the difference between the sending time and the return time of the data packet.
Further, the determining, by the timer of the boolean data structure, whether the message delay time reaches a preset time interval includes: initializing an attribute value corresponding to a timer of a Boolean data structure; setting an attribute value corresponding to a timer for changing the Boolean data structure when a preset time interval is reached; and judging whether the message delay time reaches a preset time interval or not by monitoring the attribute value corresponding to the timer of the Boolean data structure.
Further, if yes, the sending of the message alarm information to the monitoring system includes: and if the attribute value corresponding to the timer of the Boolean data structure is changed, judging that the delay time of the message reaches a preset time interval, resetting the attribute value corresponding to the timer of the Boolean data structure, and sending message alarm information to a monitoring system.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform program code for initializing the following method steps when executed on a data processing device: acquiring message delay time; setting a data structure of a timer to be a Boolean type data structure when the message delay time reaches a preset time threshold; starting a timer of a Boolean data structure, and judging whether the message delay time reaches a preset time interval or not through the timer of the Boolean data structure; if yes, message alarm information is sent to the monitoring system.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may 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 the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
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 the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (6)

1. A method for monitoring message delay, comprising:
acquiring message delay time; wherein the message is delayed by an accumulated delay time of a plurality of messages;
starting a timer of a Boolean data structure when the message delay time reaches a preset time threshold;
judging whether the message delay time reaches a preset time interval or not through a timer of the Boolean data structure;
if yes, sending message alarm information to a monitoring system;
the determining, by the timer of the boolean data structure, whether the message delay time reaches a preset time interval includes:
initializing an attribute value corresponding to a timer of a Boolean data structure;
setting an attribute value corresponding to a timer for changing the Boolean data structure when a preset time interval is reached;
judging whether the message delay time reaches a preset time interval or not by monitoring the attribute value corresponding to the timer of the Boolean data structure;
if yes, sending message alarm information to the monitoring system comprises the following steps:
if the attribute value corresponding to the timer of the Boolean data structure is changed, judging that the delay time of the message reaches a preset time interval, resetting the attribute value corresponding to the timer of the Boolean data structure, and sending message alarm information to a monitoring system;
the time for obtaining the message delay comprises:
when a delay processing request is received, determining a delay type corresponding to message delay according to the delay processing request;
and obtaining the message delay time according to the delay types corresponding to different message delays.
2. The method of claim 1, wherein obtaining the message delay time according to the delay types corresponding to different message delays comprises:
when the delay type corresponding to the message delay is routing delay, a data packet is requested to a target IP address through a network management tool, and the message delay time is acquired;
and when the delay type corresponding to the message delay is queuing delay, acquiring the message delay time by calculating the difference between the sending time and the return time of the data packet.
3. A message delay monitoring apparatus, characterized in that,
an acquisition unit configured to acquire a time when a message is delayed; wherein the message is delayed by an accumulated delay time of a plurality of messages;
the setting unit is used for starting a timer of a Boolean data structure after the time of the message delay reaches a preset time threshold;
the judging unit is used for judging whether the message delay time reaches a preset time interval or not through a timer of the Boolean data structure;
the sending unit is used for sending message alarm information to the monitoring system if the message delay time reaches a preset time interval;
the judging unit includes:
the initialization module is used for initializing the attribute value corresponding to the timer of the Boolean data structure;
the setting module is used for setting an attribute value corresponding to a timer for changing the Boolean data structure when a preset time interval is reached;
the judging module is used for judging whether the message delay time reaches a preset time interval or not by monitoring the attribute value corresponding to the timer of the Boolean data structure;
the sending unit is specifically configured to, if the attribute value corresponding to the timer of the boolean data structure is changed, determine that the message delay time reaches a preset time interval, reset the attribute value corresponding to the timer of the boolean data structure, and send message alarm information to the monitoring system;
the acquisition unit includes:
the determining module is used for determining a delay type corresponding to message delay according to the delay processing request when the delay processing request is received;
and the acquisition module is used for acquiring the message delay time according to the delay types corresponding to different message delays.
4. The apparatus of claim 3,
the obtaining module is specifically configured to, when the delay type corresponding to the message delay is a routing delay, request a data packet to a target IP address through a network management tool, and obtain a message delay time;
the obtaining module is specifically configured to obtain the message delay time by calculating a difference between the sending time and the return time of the data packet when the delay type corresponding to the message delay is a queuing delay.
5. A storage medium, comprising a stored program, wherein when the program is executed, a device in which the storage medium is located is controlled to execute the message delay monitoring method according to any one of claims 1 to 2.
6. A processor, characterized in that the processor is configured to run a program, wherein the program is configured to perform the message delay monitoring method according to any one of claims 1 to 2 when running.
CN201710873078.8A 2017-09-25 2017-09-25 Message delay monitoring method and device Active CN109560976B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710873078.8A CN109560976B (en) 2017-09-25 2017-09-25 Message delay monitoring method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710873078.8A CN109560976B (en) 2017-09-25 2017-09-25 Message delay monitoring method and device

Publications (2)

Publication Number Publication Date
CN109560976A CN109560976A (en) 2019-04-02
CN109560976B true CN109560976B (en) 2021-06-08

Family

ID=65863082

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710873078.8A Active CN109560976B (en) 2017-09-25 2017-09-25 Message delay monitoring method and device

Country Status (1)

Country Link
CN (1) CN109560976B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110187980B (en) * 2019-04-19 2021-11-19 北京三快在线科技有限公司 Message queue monitoring method and device, electronic equipment and readable storage medium
CN112395103B (en) * 2020-11-02 2022-09-13 天津五八到家货运服务有限公司 Method and device for sending delay message and storage medium
CN112347014B (en) * 2020-11-30 2022-04-26 安徽信息工程学院 Optimal time sequence control method and system for centralized data communication
CN113595814A (en) * 2021-07-06 2021-11-02 深圳Tcl新技术有限公司 Message delay detection method and device, electronic equipment and storage medium
CN115174346B (en) * 2022-09-02 2023-03-28 平安银行股份有限公司 Message queue-based delay alarm method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101437301B (en) * 2008-12-04 2011-02-09 华为技术有限公司 Method, equipment and communication system for transmitting message
US20100185411A1 (en) * 2009-01-16 2010-07-22 Randall Richard Pfeiffer Object monitor
US9429962B2 (en) * 2010-11-19 2016-08-30 Google Inc. Auto-configuring time-of day for building control unit
CN205283611U (en) * 2015-12-23 2016-06-01 武汉哒呤科技有限公司 End and server end news information will be moved and synchronous device will be carried out
CN106130816B (en) * 2016-06-24 2018-12-28 腾讯科技(深圳)有限公司 A kind of content distributing network monitoring method, monitoring server and system

Also Published As

Publication number Publication date
CN109560976A (en) 2019-04-02

Similar Documents

Publication Publication Date Title
CN109560976B (en) Message delay monitoring method and device
US10469512B1 (en) Optimized resource allocation for virtual machines within a malware content detection system
CN108075934B (en) Network quality monitoring method, device and system
CN110888783A (en) Monitoring method and device of micro-service system and electronic equipment
CN111258851B (en) Cluster alarm method, device, setting and storage medium
KR102134547B1 (en) Risk identification method, risk identification device, and cloud risk identification device and system
US20210058811A1 (en) Method and apparatus for detecting time series data
US10305974B2 (en) Ranking system
CN113067875B (en) Access method, device and equipment based on dynamic flow control of micro-service gateway
CN109597800B (en) Log distribution method and device
CN111147313B (en) Message abnormity monitoring method and device, storage medium and electronic equipment
US20160094392A1 (en) Evaluating Configuration Changes Based on Aggregate Activity Level
CN108920326B (en) Method and device for determining time-consuming abnormity of system and electronic equipment
CN107819754B (en) Anti-hijacking method, monitoring server, terminal and system
CN111478792B (en) Cutover information processing method, system and device
CN110808967B (en) Detection method for challenging black hole attack and related device
CN108804152B (en) Method and device for adjusting configuration parameters
CN108390770B (en) Information generation method and device and server
CN108880920B (en) Cloud service management method and device and electronic equipment
CN115051867A (en) Detection method and device for illegal external connection behaviors, electronic equipment and medium
CN112612578A (en) Virtual machine monitoring method and device
US20180278645A1 (en) Software evaluation method and software evaluation device
CN114500454B (en) Method and device for detecting geographic position change of electronic equipment
US11176011B2 (en) Apparatus and method for transmitting fuzzing data for one-way protocol software fuzzing
EP3113024A1 (en) Network element monitoring

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing

Applicant after: Beijing Guoshuang Technology Co.,Ltd.

Address before: 100086 Beijing city Haidian District Shuangyushu Area No. 76 Zhichun Road cuigongfandian 8 layer A

Applicant before: Beijing Guoshuang Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant