Service monitoring method and device and electronic equipment
By adding identifiers to business requests to generate transaction call chains and monitoring these chains, the problem of low accuracy in monitoring data in existing technologies is solved, thus improving the stability and reliability of the system.
Patent Information
- Application Number
- CN202511698439.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-19
- Publication Date
- 2026-02-13
AI Technical Summary
In existing technologies, business monitoring relies on log data reported by various business systems, resulting in low accuracy of monitoring data and affecting the stability of system operation.
By obtaining the output logs of multiple API calls and adding identifiers when a business request is received, a transaction call chain is generated, and a business call chain is generated based on the identifiers, thus enabling monitoring of the processing status of the business request.
It improves the stability and reliability of business systems, enables timely detection and resolution of problems in system operation, and reduces the impact of system modification and cutover on the production environment.
Smart Images

Figure CN121524005A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of business support technology, and in particular to a business monitoring method, device and electronic device. Background Technology
[0002] With the increasing sophistication of business support capabilities, operator business support systems have evolved from traditional single-system architectures to multi-system collaborative working modes. In pre-sales, sales, and after-sales business scenarios, the same service requires multiple business systems to work together through different interfaces. However, the different interface specifications and data formats used by each business system pose challenges to monitoring the operational status of the service.
[0003] Currently, business monitoring mainly relies on log data reported by various business systems. When there are delays or errors in log data reporting, the accuracy of monitoring data will be low, resulting in poor system stability. Summary of the Invention
[0004] This application provides a business monitoring method, apparatus, and electronic device to address the problem of poor system stability.
[0005] To solve the above-mentioned technical problems, this application is implemented as follows:
[0006] In a first aspect, embodiments of this application provide a business monitoring method, the method comprising:
[0007] Upon receiving a business request, the system retrieves the output logs of multiple calling interfaces corresponding to the business request and adds an identifier to the output log of each calling interface. The identifier is used to identify the business request.
[0008] Based on the calling order of the multiple calling interfaces and the identifier, at least two transaction calling chains are generated, wherein each transaction calling chain includes log data corresponding to at least two calling interfaces, and the log data is at least a portion of the data in the output log;
[0009] The identifier is used to generate a business call chain from the at least two transaction call chains, and the processing status of the business request is monitored based on the business call chain.
[0010] Secondly, embodiments of this application provide a business monitoring device, the device comprising:
[0011] The first acquisition module is used to acquire the output logs of multiple calling interfaces corresponding to the business request when a business request is received, and to add an identifier to the output log of each calling interface, wherein the identifier is used to identify the business request;
[0012] The generation module is used to generate at least two transaction call chains based on the calling order of the plurality of calling interfaces and the identifier, wherein each transaction call chain includes log data corresponding to at least two of the calling interfaces, and the log data is at least a portion of the data in the output log;
[0013] The monitoring module is used to generate a business call chain from the at least two transaction call chains using the identifier, and to monitor the processing status of the business request based on the business call chain.
[0014] Thirdly, embodiments of this application provide an electronic device, including: a processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, it implements the steps of the service monitoring method described in the first aspect.
[0015] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the business monitoring method described in the first aspect.
[0016] Fifthly, a computer program product is provided, including computer instructions that, when executed by a processor, implement the steps of the business monitoring method as described in the first aspect.
[0017] In this embodiment, by automatically collecting interface log data and adding identifiers, cross-system and cross-session transaction call chains can be automatically concatenated, thereby generating a business call chain from multiple transaction call chains of different systems. Monitoring the operational status of the business based on the business call chain facilitates timely detection and resolution of problems in system operation, improving the stability and reliability of the business system. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is one of the flowcharts of a business monitoring method provided in the embodiments of this application;
[0020] Figure 2 This is a second flowchart of a business monitoring method provided in an embodiment of this application;
[0021] Figure 3 This is a flowchart illustrating transaction call chain data acquisition provided in an embodiment of this application;
[0022] Figure 4 This is a flowchart illustrating the generation of a transaction call chain according to an embodiment of this application;
[0023] Figure 5 This is a flowchart illustrating a transaction call chain metric analysis provided in an embodiment of this application;
[0024] Figure 6 This is a flowchart of a system information configuration provided in an embodiment of this application;
[0025] Figure 7 This is a flowchart illustrating an interface configuration information output method provided in an embodiment of this application.
[0026] Figure 8 This is a flowchart of a business call chain generation method provided in an embodiment of this application;
[0027] Figure 9 This is a flowchart of a business monitoring service based on a business call chain provided in an embodiment of this application;
[0028] Figure 10 This is a schematic diagram of the structure of a business monitoring device provided in an embodiment of this application;
[0029] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0030] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0031] Currently, business monitoring methods include logging, distributed tracing, and service monitoring. These methods are applied in distributed systems to monitor and optimize system performance.
[0032] In distributed systems, logging is a crucial tool for monitoring and debugging. Common logging tools include Log4j, Logstash, and Fluentd. These tools collect and centrally store log data from distributed systems for analysis and monitoring.
[0033] Distributed tracing technology is used to track the flow of requests in a distributed system, helping developers understand the call relationships between services. Jaeger and Zipkin are commonly used distributed tracing systems that can collect time-series data of service calls and generate call chains to graphically display the flow path of requests in the system.
[0034] Service monitoring tools (such as Prometheus and Grafana) are used to monitor system performance and health in real time. These tools can collect various metrics data of system operation and display them through a graphical interface to help operations and maintenance personnel quickly identify and resolve system problems.
[0035] Currently, business monitoring relies on the timeliness and accuracy of log data reported by various business systems. Any delay or error in log recording will affect the monitoring effect of the system interface, resulting in incomplete or inaccurate monitoring information, which will affect the timely discovery and resolution of problems.
[0036] To monitor business processes, some implementations involve developers manually adding request ID generation and transmission logic to the code, a cumbersome and inefficient process. Other implementations require all business systems to be developed and integrated according to a unified standard due to differing interface specifications, which significantly impacts already deployed systems. System modifications and cutovers are not only time-consuming and labor-intensive but also affect the stability and performance of existing production systems.
[0037] This application provides a business monitoring method, apparatus, and electronic device to solve the problem of low accuracy in monitoring business processing.
[0038] See Figure 1 , Figure 1 This is a flowchart of a business monitoring method provided in an embodiment of this application, such as... Figure 1 As shown, the method includes the following steps:
[0039] Step 101: Upon receiving a business request, obtain the output logs of multiple calling interfaces corresponding to the business request, and add an identifier to the output log of each calling interface. The identifier is used to identify the business request.
[0040] Step 102: Based on the calling order of the multiple calling interfaces and the identifier, generate at least two transaction calling chains, wherein each transaction calling chain includes log data corresponding to at least two calling interfaces, and the log data is at least a portion of the data in the output log;
[0041] Step 103: Use the identifier to generate a business call chain from the at least two transaction call chains, and monitor the processing status of the business request based on the business call chain.
[0042] Among them, business requests can be business requests put forward by users. Since business requests involve multiple different systems, each system includes its own call interface specifications.
[0043] During system registration, parameter configuration management is performed, including system registration management, interface registration management, interface parameter annotation management, and injection parameter management, providing basic configuration information for business interface monitoring.
[0044] Business interface registration is the first step in business interface monitoring, defining the scope of processing within the business call chain (i.e., the business call chain itself). Specifically:
[0045] (1) System registration, including the system name and code.
[0046] (2) Interface registration, including the service interface information, interface type, and output and input parameters provided by the system registration system.
[0047] (3) Mark global variables for input and output parameters, including marking the type of global variables according to the input and output parameter information of the interface, which serves as the input basis for subsequent business connections.
[0048] (4) Generate injection configuration file information based on the system.
[0049] Obtain the output logs corresponding to each API call, and add an identifier to the output logs of each API call so that the output logs of the API that handles the business request contain the identifier.
[0050] In some implementations, upon receiving a business request, an identifier (tracid) is generated based on the business request, and the generated identifier is added to the function's output log based on the function called in the transaction.
[0051] For example, a broadband installation service request is received. This service request involves multiple systems, and each system is used to handle a transaction (corresponding to a transaction call chain). The specific transaction includes:
[0052] Transaction 1: Front desk processing, generating a pre-acceptance form based on the business request;
[0053] Transaction 2: Transfer the business flow to the scheduling system for allocating network resources;
[0054] Transaction 3: Activate the system for the account and perform 3A authentication.
[0055] Item 4: Installation and Construction.
[0056] Each of the above transaction call chains involves multiple interfaces, and a unified identifier is added to the output log corresponding to each interface.
[0057] By adding identifiers, it is possible to obtain logs containing identifiers from massive amounts of logs and extract log data from the output logs. The log data can include at least some data from the output logs, such as identifiers, interface methods, call times, completion times, processing results, and other information.
[0058] Using the acquired log data, and based on the order in which the API calls were made, the log data containing identifiers can be linked together to form at least two transaction call chains. Each transaction call chain includes log data corresponding to multiple API calls, and each transaction call chain can be used to process one transaction.
[0059] The acquired at least two transaction call chains are sorted in chronological order to generate a business call chain. This chronological order can be the order in which transactions are processed, a pre-defined order, the order in which API calls are made, or an order determined in other ways.
[0060] In some implementations, the start and end points of the business call chain are obtained, and intermediate nodes, including identifiers, are added to the business call chain. In some implementations, the start point of the business call chain is obtained, and other nodes are added to the business call chain sequentially according to the order of calls, until the end point is reached. In some implementations, a call relationship graph can be obtained based on the association relationships of the transaction call chains, and a business call chain can be generated from multiple transaction call chains based on the relationship graph. The order in which the transaction call chains call the interfaces can be determined based on information such as the interface type and input / output parameters registered during interface registration.
[0061] In some implementations, if the transaction call chain does not contain an identifier, it can be further added to the business call chain based on input and output parameters. For example, whether key data (such as work order number) in the input and output parameters matches key data in the business call chain. If they match, it indicates that they are the same transaction.
[0062] After generating the business call chain, the log data in the business call chain can be used to monitor the current processing status of the business, which facilitates the monitoring of the entire business process and provides early warnings.
[0063] For example, it can quickly obtain the node where the business is located and monitor indicators such as interface runtime and running status to determine whether it is running normally.
[0064] This application's embodiments utilize non-intrusive bytecode enhancement technology to automatically collect interface log information without modifying existing business system code, thereby reducing the impact of system modifications and cutovers on the production environment. By identifying interface input and output parameter keywords, it automatically connects cross-system and cross-session call chains, enabling the automatic generation of interface call chain topologies for business support scenarios and providing a comprehensive service call relationship diagram. Through real-time monitoring of key indicators such as interface runtime and running status, it promptly identifies and resolves problems in system operation, improving the stability and reliability of the business system.
[0065] Optionally, generating a business call chain using the identifier from the at least two transaction call chains includes:
[0066] Among the plurality of calling interfaces, a first interface and a second interface are determined, and a first transaction calling chain corresponding to the first interface and the second interface is obtained based on the identifier, wherein the first interface is the starting interface of the business calling chain, and the second interface is the ending interface of the business calling chain;
[0067] Obtain the second transaction call chain that matches the first interface or the second interface;
[0068] The first transaction call chain and the second transaction call chain are used to generate the business call chain in a sequential order, wherein the sequential order includes at least one of the business sequence order and the interface call sequence order.
[0069] Specifically, based on the method attribute information of the initial interface (i.e., the first interface) in the business interface configuration information, it is determined whether the method is the initialization method of the business interface. If so, the main record information of the business call chain is generated and the data is stored in the business call chain (also known as the business interface call chain) model.
[0070] Query the transaction call chain based on the identifier (tracid) corresponding to the initialization business interface, and transfer all the information of the associated first transaction call chain to the business call chain model.
[0071] Based on the method attribute information of the archive interface (i.e., the second interface) in the business interface configuration information, determine whether the interface is a business interface archive interface. If the system to which this interface belongs has no existing archive type in the current call chain, then this interface is a business archive interface, i.e., the second interface. If it is an archive business interface, then modify the status of the business call chain information to "archived".
[0072] Based on the identifier (tracid) corresponding to the archive interface, query the transaction call chain and transfer all the information of the associated first transaction call chain to the business call chain model.
[0073] In some implementations, the first and second interfaces corresponding to a service can also be identified based on the type of service.
[0074] The second transaction call chain can be the transaction call chain corresponding to the intermediate interface (interfaces other than the start interface and the archive interface).
[0075] The database, including the transaction call chain, is queried based on the identifier to determine the interface containing the identifier in the log data, i.e., the interface that matches the first interface or the second interface, and the corresponding transaction call chain, i.e., the second transaction call chain, is obtained. The second transaction call chain may include one or more transaction call chains.
[0076] In some implementations, a second transaction call chain matching the first or second interface can be determined based on the matching of the input and output parameters of the interface.
[0077] The first transaction call chain corresponding to the first interface and the first transaction call chain corresponding to the second interface, along with the second transaction call chain, are generated into a business call chain in chronological order. This chronological order can be a pre-defined order of business processes or the order in which the interfaces are called.
[0078] In some implementations, partial transaction call chains can be associated to generate initial business calls, and then the obtained transaction call chains can be added to the generated initial business call chains to obtain the final business call chains.
[0079] In some implementations, the first and second transaction call chains are stored in a business call chain model. Then, in the transaction call chain database, transaction call chains matching the information (such as identifiers or keywords) of the transaction call chains in the business call chain model are retrieved and added to the business call chain model. Within the business call chain model, the interface call chains are sorted according to their business order and the time of the interface calls to generate the final business call chain.
[0080] Generating business call chains using the above method allows for the association of transaction call chains corresponding to interfaces containing identifiers in different systems, improving the accuracy and comprehensiveness of business call chain generation. The system can automatically track and connect service calls distributed across different systems, applications, and sessions, generating a complete call chain topology.
[0081] Optionally, obtaining the second transaction call chain matching the first interface or the second interface includes:
[0082] In a pre-acquired transaction call chain database, a third interface corresponding to log data containing the identifier is obtained, wherein the transaction call chain database includes the at least two transaction call chains;
[0083] Obtain the transaction call chain where the third interface is located, wherein the transaction call chain where the third interface is located is the second transaction call chain that matches the first interface or the second interface.
[0084] After generating the transaction call chain, the transaction call chain can be stored in the transaction call chain database.
[0085] In the transaction call chain database, retrieve the third interface corresponding to the log data containing the aforementioned identifier. Since the log data corresponding to the first and second interfaces also contains this identifier, the transaction call chain of the third interface matches that of the first and second interfaces.
[0086] Retrieve multiple interfaces corresponding to log data with the same identifier, and associate the transaction call chains of these interfaces in chronological order to generate a business call chain. This facilitates the acquisition of the business processing flow, enables monitoring and early warning of business processes, and improves the efficiency of monitoring and handling anomalies.
[0087] Optionally, the method further includes:
[0088] In a pre-acquired transaction call chain database, obtain the parameter information of the call interface of the transaction call chain. The parameter information includes at least one of the input parameter information and the output parameter information. The call interface of the transaction call chain includes a fourth interface.
[0089] When the parameter information of the fourth interface matches the first keyword in the input parameter information of the first business interface, the third transaction call chain in which the fourth interface is located is obtained, wherein the first business interface is any one of the first interface, the second interface, or the second transaction call chain.
[0090] The step of generating the business call chain by sequentially generating the first transaction call chain and the second transaction call chain includes:
[0091] The first transaction call chain, the second transaction call chain, and the third transaction call chain are generated in sequence to form the business call chain.
[0092] After obtaining the call interface corresponding to the log data containing the above identifiers and obtaining the transaction call chain where the interface is located, these transaction call chains are stored in the business call chain model for use in the subsequent generation of business call chains.
[0093] Furthermore, it is possible to obtain the transaction call chain that matches the first business interface in the business call chain model. Specifically, the first key (such as work order number, business identifier, etc.) in the input parameter information of the first business interface is obtained, and the transaction call chain database is used to determine whether there is parameter information in the parameters of the calling interface that matches the first key.
[0094] If parameter information for a fourth interface that matches the first keyword exists, then the third transaction call chain containing that fourth interface is obtained, indicating that the third transaction call chain is associated with the first business interface.
[0095] For example, if the input parameter of the first business interface contains "work order number=ORDER-2025-001" and the output parameter of the fourth interface also contains "work order number=ORDER-2025-001", then it is considered a match. The system then searches the transaction call chain database for the third transaction call chain in which the fourth interface belongs.
[0096] The business call chain is generated in the order of the first transaction call chain, the second transaction call chain, and the third transaction call chain.
[0097] By using the above method, for transaction call chains that do not match the identifier, further matching is performed using keywords in the input and output parameters. Through double matching, the completeness of the generated business call chain can be improved, thereby improving the accuracy of monitoring the business processing status.
[0098] Optionally, obtaining the third transaction call chain where the fourth interface is located includes:
[0099] When the fourth interface includes at least two calling interfaces, obtain the second keyword annotated for the first business interface;
[0100] In the fourth interface, the first call interface whose parameter information matches the second keyword is obtained, and the third transaction call chain in which the first call interface is located is obtained.
[0101] If the fourth interface includes at least two calling interfaces, then the input and output parameter information of at least two calling interfaces is further matched with the second keyword. That is, the input and output parameter information of each of the at least two calling interfaces is compared with the second keyword marked on the first business interface. If the input and output parameter information of the first calling interface matches the second keyword, then the transaction call chain corresponding to the first calling interface is added to the business call chain.
[0102] For example, if the fourth interface includes two calling interfaces, namely calling interface A and calling interface B, and if the input and output parameters of calling interface A include parameters that match the second keyword mentioned above, while the input and output parameters of calling interface B do not include parameters that match the second keyword, then the transaction call chain containing calling interface A is added to the business call chain.
[0103] By employing the above method, and performing dual matching between the input and output parameters of the fourth interface and the first and second keywords, false matching caused by keyword matching is reduced, thereby improving the matching accuracy.
[0104] Optionally, generating at least two transaction call chains based on the call order of the plurality of calling interfaces and the identifier includes:
[0105] Log data is obtained based on the output logs of the multiple calling interfaces. The log data includes an identifier and at least one of the following: interface calling method, calling time, completion time, and processing result information.
[0106] Based on the identifier in the log data, obtain a first call chain sorted by call time and a second call chain sorted by the hierarchical relationship of the called functions, wherein the first call chain and the second call chain include log data corresponding to the call interface;
[0107] The at least two transaction call chains are generated based on the first call chain and the second call chain.
[0108] Extract information containing identifiers (tracids) from the output logs of multiple API calls, and collect log data including at least one of the following: API call method, call time, completion time, and processing result information. The specific data collected can be tailored to actual needs. To improve data completeness, all of the above data can be collected to ensure the log data fully records the API call process, facilitating subsequent processing.
[0109] Based on the identifiers contained in the log data, a first call chain is generated horizontally by sorting multiple log data according to their call times; a second call chain is generated vertically according to the hierarchical relationship of function calls. Each transaction call chain generated based on the first and second call chains includes both horizontal and vertical call chains, reflecting the topological relationship of the business process.
[0110] Based on the tracid of the transaction call chain, obtain the collection of call chain data.
[0111] Horizontally, data on various API calls within the same layer is obtained based on tracid, and then sorted according to the call time.
[0112] Vertically, the calls are sorted according to the hierarchical relationship between parent and child functions in the API method call.
[0113] Based on the TRACIID and the obtained sorting results, a transaction call chain is generated. The transaction call chain and related data are then stored in the transaction call storage data model.
[0114] By using the above methods, the completeness of business processes can be improved in terms of time sequence and hierarchical relationship, resulting in a more comprehensive business call chain and thus improving the accuracy of business monitoring.
[0115] Optionally, monitoring the processing status of the service request based on the service call chain includes:
[0116] Monitor the processing status of the business interfaces and transaction call chains in the business call chain;
[0117] If any item in the business interface or transaction call chain of the business call chain is abnormal, an alarm message will be output.
[0118] The system verifies the specific methods within the transaction call chain associated with the business call chain, employing a pass-through mechanism. If any method in the transaction call chain or business call chain is abnormal and this abnormality is not fixed, then both the transaction call chain and the business call chain are considered abnormal. In other words, if any item in the business interface or transaction call chain is abnormal, it indicates an abnormality in the business call chain, and an alarm message is output.
[0119] For example, continuously collect real-time data such as interface runtime, running status, and response time in all business call chains.
[0120] Compare the monitoring data with preset thresholds (such as the maximum response time of the interface, which is 30 seconds).
[0121] The operational status of the business interface is collected every preset time interval to improve the timeliness of monitoring.
[0122] Based on the collected data, check whether the execution of each business interface is successful and whether the execution time exceeds the threshold. Check the processing result and response time of each interface in the transaction call chain; monitor both business interfaces and transaction call chains simultaneously to form a multi-layered monitoring system.
[0123] By setting anomaly criteria, the processing status of business operations can be identified, and alarm prompts can be output when anomalies occur. In some implementations, the processing can be categorized according to severity, such as severe anomalies, warning anomalies, and ordinary anomalies, making it easier for users to handle abnormal situations.
[0124] By combining transaction call chains and business call chains, the system can monitor and analyze business processes from different levels and dimensions, providing more granular and comprehensive performance data and anomaly information. Through real-time monitoring of the business call chain's operational status, the system can promptly detect and identify various anomalies and issue notifications via early warning models, thereby improving system stability and reliability.
[0125] Optionally, an anomaly in the business interface of the business call chain includes any of the following:
[0126] The business interface call execution in the business call chain encountered an error;
[0127] The business interface call in the business call chain timed out;
[0128] The business interface execution timed out in the business call chain.
[0129] The idle time after the business interface of the business call chain is completed exceeds the first threshold value.
[0130] A business interface is considered abnormal if any of the following conditions exist:
[0131] a) If a method call in the business call chain directly reports an error, then this business interface call is an exception.
[0132] b) If the duration of a business interface call exceeds the threshold, the called business interface will be considered an exception.
[0133] c) If the business interface does not respond or times out (i.e., exceeds the set threshold), the business interface is considered abnormal.
[0134] d) Once the business interface has been executed, unless it is a business archive interface, if the idle time without subsequent operations exceeds the response threshold (i.e., the first threshold), it is defined as a business interface exception.
[0135] The above methods enable anomaly detection and timely warning of business call chains, improving the stability and reliability of business systems.
[0136] Optionally, the exception in the transaction call chain includes any of the following:
[0137] The call interface of the transaction call chain timed out or did not respond;
[0138] The runtime information of the call interface of the transaction call chain is reported as an error;
[0139] The call interface of the transaction call chain is running normally, and the runtime of the interface call exceeds the second threshold.
[0140] For a transaction call chain, any of the following situations are considered an exception.
[0141] (1) Monitor the method information of the call chain. If the reported information is that the interface call timed out or there is no response, the method is marked as abnormal. If this method call is the latest call, the call chain (tracid) of this method is an abnormal call chain.
[0142] (2) Monitoring the method information of the call chain. If the reported information is an error message in the interface, the method is marked as abnormal. If this method is the latest call, the call chain (tracid) of this method is an abnormal call chain.
[0143] (3) Monitor the method call chain information. If the reported information indicates that the interface is running normally, calculate the runtime of the interface call. If the runtime of this interface exceeds the threshold value (i.e., the second threshold value) of the average runtime generated by the system based on the historical data of the interface running normally, then the method is running abnormally. If this method call is the latest call, then the call chain (tracid) of this method is an abnormal call chain.
[0144] (4) Based on the interface information monitoring in the above steps, update the status of the transaction call chain in a timely manner, and obtain the performance data of all interface methods in the call chain according to tracid, and calculate the processing time of the transaction call chain.
[0145] (5) The performance data of the transaction call chain method and the transaction call chain are entered into the transaction call chain storage database.
[0146] By using the above methods to monitor each transaction in the business call chain, we can achieve fine-grained monitoring of the business call chain and improve the accuracy of monitoring.
[0147] To facilitate understanding of this embodiment, specific examples are provided below.
[0148] like Figure 2 As shown, the business monitoring method includes the following process.
[0149] 1. Transaction call chain data acquisition: This feature enhances the output of interface transaction call chain information through transaction call chain data acquisition technology. In some implementations, an agent can be used to automatically collect data and output the required log data. The transaction call chain data acquisition process can be found in [link to relevant documentation]. Figure 3 As shown.
[0150] (1) Generate a global tracid (transaction identifier) based on the call trigger of the business request event.
[0151] (2) Based on the function called by the transaction, inject the generated tracid information into the function's output log.
[0152] (3) If there are sub-functions called in the function, the global tracid should also be injected into the output log of the sub-function.
[0153] (4) After the transaction call method data (including log data containing tracid) is generated, the transaction method data transmission channel is invoked to report the transaction call method data to the transaction call chain storage data model.
[0154] 2. Transaction call chain generation: Based on call chain generation technology, this implements the association of all interface methods of a transaction with `TRACID`, generating a transaction call chain. Specifically, as follows... Figure 4As shown. The process includes the following:
[0155] (1) The transaction call chain storage data model parses the transaction call method data and extracts the tracid, interface method, call time, completion time and processing result information.
[0156] (2) Based on the tracid of the transaction call chain, sort the log data horizontally according to the call time and vertically according to the hierarchical relationship between parent and child functions. Generate transaction call chain data based on the sorting results.
[0157] (3) Store the transaction call chain in the transaction call chain storage data model.
[0158] 3. Method performance analysis: Generate interface performance data based on interface call logs.
[0159] After the transaction call chain is generated, method exception analysis and call chain exception analysis will be triggered upon receiving the transaction call chain method information. Exception analysis includes... Figure 5 As shown.
[0160] 4. System configuration parameter management, including system registration management, interface registration management, interface parameter annotation management, and injection parameter management, provides basic configuration information for business interface monitoring. It supports the automatic generation and management of interface call chains.
[0161] The parameter configuration process is as follows: Figure 6 As shown.
[0162] The execution order of this step with other steps is not limited, and it can be performed before step 1.
[0163] 5. Enhance agent data collection for business interfaces: Through bytecode enhancement technology and a list of interface methods to be enhanced, the output and input parameters of business interfaces are realized.
[0164] like Figure 7 As shown, the process includes the following:
[0165] (1) Obtain a list of business interfaces that need to be managed (i.e. important or key interfaces, which can be pre-defined or automatically identified), and each system generates system enhancement output service interface files through the agent.
[0166] (2) Enhance the output of the service interface list monitoring application call methods as needed. If it matches the managed business interface, enhance the output input and output parameter information. That is, output the processed input and output parameter information, and do not output parameters that are not needed.
[0167] (3) Identify the business interface methods and obtain the business interface call information.
[0168] (4) After identifying the business interface data under control, report the data to the business call chain storage data model.
[0169] This step is optional. In some implementations, this step and step 1 can be performed in parallel.
[0170] 6. Generation of business call chain: Based on the business call chain generation algorithm, a basic business call chain is constructed through the logical processing of initial interface, archive interface, general business interface and detached interface.
[0171] like Figure 8 As shown, the process includes the following steps.
[0172] Upon receiving the enhanced business data message from the business interface method, the business interface call method processing procedure is triggered.
[0173] (1) Business Interface Solution Data Parsing
[0174] Parse the received business interface method data message and extract the tracid, interface method, interface input parameter information, interface output parameter information, call time, completion time, and processing result information from the data message.
[0175] (2) Business interface annotation matching
[0176] Query configuration information based on business interfaces to obtain interface category information and annotation information for input and output parameters.
[0177] Based on the matched output parameter annotation results, annotate the global variable information (i.e., keywords) of the business interface output parameters.
[0178] Based on the matched input parameter annotation results, annotate the global variable information (i.e., keywords) of the business interface input parameters.
[0179] Establish a global variable mapping relationship between the interface's output and input parameters, which will serve as the basic data for subsequent business call chains.
[0180] (3) Business initialization interface processing, i.e. the first interface, see the description in the above embodiments for details.
[0181] (4) Business archiving interface processing, i.e. the second interface, see the description in the above embodiments for details.
[0182] (5) General business interface processing, i.e., intermediate interface
[0183] a) Query the transaction call chain database based on the TRACIDI information.
[0184] b) If a matching transaction call chain is found, the transaction call chain data is saved to the business call chain database for use in the generation of subsequent business call chains.
[0185] c) Retrieve the input and output parameter information of unarchived business interfaces based on the keywords in the input parameter information of the business interfaces.
[0186] - If there is a matching result for the keyword, and there is only one result, the transaction call chain corresponding to this business interface will be included in the matched business call chain, and the data will be stored in the business call chain model.
[0187] If multiple entries are matched, the keyword work order number type needs further verification to determine if it matches the set of work order number keywords in the already matched business call chains. If a match is found, the transaction call chain corresponding to this business interface needs to be included in the matched business call chain, and the data should be stored in the business call chain model.
[0188] - If no information is found for the keyword, this business call chain is included in the detached business interface dataset.
[0189] (6) Free interface processing
[0190] After the above steps (3)-(5) are completed, detached interface data processing is required. Information matching is performed based on the keyword information of the input and output parameters of the business interface and the data of the detached business interface set.
[0191] If a match is found, the matched detached business interface data will be included in the business call chain to which this business interface belongs.
[0192] - Data matching a detached business interface is removed from the detached business interface dataset.
[0193] (7) Generation and storage of business call chains
[0194] The business call chain is sorted according to the business order and the time of the interface call to generate the business call chain relationship.
[0195] 7. Based on the performance analysis results and the relationships between methods, transaction call chains, and business call chains, monitor the application of the business call chain. The monitoring process of the business call chain is as follows: Figure 9 As shown.
[0196] Specifically, if there is an anomaly in the interface identification under the transaction call chain, then the transaction call chain is abnormal.
[0197] When there is an exception in the transaction call chain under the business interface, this business call chain is abnormal.
[0198] Currently, business interface call chains are mainly achieved by establishing a unified interface specification, which is then developed by each business system according to the specification to report business interface data. The business source system then connects the business call chains. However, this method requires each system to modify its functions to meet the requirements of the business interface call chain.
[0199] This application embodiment automatically collects interface log information without modifying the business system code by using non-intrusive bytecode enhancement technology. Bytecode enhancement technology dynamically modifies bytecode at runtime to monitor and log method calls. By identifying keyword information in the input and output parameters of interface calls, it enables the chaining of method call chains between different sessions. This automatically generates an interface call chain topology diagram for business support scenarios, facilitating users' understanding of the dependencies between various services in the system. Real-time monitoring of interface runtime, running status, and other information allows for timely detection of anomalies in interface calls, providing real-time alerts and problem localization functions, thus improving system stability. Furthermore, it enhances system maintainability and scalability. The non-intrusive injection enhancement method and automated call chain generation and monitoring technology reduce the modification and maintenance work of system code, while the system can automatically adapt to new services and interfaces, improving system scalability.
[0200] See Figure 10 , Figure 10 This is a schematic diagram of the structure of a business monitoring device provided in an embodiment of this application, as shown below. Figure 10 As shown, the business monitoring device 1000 includes:
[0201] The first acquisition module 1001 is used to acquire the output logs of multiple calling interfaces corresponding to the business request when a business request is received, and add an identifier to the output log of each calling interface, wherein the identifier is used to identify the business request;
[0202] The generation module 1002 is used to generate at least two transaction call chains based on the calling order of the plurality of calling interfaces and the identifier, wherein each transaction call chain includes log data corresponding to at least two of the calling interfaces, and the log data is at least a portion of the data in the output log;
[0203] The monitoring module 1003 is used to generate a business call chain from the at least two transaction call chains using the identifier, and to monitor the processing status of the business request based on the business call chain.
[0204] Optionally, the monitoring module includes:
[0205] The first acquisition submodule is used to determine the first interface and the second interface among the plurality of call interfaces, and to acquire the first transaction call chain corresponding to the first interface and the second interface based on the identifier, wherein the first interface is the starting interface of the business call chain and the second interface is the ending interface of the business call chain.
[0206] The second acquisition submodule is used to acquire a second transaction call chain that matches the first interface or the second interface;
[0207] A generation submodule is used to generate the business call chain by taking the first transaction call chain and the second transaction call chain in sequence, wherein the sequence includes at least one of the business sequence and the interface call sequence.
[0208] Optionally, the second acquisition submodule is specifically used for:
[0209] In a pre-acquired transaction call chain database, a third interface corresponding to log data containing the identifier is obtained, wherein the transaction call chain database includes the at least two transaction call chains;
[0210] Obtain the transaction call chain where the third interface is located, wherein the transaction call chain where the third interface is located is the second transaction call chain that matches the first interface or the second interface.
[0211] Optionally, the device further includes:
[0212] The second acquisition module is used to acquire parameter information of the call interface of the transaction call chain from a pre-acquired transaction call chain database. The parameter information includes at least one of input parameter information and output parameter information. The call interface of the transaction call chain includes a fourth interface.
[0213] The third acquisition module is used to acquire the third transaction call chain where the fourth interface is located when the parameter information of the fourth interface matches the first keyword in the input parameter information of the first business interface, wherein the first business interface is any one of the first interface, the second interface, or the second transaction call chain.
[0214] The generation submodule is specifically used for:
[0215] The first transaction call chain, the second transaction call chain, and the third transaction call chain are generated in sequence to form the business call chain.
[0216] Optionally, the third acquisition module is specifically used for:
[0217] When the fourth interface includes at least two calling interfaces, obtain the second keyword annotated for the first business interface;
[0218] In the fourth interface, the first call interface whose parameter information matches the second keyword is obtained, and the third transaction call chain in which the first call interface is located is obtained.
[0219] Optionally, the generation module is specifically used for:
[0220] Log data is obtained based on the output logs of the multiple calling interfaces. The log data includes an identifier and at least one of the following: interface calling method, calling time, completion time, and processing result information.
[0221] Based on the identifier in the log data, obtain a first call chain sorted by call time and a second call chain sorted by the hierarchical relationship of the called functions, wherein the first call chain and the second call chain include log data corresponding to the call interface;
[0222] The at least two transaction call chains are generated based on the first call chain and the second call chain.
[0223] Optionally, the monitoring module includes:
[0224] The monitoring submodule is used to monitor the processing status of the business interfaces and transaction call chains of the business call chain;
[0225] The output submodule is used to output alarm messages when any of the business interfaces and transaction call chains in the business call chain are abnormal.
[0226] Optionally, an anomaly in the business interface of the business call chain includes any of the following:
[0227] The business interface call execution in the business call chain encountered an error;
[0228] The business interface call in the business call chain timed out;
[0229] The business interface execution timed out in the business call chain.
[0230] The idle time after the business interface of the business call chain is completed exceeds the first threshold value.
[0231] Optionally, the exception in the transaction call chain includes any of the following:
[0232] The call interface of the transaction call chain timed out or did not respond;
[0233] The runtime information of the call interface of the transaction call chain is reported as an error;
[0234] The call interface of the transaction call chain is running normally, and the runtime of the interface call exceeds the second threshold.
[0235] Business monitoring devices can achieve Figure 1 The various processes implemented in the method embodiments can achieve the same technical effect, and will not be described again here to avoid repetition.
[0236] like Figure 11 As shown, this application embodiment also provides an electronic device 1100, including: a processor 1101, a memory 1102, and a program stored in the memory 1102 and executable on the processor 1101. When the program is executed by the processor 1101, it implements the various processes of the above-described business monitoring method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0237] This application also provides a computer-readable storage medium storing a computer program. When executed by a processor, this computer program implements the various processes of the above-described business monitoring method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0238] This application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the above-described... Figure 1 The various processes of the method embodiments shown can achieve the same technical effect, and will not be described again here to avoid repetition.
[0239] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0240] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0241] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A business monitoring method, characterized in that, include: Upon receiving a business request, the system retrieves the output logs of multiple calling interfaces corresponding to the business request and adds an identifier to the output log of each calling interface. The identifier is used to identify the business request. Based on the calling order of the multiple calling interfaces and the identifier, at least two transaction calling chains are generated, wherein each transaction calling chain includes log data corresponding to at least two calling interfaces, and the log data is at least a portion of the data in the output log; The identifier is used to generate a business call chain from the at least two transaction call chains, and the processing status of the business request is monitored based on the business call chain.
2. The method according to claim 1, characterized in that, The step of generating a business call chain from the at least two transaction call chains using the identifier includes: Among the plurality of calling interfaces, a first interface and a second interface are determined, and a first transaction calling chain corresponding to the first interface and the second interface is obtained based on the identifier, wherein the first interface is the starting interface of the business calling chain, and the second interface is the ending interface of the business calling chain; Obtain the second transaction call chain that matches the first interface or the second interface; The first transaction call chain and the second transaction call chain are used to generate the business call chain in a sequential order, wherein the sequential order includes at least one of the business sequence order and the interface call sequence order.
3. The method according to claim 2, characterized in that, The step of obtaining the second transaction call chain that matches the first interface or the second interface includes: In a pre-acquired transaction call chain database, a third interface corresponding to log data containing the identifier is obtained, wherein the transaction call chain database includes the at least two transaction call chains; Obtain the transaction call chain where the third interface is located, wherein the transaction call chain where the third interface is located is the second transaction call chain that matches the first interface or the second interface.
4. The method according to claim 2, characterized in that, The method further includes: In a pre-acquired transaction call chain database, obtain the parameter information of the call interface of the transaction call chain. The parameter information includes at least one of the input parameter information and the output parameter information. The call interface of the transaction call chain includes a fourth interface. When the parameter information of the fourth interface matches the first keyword in the input parameter information of the first business interface, the third transaction call chain in which the fourth interface is located is obtained, wherein the first business interface is any one of the first interface, the second interface, or the second transaction call chain. The step of generating the business call chain by sequentially generating the first transaction call chain and the second transaction call chain includes: The first transaction call chain, the second transaction call chain, and the third transaction call chain are generated in sequence to form the business call chain.
5. The method according to claim 4, characterized in that, The step of obtaining the third transaction call chain where the fourth interface is located includes: When the fourth interface includes at least two calling interfaces, obtain the second keyword annotated for the first business interface; In the fourth interface, the first call interface whose parameter information matches the second keyword is obtained, and the third transaction call chain in which the first call interface is located is obtained.
6. The method according to claim 1, characterized in that, Based on the calling order of the multiple calling interfaces and the identifier, at least two transaction call chains are generated, including: Log data is obtained based on the output logs of the multiple calling interfaces. The log data includes an identifier and at least one of the following: interface calling method, calling time, completion time, and processing result information. Based on the identifier in the log data, obtain a first call chain sorted by call time and a second call chain sorted by the hierarchical relationship of the called functions, wherein the first call chain and the second call chain include log data corresponding to the call interface; The at least two transaction call chains are generated based on the first call chain and the second call chain.
7. The method according to any one of claims 1 to 6, characterized in that, The monitoring of the processing status of the business request based on the business call chain includes: Monitor the processing status of the business interfaces and transaction call chains in the business call chain; If any item in the business interface or transaction call chain of the business call chain is abnormal, an alarm message will be output.
8. The method according to claim 7, characterized in that, The business interface of the business call chain may have any of the following abnormalities: The business interface call execution in the business call chain encountered an error; The business interface call in the business call chain timed out; The business interface execution timed out in the business call chain. The idle time after the business interface of the business call chain is completed exceeds the first threshold value.
9. The method according to claim 7, characterized in that, The transaction call chain is abnormal, including any of the following: The call interface of the transaction call chain timed out or did not respond; The runtime information of the call interface of the transaction call chain is reported as an error; The call interface of the transaction call chain is running normally, and the runtime of the interface call exceeds the second threshold.
10. A business monitoring device, characterized in that, include: The first acquisition module is used to acquire the output logs of multiple calling interfaces corresponding to the business request when a business request is received, and to add an identifier to the output log of each calling interface, wherein the identifier is used to identify the business request; The generation module is used to generate at least two transaction call chains based on the calling order of the plurality of calling interfaces and the identifier, wherein each transaction call chain includes log data corresponding to at least two of the calling interfaces, and the log data is at least a portion of the data in the output log; The monitoring module is used to generate a business call chain from the at least two transaction call chains using the identifier, and to monitor the processing status of the business request based on the business call chain.
11. An electronic device, characterized in that, include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the business monitoring method as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the business monitoring method as described in any one of claims 1 to 9.
13. A computer program product, characterized in that, It includes computer instructions that, when executed by a processor, implement the steps of the business monitoring method as described in any one of claims 1 to 9.