Business abnormality monitoring method, electronic device and storage medium
By obtaining and analyzing the interface data reported by the business system, including link identification and service request processing sequence identification, the problems of high intrusion, incomplete coverage and difficulty in determining the root cause of business abnormality monitoring in the prior art are solved, and low intrusion, full coverage of business abnormality monitoring and root cause positioning are achieved.
Patent Information
- Application Number
- CN202311368776.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-20
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2043-10-20
AI Technical Summary
The prior art has problems such as high invasiveness, incomplete coverage and difficulty in determining the root cause of the abnormality in business abnormal alarms.
By obtaining the interface data reported by each business system, including service data, link identification and service request processing sequence identification, querying the link data storage table, storing and polling the link identification, to determine the service abnormality and locate the root cause of the business system.
It realizes low intrusive monitoring of the business system, basically has no perception, can reflect the call link of the business system and determine the root cause of the business system, reducing maintenance costs.
Smart Images

Figure CN117667565B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a business abnormality monitoring method, an electronic device and a storage medium. Background Art
[0002] Currently, the mainstream monitoring and alarm systems on the market include skywalking, Prometheus, Splunk, Zabbix, Meituan's CAT, etc. These monitoring systems mainly focus on monitoring servers, application performance, networks, and middleware.
[0003] For business exception alerts (such as a WeChat payment transaction that failed because the acquiring merchant was subject to WeChat risk control), the current solutions on the market are based on real-time analysis of application logs, and then triggered according to keywords and corresponding rules, such as ELK+flink or Splunk, etc. These solutions require the business system to do point tracking itself. The disadvantages of tracking are obvious. First, a lot of tracking is required, which is too invasive to the business system; second, because the judgment of business anomalies is relatively subjective, everyone's understanding is different, and manual tracking is easy to miss, so the scenario cannot be fully covered. In addition, a business request usually involves multiple business systems. When a business request is abnormal, the above solution cannot determine in which system the root cause of the business anomaly occurs, and can only rely on R&D personnel to manually locate it. Summary of the invention
[0004] In view of the defects in the prior art, the embodiments of the present invention provide a business abnormality monitoring method, an electronic device and a storage medium.
[0005] An embodiment of the present invention provides a method for monitoring business anomalies, comprising: obtaining interface data reported by each business system; wherein the interface data comprises business data, a link identifier and a business request processing sequence identifier; the link identifier corresponds to the business request one-to-one; the business request processing sequence identifier corresponds to the business system, and is used to indicate the calling sequence of the business system in the execution of the business request; querying a link data storage table according to the link identifier, and in response to the link identifier not being stored in the link data storage table, storing the link identifier in the link data storage table; according to the link identifier, storing the business data and the business request processing sequence identifier of each business system in an interface data storage table in correspondence; polling the link data storage table to obtain the link identifier corresponding to the business request currently to be monitored for business anomalies; obtaining the business data corresponding to the link identifier from the interface data storage table according to the link identifier, and determining whether a business anomaly occurs and locating the root cause business system of the business anomaly according to the business request processing sequence identifier and the business data.
[0006] According to a business anomaly monitoring method provided by an embodiment of the present invention, storing the link identifier in the link data storage table includes: generating a delayed processing time corresponding to the link identifier, and storing the delayed processing time and the link identifier in the link data storage table in correspondence.
[0007] According to a business exception monitoring method provided by an embodiment of the present invention, obtaining the link identifier corresponding to the business request currently to be monitored for business exceptions includes: obtaining the delayed processing time greater than or equal to the current time, and obtaining the link identifier corresponding to the delayed processing time.
[0008] According to a business anomaly monitoring method provided by an embodiment of the present invention, the method of determining whether a business anomaly occurs and locating the root cause business system of the business anomaly according to the business request processing sequence identifier and the business data includes: obtaining the business data of the business system corresponding to the business request processing sequence identifier in reverse order of the business system call sequence reflected by the business request processing sequence identifier, and in response to the business data being abnormal, determining that a business anomaly has occurred and that the root cause business system of the business anomaly is the business system corresponding to the current business request processing sequence identifier.
[0009] According to a business exception monitoring method provided by an embodiment of the present invention, the business request processing sequence identifier includes a timestamp when the business system receives relevant data of the business request, or includes a number that represents the calling sequence between business systems through a numerical value.
[0010] According to a business exception monitoring method provided by an embodiment of the present invention, the business system uploads the interface data in the form of referencing a jar package.
[0011] According to a method for monitoring business anomalies provided by an embodiment of the present invention, the interface corresponding to the interface data supports custom configuration of the business system.
[0012] According to a business anomaly monitoring method provided by an embodiment of the present invention, before storing the business data of each business system and the business request processing sequence identifier correspondingly into an interface data storage table according to the link identifier, the method also includes: processing the business data into preset standardized data through a script.
[0013] According to a method for monitoring business anomalies provided by an embodiment of the present invention, the method further includes: in response to the business data containing error information and the error information hitting a preset alarm rule, determining that the business data is abnormal.
[0014] According to a business anomaly monitoring method provided by an embodiment of the present invention, the method also includes: obtaining a corresponding alarm information template according to the preset alarm rule that is hit; assembling the business parameters preset in the alarm information template according to the preset standardized data of each of the business systems; and generating alarm data according to the alarm information template, the business parameters and the information of the root cause business system.
[0015] According to a business anomaly monitoring method provided by an embodiment of the present invention, after generating alarm data according to the alarm information template, the business parameters and the information of the root cause business system, the method further includes: sending the alarm data to an alarm receiving object according to a preset alarm method; wherein the alarm method and the information of the alarm receiving object are obtained based on the preset alarm rule that is hit.
[0016] According to a business anomaly monitoring method provided by an embodiment of the present invention, before obtaining the corresponding alarm information template according to the preset alarm rule that is hit, the method also includes: obtaining the configuration status of the preset alarm rule, and ignoring the error information in response to the configuration status being a silent state.
[0017] According to a business anomaly monitoring method provided by an embodiment of the present invention, the method also includes: obtaining the preset alarm rule of the custom configuration of the business system; in response to the error information containing an error code in the preset alarm rule, determining that the error information hits the preset alarm rule.
[0018] The embodiment of the present invention also provides a service anomaly monitoring device, comprising: a data acquisition module, used to: acquire interface data reported by each service system; wherein the interface data includes service data, link identifier and service request processing sequence identifier; the link identifier corresponds to the service request one-to-one; the service request processing sequence identifier corresponds to the service system, and is used to indicate the calling sequence of the service system in the execution of the service request; a first storage module, used to: query the link data storage table according to the link identifier, and in response to the link identifier not being stored in the link data storage table, store the link identifier in the link data storage table; a second storage module, used to: store the service data and the service request processing sequence identifier of each service system in the interface data storage table according to the link identifier; a polling module, used to: poll the link data storage table to acquire the link identifier corresponding to the service request currently to be monitored for service anomalies; an anomaly locating module, used to: acquire the service data corresponding to the link identifier from the interface data storage table according to the link identifier, determine whether a service anomaly occurs and locate the root cause service system of the service anomaly according to the service request processing sequence identifier and the service data.
[0019] An embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned methods for monitoring business anomalies are implemented.
[0020] An embodiment of the present invention further provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned methods for monitoring business anomalies are implemented.
[0021] An embodiment of the present invention further provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned service anomaly monitoring methods are implemented.
[0022] The business anomaly monitoring method, electronic device and storage medium provided by the embodiment of the present invention obtain interface data reported by each business system, wherein the interface data includes business data, link identifier and business request processing sequence identifier, the link identifier corresponds to the business request one by one, the business request processing sequence identifier corresponds to the business system, and is used to indicate the calling sequence of the business system in the execution of the business request, query the link data storage table according to the link identifier, and in response to the link identifier not being stored in the link data storage table, store the link identifier in the link data storage table, store the business data and business request processing sequence identifier of each business system in the interface data storage table according to the link identifier, poll the link data storage table, obtain the link identifier corresponding to the business request to be currently monitored for business anomaly, obtain the business data corresponding to the link identifier from the interface data storage table according to the link identifier, determine whether a business anomaly occurs and locate the root cause business system of the business anomaly according to the business request processing sequence identifier and the business data, and perform business anomaly monitoring by obtaining the interface data, with little intrusion on the business system, and the business system is basically unaware, and can reflect the calling link of the business system and determine the root cause business system of the business anomaly, and the cost of building and maintaining is low. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solution of the present invention, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0024] Figure 1 This is one of the flow charts of the service anomaly monitoring method provided by an embodiment of the present invention;
[0025] Figure 2It is a schematic diagram of business request processing in the business exception monitoring method provided by an embodiment of the present invention;
[0026] Figure 3 It is an overall architecture diagram of the business anomaly monitoring method provided by an embodiment of the present invention;
[0027] Figure 4 This is a second flow chart of the service anomaly monitoring method provided by an embodiment of the present invention;
[0028] Figure 5 It is a structural diagram of a service anomaly monitoring device provided by an embodiment of the present invention;
[0029] Figure 6 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] Figure 1 FIG. 1 is one of the flow charts of the service anomaly monitoring method provided by an embodiment of the present invention. Figure 1 As shown, the method includes:
[0032] Step S1, obtaining interface data reported by each business system; wherein the interface data includes business data, link identifier and business request processing sequence identifier; wherein the link identifier corresponds one-to-one with the business request; the business request processing sequence identifier corresponds to the business system, and is used to indicate the calling order of the business system in the execution of the business request.
[0033] A business request is usually processed by multiple business systems. These business systems can implement different business functions in the form of applications. For example, a payment request can be processed by the cash register system, the acquiring system, the channel system, the routing system, etc. Different business systems can be distributed on different devices to improve business processing capabilities through a distributed architecture. It is understandable that the business systems involved in a business request can be deployed on different devices, or on the same device, or part of the business systems can be deployed on the same device.
[0034] The service anomaly monitoring method provided by the embodiment of the present invention is applied to the server. After processing the service request, the service system sends interface data to the server through the interface, and the server obtains the interface data reported by each service system. The interface data includes service data, link identifier and service request processing sequence identifier.
[0035] Among them, business data includes relevant data generated in the processing of business requests, including request parameters and response parameters of the interface. After a business request arrives, it can be processed by various business systems. Each business system is called in sequence to form a call link. Each business system has a link identifier for the business request, which is used to indicate that it corresponds to the processing of the business request. That is, each business system on the same call link is used to process the same business request. According to the calling order, the processing of each business system is in sequence. In a call link, each business system has a business request processing sequence identifier, which is used to indicate the calling order of the business system in the execution of the business request or the order of processing the business request.
[0036] Step S2: query a link data storage table according to the link identifier, and in response to the link identifier not being stored in the link data storage table, store the link identifier in the link data storage table.
[0037] The link data storage table is used to store link identifiers. The interface data reported by multiple business systems involved in a business request all include link identifiers, and the same link identifier only needs to be stored once in the link data table. After receiving the interface data reported by the first business system among the multiple business systems involved in the business request, the server obtains the link identifier and stores the link identifier in the link data storage table. If the server subsequently receives interface data reported by other business systems for the same business request, it is no longer necessary to store the data in the link data storage table.
[0038] Therefore, after receiving the interface data reported by the business system, the server queries the link data storage table according to the link identifier in the interface data. If the link identifier is not stored in the link data storage table, the link identifier is stored in the link data storage table. If the corresponding link identifier is already stored in the link data storage table, no data is stored in the link data storage table.
[0039] Step S3: According to the link identifier, the service data of each service system and the service request processing sequence identifier are stored in an interface data storage table in a corresponding manner.
[0040] The interface data storage table stores the service data under the corresponding link identifier and the corresponding service request processing sequence identifier according to the link identifier. After receiving the interface data, regardless of whether the link identifier in the interface data is stored in the link data storage table, the service data and the service request processing sequence identifier will be stored in the data under the corresponding link identifier in the interface data storage table.
[0041] The interface data storage table can adopt the redis Zset structure to realize the data storage of each link. Among them, the link identifier is used as the Zset key (key value), the Zset member (element value) is the business data, and the Zset Score (score) corresponding to each element value is the business request processing order identifier.
[0042] Step S4: poll the link data storage table to obtain the link identifier corresponding to the service request currently to be monitored for service anomalies.
[0043] The server polls the link data storage table at preset intervals to obtain the link identifier corresponding to the service request currently to be monitored for service anomalies. The link identifier corresponding to the service request currently to be monitored for service anomalies can be determined according to the storage order of the link identifiers in the link data storage table.
[0044] Step S5: acquiring the service data corresponding to the link identifier from the interface data storage table according to the link identifier, determining whether a service anomaly occurs and locating the root cause service system of the service anomaly according to the service request processing sequence identifier and the service data.
[0045] When monitoring business anomalies, the server needs to determine whether a business anomaly has occurred. When a business anomaly has occurred, the server needs to locate the root cause business system. The root cause business system can be considered the "originator" of the business anomaly. Since business anomalies are transmitted, business anomalies in other business systems can be considered to be caused by the anomaly of the root cause business system. Currently, it cannot be completely ruled out that other business anomalies exist in other business systems. After the current root cause business system is troubleshooted, further investigation can be carried out.
[0046] After obtaining the link identifier corresponding to the business request to be monitored for business anomalies by polling the link data storage table, the data corresponding to the link identifier is further obtained by querying the interface data storage table, wherein the data corresponding to the link identifier includes the business data and business request processing sequence identifier stored one by one.
[0047] By analyzing the business data, it can be determined whether each business system has an abnormality. In addition, the calling sequence between business systems can be known based on the business request processing sequence identifier of the business system. The root cause of the business abnormality can be known based on the abnormal situation and calling sequence of the business system.
[0048] The business exception monitoring method provided by the embodiment of the present invention obtains interface data reported by each business system, wherein the interface data includes business data, link identifiers and business request processing sequence identifiers, the link identifiers correspond to the business requests one by one, the business request processing sequence identifiers correspond to the business systems, and are used to indicate the calling sequence of the business systems in the execution of the business requests, and queries the link data storage table according to the link identifiers, and in response to the link identifiers not being stored in the link data storage table, stores the link identifiers in the link data storage table, stores the business data and business request processing sequence identifiers of each business system in the interface data storage table according to the link identifiers, polls the link data storage table, obtains the link identifiers corresponding to the business requests to be monitored for business exceptions, obtains the business data corresponding to the link identifiers from the interface data storage table according to the link identifiers, determines whether a business exception occurs and locates the root cause business system of the business exception according to the business request processing sequence identifiers and the business data, and performs business exception monitoring by obtaining the interface data, which has little intrusion on the business system and is basically unaware of the business system, can reflect the calling links of the business system and determine the root cause business system of the business exception, and has low construction and maintenance costs.
[0049] According to a business anomaly monitoring method provided by an embodiment of the present invention, storing the link identifier in the link data storage table includes: generating a delayed processing time corresponding to the link identifier, and storing the delayed processing time and the link identifier in the link data storage table in correspondence.
[0050] Since a business request may be transferred to N business systems for processing, each business system needs time to process the business request. The server needs to wait for each business system to report its own information after processing the business request, and then determine whether a business abnormality occurs.
[0051] The link data storage table is used to store link identifiers and delayed processing time. The interface data reported by multiple business systems involved in a business request all include link identifiers, and the same link identifier only needs to be stored once in the link data table. After receiving the interface data reported by the first business system among the multiple business systems involved in the business request, the server obtains the link identifier, stores the link identifier in the link data storage table, and stores the delayed processing time accordingly. The delayed processing time can be obtained by adding the preset delay waiting time to the time when the first business system reports the interface data. If the server subsequently receives interface data reported by other business systems for the same business request, it is no longer necessary to store the data in the link data storage table.
[0052] Therefore, after receiving the interface data reported by the business system, the server queries the link data storage table according to the link identifier in the interface data. If the link identifier is not stored in the link data storage table, the delayed processing time is generated and stored in the link data storage table corresponding to the link identifier. If the corresponding link identifier is already stored in the link data storage table, no data is stored in the link data storage table.
[0053] The link data storage table can adopt the redis Zset structure, where the Zset key (key value) represents the delay queue (alarm_delay_queue), the Zset member (element value) is the link identifier (traceId), and the Zset Score (score) corresponding to each element value is the delay processing time.
[0054] The business anomaly monitoring method provided by the embodiment of the present invention generates a delayed processing time corresponding to a link identifier, and stores the delayed processing time and the link identifier in a link data storage table in correspondence with each other, which is conducive to triggering business anomaly monitoring based on the delayed processing time and ensuring the reliability of business anomaly monitoring.
[0055] According to a business exception monitoring method provided by an embodiment of the present invention, obtaining the link identifier corresponding to the business request currently to be monitored for business exceptions includes: obtaining the delayed processing time greater than or equal to the current time, and obtaining the link identifier corresponding to the delayed processing time.
[0056] The server polls the link data storage table at preset intervals to obtain the expired delayed processing time, that is, the delayed processing time that is greater than or equal to the current time. Since the link identifier and the delayed processing time are stored one-to-one in the link data storage table, the corresponding link identifier can be obtained by obtaining the delayed processing time. When the delayed processing time expires, it means that the server can monitor and analyze the business data of the corresponding call link to see if there is any business anomaly.
[0057] The business exception monitoring method provided by the embodiment of the present invention ensures that business requests are effectively processed during business exception monitoring by obtaining a delayed processing time that is greater than or equal to the current time and obtaining a link identifier corresponding to the delayed processing time, thereby improving the reliability of business exception monitoring.
[0058] According to a business anomaly monitoring method provided by an embodiment of the present invention, the method of determining whether a business anomaly occurs and locating the root cause business system of the business anomaly according to the business request processing sequence identifier and the business data includes: obtaining the business data of the business system corresponding to the business request processing sequence identifier in reverse order of the business system call sequence reflected by the business request processing sequence identifier, and in response to the business data being abnormal, determining that a business anomaly has occurred and that the root cause business system of the business anomaly is the business system corresponding to the current business request processing sequence identifier.
[0059] In the processing of business requests, according to the calling sequence of business systems, if the previous business system fails, the next business system will not be called. Therefore, the server will not receive the interface data of the next business system. Therefore, the business data can be analyzed in the reverse order of the business system calls. If the corresponding business system fails, it is the root cause business system of the exception. In this way, the efficiency of determining the root cause business system can be improved.
[0060] The business request processing sequence identifier can reflect the calling sequence of the business system. The following operations are performed in reverse order of the business system calling sequence reflected by the business request processing sequence identifier: obtain the business data of the business system corresponding to the business request processing sequence identifier. If the business data is abnormal, determine that the business exception has occurred and the root cause of the business exception is the business system corresponding to the current business request processing sequence identifier.
[0061] If the business data are normal in the above operations performed in the reverse order of the business system call sequence reflected by the business request processing sequence identifier, it means that there is no business abnormality in the business operation.
[0062] Since the processing of business requests includes requests and responses, business exceptions may also occur in the subsequent processing after the business system receives the response. This is why the reverse traversal of the business system call sequence reflected by the business request processing sequence identifier is required. The following example illustrates this.
[0063] Figure 2 FIG. 1 is a schematic diagram of service request processing in the service exception monitoring method provided in an embodiment of the present invention. Figure 2As shown in the figure, for a payment acquisition transaction, three business systems are involved: cashier system --> transaction system --> channel system. The calling order is cashier system --> transaction system --> channel system. After receiving the business request, each business system will perform corresponding business processing and then request the downstream business system, and perform corresponding processing according to the return result of the downstream business system. The abnormal scenarios in this process are as follows Figure 2 The five situations are framed in the figure.
[0064] For example, when the channel system processes normally and returns the result to the transaction system, an exception occurs in the transaction system during the processing of box numbered 4. At this time, the last business system in the calling sequence is the channel system, but the problem is in the transaction system. Therefore, it is not possible to determine only the last business system in the reverse order of the business system calling sequence reflected by the business request processing sequence identifier, but to traverse forward.
[0065] However, the response to the request is transmitted from back to front. Therefore, the business data of the business system corresponding to the business request processing sequence identifier is obtained in the reverse order of the business system call order reflected by the business request processing sequence identifier. If the business data is abnormal, it is determined to be the root cause business system.
[0066] The business anomaly monitoring method provided by the embodiment of the present invention obtains the business data of the business system corresponding to the business request processing sequence identifier in the reverse order of the business system call order embodied by the business request processing sequence identifier, and in response to the business data exception, determines that the business anomaly has occurred and the root cause business system of the business anomaly is the business system corresponding to the current business request processing sequence identifier, thereby improving the efficiency and accuracy of obtaining the root cause business system of the business anomaly.
[0067] According to a business exception monitoring method provided by an embodiment of the present invention, the business request processing sequence identifier includes a timestamp when the business system receives relevant data of the business request, or includes a number that represents the calling sequence between business systems through a numerical value.
[0068] Generally speaking, each business system in the call link requires strict time synchronization. At this time, the call order can be determined based on the timestamp of the business system receiving the relevant data of the business request. Therefore, the call order between business systems can be determined by the business request processing sequence identifier including the timestamp when the business system receives the relevant data of the business request.
[0069] If the business systems in the call link cannot achieve strict time synchronization, when the business system receives the relevant data of the business request, it can generate a number and synchronize it to other business systems in the call link. After receiving the relevant data of the business request, other business systems will change the number monotonically, such as monotonically increasing, so that the calling order between business systems can also be determined.
[0070] The business anomaly monitoring method provided by the embodiment of the present invention realizes the flexibility of setting the business request processing sequence identifier by including the timestamp of the relevant data of the business request received by the business system, or including a number that represents the calling sequence between business systems through the size of a numerical value.
[0071] According to a business exception monitoring method provided by an embodiment of the present invention, the business system uploads the interface data in the form of referencing a jar package.
[0072] You can provide a jar package to the business system, and the business system can communicate with the server by quoting the jar package to report the interface data. This avoids the invasion of the embedded point into the business system, and the business system is basically unaware. The business system can first store the reported interface data in the Kafka cluster, and the server obtains the interface data reported by the business system by consuming data.
[0073] Figure 3 : is the overall architecture diagram of the service anomaly monitoring method provided by the embodiment of the present invention. Figure 3 As shown in the figure, Collection refers to the interface data collection and reporting of each business system. Each business system can be an application (App), and each business system reports interface data by referencing a jar package. The jar package belongs to a java software package and needs to rely on a java virtual machine (Virtual) to run. Each business system that references the jar package can be regarded as a client (monitor client) that communicates with the server to implement business exception monitoring. The client mainly uses the filter in java to intercept the interface data of the business system.
[0074] The business system stores the interface data in the Kafka cluster by producing data. The server obtains the interface data by consuming data and performs business anomaly monitoring and alarm. The server can also be deployed in a distributed architecture.
[0075] In the business anomaly monitoring method provided by the embodiment of the present invention, the business system uploads interface data in the form of referencing a jar package, thereby easily realizing the reporting of the interface data.
[0076] According to a method for monitoring business anomalies provided by an embodiment of the present invention, the interface corresponding to the interface data supports custom configuration of the business system.
[0077] The business system can customize the interface data to be monitored and synchronize it to the server. When reporting interface data, only the interface data of the configured interface needs to be reported.
[0078] The business exception monitoring method provided by the embodiment of the present invention improves flexibility by supporting the business system to customize the configuration of the interface to be monitored.
[0079] According to a business anomaly monitoring method provided by an embodiment of the present invention, before storing the business data of each business system and the business request processing sequence identifier correspondingly into an interface data storage table according to the link identifier, the method also includes: processing the business data into preset standardized data through a script.
[0080] Since the request parameters and response parameters of each interface of each business system are not standardized and there are differences between them, after the server receives the reported data, it parses the parameters of the interface data according to the script and converts them into preset standardized data before storing the business data and business request processing sequence identifiers of each business system in the interface data storage table according to the link identifier.
[0081] The script used for standardization processing can store the mapping relationship between various data forms and standard forms, query the mapping relationship according to the data form of the parameters in the interface data, and convert it into the corresponding standard form.
[0082] The business anomaly monitoring method provided by the embodiment of the present invention facilitates subsequent processing and analysis of the interface data by processing the business data into preset standardized data through a script before storing the business data and business request processing sequence identifiers of each business system in the interface data storage table according to the link identifier.
[0083] According to a method for monitoring business anomalies provided by an embodiment of the present invention, the method further includes: in response to the business data containing error information and the error information hitting a preset alarm rule, determining that the business data is abnormal.
[0084] When determining whether the business data is abnormal, if the business data contains error information and the error information hits the preset alarm rule, the business data is determined to be abnormal; otherwise, the business data is normal. The preset alarm rule may include error information and corresponding alarm strategies, and hitting the preset alarm rule can be understood as the preset alarm rule containing the corresponding error information.
[0085] The business anomaly monitoring method provided by the embodiment of the present invention determines that the business data is abnormal in response to the business data containing error information and the error information hits the preset alarm rule, thereby improving the accuracy of the business data anomaly judgment.
[0086] According to a business anomaly monitoring method provided by an embodiment of the present invention, the method also includes: obtaining a corresponding alarm information template according to the preset alarm rule that is hit; assembling the business parameters preset in the alarm information template according to the preset standardized data of each of the business systems; and generating alarm data according to the alarm information template, the business parameters and the information of the root cause business system.
[0087] Pre-configure the alarm information template corresponding to the preset alarm rule, and set the preset business parameters in the alarm information template. The preset business parameters in the alarm information template often require data splicing of upstream and downstream business systems. For example, field A is only available in the upstream business system, and field B is only available in the downstream application. At this time, the fields required for the alarm template need to be extracted from the upstream and downstream systems respectively.
[0088] The server obtains the corresponding alarm information template according to the alarm rules that are matched; assembles the business parameters preset in the alarm information template according to the preset standardized data of each business system (not necessarily all); and generates alarm data according to the alarm information template, business parameters and the information of the root cause business system. That is, the alarm data contains the information of the business parameters and the root cause business system.
[0089] The business anomaly monitoring method provided by the embodiment of the present invention obtains the corresponding alarm information template according to the hit preset alarm rule, assembles the business parameters preset in the alarm information template according to the preset standardized data of each business system, and generates alarm data according to the alarm information template, business parameters and the information of the root cause business system. The alarm data reflects the business parameters and the root cause business system, thereby improving the quality of the alarm data.
[0090] According to a business anomaly monitoring method provided by an embodiment of the present invention, after generating alarm data according to the alarm information template, the business parameters and the information of the root cause business system, the method further includes: sending the alarm data to an alarm receiving object according to a preset alarm method; wherein the alarm method and the information of the alarm receiving object are obtained based on the preset alarm rule that is hit.
[0091] According to the preset alarm rules, the alarm method and the information of the alarm recipient are obtained. After the alarm data is generated according to the alarm information template, business parameters and the information of the root cause business system, the alarm data is sent to the alarm recipient according to the preset alarm method.
[0092] The business anomaly monitoring method provided in the embodiment of the present invention obtains a preset alarm method and an alarm receiving object based on the hit preset alarm rule, and sends the alarm data to the alarm receiving object according to the preset alarm method, thereby achieving reliable access to the alarm data.
[0093] According to a business anomaly monitoring method provided by an embodiment of the present invention, before obtaining the corresponding alarm information template according to the preset alarm rule that is hit, the method also includes: obtaining the configuration status of the preset alarm rule, and ignoring the error information in response to the configuration status being a silent state.
[0094] Since multiple identical business requests will trigger the same business anomaly, only one alarm is required. Therefore, if the business data includes error information and the error information hits the preset alarm rule, before obtaining the corresponding alarm information template according to the hit preset alarm rule, first obtain the configuration status of the preset alarm rule. If the configuration status of the preset alarm rule is silent (that is, it means that the alarm rule will not be processed), ignore the error information. If the configuration status of the preset alarm rule is active, then execute the steps of obtaining the corresponding alarm information template according to the hit preset alarm rule, and the subsequent alarm data generation steps. Among them, the silent state and the active state can be switched by configuration, or automatically switched according to the set rules.
[0095] The business anomaly monitoring method provided by the embodiment of the present invention obtains the configuration status of the preset alarm rules, and ignores the error information in response to the configuration status being a silent state, thereby avoiding repeated generation and frequent sending of similar alarm data, saving system resources, and avoiding frequent disturbances to the alarm recipients.
[0096] According to a business anomaly monitoring method provided by an embodiment of the present invention, the method also includes: obtaining the preset alarm rule of the custom configuration of the business system; in response to the error information containing an error code in the preset alarm rule, determining that the error information hits the preset alarm rule.
[0097] The preset alarm rules support custom configuration of the business system. If the received business data includes error information, it is necessary to further determine whether the business data hits the preset alarm rules. According to the attribution of the business data, the preset alarm rules configured for the corresponding business system are obtained. If the error information in the business data contains the error code in the preset alarm rule, the error information hits the preset alarm rule.
[0098] The business anomaly monitoring method provided in the embodiment of the present invention improves flexibility by customizing the preset alarm rules of the business system; by responding to the error code in the preset alarm rule contained in the error information, it is determined that the error information hits the preset alarm rule, thereby improving the accuracy and efficiency of the judgment of whether the error information hits the alarm rule.
[0099] Figure 4 FIG. 2 is a flow chart of the service anomaly monitoring method provided by an embodiment of the present invention. Figure 4 As shown, the method includes:
[0100] The server pulls the message (interface data) reported by the client in Kafka, parses the message body, and determines whether the traceId (link identifier) in the message is in the redis delay queue (link data storage table). If it exists, the current processing is skipped; if not, the traceId is placed in the redis delay queue. For the received message, regardless of whether the traceId is in the redis delay queue, the corresponding application standardized data will be placed in the redis interface data storage table. Among them, the application refers to the business system.
[0101] The link data storage table is used to store traceId and trigger time (delay processing time). In the link data storage table, Zset Key is represented by alarm_delay_queue (delay queue), Zset member is the link identifier, and ZsetScore is the delay processing time. The interface data storage table is used to store messages reported by all business systems under traceId. In the interface data storage table, Zset Key is traceId, Zset member is business data (log body), and Zset Score is spanId (business request processing sequence identifier).
[0102] The server pulls the expired tasks in the redis delay queue from the link data storage table, obtains all corresponding messages according to the traceId by querying the interface data storage table, calculates the call link according to the spanId, traverses the application data, calculates the root cause application, and obtains the alarm rule according to the error code of the root cause application (the error information is expressed as the error code). If the error code does not hit the alarm rule, the corresponding error code is discarded without processing; if the error code hits the alarm rule, it determines whether the alarm rule is in a silent state. If the alarm rule is in a silent state, the corresponding error code is discarded without processing; if the alarm rule is active, the alarm information template corresponding to the alarm rule is obtained, the alarm information is assembled according to the application data and template, and the alarm is issued according to the configuration of the alarm rule.
[0103] It should be noted that the multiple preferred implementations given in this embodiment can be freely combined under the premise that they do not conflict with each other in logic or structure, and the present invention does not limit this.
[0104] The following describes a service anomaly monitoring device provided by an embodiment of the present invention. The service anomaly monitoring device described below and the service anomaly monitoring method described above can be referenced to each other.
[0105] Figure 5 Schematic diagram of the structure of the service anomaly monitoring device provided by the embodiment of the present invention. Figure 5 As shown, the device includes a data acquisition module 10, a first storage module 20, a second storage module 30, a polling module 40 and an abnormality positioning module 50, wherein: the data acquisition module 10 is used to: obtain interface data reported by each business system; wherein the interface data includes business data, link identifier and business request processing sequence identifier; the link identifier corresponds to the business request one-to-one; the business request processing sequence identifier corresponds to the business system, and is used to indicate the calling sequence of the business system in the execution of the business request; the first storage module 20 is used to: query the link data storage table according to the link identifier, in response to the link identifier not being stored in the link data storage table , storing the link identifier in the link data storage table; the second storage module 30 is used to: according to the link identifier, store the business data of each business system and the business request processing sequence identifier into the interface data storage table; the polling module 40 is used to: poll the link data storage table to obtain the link identifier corresponding to the business request currently to be monitored for business anomalies; the anomaly locating module 50 is used to: obtain the business data corresponding to the link identifier from the interface data storage table according to the link identifier, determine whether a business anomaly occurs and locate the root cause business system of the business anomaly according to the business request processing sequence identifier and the business data.
[0106] The service anomaly monitoring device provided by the embodiment of the present invention obtains interface data reported by each service system, wherein the interface data includes service data, link identifier and service request processing sequence identifier, the link identifier corresponds to the service request one by one, the service request processing sequence identifier corresponds to the service system, and is used to indicate the calling sequence of the service system in the execution of the service request, queries the link data storage table according to the link identifier, and in response to the link identifier not being stored in the link data storage table, stores the link identifier in the link data storage table accordingly, stores the service data and service request processing sequence identifier of each service system in the interface data storage table according to the link identifier, polls the link data storage table, obtains the link identifier corresponding to the service request to be currently monitored for service anomaly, obtains the service data corresponding to the link identifier from the interface data storage table according to the link identifier, determines whether a service anomaly occurs and locates the root cause service system of the service anomaly according to the service request processing sequence identifier and the service data, performs service anomaly monitoring by obtaining interface data, has little intrusion on the service system, and the service system is basically unaware, can reflect the calling link of the service system and determine the root cause service system of the service anomaly, and has low construction and maintenance costs.
[0107] According to a business anomaly monitoring device provided by an embodiment of the present invention, the first storage module 20, when used to store the link identifier in the link data storage table, is specifically used to: generate a delayed processing time corresponding to the link identifier, and store the delayed processing time and the link identifier in the link data storage table in correspondence.
[0108] The business anomaly monitoring device provided by an embodiment of the present invention generates a delayed processing time corresponding to the link identifier, and stores the delayed processing time and the link identifier in the link data storage table in correspondence with each other, which is conducive to triggering business anomaly monitoring based on the delayed processing time and ensuring the reliability of business anomaly monitoring.
[0109] According to a business anomaly monitoring device provided by an embodiment of the present invention, the polling module 40, when used to obtain the link identifier corresponding to the business request currently to be monitored for business anomalies, is specifically used to: obtain the delayed processing time greater than or equal to the current time, and obtain the link identifier corresponding to the delayed processing time.
[0110] The business exception monitoring device provided by the embodiment of the present invention ensures that the business request is effectively processed during business exception monitoring by obtaining the delayed processing time that is greater than or equal to the current time and obtaining the link identifier corresponding to the delayed processing time, thereby improving the reliability of business exception monitoring.
[0111] According to a business anomaly monitoring device provided by an embodiment of the present invention, the anomaly locating module 50, when used to determine whether a business anomaly occurs and locate the root cause business system of the business anomaly according to the business request processing sequence identifier and the business data, is specifically used to: obtain the business data of the business system corresponding to the business request processing sequence identifier in reverse order of the business system call sequence embodied by the business request processing sequence identifier, and in response to the business data being abnormal, determine that a business anomaly occurs and that the root cause business system of the business anomaly is the business system corresponding to the current business request processing sequence identifier.
[0112] The business anomaly monitoring device provided by the embodiment of the present invention obtains the business data of the business system corresponding to the business request processing sequence identifier in the reverse order of the business system call order embodied by the business request processing sequence identifier, and in response to the business data exception, determines that the business anomaly has occurred and the root cause business system of the business anomaly is the business system corresponding to the current business request processing sequence identifier, thereby improving the efficiency and accuracy of obtaining the root cause business system of the business anomaly.
[0113] According to a service anomaly monitoring device provided by an embodiment of the present invention, the service request processing sequence identifier includes a timestamp when the service system receives relevant data of the service request, or includes a number representing a call sequence between service systems by a numerical value.
[0114] The business anomaly monitoring device provided by the embodiment of the present invention realizes the flexibility of setting the business request processing sequence identifier by including a timestamp of the relevant data of the business request received by the business system, or including a number that represents the calling sequence between business systems through a numerical value.
[0115] According to a business anomaly monitoring device provided by an embodiment of the present invention, the business system uploads the interface data in the form of referencing a jar package.
[0116] In the service anomaly monitoring device provided by the embodiment of the present invention, the service system uploads the interface data in the form of referencing a jar package, thereby realizing the reporting of the interface data in a simple manner.
[0117] According to a service anomaly monitoring device provided by an embodiment of the present invention, the interface corresponding to the interface data supports custom configuration of the service system.
[0118] The service anomaly monitoring device provided by the embodiment of the present invention improves flexibility by supporting the service system to customize the configuration of the interface to be monitored.
[0119] According to a business anomaly monitoring device provided by an embodiment of the present invention, the second storage module 30 is also used to: process the business data into preset standardized data through a script before storing the business data and the business request processing sequence identifier of each business system correspondingly into the interface data storage table according to the link identifier.
[0120] The business anomaly monitoring device provided by the embodiment of the present invention processes the business data into preset standardized data through a script before storing the business data and business request processing sequence identifiers of each business system in the interface data storage table according to the link identifier, thereby facilitating the subsequent processing and analysis of the interface data.
[0121] According to a service anomaly monitoring device provided by an embodiment of the present invention, the anomaly locating module 50 is further used to: determine that the service data is abnormal in response to the service data containing error information and the error information hits a preset alarm rule.
[0122] The business anomaly monitoring device provided by the embodiment of the present invention determines that the business data is abnormal in response to the business data containing error information and the error information hits the preset alarm rule, thereby improving the accuracy of the business data anomaly judgment.
[0123] According to a business anomaly monitoring device provided by an embodiment of the present invention, the device also includes an alarm module, which is used to: obtain a corresponding alarm information template according to the preset alarm rule that is hit; assemble the business parameters preset in the alarm information template according to the preset standardized data of each of the business systems; and generate alarm data according to the alarm information template, the business parameters and the information of the root cause business system.
[0124] The business anomaly monitoring device provided by the embodiment of the present invention obtains the corresponding alarm information template according to the hit preset alarm rule, assembles the business parameters preset in the alarm information template according to the preset standardized data of each business system, and generates alarm data according to the alarm information template, business parameters and the information of the root cause business system. The alarm data reflects the business parameters and the root cause business system, thereby improving the quality of the alarm data.
[0125] According to a business anomaly monitoring device provided by an embodiment of the present invention, the alarm module is used to generate alarm data according to the alarm information template, the business parameters and the information of the root cause business system, and is also used to: send the alarm data to the alarm receiving object according to a preset alarm method; wherein the alarm method and the information of the alarm receiving object are obtained based on the preset alarm rule that is hit.
[0126] The business anomaly monitoring device provided in the embodiment of the present invention obtains a preset alarm method and an alarm receiving object based on the hit preset alarm rule, and sends the alarm data to the alarm receiving object according to the preset alarm method, thereby achieving reliable access to the alarm data.
[0127] According to a business anomaly monitoring device provided by an embodiment of the present invention, the alarm module is used to obtain the configuration status of the preset alarm rule before obtaining the corresponding alarm information template according to the preset alarm rule that is hit, and ignore the error information in response to the configuration status being a silent state.
[0128] The business anomaly monitoring device provided by the embodiment of the present invention obtains the configuration status of the preset alarm rules, and ignores the error information in response to the configuration status being a silent state, thereby avoiding repeated generation and frequent sending of similar alarm data, saving system resources, and avoiding frequent disturbances to the alarm recipients.
[0129] According to a business anomaly monitoring device provided by an embodiment of the present invention, the anomaly locating module 50 is also used to: obtain the preset alarm rule of the custom configuration of the business system; in response to the error information containing an error code in the preset alarm rule, determine that the error information hits the preset alarm rule.
[0130] The business anomaly monitoring device provided in the embodiment of the present invention improves flexibility by customizing preset alarm rules in the business system; by responding to the error code in the preset alarm rule included in the error information, it is determined that the error information hits the preset alarm rule, thereby improving the accuracy and efficiency of the judgment of whether the error information hits the alarm rule.
[0131] Figure 6 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Figure 6As shown, the electronic device may include: a processor (processor) 510, a communication interface (Communications Interface) 520, a memory (memory) 530 and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other through the communication bus 540. The processor 510 can call the logic instructions in the memory 530 to execute the business exception monitoring method, which includes: obtaining interface data reported by each business system; wherein the interface data includes business data, link identifier and business request processing sequence identifier; the link identifier corresponds to the business request one by one; the business request processing sequence identifier corresponds to the business system, and is used to indicate the calling order of the business system in the execution of the business request; querying the link data storage table according to the link identifier, and in response to the link identifier not being stored in the link data storage table, storing the link identifier in the link data storage table; according to the link identifier, storing the business data and the business request processing sequence identifier of each business system in the interface data storage table in correspondence; polling the link data storage table to obtain the link identifier corresponding to the business request currently to be monitored for business exceptions; obtaining the business data corresponding to the link identifier from the interface data storage table according to the link identifier, and determining whether a business exception occurs and locating the root cause business system of the business exception according to the business request processing sequence identifier and the business data.
[0132] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0133] On the other hand, an embodiment of the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the business exception monitoring method provided by the above methods, the method comprising: obtaining interface data reported by each business system; wherein the interface data includes business data, link identifier and business request processing sequence identifier; the link identifier corresponds to the business request one by one; the business request processing sequence identifier corresponds to the business system, and is used to indicate the calling order of the business system in the execution of the business request; querying a link data storage table according to the link identifier, and in response to the link identifier not being stored in the link data storage table, storing the link identifier in the link data storage table; according to the link identifier, correspondingly storing the business data and the business request processing sequence identifier of each business system into the interface data storage table; polling the link data storage table to obtain the link identifier corresponding to the business request currently to be monitored for business exception; obtaining the business data corresponding to the link identifier from the interface data storage table according to the link identifier, determining whether a business exception occurs and locating the root cause business system of the business exception according to the business request processing sequence identifier and the business data.
[0134] On the other hand, an embodiment of the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented by a processor to execute the business anomaly monitoring method provided by the above-mentioned methods when executed, the method comprising: obtaining interface data reported by each business system; wherein the interface data comprises business data, a link identifier and a business request processing sequence identifier; the link identifier corresponds to the business request one-to-one; the business request processing sequence identifier corresponds to the business system, and is used to indicate the calling sequence of the business system in the execution of the business request; querying a link data storage table according to the link identifier, and in response to the link identifier not being stored in the link data storage table, storing the link identifier in the link data storage table; according to the link identifier, correspondingly storing the business data and the business request processing sequence identifier of each business system into the interface data storage table; polling the link data storage table to obtain the link identifier corresponding to the business request currently to be monitored for business anomalies; obtaining the business data corresponding to the link identifier from the interface data storage table according to the link identifier, and determining whether a business anomaly occurs and locating the root cause business system of the business anomaly according to the business request processing sequence identifier and the business data.
[0135] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0136] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0137] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for monitoring business anomalies, characterized in that: include: Acquire interface data reported by each business system; wherein the interface data includes business data, link identifier and business request processing sequence identifier; the link identifier corresponds to the business request one-to-one; the business request processing sequence identifier corresponds to the business system and is used to indicate the calling sequence of the business system in the execution of the business request; querying a link data storage table according to the link identifier, and in response to the link identifier not being stored in the link data storage table, storing the link identifier in the link data storage table; According to the link identifier, the service data of each service system and the service request processing sequence identifier are stored in an interface data storage table in a corresponding manner; Poll the link data storage table to obtain the link identifier corresponding to the service request currently to be monitored for service anomalies; Acquire the service data corresponding to the link identifier from the interface data storage table according to the link identifier, determine whether a service anomaly occurs and locate the root cause service system of the service anomaly according to the service request processing sequence identifier and the service data; Before storing the service data and the service request processing sequence identifier of each service system in an interface data storage table according to the link identifier, the method further includes: processing the service data into preset standardized data through a script; The method further includes: in response to the business data containing error information and the error information hitting a preset alarm rule, determining that the business data is abnormal; According to the preset alarm rule that is hit, obtain the corresponding alarm information template; Assembling the business parameters preset in the alarm information template according to the preset standardized data of each of the business systems; Alarm data is generated according to the alarm information template, the business parameters and the information of the root cause business system.
2. The method for monitoring business anomalies according to claim 1, characterized in that: The storing the link identifier in the link data storage table comprises: Generate a delayed processing time corresponding to the link identifier, and store the delayed processing time and the link identifier in the link data storage table in correspondence.
3. The method for monitoring business anomalies according to claim 2, characterized in that: The obtaining of the link identifier corresponding to the current service request to be monitored for service exceptions includes: Obtain the delayed processing time that is greater than or equal to the current time, and obtain the link identifier corresponding to the delayed processing time.
4. The method for monitoring business anomalies according to claim 1, characterized in that: The business system for determining whether a business anomaly occurs and locating the root cause of the business anomaly according to the business request processing sequence identifier and the business data includes: In the reverse order of the business system call order reflected by the business request processing sequence identifier, the business data of the business system corresponding to the business request processing sequence identifier is obtained, and in response to the business data exception, it is determined that the business exception has occurred and the root cause of the business exception is the business system corresponding to the current business request processing sequence identifier.
5. The method for monitoring business anomalies according to claim 1, characterized in that: The business request processing sequence identifier includes a timestamp when the business system receives the relevant data of the business request, or includes a number that indicates the calling sequence between business systems through a numerical value.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the service exception monitoring method according to any one of claims 1 to 5 are implemented.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the service anomaly monitoring method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Business exception positioning method and device, electronic equipment, medium and product
CN112506799A
Data acquisition method, device and equipment and readable storage medium
CN114745295A