Monitoring method and device and service monitoring processing system
Through the design of the three -level monitoring architecture, including the monitoring process, nodes, and rules, the problem of poor flexibility and scalability of the monitoring system in existing technologies, realizing high flexibility and strong scalability monitoring systems, and through the distributed architecture Optimized system performance.
Patent Information
- Application Number
- CN202310896949.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-20
- Publication Date
- 2025-01-21
AI Technical Summary
The existing technology adopts hard-coded methods in monitoring business systems such as order systems, which have poor flexibility and are difficult to achieve horizontal expansion of the monitoring system, which has performance bottlenecks.
A three-level monitoring architecture is designed, including monitoring processes, monitoring nodes and monitoring rules. It interacts with the business system through message queues, dynamically determines the target monitoring processes and nodes, and processes business objects according to the monitoring rules.
A monitoring system with high flexibility and strong scalability is implemented, which can create, delete, modify, and query monitoring processes, nodes and rules as needed, avoids the impact of batch deletion of historical records on system performance, and realizes load through distributed architecture balanced.
Smart Images

Figure CN119336566A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent supply chain, and in particular to a monitoring method and device and a business monitoring processing system. Background Art
[0002] At present, the monitoring of business systems such as order systems generally adopts hard coding, which is very inflexible and has poor scalability. Faced with a large amount of historical monitoring data, batch deletion will be performed after the corresponding monitoring cycle is completed, which has a certain impact on system performance and stability. In addition, the current monitoring system generally adopts a single-machine multi-threaded method, which can only rely on vertical expansion of machine configuration to alleviate load pressure, and it is difficult to achieve horizontal expansion, which has performance bottlenecks. Summary of the invention
[0003] In view of this, the embodiments of the present invention provide a monitoring method and device as well as a business monitoring processing system, which can realize a highly flexible and highly scalable monitoring system by designing a three-level monitoring architecture of monitoring process, monitoring node, and monitoring rule.
[0004] To achieve the above objective, according to one aspect of the present invention, a monitoring method is provided.
[0005] The monitoring method of the embodiment of the present invention is executed by a pre-established monitoring system, which is pre-configured with at least one monitoring process, each monitoring process has multiple bound monitoring rules and monitoring nodes corresponding to business nodes, and the monitoring rules include trigger conditions and corresponding execution actions; the method includes: receiving a monitoring message reported by the business system, which includes a business object identifier and monitoring content data, and determining from the monitoring message a target monitoring process corresponding to the business object and a target monitoring node in the target monitoring process; when it is determined that the target monitoring node is bound to the monitoring rule, obtaining the target monitoring rule bound to the target monitoring node; when the monitoring content data meets the trigger condition of any target monitoring rule, processing the business object based on the execution action in the target monitoring rule.
[0006] Optionally, determining the target monitoring process corresponding to the business object and the target monitoring node in the target monitoring process from the monitoring message includes: when the monitoring message contains a specific business identifier and a business node identifier, using a predetermined mapping relationship between the specific business and the monitoring process to determine the target monitoring process corresponding to the specific business identifier, and using a predetermined mapping relationship between the business node and the monitoring node to determine the target monitoring node corresponding to the business node identifier; when the monitoring message contains a monitoring process identifier and a monitoring node identifier, using the monitoring process identifier to determine the corresponding target monitoring process, and using the monitoring node identifier to determine the corresponding target monitoring node.
[0007] Optionally, each monitoring node of the same monitoring process has a unique sequence number, and the sequence number forms an ordered queue along with the flow order of each monitoring node; and the method further includes: after determining the target monitoring node, if it is determined that the monitoring system has pre-stored a target monitoring message, then detecting whether the sequence number of the target monitoring node is after the monitoring node sequence number in the target monitoring message; if so, deleting the target monitoring message, and storing the monitoring message corresponding to the target monitoring node as a monitoring record under the corresponding business object identifier; wherein the target monitoring message and the monitoring message corresponding to the target monitoring node have the same business object identifier; if it is determined that the target monitoring message is not stored in the monitoring system, then storing the monitoring message corresponding to the target monitoring node as a monitoring record under the corresponding business object identifier.
[0008] Optionally, the method further includes: after determining the target monitoring node, if it is determined that the sequence number of the target monitoring node is equal to the sequence number of the monitoring node in the pre-stored target monitoring message or is before the sequence number, the monitoring message corresponding to the target monitoring node is discarded.
[0009] Optionally, the monitoring node having a sequence number that is at the tail position of the queue is the end node; and the method further includes: after determining the target monitoring node, judging whether the target monitoring node is the end node according to the sequence number of the target monitoring node; if so, deleting the pre-stored monitoring record under the corresponding business object identifier.
[0010] Optionally, processing the business object based on the execution action in the target monitoring rule includes: sending an exception message containing the business object identifier and the execution action in the target monitoring rule to a pre-established management platform.
[0011] Optionally, the monitoring node has a status value indicating whether it is currently available; and the method further includes: determining the currently available monitoring node based on the status value, and obtaining the total number of monitoring records in the currently available monitoring node; dividing the total number of monitoring records by a preset single-threaded processing data volume to obtain the total number of threads to be created, and dividing the total number of threads to be created by the number of hosts of the monitoring system to obtain the number of threads to be created for each host; creating threads on each host according to the number of threads to be created, and allocating monitoring records to each thread according to the single-threaded processing data volume.
[0012] Optionally, the execution action includes at least one of the following: sending a message, an alarm, deleting data; the monitoring process includes at least one of the following attributes: business domain, process ID, process name, process description information, process status; the monitoring node further includes at least one of the following attributes: process ID, node name; the monitoring rule further includes at least one of the following attributes: node ID, rule ID, rule name, rule execution cycle, notification method, rule status; the monitoring message further includes at least one of the following data: business domain, business type, timestamp.
[0013] To achieve the above objective, according to another aspect of the present invention, a monitoring device is provided.
[0014] The monitoring device of an embodiment of the present invention is set in a pre-established monitoring system, which is pre-configured with at least one monitoring process, each monitoring process has multiple bound monitoring rules and monitoring nodes corresponding to business nodes, and the monitoring rules include trigger conditions and corresponding execution actions; the device may include: a receiving and parsing unit, which is used to receive a monitoring message reported by the business system and containing a business object identifier and monitoring content data, and determine the target monitoring process corresponding to the business object and the target monitoring node in the target monitoring process from the monitoring message; a processing unit, which is used to: when it is determined that the target monitoring node is bound to the monitoring rule, obtain the target monitoring rule bound to the target monitoring node; when the monitoring content data meets the trigger condition of any target monitoring rule, process the business object based on the execution action in the target monitoring rule.
[0015] To achieve the above objective, according to another aspect of the present invention, a service monitoring and processing system is provided.
[0016] The business monitoring processing system of an embodiment of the present invention includes a business system and a monitoring system that interact through a message queue; the monitoring system is pre-configured with at least one monitoring process, each monitoring process has multiple bound monitoring rules and monitoring nodes corresponding to business nodes, and the monitoring rules include trigger conditions and corresponding execution actions; the business system reports a monitoring message containing a business object identifier and monitoring content data to the monitoring system; the monitoring system determines the target monitoring process corresponding to the business object and the target monitoring node in the target monitoring process from the received monitoring message; the monitoring system determines whether the target monitoring node is bound to the monitoring rule; if bound, the monitoring system obtains the target monitoring rule bound to the target monitoring node, and when it is determined that the monitoring content data meets the trigger condition of any target monitoring rule, processes the business object based on the execution action in the target monitoring rule.
[0017] To achieve the above objective, according to another aspect of the present invention, an electronic device is provided.
[0018] An electronic device of the present invention comprises: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the monitoring method provided by the present invention.
[0019] To achieve the above objective, according to yet another aspect of the present invention, a computer-readable storage medium is provided.
[0020] A computer-readable storage medium of the present invention stores a computer program, which implements the monitoring method provided by the present invention when executed by a processor.
[0021] According to the technical solution of the present invention, the embodiments of the above invention have the following advantages or beneficial effects:
[0022] The monitoring system of the embodiment of the present invention adopts a three-level monitoring architecture including monitoring process, monitoring node and monitoring rules. The monitoring process corresponds to a specific business, the monitoring node corresponds to the business node, and the monitoring rule is bound to the monitoring node. The monitoring system interacts with the business system through a message queue. When a business object (such as an order) flows to a business node, the business system reports a monitoring message to the monitoring system, and the monitoring system determines the corresponding monitoring process and the monitoring node in the monitoring process, and processes the corresponding business object according to the corresponding execution action when judging that the monitoring content data in the monitoring message meets the triggering condition of any monitoring rule bound to the monitoring node, thereby realizing the full process monitoring and timely disposal of each specific business and each business object, and each monitoring process, monitoring node and monitoring rule can perform operations such as creation, deletion, modification, and query as needed, with high flexibility and scalability. In addition, only the latest record of the same business object is persisted in the monitoring system, and the historical record is deleted when the latest record is obtained, and any monitoring message is associated with the last node (i.e., the end node) of the monitoring process, so as to clear this record, thereby realizing the automatic clearing of a small number of historical records after the completion of its monitoring cycle, avoiding the impact of batch deletion of a large number of historical records on system performance in the prior art. In addition, a corresponding sequence number is set for each monitoring node of the same monitoring process, and the flow order of different monitoring nodes can be distinguished from the sequence number, so that when a monitoring message with an incorrect sequence number (such as a repeated sequence number or a previous sequence number) is received, it is discarded to avoid repeated consumption of monitoring messages or errors caused by first send last arrive or last send first arrive. Finally, the embodiment of the present invention adopts a horizontally scalable distributed system architecture, and determines the number of threads of each host according to the total number of monitoring records to be processed, the number of monitoring system hosts, and the amount of data processed by a single thread, and then performs task allocation to ensure load balancing of each host.
[0023] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0025] Figure 1 Schematic diagram of the main steps of the monitoring method in an embodiment of the present invention;
[0026] Figure 2 is a schematic diagram of the architecture of a business monitoring and processing system in an embodiment of the present invention;
[0027] Figure 3 is a schematic diagram of a three-level monitoring architecture according to an embodiment of the present invention;
[0028] Figure 4 is a schematic diagram of a distributed framework of an embodiment of the present invention;
[0029] Figure 5 It is a schematic diagram of components of a monitoring device in an embodiment of the present invention;
[0030] Figure 6 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
[0031] Figure 7 It is a schematic diagram of the structure of an electronic device used to implement the monitoring method in the embodiment of the present invention. DETAILED DESCRIPTION
[0032] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0033] It should be pointed out that the embodiments of the present invention and the technical features therein may be combined with each other without conflict.
[0034] Figure 1 1 is a schematic diagram of main steps of a monitoring method according to an embodiment of the present invention, and the monitoring method is executed by a monitoring system.
[0035] In the technical solution of the present invention, the monitoring system is pre-configured with at least one monitoring process, and the monitoring process can correspond to a specific business (such as an order business). In actual applications, a corresponding monitoring process can be formulated for a specific business to perform monitoring and abnormal handling on the specific business. The monitoring process includes at least one of the following attributes: the business domain to which it belongs, the process identifier, the process name, the process description information, and the process status. Among them, multiple monitoring processes can be created under one business domain, and the attribute value of the process status can include currently available and currently unavailable.
[0036] Each monitoring process has multiple monitoring rules bound to it and monitoring nodes corresponding to business nodes. For example, the order business has four business nodes: receiving orders, returning data, sending goods, and delivering goods. Each business node can correspond to a monitoring node, such as the four monitoring nodes of receiving orders, returning data, sending goods, and delivering goods. These four monitoring nodes belong to the order monitoring process corresponding to the order business.
[0037] Optionally, you can configure monitoring rules for all monitoring nodes of the same monitoring process, or you can configure monitoring rules for some monitoring nodes of the same monitoring process. Continuing with the above example, you can configure monitoring rules for the four monitoring nodes of the order receiving, return, shipment, and delivery in advance, and configure the end node at the end of the order monitoring process. No monitoring rules can be configured for the end node.
[0038] It can be seen that the switching of each monitoring node corresponding to the same business object (business object refers to the target of monitoring, such as a specific order, etc.) of the same monitoring process has a fixed flow order, such as order receiving, return transmission, shipment, distribution, and end. Therefore, a sequence number can be configured for each monitoring node to indicate this order. The sequence numbers of each monitoring node in the same monitoring process are different from each other, and each sequence number forms an ordered queue. The order from the head to the end of the queue is the above flow order. In the above example, the queue formed by the sequence number of each monitoring node is: order receiving node sequence number, return node sequence number, shipment node sequence number, distribution node sequence number, and end node sequence number. If the sequence number of monitoring node 1 is before the sequence number of monitoring node 2 (that is, the sequence number of monitoring node 2 is after the sequence number of monitoring node 1), it means that monitoring node 1 is the previous node of monitoring node 2 on the time axis. Exemplarily, the above sequence number can be used as a positive integer that increases in sequence. For example, the sequence numbers of the five monitoring nodes in the above example are 1, 2, 3, 4, and 5, respectively. The smaller the sequence number is, the node that is relatively in front, and the larger the sequence number is, the node that is relatively behind.
[0039] In addition to the sequence number and the identifier, the monitoring node may also include at least one of the following attributes: a process identifier, a node name, a node status, etc. The attribute value of the node status may include currently available and currently unavailable.
[0040] Each monitoring rule may include a trigger condition and a corresponding execution action. The trigger condition may be represented by a rule expression, and the execution action may include sending a message, issuing an alarm, deleting data, etc. In particular, a monitoring rule whose execution action is to delete data is an end rule, which automatically deletes all or part of the data currently recorded when the trigger condition is met. Based on the end rule, automatic data clearing at a specific time can be achieved. The monitoring rule may also include at least one of the following attributes: the node identifier, the rule identifier, the rule name, the rule execution cycle, the notification method (such as the topic of the message), and the rule status (currently available or currently unavailable).
[0041] The above monitoring processes, monitoring nodes, monitoring rules and their specific attributes and attribute values can be configured as needed, and can also be created, deleted, modified, and queried as needed, thereby realizing a configurable and extensible monitoring architecture. The three-level monitoring architecture including monitoring processes, monitoring nodes, and monitoring rules can be found in Figure 3 .
[0042] like Figure 1 As shown, the monitoring method performed by the monitoring system in the embodiment of the present invention can be specifically performed according to the following steps:
[0043] Step S101: receiving a monitoring message reported by a business system and including a business object identifier and monitoring content data, and determining a target monitoring process corresponding to the business object and a target monitoring node in the target monitoring process from the monitoring message.
[0044] In the embodiment of the present invention, the business system and the monitoring system interact through an asynchronous communication mechanism based on a message queue, see Figure 2 . The monitoring message reported by the business system to the monitoring system contains the corresponding business object identifier and monitoring content data, and can also indicate the target monitoring process corresponding to the business object and the target monitoring node in the target monitoring process. Among them, the monitoring content data refers to the relevant data (such as business data, statistical data, etc.) used to compare with the trigger conditions in the monitoring rules. The above "indication" refers to the target monitoring process and target monitoring node, that is, the monitoring message and the monitoring process and monitoring node corresponding to the corresponding business object that can be directly obtained or indirectly inferred or calculated.
[0045] In actual applications, if the monitoring message contains a specific business identifier and a business node identifier, the monitoring system uses a predetermined mapping relationship between a specific business and a monitoring process to determine the target monitoring process corresponding to the specific business identifier, and uses a predetermined mapping relationship between a business node and a monitoring node to determine the target monitoring node corresponding to the business node identifier. If the monitoring message contains a monitoring process identifier and a monitoring node identifier, the monitoring system uses the monitoring process identifier to determine the corresponding target monitoring process, and uses the monitoring node identifier to determine the corresponding target monitoring node, thereby determining the target monitoring process and the target monitoring node. Exemplarily, the above specific business identifier may exist in the form of a prefix in the business node identifier data of the monitoring message, and the above monitoring process identifier may exist in the form of a prefix in the monitoring node identifier data of the monitoring message.
[0046] In a specific scenario, the monitoring message may also include at least one of the following data: business domain, tenant identifier, business identity, business type, business scenario, and timestamp, to achieve specific business purposes.
[0047] After determining the target monitoring node, if the monitoring system determines that the target monitoring message is pre-stored locally (i.e., the historical monitoring message corresponding to the same business object as the received monitoring message), then detect whether the sequence number of the target monitoring node is after the sequence number of the monitoring node in the target monitoring message (before and after refer to the time relationship in the above queue); if so, it means that the target monitoring node is the latter node, which is a normal situation for node transfer. At this time, the monitoring system deletes the target monitoring message and stores the monitoring message corresponding to the target monitoring node as a monitoring record under the corresponding business object identifier. If the monitoring system determines that the target monitoring message is not stored locally, it means that the currently received monitoring message is the first monitoring message under the name of the corresponding business object. At this time, the monitoring system stores the monitoring message corresponding to the target monitoring node as a monitoring record under the corresponding business object identifier. In this way, the automatic coverage of historical data by current data is achieved, so that the monitoring system can only store at most one monitoring message of the same business object at any time, that is, the monitoring system can only store at most one monitoring message of the same business object at any time. The monitoring message of the monitoring node.
[0048] After determining the target monitoring node, if the monitoring system determines that the target monitoring message is pre-stored locally, and detects that the sequence number of the target monitoring node is before or equal to the sequence number of the monitoring node in the target monitoring message, it means that the target monitoring node is the previous node or the same node. This is an abnormal situation where the monitoring message is sent first and arrives last, sent last and arrives first, or consumed repeatedly. At this time, the monitoring message corresponding to the target monitoring node can be discarded, which can avoid system errors caused by abnormal monitoring messages.
[0049] Step S102: when determining the target monitoring node is bound to a monitoring rule, obtain the target monitoring rule bound to the target monitoring node; when the monitoring content data meets the triggering condition of any target monitoring rule, process the business object based on the execution action in the target monitoring rule.
[0050] In this step, the monitoring system first determines whether the target monitoring node is bound to a monitoring rule. In one embodiment, the end node is generally not bound to a monitoring rule, while the non-end node is generally bound to a monitoring rule. When the monitoring system determines that the target monitoring node is bound to a monitoring rule, it obtains the target monitoring rule bound to the target monitoring node, and determines whether the monitoring content data in the monitoring message meets any target monitoring rule; if so, the business object is processed based on the execution action in the target monitoring rule; if not, the current process is terminated.
[0051] As a preferred solution, the monitoring system can also interact with the management center through a message queue, and the management center is used to process the abnormal situations reported by the monitoring system. Then, the above-mentioned method of processing business objects can be: the monitoring system sends an abnormal message containing the business object identifier and the execution action in the target monitoring rule to the management platform, so that the management platform operates the corresponding business object based on the execution action in the abnormal message. The abnormal message can also include other data such as the monitoring process identifier, the monitoring node identifier, and the triggered monitoring rule identifier.
[0052] In addition, if the monitoring system determines that the target monitoring node is an end node according to the sequence number of the target monitoring node, the monitoring record under the corresponding business object identifier stored in advance is deleted, thereby completing the life cycle of the monitoring record. The way to determine the end node can be to detect whether the sequence number of the target monitoring node is the last known node sequence number.
[0053] Through the above automatic overwriting mechanism and the deletion mechanism based on the end node and the end rule, a small amount of historical records are automatically cleared after their monitoring cycle is completed, avoiding the impact of batch deletion of a large number of historical records on system performance in the prior art.
[0054] In the embodiment of the present invention, a distributed framework capable of horizontal expansion is used to establish a monitoring system, and the monitoring system needs to achieve load balancing of each host. Figure 4 , each host needs to be allocated the same or similar number of monitoring records, so that the system has higher stability and data processing efficiency. Preferably, the steps of load balancing are as follows.
[0055] First, the monitoring system determines the currently available monitoring nodes based on the status values of each monitoring node, and obtains the total number of monitoring records in the currently available monitoring nodes. Next, the monitoring system divides the total number of monitoring records by the preset single-thread processing data volume to obtain the total number of threads to be created, and divides the total number of threads to be created by the number of hosts in the monitoring system to obtain the number of threads to be created on each host. Finally, the monitoring system creates threads on each host according to the number of threads to be created, and allocates monitoring records to each thread according to the single-thread processing data volume, thereby achieving load balancing of each host in the distributed system.
[0056] In the technical solution of the embodiment of the present invention, a three-level monitoring model including monitoring process, monitoring nodes, and monitoring rules is designed. Monitoring nodes can be customized under the monitoring process, and monitoring rules can be customized under the monitoring nodes. Both monitoring nodes and monitoring rules can be flexibly configured and increased or decreased at will, which greatly improves the flexibility and extensibility of the monitoring system configuration. The monitoring system of the present invention supports the configuration of end nodes and end rules. When the monitoring data encounters an end node or hits an end rule, it is cleared from the system, thereby realizing the automatic clearing of the monitoring data after completing its monitoring life cycle, so that the storage space occupied by the monitoring data will reach a dynamic equilibrium state, avoiding the storage cost caused by the unlimited growth of monitoring data, and reducing the impact on system stability when deleting data in large quantities. The monitoring system of the present invention adopts a multi-machine multi-threaded distributed task scheduling method, which can easily cope with the system pressure caused by the growth of monitoring data through horizontal expansion.
[0057] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of the present invention are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.
[0058] For the above-mentioned method embodiments, for the convenience of description, they are expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the order of the actions described, and some steps can actually be performed in other orders or simultaneously. In addition, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily necessary to implement the present invention.
[0059] In order to better implement the above-mentioned solution of the embodiment of the present invention, relevant devices for implementing the above-mentioned solution are also provided below.
[0060] See also Figure 5 As shown, the device 500 provided by an embodiment of the present invention is set in a pre-established monitoring system, and the monitoring system is pre-configured with at least one monitoring process, each monitoring process has multiple binding monitoring rules and monitoring nodes corresponding to business nodes, and the monitoring rules include trigger conditions and corresponding execution actions; the device 500 may include: a receiving and parsing unit 501 and a handling unit 502.
[0061] Among them, the receiving and parsing unit 501 can be used to receive a monitoring message reported by the business system, which contains a business object identifier and monitoring content data, and determine the target monitoring process corresponding to the business object and the target monitoring node in the target monitoring process from the monitoring message; the handling unit 502 can be used to: when it is determined that the target monitoring node is bound to the monitoring rule, obtain the target monitoring rule bound to the target monitoring node; when the monitoring content data meets the triggering condition of any target monitoring rule, process the business object based on the execution action in the target monitoring rule.
[0062] In an embodiment of the present invention, the receiving and parsing unit 501 can be further used for: when the monitoring message contains a specific business identifier and a business node identifier, determining the target monitoring process corresponding to the specific business identifier by using a predetermined mapping relationship between the specific business and the monitoring process, and determining the target monitoring node corresponding to the business node identifier by using a predetermined mapping relationship between the business node and the monitoring node; when the monitoring message contains a monitoring process identifier and a monitoring node identifier, determining the corresponding target monitoring process by using the monitoring process identifier, and determining the corresponding target monitoring node by using the monitoring node identifier.
[0063] In a specific application, each monitoring node of the same monitoring process has a unique sequence number, and the sequence number forms an ordered queue with the flow order of each monitoring node; and the device 500 may further include: a data processing unit, used to: after determining the target monitoring node, if it is determined that the monitoring system has pre-stored a target monitoring message, then detect whether the sequence number of the target monitoring node is after the monitoring node sequence number in the target monitoring message; if so, delete the target monitoring message, and store the monitoring message corresponding to the target monitoring node as a monitoring record under the corresponding business object identifier; wherein the target monitoring message and the monitoring message corresponding to the target monitoring node have the same business object identifier; if it is determined that the target monitoring message is not stored in the monitoring system, then store the monitoring message corresponding to the target monitoring node as a monitoring record under the corresponding business object identifier.
[0064] In actual applications, the data processing unit can be further used for: after determining the target monitoring node, if it is determined that the sequence number of the target monitoring node is equal to the sequence number of the monitoring node in the pre-stored target monitoring message or is before the sequence number, the monitoring message corresponding to the target monitoring node is discarded.
[0065] Preferably, the monitoring node having a sequence number that is at the tail position of the queue is the end node; and the data processing unit can be further used to: after determining the target monitoring node, determine whether the target monitoring node is the end node based on the sequence number of the target monitoring node; if so, delete the pre-stored monitoring record under the corresponding business object identifier.
[0066] As a preferred solution, the handling unit 502 may be further configured to: send an exception message containing the business object identifier and the execution action in the target monitoring rule to a pre-established management platform.
[0067] In an optional technical solution, the monitoring node has a status value indicating whether it is currently available; and the device 500 may further include: a load balancing unit, used to determine the currently available monitoring node based on the status value, and obtain the total number of monitoring records in the currently available monitoring node; divide the total number of monitoring records by a preset single-threaded processing data volume to obtain the total number of threads to be created, and divide the total number of threads to be created by the number of hosts of the monitoring system to obtain the number of threads to be created for each host; create threads on each host according to the number of threads to be created, and allocate monitoring records to each thread according to the single-threaded processing data volume.
[0068] In addition, in an embodiment of the present invention, the execution action includes at least one of the following: sending a message, an alarm, and deleting data; the monitoring process includes at least one of the following attributes: business domain, process identifier, process name, process description information, and process status; the monitoring node further includes at least one of the following attributes: process identifier and node name; the monitoring rule further includes at least one of the following attributes: node identifier, rule identifier, rule name, rule execution cycle, notification method, and rule status; the monitoring message further includes at least one of the following data: business domain, business type, and timestamp.
[0069] According to the technical solution of the embodiment of the present invention, full-process monitoring and timely disposal of each specific business and each business object are realized based on the three-level monitoring architecture. Each monitoring process, monitoring node and monitoring rule can perform operations such as creation, deletion, modification and query as needed, which has high flexibility and scalability. In addition, it can also realize the automatic clearing of a small number of historical records after the completion of its monitoring cycle, avoiding the impact of batch deletion of a large number of historical records on system performance in the prior art, and avoiding errors caused by repeated consumption of monitoring messages or first-come-first-served errors by setting sequence numbers for monitoring nodes of the same monitoring process.
[0070] The present invention further provides a service monitoring and processing system, see Figure 2The business monitoring and processing system includes a business system and a monitoring system that interact through a message queue.
[0071] Among them, the monitoring system is pre-configured with at least one monitoring process, each monitoring process has multiple bound monitoring rules and monitoring nodes corresponding to business nodes, and the monitoring rules include trigger conditions and corresponding execution actions; the business system reports a monitoring message containing a business object identifier and monitoring content data to the monitoring system; the monitoring system determines the target monitoring process corresponding to the business object and the target monitoring node in the target monitoring process from the received monitoring message; the monitoring system determines whether the target monitoring node is bound to the monitoring rule; if bound, the monitoring system obtains the target monitoring rule bound to the target monitoring node, and when it is determined that the monitoring content data meets the trigger condition of any target monitoring rule, processes the business object based on the execution action in the target monitoring rule.
[0072] In an embodiment of the present invention, when the monitoring message includes a specific business identifier and a business node identifier, the monitoring system uses a predetermined mapping relationship between the specific business and the monitoring process to determine the target monitoring process corresponding to the specific business identifier, and uses a predetermined mapping relationship between the business node and the monitoring node to determine the target monitoring node corresponding to the business node identifier; when the monitoring message includes a monitoring process identifier and a monitoring node identifier, the monitoring system uses the monitoring process identifier to determine the corresponding target monitoring process, and uses the monitoring node identifier to determine the corresponding target monitoring node.
[0073] In a specific scenario, each monitoring node of the same monitoring process has a unique sequence number, and the sequence number forms an ordered queue with the flow order of each monitoring node; and, after determining the target monitoring node, if the monitoring system determines that the monitoring system has pre-stored a target monitoring message, it detects whether the sequence number of the target monitoring node is after the monitoring node sequence number in the target monitoring message; if so, the target monitoring message is deleted, and the monitoring message corresponding to the target monitoring node is stored as a monitoring record under the corresponding business object identifier; wherein, the target monitoring message and the monitoring message corresponding to the target monitoring node have the same business object identifier; if the monitoring system determines that the target monitoring message is not stored in the monitoring system, the monitoring message corresponding to the target monitoring node is stored as a monitoring record under the corresponding business object identifier.
[0074] In one embodiment, after determining the target monitoring node, if the monitoring system determines that the sequence number of the target monitoring node is equal to the sequence number of the monitoring node in the pre-stored target monitoring message or is before the sequence number, the monitoring message corresponding to the target monitoring node is discarded.
[0075] In an optional implementation, the monitoring node having a sequence number that is at the tail position of the queue is the end node; and, after determining the target monitoring node, the monitoring system determines whether the target monitoring node is the end node based on the sequence number of the target monitoring node; if so, delete the pre-stored monitoring record under the corresponding business object identifier.
[0076] Preferably, the monitoring system sends an exception message containing the business object identifier and the execution action in the target monitoring rule to a pre-established management platform.
[0077] In an actual scenario, the monitoring node has a status value indicating whether it is currently available; and the monitoring system determines the currently available monitoring nodes based on the status value, and obtains the total number of monitoring records in the currently available monitoring nodes; the monitoring system divides the total number of monitoring records by a preset single-threaded processing data volume to obtain the total number of threads to be created, and divides the total number of threads to be created by the number of hosts of the monitoring system to obtain the number of threads to be created for each host; the monitoring system creates threads on each host according to the number of threads to be created, and allocates monitoring records to each thread according to the single-threaded processing data volume.
[0078] In addition, in an embodiment of the present invention, the execution action includes at least one of the following: sending a message, an alarm, and deleting data; the monitoring process includes at least one of the following attributes: business domain, process identifier, process name, process description information, and process status; the monitoring node further includes at least one of the following attributes: process identifier and node name; the monitoring rule further includes at least one of the following attributes: node identifier, rule identifier, rule name, rule execution cycle, notification method, and rule status; the monitoring message further includes at least one of the following data: business domain, business type, and timestamp.
[0079] According to the technical solution of the embodiment of the present invention, the monitoring system adopts a three-level monitoring architecture including monitoring process, monitoring node and monitoring rules. The monitoring process corresponds to the specific business, the monitoring node corresponds to the business node, and the monitoring rule is bound to the monitoring node. The monitoring system interacts with the business system through a message queue. When a business object flows to a business node, the business system reports a monitoring message to the monitoring system, and the monitoring system determines the corresponding monitoring process and the monitoring node in the monitoring process, and processes the corresponding business object according to the corresponding execution action when judging that the monitoring content data in the monitoring message meets the triggering condition of any monitoring rule bound to the monitoring node, thereby realizing the full process monitoring and timely disposal of each specific business and each business object, and each monitoring process, monitoring node and monitoring rule can perform operations such as creation, deletion, modification, and query as needed, with high flexibility and scalability. In addition, only the latest record of the same business object is persisted in the monitoring system, and the historical record is deleted when the latest record is obtained, and any monitoring message is associated with the last node (i.e., the end node) of the monitoring process, so as to clear this record, thereby realizing the automatic clearing of a small number of historical records after the completion of its monitoring cycle, avoiding the impact of batch deletion of a large number of historical records on system performance in the prior art. In addition, a corresponding sequence number is set for each monitoring node of the same monitoring process, and the flow order of different monitoring nodes can be distinguished from the sequence number, so that when a monitoring message with an incorrect sequence number is received, it is discarded to avoid errors caused by repeated consumption of monitoring messages or first-come-first-served errors. Finally, the embodiment of the present invention adopts a horizontally scalable distributed system architecture, and determines the number of threads of each host according to the total number of monitoring records to be processed, the number of monitoring system hosts, and the amount of data processed by a single thread, and then performs task allocation to ensure load balancing of each host.
[0080] Figure 6 An exemplary system architecture 600 to which the monitoring method or monitoring device according to the embodiment of the present invention can be applied is shown.
[0081] like Figure 6 As shown, the system architecture 600 may include terminal devices 601, 602, 603, a network 604 and a server 605 (this architecture is only an example, and the components included in the specific architecture may be adjusted according to the specific application). The network 604 is used to provide a medium for a communication link between the terminal devices 601, 602, 603 and the server 605. The network 604 may include various connection types, such as wired, wireless communication links or optical fiber cables.
[0082] The user can use the terminal devices 601, 602, 603 to interact with the server 605 through the network 604 to receive or send messages, etc. Various client applications, such as a monitoring application (only an example), can be installed on the terminal devices 601, 602, 603.
[0083] The terminal devices 601 , 602 , and 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.
[0084] The server 605 may be a server that provides various services, such as a background server (only an example) that provides support for monitoring applications operated by users using the terminal devices 601, 602, and 603. The background server may process the received monitoring request and feed back the processing result (such as monitored abnormal information - only an example) to the terminal devices 601, 602, and 603.
[0085] It should be noted that the monitoring method provided in the embodiment of the present invention is generally executed by the server 605 , and accordingly, the monitoring device is generally arranged in the server 605 .
[0086] It should be understood that Figure 6 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0087] The present invention also provides an electronic device. The electronic device of an embodiment of the present invention comprises: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the monitoring method provided by the present invention.
[0088] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system 700 of an electronic device suitable for implementing an embodiment of the present invention. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0089] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the computer system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0090] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that a computer program read therefrom is installed into the storage section 708 as needed.
[0091] In particular, according to the embodiments disclosed in the present invention, the process described in the main step diagram above can be implemented as a computer software program. For example, the embodiments of the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the main step diagram. In the above embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit 701, the above functions defined in the system of the present invention are executed.
[0092] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0093] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0094] The units involved in the embodiments of the present invention may be implemented by software or hardware. The units described may also be arranged in a processor, for example, it may be described as: a processor includes a receiving and parsing unit and a handling unit. The names of these units do not constitute a limitation on the units themselves in some cases, for example, the receiving and parsing unit may also be described as "a unit that provides a target monitoring node to a handling unit".
[0095] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by the device, the steps executed by the device include: receiving a monitoring message reported by the business system and containing a business object identifier and monitoring content data, determining from the monitoring message the target monitoring process corresponding to the business object and the target monitoring node in the target monitoring process; in the case of determining that the target monitoring node is bound to a monitoring rule, obtaining the target monitoring rule bound to the target monitoring node; in the case that the monitoring content data meets the triggering condition of any target monitoring rule, processing the business object based on the execution action in the target monitoring rule.
[0096] In the technical solution of the embodiment of the present invention, a three-level monitoring model including monitoring process, monitoring nodes, and monitoring rules is designed. Monitoring nodes can be customized under the monitoring process, and monitoring rules can be customized under the monitoring nodes. Both monitoring nodes and monitoring rules can be flexibly configured and increased or decreased at will, which greatly improves the flexibility and extensibility of the monitoring system configuration. The monitoring system of the present invention supports the configuration of end nodes and end rules. When the monitoring data encounters an end node or hits an end rule, it is cleared from the system, thereby realizing the automatic clearing of the monitoring data after completing its monitoring life cycle, so that the storage space occupied by the monitoring data will reach a dynamic equilibrium state, avoiding the storage cost caused by the unlimited growth of monitoring data, and reducing the impact on system stability when deleting data in large quantities. The monitoring system of the present invention adopts a multi-machine multi-threaded distributed task scheduling method, which can easily cope with the system pressure caused by the growth of monitoring data through horizontal expansion.
[0097] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A monitoring method, characterized in that: The method is executed by a pre-established monitoring system, wherein the monitoring system is pre-configured with at least one monitoring process, each monitoring process has a plurality of monitoring nodes bound to monitoring rules and corresponding to business nodes, wherein the monitoring rules include trigger conditions and corresponding execution actions; the method includes: Receiving a monitoring message reported by a business system and including a business object identifier and monitoring content data, and determining a target monitoring process corresponding to the business object and a target monitoring node in the target monitoring process from the monitoring message; When it is determined that the target monitoring node is bound to the monitoring rule, the target monitoring rule bound to the target monitoring node is obtained; when the monitoring content data meets the triggering condition of any target monitoring rule, the business object is processed based on the execution action in the target monitoring rule.
2. The method according to claim 1, characterized in that The step of determining a target monitoring process corresponding to the business object and a target monitoring node in the target monitoring process from the monitoring message includes: In the case where the monitoring message includes a specific service identifier and a service node identifier, a target monitoring process corresponding to the specific service identifier is determined using a predetermined mapping relationship between the specific service and the monitoring process, and a target monitoring node corresponding to the service node identifier is determined using a predetermined mapping relationship between the service node and the monitoring node; In the case where the monitoring message includes a monitoring process identifier and a monitoring node identifier, the monitoring process identifier is used to determine a corresponding target monitoring process, and the monitoring node identifier is used to determine a corresponding target monitoring node.
3. The method according to claim 1, characterized in that Each monitoring node of the same monitoring process has a unique sequence number, and the sequence number forms an ordered queue along with the flow order of each monitoring node; And, the method further comprises: After determining the target monitoring node, if it is determined that the monitoring system has pre-stored a target monitoring message, then detect whether the sequence number of the target monitoring node is after the monitoring node sequence number in the target monitoring message; if so, delete the target monitoring message, and store the monitoring message corresponding to the target monitoring node as a monitoring record under the corresponding business object identifier; wherein the target monitoring message and the monitoring message corresponding to the target monitoring node have the same business object identifier; If it is determined that the target monitoring message is not stored in the monitoring system, the monitoring message corresponding to the target monitoring node is stored as a monitoring record under the corresponding business object identifier.
4. The method according to claim 3, characterized in that The method further comprises: After determining the target monitoring node, if it is determined that the sequence number of the target monitoring node is equal to or before the sequence number of the monitoring node in the pre-stored target monitoring message, the monitoring message corresponding to the target monitoring node is discarded.
5. The method according to claim 3, characterized in that: The monitoring node with the sequence number at the end of the queue is the end node; And, the method further comprises: After determining the target monitoring node, judging whether the target monitoring node is an end node according to the sequence number of the target monitoring node; If so, delete the pre-stored monitoring record under the corresponding business object identifier.
6. The method according to claim 1, characterized in that The processing of the business object based on the execution action in the target monitoring rule includes: An abnormal message containing the business object identifier and the execution action in the target monitoring rule is sent to a pre-established management platform.
7. The method according to claim 1, characterized in that The monitoring node has a status value indicating whether it is currently available; And, the method further comprises: Determine a currently available monitoring node according to the status value, and obtain the total number of monitoring records in the currently available monitoring node; The total number of monitoring records is divided by the preset single-thread processing data volume to obtain the total number of threads to be created, and the total number of threads to be created is divided by the number of hosts of the monitoring system to obtain the number of threads to be created for each host; A thread is created on each host according to the number of threads to be created, and a monitoring record is allocated to each thread according to the amount of data processed by the single thread.
8. The method according to claim 1, characterized in that The execution action includes at least one of the following: sending a message, issuing an alarm, or deleting data; The monitoring process includes at least one of the following attributes: business domain, process identifier, process name, process description information, and process status; The monitoring node further includes at least one of the following attributes: a process identifier, a node name; The monitoring rule further includes at least one of the following attributes: a node identifier, a rule identifier, a rule name, a rule execution period, a notification method, and a rule status; The monitoring message further includes at least one of the following data: business domain, business type, and timestamp.
9. A monitoring device, characterized in that: The device is provided in a pre-established monitoring system, wherein the monitoring system is pre-configured with at least one monitoring process, each monitoring process has a plurality of monitoring nodes bound to monitoring rules and corresponding to business nodes, wherein the monitoring rules include trigger conditions and corresponding execution actions; the device includes: A receiving and parsing unit, configured to receive a monitoring message reported by a business system and including a business object identifier and monitoring content data, and determine a target monitoring process corresponding to the business object and a target monitoring node in the target monitoring process from the monitoring message; The handling unit is used to: when it is determined that the target monitoring node is bound to the monitoring rule, obtain the target monitoring rule bound to the target monitoring node; when the monitoring content data meets the triggering condition of any target monitoring rule, process the business object based on the execution action in the target monitoring rule.
10. A business monitoring and processing system, characterized in that: Includes business systems and monitoring systems that interact through message queues; The monitoring system is pre-configured with at least one monitoring process, each monitoring process having a plurality of monitoring rules bound thereto and monitoring nodes corresponding to the service nodes, the monitoring rules including trigger conditions and corresponding execution actions; The business system reports a monitoring message including a business object identifier and monitoring content data to the monitoring system; the monitoring system determines a target monitoring process corresponding to the business object and a target monitoring node in the target monitoring process from the received monitoring message; The monitoring system determines whether the target monitoring node is bound to the monitoring rule; if bound, the monitoring system obtains the target monitoring rule bound to the target monitoring node, and when it is determined that the monitoring content data meets the triggering conditions of any target monitoring rule, the monitoring system processes the business object based on the execution action in the target monitoring rule.
11. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.